From c0cffd791bfaffaad631076141fcdfc000adcac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Fri, 14 Apr 2017 18:42:48 +0200 Subject: New upstream version 3.0.4 --- util/oem_lenovo.c | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) (limited to 'util/oem_lenovo.c') diff --git a/util/oem_lenovo.c b/util/oem_lenovo.c index a1162bb..dc15a5d 100644 --- a/util/oem_lenovo.c +++ b/util/oem_lenovo.c @@ -61,8 +61,8 @@ extern uchar bitnum(ushort value); /*isensor.c*/ extern char fdebug; /*ipmicmd.c*/ void set_loglevel(int level); /*prototype */ -static char * progver = "3.02"; -static char * progname = "ioemlenovo"; +static char * progver = "3.04"; +static char * progname = "ilenovooem"; static int verbose = 0; static uchar g_bus = PUBLIC_BUS; static uchar g_sa = BMC_SA; @@ -92,6 +92,7 @@ int decode_sensor_lenovo(uchar *sdr,uchar *reading,char *pstring, int slen) ushort rval; char *pstr = NULL; int b; + int vend, prod; if (sdr == NULL || reading == NULL) return(rv); if (pstring == NULL || slen == 0) return(rv); @@ -103,11 +104,12 @@ int decode_sensor_lenovo(uchar *sdr,uchar *reading,char *pstring, int slen) etype = sdr[13]; rval = reading[2] | ((reading[3] & 0x7f) << 8); b = bitnum(rval); - if (fdebug) printf("oem_lenovo: sensor type=%x evt=%x entity=%x rval=%04x\n", - stype,etype,entity,rval); + get_mfgid(&vend,&prod); /*saved from ipmi_getdeviceid */ + if (fdebug) printf("oem_lenovo: mfg=%04x:%04x sensor type=%x evt=%x entity=%x rval=%04x\n", + vend,prod,stype,etype,entity,rval); switch(stype) { - case 0x07: /* All CPUs */ - if (etype == 0x6F) { + case 0x07: /* CPU sensor type */ + if ((etype == 0x6F) && (entity == 25)) { /*All CPUs*/ switch(b) { case 0x00: pstr = "OK"; break; case 0x02: pstr = "BIST_Fail"; break; @@ -118,6 +120,28 @@ int decode_sensor_lenovo(uchar *sdr,uchar *reading,char *pstring, int slen) } rv = 0; } + else if ((etype == 0x6F) && (entity == 3)) { /*CPU status*/ + /* Special CPU status reported on IBM/Lenovo */ + switch(rval) { + case 0x00: pstr = "Absent"; break; + case 0x80: pstr = "Present"; break; + default: pstr = "Error"; break; + } + rv = 0; + } + break; + case 0x0C: /* DIMM slot status */ + /* Special DIMM status reported on IBM/Lenovo */ + /* IBM x3650 M2 (0x0002, 0x00dc) and + * Lenovo x3650 M4 (0x4f4d, 0x0143) */ + if (etype == 0x6F) { + switch(rval) { + case 0x00: pstr = "Absent"; break; + case 0x40: pstr = "Present"; break; + default: pstr = "Error"; break; + } + rv = 0; + } break; case 0x0D: /* Disk Drive slots */ if (etype == 0x6F) { @@ -204,6 +228,7 @@ int decode_sensor_lenovo(uchar *sdr,uchar *reading,char *pstring, int slen) rv = 0; } break; + default: break; } if (rv == 0) snprintf(pstring,slen,"%s",pstr); -- cgit v1.2.3