]> git.zerfleddert.de Git - rsbs2/commitdiff
make ipmb responses const
authorMichael Gernoth <michael@gernoth.net>
Tue, 24 Aug 2010 07:57:57 +0000 (09:57 +0200)
committerMichael Gernoth <michael@gernoth.net>
Tue, 24 Aug 2010 07:57:57 +0000 (09:57 +0200)
bmc/Makefile
bmc/ipmb.c

index 8285880eb756fe5b9408b789a638c82fbcfdff0b..b97087872c2ec8a623a8b7fafe3b6b1c0c580d2b 100644 (file)
@@ -1,5 +1,4 @@
-PROG=dragon_jtag
-PORT=usb
+#PROG=-c dragon_jtag -P usb
 PMCU=m16
 GCCMCU=atmega16
 #Fuses for 1MHz:
@@ -21,7 +20,7 @@ bmc.bin: bmc
        $(OBJCOPY) -j .text -j .data -O binary $^ $@
 
 flash: bmc.bin
-       avrdude -v -c $(PROG) -P $(PORT) -p $(PMCU) -U flash:w:$^
+       avrdude -v $(PROG) -p $(PMCU) -U flash:w:$^
 
 debug: bmc bmc.bin
        setsid avarice -g -D :4242
index fa057c92925404b3de34292c098c6506a9374e97..e325d5709ed80521f6eea644a3e7f4f4ab1056ad 100644 (file)
@@ -1,3 +1,4 @@
+#include <avr/pgmspace.h>
 #include <string.h>
 #include <stdio.h>
 
@@ -17,7 +18,7 @@ uint8_t ipmb_csum(unsigned char *buf, int len)
        return -csum;
 }
 
-void ipmb_send(struct ipmb_resp *resp, unsigned char *data, uint8_t datalen)
+void ipmb_send(struct ipmb_resp *resp, const unsigned char *data, uint8_t datalen)
 {
        unsigned char buf[24];
        int len;
@@ -72,7 +73,7 @@ void ipmb_dump_req(struct ipmb_req *req)
 void ipmb_invalid(struct ipmb_resp *resp)
 {
 #if 1
-       static unsigned char cmd_invalid[] = {IPMB_CC_INVALID};
+       const unsigned char cmd_invalid[] = {IPMB_CC_INVALID};
 
        ipmb_send(resp, cmd_invalid, sizeof(cmd_invalid));
 #endif
@@ -81,25 +82,25 @@ void ipmb_invalid(struct ipmb_resp *resp)
 void ipmb_cmd(struct ipmb_req *req)
 {
        struct ipmb_resp resp;
-       static unsigned char get_devid[] =
+       const unsigned char get_devid[] =
                {IPMB_CC_NORMALLY, 0x42, 0x42, 0x01, 0x01, 0x51, 0xff /* Add. Dev. Supp */, 0x00, 0x00, 0x00, 0x00, 0x00 };
-       static unsigned char get_wd_timer[] =
+       const unsigned char get_wd_timer[] =
                {IPMB_CC_NORMALLY, 0x42, 0x00, 0x00, 0x04, 0xff, 0xff, 0xfe, 0xfe};
-       static unsigned char cc_normal[] =
+       const unsigned char cc_normal[] =
                {IPMB_CC_NORMALLY};
-       static unsigned char sel_info[] =
+       const unsigned char sel_info[] =
                {IPMB_CC_NORMALLY, 0x51, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00};
-       static unsigned char sel_alloc_info[] =
+       const unsigned char sel_alloc_info[] =
                {IPMB_CC_NORMALLY, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
-       static unsigned char sel_entry[] =
+       const unsigned char sel_entry[] =
                {IPMB_CC_ERROR};
-       static unsigned char sel_timestamp[] =
+       const unsigned char sel_timestamp[] =
                {IPMB_CC_NORMALLY, 0x00, 0x00, 0x00, 0x00};
-       static unsigned char chassis_status[] =
+       const unsigned char chassis_status[] =
                {IPMB_CC_NORMALLY, 0x60, 0x10, 0x00, 0x00};
-       static unsigned char reserve_sdr[] =
+       const unsigned char reserve_sdr[] =
                {IPMB_CC_NORMALLY, 0x00, 0x00};
-       static unsigned char get_sdr[] =
+       const unsigned char get_sdr[] =
                {IPMB_CC_NORMALLY, 0xff, 0xff};
 
        resp.rqSA = req->rqSA;
Impressum, Datenschutz