summaryrefslogtreecommitdiff
path: root/util/oem_lenovo.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-04-14 18:42:48 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-04-14 18:42:48 +0200
commitc0cffd791bfaffaad631076141fcdfc000adcac1 (patch)
tree18aa64564a5c0abaf8fb908041de106cca11548b /util/oem_lenovo.c
parente3a9bfc89256e939ab1c1f56f6961b6ee15aa84a (diff)
New upstream version 3.0.4upstream/3.0.4
Diffstat (limited to 'util/oem_lenovo.c')
-rw-r--r--util/oem_lenovo.c37
1 files changed, 31 insertions, 6 deletions
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);