diff options
Diffstat (limited to 'util/oem_supermicro.c')
-rw-r--r-- | util/oem_supermicro.c | 42 |
1 files changed, 28 insertions, 14 deletions
diff --git a/util/oem_supermicro.c b/util/oem_supermicro.c index 94024b2..1924345 100644 --- a/util/oem_supermicro.c +++ b/util/oem_supermicro.c @@ -68,7 +68,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. void set_loglevel(int level); /*prototype */ extern char fsm_debug; /*mem_if.c*/ -static char * progver = "3.06"; +static char * progver = "3.07"; static char * progname = "ismcoem"; static int verbose = 0; static char fdebug = 0; @@ -604,12 +604,14 @@ int decode_sel_supermicro(uchar *evt, char *outbuf, int outsz, char fdesc, uchar rectype; ulong timestamp; char mybuf[64]; + char mytype[64]; char *type_str = ""; char *pstr = NULL; - int sevid; + int sevid, d1; ushort genid; uchar snum; uchar data1, data2, data3; + char *psens = NULL; fdebug = fdbg; sevid = SEV_INFO; @@ -627,17 +629,22 @@ int decode_sel_supermicro(uchar *evt, char *outbuf, int outsz, char fdesc, switch(evt[10]) { /*sensor type*/ case 0xC0: /* CPU Temp Sensor */ type_str = "OEM_CpuTemp"; - switch((evt[13] & 0x0f)) { /*offset/data1 l.o. nibble*/ + d1 = (evt[13] & 0x0f); /*offset/data1 l.o. nibble*/ + switch(d1) { case 0x02: /* CPU Temp Sensor Overheat event offset */ if (evt[12] & 0x80) { /*EvTyp==0xF0 if deassert*/ pstr = "CpuTemp Overheat OK"; sevid = SEV_INFO; } else { /* EvTyp=0x70 assert */ pstr = "CpuTemp Overheat "; sevid = SEV_MAJ; } - rv = 0; break; - default: pstr = "CpuTemp Event"; rv = 0; break; + default: pstr = "CpuTemp Event"; + sprintf(mytype,"CpuTemp_%02x", d1); + type_str = mytype; + sevid = SEV_MIN; + break; } + rv = 0; break; case 0xC2: /* CPLD Event */ type_str = "OEM_CPLD"; @@ -646,10 +653,10 @@ int decode_sel_supermicro(uchar *evt, char *outbuf, int outsz, char fdesc, if (evt[14] == 0x1c) { pstr = "CPLD CATERR Asserted"; sevid = SEV_CRIT; } else { pstr = "CPLD Event Asserted"; sevid = SEV_MIN; } - rv = 0; break; - default: pstr = "CPLD Event"; rv = 0; break; + default: pstr = "CPLD Event"; sevid = SEV_MIN; break; } + rv = 0; break; case 0xD0: /* BMC Event */ type_str = "OEM_BMC"; @@ -666,13 +673,15 @@ int decode_sel_supermicro(uchar *evt, char *outbuf, int outsz, char fdesc, break; case 0xC5: /* Observed Event: Storage, drive slot */ /* usually OEM(c5) #52 - 6f [01 00 00] */ - pstr = "OEMC5: Storage/DriveSlot fault"; + type_str = "OEM_C5"; + pstr = "Storage/DriveSlot fault"; sevid = SEV_MAJ; rv = 0; break; case 0xC8: /* Observed Event: AC Power on event */ /* usually OEM(c8) #ff - 6f [a0 ff ff] */ - pstr = "OEMC8: AC Power On"; + type_str = "OEM_C8"; + pstr = "AC Power On"; sevid = SEV_MAJ; rv = 0; break; @@ -682,11 +691,16 @@ int decode_sel_supermicro(uchar *evt, char *outbuf, int outsz, char fdesc, } if (rv == 0) { format_event(id,timestamp, sevid, genid, type_str, - snum,NULL,pstr,mybuf,outbuf,outsz); + snum,psens,pstr,mybuf,outbuf,outsz); } return(rv); } +/* factory_defaults: set SMC factory defaults + * mode: 0 = detect, default is c0 41 method + * 2 = use c0 41 method, also get guid + * 3 = use f0 40 method (usu X11) + */ static int factory_defaults(int mode) { int rv = -1; @@ -705,10 +719,10 @@ static int factory_defaults(int mode) start_kcs_transaction - c0 41 (reset_factory_defaults, -fde) */ if ((prod_id > 2200) && (prod_id < 2300) && (mode == 0)) { - /* use netfn 3c, cmd 40 for X11? */ - /* similar to ipmitool raw 0x3c 0x40 */ - if (fdebug) printf("may also need ipmiutil cmd 00 20 f0 40\n"); - // mode = 3; + /* Looks like X11 board, may use netfn 3c, cmd 40 ? */ + /* do not auto-set this if mode param is not 3 */ + // mode = 3; /* cmd=0x40 netfn=0x3c (netfn/lun=0xF0) */ + if (fdebug) printf("may also need ipmiutil cmd 00 20 f0 40\n"); } /* b0 00 00: cmd=00 netfn=2C */ |