diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-08-13 17:26:48 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2017-08-13 17:26:48 +0200 |
commit | 64529036a8d742cc45f4b35085205c86ab46b5e0 (patch) | |
tree | 564ce1d693ed2c23a626262ac59d8a8d383856e8 /util/oem_supermicro.c | |
parent | 401b3073c7af7fe89dd70955ef4431da91cc3f29 (diff) | |
parent | b95848947f99031ad56ed6220665bdb3658d8113 (diff) |
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'util/oem_supermicro.c')
-rw-r--r-- | util/oem_supermicro.c | 41 |
1 files changed, 33 insertions, 8 deletions
diff --git a/util/oem_supermicro.c b/util/oem_supermicro.c index d733213..94024b2 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.05"; +static char * progver = "3.06"; static char * progname = "ismcoem"; static int verbose = 0; static char fdebug = 0; @@ -433,6 +433,7 @@ int decode_sensor_supermicro(uchar *sdr,uchar *reading,char *pstring, int slen, snum = sdr[7]; /*sdr01->sens_num*/ stype = sdr[12]; /*sensor_type*/ etype = sdr[13]; /*sdr01->ev_type*/ + get_mfgid(&vend_id,&prod_id); /*saved from ipmi_getdeviceid */ /* sdr[3] rec_type is 0x01 for Full, 0x02 for Compact */ if ((sdr[3] == 0x01) && (etype == 0x01)) { /* full threshold sensor */ /*if Temp sensor, bits==0 would show BelowCrit, so handle normally */ @@ -497,6 +498,14 @@ int decode_sensor_supermicro(uchar *sdr,uchar *reading,char *pstring, int slen, default: rv = -1; break; } break; + case 0x29: /* VBAT sensor */ + if (prod_id == 0x0917) { /*X11DRi has inert VBAT full sensor*/ + if (bval == 0) { + pstr = "NotAvailable"; + rv = 0; + } + } + break; default: break; } @@ -661,9 +670,9 @@ int decode_sel_supermicro(uchar *evt, char *outbuf, int outsz, char fdesc, sevid = SEV_MAJ; rv = 0; break; - case 0xC8: /* Observed Event: Temp/Cooling issue, reboots */ + case 0xC8: /* Observed Event: AC Power on event */ /* usually OEM(c8) #ff - 6f [a0 ff ff] */ - pstr = "OEMC8: Temp/Cooling fault"; + pstr = "OEMC8: AC Power On"; sevid = SEV_MAJ; rv = 0; break; @@ -686,7 +695,7 @@ static int factory_defaults(int mode) uchar idata[16]; uchar cc; /* - From SMC IPMICFG -fde session: + From SMC IPMICFG -fde factory defaults session: start_kcs_transaction - 18 01 (get_device_id) start_kcs_transaction - 18 25 (watchdog get) start_kcs_transaction - b0 00 00 (unknown, invalid) @@ -695,6 +704,12 @@ static int factory_defaults(int mode) start_kcs_transaction - 18 01 (get_device_id) 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; + } /* b0 00 00: cmd=00 netfn=2C */ rlen = sizeof(rdata); @@ -705,7 +720,7 @@ static int factory_defaults(int mode) if (fdebug) printf("b0 00 returned %d\n",rv); /* if (rv != 0) return(rv); */ - if (mode == 2) { + if (mode == 2) { /* (get_system_guid) */ rlen = sizeof(rdata); rv = ipmi_cmdraw(0x37, (0x18 >> 2), BMC_SA, PUBLIC_BUS, BMC_LUN, idata, 0, rdata, &rlen, &cc, fdebug); @@ -714,10 +729,15 @@ static int factory_defaults(int mode) if (rv != 0) return(rv); } - /* reset factory defaults cmd=0x41 netfn=0x30 (netfn/lun=0xC0) */ + /* reset factory defaults */ rlen = sizeof(rdata); - rv = ipmi_cmdraw(0x41, (0xc0 >> 2), BMC_SA, PUBLIC_BUS, BMC_LUN, - idata, 0, rdata, &rlen, &cc, fdebug); + if (mode == 3) { /* cmd=0x40 netfn=0x3c (netfn/lun=0xF0) */ + rv = ipmi_cmdraw(0x40, 0x3c, BMC_SA, PUBLIC_BUS, BMC_LUN, + idata, 0, rdata, &rlen, &cc, fdebug); + } else { /* cmd=0x41 netfn=0x30 (netfn/lun=0xC0) if X10 or less */ + rv = ipmi_cmdraw(0x41, (0xc0 >> 2), BMC_SA, PUBLIC_BUS, BMC_LUN, + idata, 0, rdata, &rlen, &cc, fdebug); + } if ((rv == 0) && (cc != 0)) rv = cc; if (fdebug) printf("factory default reset returned %d\n",rv); if (rv != 0) return(rv); @@ -743,6 +763,11 @@ static int ipmi_smcoem_main(int argc, char **argv) char msg[80]; uchar val; + if ((vend_id != VENDOR_SUPERMICRO) && (vend_id != VENDOR_SUPERMICROX)) { + printf("Not SuperMicro firmware, ignoring smcoem\n"); + usage(); + return(ERR_USAGE); + } if (strncmp(argv[0],"intrusion",9) == 0) { printf("Clearing Chassis Intrusion ...\n"); rv = oem_supermicro_reset_intrusion(); |