]> git.zerfleddert.de Git - rsbs2/commitdiff
put ipmb responses only into flash and copy only one on demand
authorMichael Gernoth <michael@gernoth.net>
Tue, 24 Aug 2010 08:03:46 +0000 (10:03 +0200)
committerMichael Gernoth <michael@gernoth.net>
Tue, 24 Aug 2010 08:03:46 +0000 (10:03 +0200)
bmc/ipmb.c

index e325d5709ed80521f6eea644a3e7f4f4ab1056ad..b18d664acd67992b280cbbd2f774cb81790db397 100644 (file)
@@ -32,7 +32,7 @@ void ipmb_send(struct ipmb_resp *resp, const unsigned char *data, uint8_t datale
        buf[3] = resp->rsSA;
        buf[4] = ((resp->rqSEQ)<<2) | (resp->rsLUN & 0x3);
        buf[5] = resp->cmd;
-       memcpy(buf+6, data, datalen);
+       memcpy_P(buf+6, data, datalen);
        len = datalen + 7;
        buf[len-1] = ipmb_csum(buf+3, len - 4);
 
@@ -73,7 +73,7 @@ void ipmb_dump_req(struct ipmb_req *req)
 void ipmb_invalid(struct ipmb_resp *resp)
 {
 #if 1
-       const unsigned char cmd_invalid[] = {IPMB_CC_INVALID};
+       static const unsigned char cmd_invalid[] PROGMEM = {IPMB_CC_INVALID};
 
        ipmb_send(resp, cmd_invalid, sizeof(cmd_invalid));
 #endif
@@ -82,25 +82,25 @@ void ipmb_invalid(struct ipmb_resp *resp)
 void ipmb_cmd(struct ipmb_req *req)
 {
        struct ipmb_resp resp;
-       const unsigned char get_devid[] =
+       static const unsigned char get_devid[] PROGMEM =
                {IPMB_CC_NORMALLY, 0x42, 0x42, 0x01, 0x01, 0x51, 0xff /* Add. Dev. Supp */, 0x00, 0x00, 0x00, 0x00, 0x00 };
-       const unsigned char get_wd_timer[] =
+       static const unsigned char get_wd_timer[] PROGMEM =
                {IPMB_CC_NORMALLY, 0x42, 0x00, 0x00, 0x04, 0xff, 0xff, 0xfe, 0xfe};
-       const unsigned char cc_normal[] =
+       static const unsigned char cc_normal[] PROGMEM =
                {IPMB_CC_NORMALLY};
-       const unsigned char sel_info[] =
+       static const unsigned char sel_info[] PROGMEM =
                {IPMB_CC_NORMALLY, 0x51, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00};
-       const unsigned char sel_alloc_info[] =
+       static const unsigned char sel_alloc_info[] PROGMEM =
                {IPMB_CC_NORMALLY, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-       const unsigned char sel_entry[] =
+       static const unsigned char sel_entry[] PROGMEM =
                {IPMB_CC_ERROR};
-       const unsigned char sel_timestamp[] =
+       static const unsigned char sel_timestamp[] PROGMEM =
                {IPMB_CC_NORMALLY, 0x00, 0x00, 0x00, 0x00};
-       const unsigned char chassis_status[] =
+       static const unsigned char chassis_status[] PROGMEM =
                {IPMB_CC_NORMALLY, 0x60, 0x10, 0x00, 0x00};
-       const unsigned char reserve_sdr[] =
+       static const unsigned char reserve_sdr[] PROGMEM =
                {IPMB_CC_NORMALLY, 0x00, 0x00};
-       const unsigned char get_sdr[] =
+       static const unsigned char get_sdr[] PROGMEM =
                {IPMB_CC_NORMALLY, 0xff, 0xff};
 
        resp.rqSA = req->rqSA;
Impressum, Datenschutz