summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/ialarms.c5
-rw-r--r--util/icmd.c5
-rw-r--r--util/iconfig.c5
-rw-r--r--util/idcmi.c7
-rw-r--r--util/ievents.c202
-rw-r--r--util/ievents.h3
-rw-r--r--util/ifirewall.c7
-rw-r--r--util/ifru.c83
-rw-r--r--util/ifruset.c14
-rw-r--r--util/igetevent.c7
-rw-r--r--util/ihealth.c7
-rw-r--r--util/ilan.c239
-rw-r--r--util/ipicmg.c7
-rw-r--r--util/ipmiutil.c6
-rw-r--r--util/ireset.c5
-rw-r--r--util/isel.c19
-rw-r--r--util/iseltime.c5
-rw-r--r--util/isensor.c11
-rw-r--r--util/iserial.c5
-rw-r--r--util/isol.c5
-rw-r--r--util/itsol.c7
-rw-r--r--util/iuser.c7
-rw-r--r--util/iwdt.c5
-rw-r--r--util/mem_if.c2
-rw-r--r--util/oem_asus.c7
-rw-r--r--util/oem_dell.c6
-rw-r--r--util/oem_fujitsu.c5
-rw-r--r--util/oem_hp.c5
-rw-r--r--util/oem_intel.c10
-rw-r--r--util/oem_kontron.c5
-rw-r--r--util/oem_lenovo.c111
-rw-r--r--util/oem_newisys.c5
-rw-r--r--util/oem_quanta.c5
-rw-r--r--util/oem_sun.c7
-rw-r--r--util/oem_supermicro.c13
-rw-r--r--util/subs.c4
36 files changed, 502 insertions, 349 deletions
diff --git a/util/ialarms.c b/util/ialarms.c
index d9c6d5e..2fdfb45 100644
--- a/util/ialarms.c
+++ b/util/ialarms.c
@@ -75,8 +75,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*
* Global variables
*/
+#ifdef METACOMMAND
+extern char * progver; /*from ipmiutil.c*/
+static char * progname = "ipmiutil alarms";
+#else
static char * progver = "3.08";
static char * progname = "ialarms";
+#endif
static char fdebug = 0;
static char fbmctam = 0;
static char fpicmg = 0;
diff --git a/util/icmd.c b/util/icmd.c
index ed89004..a116b6f 100644
--- a/util/icmd.c
+++ b/util/icmd.c
@@ -78,8 +78,13 @@ extern void ipmi_lan_set_timeout(int ipmito, int tries, int pingto);
/*
* Global variables
*/
+#ifdef METACOMMAND
+extern char * progver; /*from ipmiutil.c*/
+static char * progname = "ipmiutil cmd";
+#else
static char * progver = "3.08";
static char * progname = "icmd";
+#endif
static char fdebug = 0;
static char fquiet = 0;
static char fset_mc = 0;
diff --git a/util/iconfig.c b/util/iconfig.c
index b9da59b..25e0c67 100644
--- a/util/iconfig.c
+++ b/util/iconfig.c
@@ -172,8 +172,13 @@ typedef struct
/*
* Global variables
*/
+#ifdef METACOMMAND
+extern char * progver; /*from ipmiutil.c*/
+static char * progname = "ipmiutil config";
+#else
static char * progver = "3.08";
static char * progname = "iconfig";
+#endif
static char fdebug = 0;
static char fipmilan = 0;
static FILE * fd_bmc = NULL;
diff --git a/util/idcmi.c b/util/idcmi.c
index f35e711..ec3ec0f 100644
--- a/util/idcmi.c
+++ b/util/idcmi.c
@@ -61,8 +61,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "isensor.h"
#include "idcmi.h"
-static char * progname = "idcmi";
+#ifdef METACOMMAND
+extern char * progver; /*from ipmiutil.c*/
+static char * progname = "ipmiutil dcmi";
+#else
static char * progver = "3.08";
+static char * progname = "idcmi";
+#endif
extern char fdebug; /*from ipmicmd.c*/
static uchar g_bus = PUBLIC_BUS;
static uchar g_sa = BMC_SA;
diff --git a/util/ievents.c b/util/ievents.c
index b244b68..bb3a81f 100644
--- a/util/ievents.c
+++ b/util/ievents.c
@@ -76,8 +76,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define SELprintf printf
#define SMS_SA 0x41
#define SMI_SA 0x21
-static char *progver = "3.08";
+#ifdef METACOMMAND
+extern char *progver; /*from ipmiutil.c*/
+static char * progname = "ipmiutil events";
+#else
+static char *progver = "3.11";
static char *progname = "ievents";
+#endif
static char fsensdesc = 0; /* 1= get extended sensor descriptions*/
static char fcanonical = 0; /* 1= show canonical, delimited output*/
static char fgetdevid = 0; /* 1= get device ID */
@@ -86,6 +91,7 @@ static char futc = 0; /* 1= raw UTC time */
static uchar thr_sa = SMS_SA; /* 0x41 (Sms) used by ipmitool PlarformEvents */
static void *sdrcache = NULL;
static int pet_guid = 8; /*bytes in the input data for the GUID*/
+static int iopt = -1; /*iana option*/
static char bcomma = ',';
static char bdelim = BDELIM; /* '|' */
#ifdef ALONE
@@ -593,7 +599,6 @@ uchar entity2sensor_type(uchar ent)
return(stype);
}
-
static char *mem_str(int off)
{
char *pstr;
@@ -604,121 +609,15 @@ static char *mem_str(int off)
case 0x03: pstr = "Memory Scrub Failed"; break;
case 0x04: pstr = "Memory Device Disabled"; break;
case 0x05: pstr = "ECC limit reached" ; break;
- case 0x07: pstr = "SMI Link Lane Fail Over"; break; /*Quanta QSSC_S4R*/
+ case 0x07: pstr = "ConfigError: SMI Link Lane FailOver"; break; /*Quanta QSSC_S4R*/
+ case 0x08: pstr = "Spare"; break; /*uses data3 */
+ case 0x09: pstr = "Memory Automatically Throttled"; break;
+ case 0x0A: pstr = "Critical Overtemperature"; break;
default: pstr = "Other Memory Error"; break;
}
return(pstr);
}
-#ifdef NEW
-#define OEM_CODE_IN_BYTE2 0x80
-#define OEM_CODE_IN_BYTE3 0x20
-static int decode_mem_default(uchar data1, uchar data2, uchar data3,
- char *desc, int *psz)
-{
- char tmpdesc[80];
- int tmpsz = sizeof(tmpdesc);
- int dsz, incr;
- if ((psz == NULL) || (desc == NULL)) return -1;
- dsz = *psz;
- /*
- * Based on the above error, we need to find whcih memory slot or
- * Card has got the Errors/Sel Generated.
- */
- if(data1 & OEM_CODE_IN_BYTE2 ) {
- /* Find the Card Type */
- if((0x0F != (data2 >> 4)) && ((data2 >> 4) < 0x08))
- {
- tmpData = ('A'+ (data2 >> 4));
- if( (sensor_type == SENSOR_TYPE_MEMORY ) && (0x0B == rec->sel_type.standard_type.event_type) )
- {
- snprintf(tmpdesc, tmpsz, "Bad Card %c", tmpData);
- } else {
- snprintf(tmpdesc, tmpsz, "Card %c", tmpData);
- }
- strcat(desc, tmpdesc);
- } /* Find the Bank Number of the DIMM */
- if (0x0F != (data2 & MASK_LOWER_NIBBLE))
- {
- if(0x51 == version)
- {
- snprintf(tmpdesc, tmpsz, "Bank %d", ((data2 & 0x0F)+1));
- strcat(desc, tmpdesc);
- } else {
- incr = (data2 & 0x0f) << 3;
- }
- }
-
- }
- /* Find the DIMM Number of the Memory which has Generated the Fault or Sel */
- if(data1 & OEM_CODE_IN_BYTE3 )
- {
- // Based on the IPMI Spec Need Identify the DIMM Details.
- // For the SPEC 1.5 Only the DIMM Number is Valid.
- if(0x51 == version)
- {
- snprintf(tmpdesc, tmpsz, "DIMM %c", ('A'+ data3));
- strcat(desc, tmpdesc);
- }
- /* For the SPEC 2.0 Decode the DIMM Number as it supports more*/
- else if( ((data2 >> 4) > 0x07) && (0x0F != (data2 >> 4) ))
- {
- strcpy(dimmStr, " DIMM");
- str = desc+strlen(desc);
- dimmsPerNode = 4;
- if(0x09 == (data2 >> 4)) dimmsPerNode = 6;
- else if(0x0A == (data2 >> 4)) dimmsPerNode = 8;
- else if(0x0B == (data2 >> 4)) dimmsPerNode = 9;
- else if(0x0C == (data2 >> 4)) dimmsPerNode = 12;
- else if(0x0D == (data2 >> 4)) dimmsPerNode = 24;
- else if(0x0E == (data2 >> 4)) dimmsPerNode = 3;
- count = 0;
- for (i = 0; i < 8; i++)
- {
- if (BIT(i) & data3)
- {
- if(count)
- {
- strcat(str,",");
- count = 0x00;
- }
- node = (incr + i)/dimmsPerNode;
- dimmNum = ((incr + i)%dimmsPerNode)+1;
- dimmStr[5] = node + 'A';
- sprintf(tmpdesc,"%d",dimmNum);
- for(j = 0; j < strlen(tmpdesc);j++)
- dimmStr[6+j] = tmpdesc[j];
- dimmStr[6+j] = '\0';
- strcat(str,dimmStr); // final DIMM Details.
- count++;
- }
- }
- } else {
- strcpy(dimmStr, " DIMM");
- str = desc+strlen(desc);
- count = 0;
- for (i = 0; i < 8; i++)
- {
- if (BIT(i) & data3)
- {
- // check if more than one DIMM, if so add a comma to the string.
- sprintf(tmpdesc,"%d",(i + incr + 1));
- if(count)
- {
- strcat(str,",");
- count = 0x00;
- }
- for(j = 0; j < strlen(tmpdesc);j++)
- dimmStr[5+j] = tmpdesc[j];
- dimmStr[5+j] = '\0';
- strcat(str, dimmStr);
- count++;
- }
- }
- }
- }
-}
-#endif
#if defined(METACOMMAND)
/* METACOMMAND is defined for ipmiutil meta-command build. */
@@ -751,7 +650,8 @@ static int default_mem_desc(uchar b2, uchar b3, char *desc, int *psz)
else bdata = b3; /* normal case */
array = (bdata & 0xc0) >> 6;
dimm = bdata & 0x3f;
- n = sprintf(desc,"DIMM[%d]",dimm);
+ if (bdata == 0xFF) n = sprintf(desc,DIMM_UNKNOWN);
+ else n = sprintf(desc,DIMM_NUM,dimm);
*psz = n;
return(0);
}
@@ -803,10 +703,13 @@ static int GetSensorType(int snum, uchar *stype, uchar *rtype)
* SMBIOS type 17, and the descriptions vary for each baseboard.
* We'll just show the index here by default.
* Do the SMBIOS lookup if not standalone build. */
+int g_vend_id = VENDOR_INTEL; /*assume a default of Intel*/
int strlen_(const char *s) { return((int)strlen(s)); }
-// char * get_iana_str(int vend) { return(""); } *from subs.c*/
-void set_iana(int vend) { return; }
+char *get_iana_str(int vend) { return(""); } /*from subs.c*/
+void set_iana(int vend) { g_vend_id = vend; return; }
+char is_remote(void) { return(1); } /* act as if remote with standalone */
+
int get_MemDesc(int array, int idimm, char *desc, int *psz)
{
/* standalone, so use the default method for the DIMM index */
@@ -816,11 +719,9 @@ int get_MemDesc(int array, int idimm, char *desc, int *psz)
void get_mfgid(int *vend, int *prod)
{
if ((vend == NULL) || (prod == NULL)) return;
- *vend = VENDOR_INTEL; /*assume a default of Intel*/
+ *vend = g_vend_id; /*assume a default of Intel*/
*prod = 0;
}
-char is_remote(void)
-{ return(1); /* act as if remote with standalone utility */ }
char * decode_rv(int rv)
{
static char mystr[30];
@@ -887,6 +788,38 @@ extern char * decode_rv(int rv); /*from ipmilan.c*/
extern void dump_buf(char *tag, uchar *pbuf, int sz, char fshowascii);
#endif
+static int decode_mem_default(uchar b1, uchar b2, uchar b3, uchar etype, char *desc, int *psz)
+{
+ int cpu, dimm, n;
+ int rv = -1;
+ int offset = 0;
+ uchar bdata;
+
+ if ((desc == NULL) || (psz == NULL)) return -1;
+ offset = (b1 & 0x0F);
+ if ((b1 & 0x20) != 0) { bdata = b3; } /*dimm data in byte 3*/
+ else if (b2 == 0xff) { bdata = b3; } /*ff is reserved*/
+ else { bdata = b2; } /*if here, should also have (b1 & 0x80)*/
+
+ if (bdata == 0xFF) n = sprintf(desc,DIMM_UNKNOWN);
+ else {
+ cpu = (bdata & 0xc0) >> 6;
+ dimm = (bdata & 0x3F);
+ n = sprintf(desc,DIMM_NUM,dimm);
+ /* Use DMI if we get confirmation about cpu/dimm indices. */
+ if (! is_remote()) {
+ fsm_debug = fdebug;
+ rv = get_MemDesc(cpu,dimm,desc,psz);
+ if (rv != 0) n = sprintf(desc,DIMM_NUM,dimm);
+ }
+ }
+ *psz = n;
+ if (fdebug)
+ printf("decode_mem_default: bdata=%02x(%d) %d dimm=%d\n",bdata,bdata,offset,dimm);
+ rv = 0;
+ return(rv);
+} /*end decode_mem_default*/
+
int new_event(uchar *buf, int len)
{
int rlen, rv;
@@ -1335,6 +1268,7 @@ int get_sensor_tag(int isdr, int genid, uchar snum, char *tag,
rv = ERR_NOT_FOUND; /*got tag, but did not get SDR*/
}
}
+ if (rv != 0) strcpy(tag,"na");
if (fdebug) printf("get_sensor_tag(%d): find_sdr(%x,%x) rv=%d tag=/%s/\n",
fsensdesc,snum,genid,rv,tag);
return(rv);
@@ -1537,7 +1471,7 @@ void format_event(ushort id, time_t timestamp, int sevid, ushort genid,
gstr, bdelim, ptype, bdelim,
psens, bdelim, pstr, more );
} else {
- snprintf(outbuf,outsz,"%04x %s %s %s %s #%02x %s%s %s\n",
+ snprintf(outbuf,outsz,"%04x %s %s %s %s #%02x %s %s %s\n",
id, timestr, get_sev_str(sevid),
gstr, ptype, snum, psens, pstr, more);
}
@@ -1589,6 +1523,7 @@ int decode_sel_entry( uchar *pevt, char *outbuf, int szbuf)
uchar *pc;
SEL_RECORD *psel;
uchar fdeassert = 0;
+ uchar etype;
uchar sev = SEV_INFO;
uchar sdr[MAX_BUFFER_SIZE]; /*sdr usu <= 65 bytes*/
int isdr = 0;
@@ -1607,6 +1542,7 @@ int decode_sel_entry( uchar *pevt, char *outbuf, int szbuf)
}
get_mfgid(&vend,&prod); /*saved from ipmi_getdeviceid */
psel = (SEL_RECORD *)pevt;
+ etype = psel->event_trigger;
j = decode_sel_oem(vend,pevt,outbuf,szbuf,fsensdesc,fdebug);
if (j == 0) return(0); /*successful, have the description*/
@@ -1903,6 +1839,7 @@ int decode_sel_entry( uchar *pevt, char *outbuf, int szbuf)
if (i == 0) sev = SEV_MIN; /*correctable ECC*/
else sev = SEV_MAJ;
if (fdebug) printf("DIMM(%d) vend=%x prod=%x\n",j,vend,prod);
+ msz = sizeof(mdesc);
/* For Intel S5500/S2600 see decode_mem_intel */
if (vend == VENDOR_INTEL) {
decode_mem_intel(prod,b2,b3,mdesc,&msz);
@@ -1911,8 +1848,10 @@ int decode_sel_entry( uchar *pevt, char *outbuf, int szbuf)
(vend == VENDOR_SUPERMICROX)) {
decode_mem_supermicro(prod,b2,b3,mdesc,&msz);
sprintf(mystr,"%s%c %s",mem_str(i),bcomma,mdesc);
- } else {
- sprintf(mystr,"%s%c DIMM[%d]",mem_str(i),bcomma,j);
+ } else { /*decode_mem_raw*/
+ decode_mem_default(psel->event_data1,b2,b3,etype,mdesc,&msz);
+ sprintf(mystr,"%s%c %s",mem_str(i),bcomma,mdesc);
+ //old: sprintf(mystr,"%s%c DIMM[%d]",mem_str(i),bcomma,j);
/* DIMM[2] = 3rd one (zero-based index) */
}
}
@@ -1920,7 +1859,7 @@ int decode_sel_entry( uchar *pevt, char *outbuf, int szbuf)
break;
case 0x0F: /*System Firmware events, incl POST Errs*/
sev = SEV_MAJ; /*usu major, but platform-specific*/
- switch (psel->event_data1)
+ switch (psel->event_data1 & 0x0f)
{
case 0x00: /* System firmware errors */
i = psel->event_data2;
@@ -1960,7 +1899,7 @@ int decode_sel_entry( uchar *pevt, char *outbuf, int szbuf)
psel->event_data2,
psel->event_data3, &sev);
if (pstr == NULL)
- pstr = "POST Error"; /*default string*/
+ pstr = "POST Event"; /*default string*/
} /*end switch(data1)*/
break;
case 0x13: /*Crit Int*/
@@ -2400,19 +2339,18 @@ int i_events(int argc, char **argv)
fPET = 1; /*incoming data is in PET format*/
break;
case 'u': futc = 1; break; /*use raw UTC time*/
-#ifndef ALONE
+ case 'M': /* Set manufacturer IANA */
case 'o': /*specify OEM IANA manufacturer id */
if (argc > 1) { /*next argv is IANA number */
- i = atoi(argv[1]);
- printf("setting IANA to %d (%s)\n",i,get_iana_str(i));
- set_iana(i);
+ iopt = atoi(argv[1]);
+ printf("setting IANA to %d (%s)\n",iopt,get_iana_str(iopt));
+ set_iana(iopt);
argc--; argv++;
} else {
- printf("option -%c requires an argument\n",c);
- rv = ERR_BAD_PARAM;
- }
+ printf("option -%c requires an argument\n",c);
+ rv = ERR_BAD_PARAM;
+ }
break;
-#endif
case 't': /*PET format Trap, use all data*/
/* This may be helpful if all bytes are available, or if
* the GUID is relevant. */
@@ -2497,7 +2435,7 @@ int i_events(int argc, char **argv)
default: /*unknown option*/
printf("Unknown option -%c\n",c);
show_usage();
- rv = ERR_USAGE;
+ rv = ERR_USAGE;
goto do_exit;
break;
}
diff --git a/util/ievents.h b/util/ievents.h
index 71bc449..c9a423c 100644
--- a/util/ievents.h
+++ b/util/ievents.h
@@ -45,6 +45,9 @@ int get_sensor_tag(int isdr, int genid, uchar snum, char *tag,
void format_event(ushort id, time_t timestamp, int sevid, ushort genid,
char *ptype, uchar snum, char *psens, char *pstr, char *more,
char *outbuf, int outsz);
+
+#define DIMM_UNKNOWN "DIMM_unknown"
+#define DIMM_NUM "DIMM(%d)"
/*
* set_sel_opts is used to specify options for showing/decoding SEL events.
* sensdesc : 0 = simple, no sensor descriptions
diff --git a/util/ifirewall.c b/util/ifirewall.c
index e410a45..5708492 100644
--- a/util/ifirewall.c
+++ b/util/ifirewall.c
@@ -63,8 +63,13 @@
#include "ifirewall.h"
/* global variables */
-static char * progname = "ifirewall";
+#ifdef METACOMMAND
+extern char * progver; /*from ipmiutil.c*/
+static char * progname = "ipmiutil firewall";
+#else
static char * progver = "3.08";
+static char * progname = "ifirewall";
+#endif
static char fdebug = 0;
static uchar g_bus = PUBLIC_BUS;
static uchar g_sa = BMC_SA;
diff --git a/util/ifru.c b/util/ifru.c
index cc866d8..86e47bf 100644
--- a/util/ifru.c
+++ b/util/ifru.c
@@ -113,10 +113,13 @@ extern int get_LastError( void ); /* ipmilan.c */
extern int GetSDRRepositoryInfo(int *nret, int *fdev); /*isensor.h*/
#ifdef METACOMMAND
extern int ipmi_kontronoem_main(void * intf, int argc, char ** argv);
+extern char *progver; /*from ipmiutil.c*/
+static char *progname = "ipmiutil fru";
+#else
+static char *progver = "3.11";
+static char *progname = "ifru";
#endif
-static char *progname = "ifru";
-static char *progver = "3.08";
static int vend_id = 0;
static int prod_id = 0;
static char fdebug = 0;
@@ -197,7 +200,7 @@ static int sdr_get_reservation(uchar *res_id, int fdev) { return(-1); }
#define STRING_DATA_TYPE_SIX_BIT_ASCII 0x02
#define STRING_DATA_TYPE_LANG_DEPENDENT 0x03
-#define FRUCHUNK_SZ 16
+#define FRUCHUNK_SZ 16 /* optimal chunk = 16 bytes */
#define FRU_END 0xC1
#define FRU_EMPTY_FIELD 0xC0
#define FRU_TYPE_MASK 0xC0
@@ -267,7 +270,7 @@ int
load_fru(uchar sa, uchar frudev, uchar frutype, uchar **pfrubuf)
{
int ret = 0;
- uchar indata[16];
+ uchar indata[FRUCHUNK_SZ+9];
uchar resp[18];
int sresp;
uchar cc;
@@ -279,6 +282,7 @@ load_fru(uchar sa, uchar frudev, uchar frutype, uchar **pfrubuf)
if (pfrubuf == NULL) return(ERR_BAD_PARAM);
*pfrubuf = NULL;
+ memset(indata, 0, sizeof(indata));
indata[0] = frudev;
sresp = sizeof(resp);
if (fdebug) printf("load_fru: sa=%02x, frudev=%02x, addrtype=%d\n",
@@ -312,14 +316,14 @@ load_fru(uchar sa, uchar frudev, uchar frutype, uchar **pfrubuf)
}
indata[1] = fruoff & 0x00FF;
indata[2] = (fruoff & 0xFF00) >> 8;
- sresp = sizeof(resp);
+ sresp = sizeof(resp);
ret = ipmi_cmd_mc(READ_FRU_DATA,indata,4,resp,&sresp,&cc,fdebug);
- if (ret != 0) break;
- else if (cc != 0) {
- if (i == 0) ret = cc & 0x00ff;
- if (fdebug) printf("read_fru[%d]: ret = %d cc = %x\n",i,ret,cc);
- break;
- }
+ if (ret != 0) break;
+ else if (cc != 0) {
+ if (i == 0) ret = cc & 0x00ff;
+ if (fdebug) printf("read_fru[%d]: ret = %d cc = %x\n",i,ret,cc);
+ break;
+ }
memcpy(&frubuf[i],&resp[1],chunk);
}
@@ -335,16 +339,16 @@ load_fru(uchar sa, uchar frudev, uchar frutype, uchar **pfrubuf)
if (fdebug) printf("get_SystemGuid: ret = %d\n",rv);
}
if (rv == 0 && cc == 0) {
- if (fdebug) {
- printf("system guid (%d): ",sresp);
- for (i=0; i<16; i++) printf("%02x ",resp[i]);
- printf("\n");
- }
- memcpy(&guid,&resp,16);
- guid[16] = 0;
+ if (fdebug) {
+ printf("system guid (%d): ",sresp);
+ for (i=0; i<16; i++) printf("%02x ",resp[i]);
+ printf("\n");
+ }
+ memcpy(&guid,&resp,16);
+ guid[16] = 0;
} else {
- printf("WARNING: GetSystemGuid error %d, %s\n",rv,decode_rv(rv));
- /*do not pass this error upstream*/
+ printf("WARNING: GetSystemGuid error %d, %s\n",rv,decode_rv(rv));
+ /*do not pass this error upstream*/
}
} /*endif*/
return(ret);
@@ -1074,8 +1078,8 @@ int write_fru_data(uchar id, ushort offset, uchar *data, int dlen, char fdebug)
int ret = -1;
int chunk;
ushort fruoff;
- uchar req[25];
- uchar resp[16];
+ uchar req[FRUCHUNK_SZ+9];
+ uchar resp[FRUCHUNK_SZ];
int sresp;
uchar cc;
int i, j;
@@ -1643,7 +1647,7 @@ int i_fru(int argc, char **argv)
char do_reserve = 1;
char devstr[32];
- printf("%s: version %s\n",progname,progver);
+ printf("%s version %s\n",progname,progver);
parse_lan_options('V',"4",0); /*default to admin privilege*/
while ( (c = getopt( argc, argv,"a:bcd:efhkl:m:n:i:p:r:s:t:v:xyzT:V:J:EYF:P:N:R:U:Z:?")) != EOF )
@@ -1877,25 +1881,26 @@ int i_fru(int argc, char **argv)
recid = 0;
while (recid != LAST_REC)
{
- if (do_reserve) {
+ if (do_reserve) {
/* reserve the SDR repository */
ret = sdr_get_reservation((uchar *)&rsvid,fdevsdrs);
if (fdebug) printf("sdr_get_reservation ret=%d\n",ret);
- if (ret == 0) do_reserve = 0;
- }
-
- len = sizeof(sdr); /*sizeof(sdr); get 32 sdr bytes*/
- ret = get_sdr(recid,rsvid,&nextid,sdr,&len,&cc);
- if ((ret != 0) || (cc != 0)) {
- printf("SDR[%04x] error %d ccode = %x\n",recid,ret,cc);
- if ((cc == 0xC5) || (cc == 0x83)) ; /*do not stop (ARC)*/
- else break; /*stop if errors*/
- }
- if (len >= MIN_SDR_SZ) {
- if ((sdr[3] == 0x11) || (sdr[3] == 0x12)) /*SDR FRU or IPMB type*/
- ret = get_show_fru(recid, sdr,len);
- do_reserve = 1;
- } /*endif get_show_fru */
+ if (ret == 0) do_reserve = 0;
+ }
+
+ len = sizeof(sdr); /*sizeof(sdr); get 32 sdr bytes*/
+ ret = get_sdr(recid,rsvid,&nextid,sdr,&len,&cc);
+ if ((ret != 0) || (cc != 0)) {
+ printf("SDR[%04x] error %d ccode = %x\n",recid,ret,cc);
+ if (cc == 0xC5) do_reserve = 1; /*retry w reserve*/
+ if (cc == 0x83) os_usleep(0,100); /*busy, retry*/
+ else break; /*stop if errors*/
+ }
+ if (len >= MIN_SDR_SZ) {
+ if ((sdr[3] == 0x11) || (sdr[3] == 0x12)) /*SDR FRU or IPMB type*/
+ ret = get_show_fru(recid, sdr,len);
+ do_reserve = 1;
+ } /*endif get_show_fru */
#ifdef PICMG_CHILD
/*
* Special logic for blade child MCs in PICMG ATCA systems
diff --git a/util/ifruset.c b/util/ifruset.c
index 0a9ac00..b2f8b66 100644
--- a/util/ifruset.c
+++ b/util/ifruset.c
@@ -105,8 +105,13 @@ extern void fmt_time(time_t etime, char *buf, int bufsz); /*see ievents.c*/
#define IPROD_FRUID 6
#define IPROD_OEM 7
+#ifdef METACOMMAND
+extern char * progver; /*from ipmiutil.c*/
+static char *progname = "ipmiutil fruset";
+#else
+static char * progver = "3.08";
static char *progname = "ifruset";
-static char *progver = "3.08";
+#endif
static char fdebug = 0;
static char fpicmg = 0;
static char fonlybase = 0;
@@ -240,7 +245,7 @@ int
load_fru(uchar sa, uchar frudev, uchar frutype)
{
int ret = 0;
- uchar indata[16];
+ uchar indata[FRUCHUNK_SZ];
uchar resp[18];
int sresp;
uchar cc;
@@ -250,6 +255,7 @@ load_fru(uchar sa, uchar frudev, uchar frutype)
int i;
int chunk;
+ memset(indata, 0, sizeof(indata));
indata[0] = frudev;
sresp = sizeof(resp);
if (fdebug) printf("load_fru: sa = %02x, frudev = %02x\n",sa,frudev);
@@ -918,7 +924,7 @@ write_fru_data(uchar id, ushort offset, uchar *data, int dlen, char fdebug)
int ret = -1;
int chunk;
ushort fruoff;
- uchar req[25];
+ uchar req[FRUCHUNK_SZ+9];
uchar resp[16];
int sresp;
uchar cc;
@@ -1215,7 +1221,7 @@ main(int argc, char **argv)
char *s1;
FILE *fp;
- printf("%s: version %s\n",progname,progver);
+ printf("%s version %s\n",progname,progver);
parse_lan_options('V',"4",0); /*request admin priv by default*/
while ( (c = getopt( argc, argv,"a:bcd:h:i:f:m:n:o:p:r:s:u:v:xyz:T:V:J:EYF:P:N:R:U:Z:?")) != EOF )
switch(c) {
diff --git a/util/igetevent.c b/util/igetevent.c
index 1cda21c..f4c75d6 100644
--- a/util/igetevent.c
+++ b/util/igetevent.c
@@ -168,8 +168,13 @@ extern void free_sdr_cache(uchar *pret); /*see isensor.c*/
/*
* Global variables
*/
-static char * progname = "igetevent";
+#ifdef METACOMMAND
+extern char * progver; /*from ipmiutil.c*/
+static char * progname = "ipmiutil getevent";
+#else
static char * progver = "3.08";
+static char * progname = "igetevent";
+#endif
static char fdebug = 0;
static char fipmilan = 0;
static char frunonce = 0;
diff --git a/util/ihealth.c b/util/ihealth.c
index dd9be29..f985d83 100644
--- a/util/ihealth.c
+++ b/util/ihealth.c
@@ -82,8 +82,13 @@ extern int oem_supermicro_get_firmware_str(char *pstr, int sz); /*oem_supermicro
/*
* Global variables
*/
-static char * progname = "ihealth";
+#ifdef METACOMMAND
+extern char * progver; /*from ipmiutil.c*/
+static char * progname = "ipmiutil health";
+#else
static char * progver = "3.08";
+static char * progname = "ihealth";
+#endif
static char fdebug = 0;
static char fipmilan = 0;
static char fcanonical = 0;
diff --git a/util/ilan.c b/util/ilan.c
index a6e91a3..635a22a 100644
--- a/util/ilan.c
+++ b/util/ilan.c
@@ -305,8 +305,13 @@ extern char *get_sensor_type_desc (uchar stype); /*from ievents.c */
/*
* Global variables
*/
-static char * progname = "ilan";
+#ifdef METACOMMAND
+extern char * progver; /*from ipmiutil.c*/
+static char * progname = "ipmiutil lan";
+#else
static char * progver = "3.08";
+static char * progname = "ilan";
+#endif
static char fdebug = 0;
static char fipmilan = 0;
static char fIPMI10 = 0; /* =1 if IPMI v1.0 or less */
@@ -4093,7 +4098,8 @@ main(int argc, char **argv)
while ((c =
getopt (argc, argv,
"a:b:cdef:gh:i:j:klm:n:op:q:rstu:v:w:xy:z#::A:B:C:DEF:G:H:I:J:K:L:M:N:OP:Q:R:S:T:U:V:X:YZ:?"))
- != EOF) {
+ != EOF)
+ {
switch (c) {
case 'a': /* alert dest number (usu 1 thru 4) */
alertnum = atob (optarg);
@@ -4121,12 +4127,11 @@ main(int argc, char **argv)
break;
case 'f':
i = atoi (optarg); /*set arp_ctl */
- if (i < 0 || i > 3)
- printf ("Invalid ARP control %d\n", i);
+ if (i < 0 || i > 3) printf ("Invalid ARP control %d\n", i);
else {
- arp_ctl = i;
- fsetarp = 1;
- j++;
+ arp_ctl = i;
+ fsetarp = 1;
+ j++;
}
break;
case 'l':
@@ -4138,39 +4143,34 @@ main(int argc, char **argv)
case 'h': /* VLAN ID */
i = atoi (optarg);
if (i > 4095)
- vlan_enable = 0;
+ vlan_enable = 0;
else {
- vlan_enable = 1;
- vlan_id = (ushort) i;
+ vlan_enable = 1;
+ vlan_id = (ushort) i;
}
j++;
break;
case 'y': /* OEM LAN Failover enable/disable */
i = atoi (optarg);
- if (i < 0)
- printf ("Failover(-y) parameter is negative\n");
- else
- failover_enable = i;
+ if (i < 0) printf ("Failover(-y) parameter is negative\n");
+ else failover_enable = i;
j++;
break;
case 'Q': /* VLAN Priority */
i = atoi (optarg);
- if (i > 7 || i < 0)
- vlan_enable = 0;
+ if (i > 7 || i < 0) vlan_enable = 0;
else {
- vlan_enable = 1;
- vlan_prio = (uchar) i;
+ vlan_enable = 1;
+ vlan_prio = (uchar) i;
}
j++;
break;
case 'i': /* eth interface (ifname) */
fsetifn = 1;
i = sizeof (ifname);
- if (strlen (optarg) > (uint) i)
- optarg[i] = 0;
+ if (strlen (optarg) > (uint) i) optarg[i] = 0;
strcpy (ifname, optarg);
- if (fdebug)
- printf ("ifname = %s\n", ifname);
+ if (fdebug) printf ("ifname = %s\n", ifname);
j++;
break;
case 'j':
@@ -4189,15 +4189,15 @@ main(int argc, char **argv)
custPEF[8] = htoi (&optarg[16]); /*data1offset */
custPEF[9] = htoi (&optarg[18]); /*data1mask */
if (optarg[20] != 0) {
- /* optionally get 8 extra PEF entry bytes */
- custPEF[10] = htoi (&optarg[20]); /*data1cmp1 */
- custPEF[11] = htoi (&optarg[22]); /*data1cmp2 */
- custPEF[12] = htoi (&optarg[24]); /*data2mask */
- custPEF[13] = htoi (&optarg[26]); /*data2cmp1 */
- custPEF[14] = htoi (&optarg[28]); /*data2cmp2 */
- custPEF[15] = htoi (&optarg[30]); /*data3mask */
- custPEF[16] = htoi (&optarg[32]); /*data3cmp1 */
- custPEF[17] = htoi (&optarg[34]); /*data3cmp2 */
+ /* optionally get 8 extra PEF entry bytes */
+ custPEF[10] = htoi (&optarg[20]); /*data1cmp1 */
+ custPEF[11] = htoi (&optarg[22]); /*data1cmp2 */
+ custPEF[12] = htoi (&optarg[24]); /*data2mask */
+ custPEF[13] = htoi (&optarg[26]); /*data2cmp1 */
+ custPEF[14] = htoi (&optarg[28]); /*data2cmp2 */
+ custPEF[15] = htoi (&optarg[30]); /*data3mask */
+ custPEF[16] = htoi (&optarg[32]); /*data3cmp1 */
+ custPEF[17] = htoi (&optarg[34]); /*data3cmp2 */
}
j++;
break;
@@ -4212,11 +4212,11 @@ main(int argc, char **argv)
fpefenable = 1;
pefnum = atob (optarg);
if (pefnum >= MAXPEF) {
- pefnum = MAXPEF - 1;
- fAdjustPefNum = 1;
+ pefnum = MAXPEF - 1;
+ fAdjustPefNum = 1;
}
else
- fUserPefNum = 1;
+ fUserPefNum = 1;
j++;
break;
case 'o':
@@ -4237,18 +4237,14 @@ main(int argc, char **argv)
break;
case 'v': /* user access privilege level */
i = atoi (optarg);
- if (valid_priv (i))
- lan_access = i & 0x0f;
- else
- printf ("Invalid privilege -v %d, using Admin\n", i);
+ if (valid_priv (i)) lan_access = i & 0x0f;
+ else printf ("Invalid privilege -v %d, using Admin\n", i);
j++;
break;
case 'w':
i = atoi (optarg); /*set grat arp interval, in #sec */
- if (i >= 0 && i < 256)
- arp_interval = i * 2;
- else
- printf ("Invalid arp interval -w %d, skipping\n", i);
+ if (i >= 0 && i < 256) arp_interval = i * 2;
+ else printf ("Invalid arp interval -w %d, skipping\n", i);
break;
case 'x':
fdebug = 1;
@@ -4271,8 +4267,7 @@ main(int argc, char **argv)
break;
case 'M': /* My BMC MAC Address */
atomac (rgmymac, optarg);
- if (!MacIsValid (rgmymac))
- printf ("Invalid MAC for -M\n");
+ if (!MacIsValid (rgmymac)) printf ("Invalid MAC for -M\n");
j++;
break;
case 'S': /* Subnet IP Address */
@@ -4291,8 +4286,7 @@ main(int argc, char **argv)
break;
case 'H': /* Gateway MAC Address */
atomac (rggwymac, optarg);
- if (!MacIsValid (rggwymac))
- printf ("Invalid MAC for -H\n");
+ if (!MacIsValid (rggwymac)) printf ("Invalid MAC for -H\n");
j++;
break;
case 'B': /* SOL Baud rate */
@@ -4309,8 +4303,7 @@ main(int argc, char **argv)
break;
case 'X': /* Alert Dest MAC Address */
atomac (rgdestmac, optarg);
- if (!MacIsValid (rgdestmac))
- printf ("Invalid MAC for -X\n");
+ if (!MacIsValid (rgdestmac)) printf ("Invalid MAC for -X\n");
fpefenable = 1; /* PEF is implied here */
j++;
break;
@@ -4324,8 +4317,7 @@ main(int argc, char **argv)
case 'C': /* Community String */
fsetcommunity = 1;
i = sizeof (rgcommunity); /*usu 18 */
- if (strlen (optarg) > (uint) i)
- optarg[i] = 0;
+ if (strlen (optarg) > (uint) i) optarg[i] = 0;
strcpy (rgcommunity, optarg);
fpefenable = 1; /* PEF is implied here */
j++;
@@ -4339,8 +4331,7 @@ main(int argc, char **argv)
if (strlen (optarg) > PSW_MAX)
optarg[PSW_MAX] = 0;
strcpy (passwordData, optarg);
- if (fdebug)
- printf ("Password = %s\n", passwordData);
+ if (fdebug) printf ("Password = %s\n", passwordData);
/* Hide password from 'ps' */
memset (optarg, ' ', strlen (optarg));
j++;
@@ -4348,16 +4339,15 @@ main(int argc, char **argv)
case 'q':
case '#':
usernum = atob (optarg);
- if (usernum > 15)
- usernum = 0; /*MAX_IPMI_USERS = 15 */
+ if (usernum > 15) usernum = 0; /*MAX_IPMI_USERS = 15 */
j++;
break;
case 'L':
if (strcmp (optarg, "list") == 0)
- fshowchan = 1;
+ fshowchan = 1;
lan_ch_parm = atob (optarg);
if (lan_ch_parm > MAXCHAN)
- lan_ch_parm = PARM_INIT; /*invalid */
+ lan_ch_parm = PARM_INIT; /*invalid */
break;
case 'V': /* priv level */
fprivset = 1;
@@ -4469,90 +4459,78 @@ main(int argc, char **argv)
pefmax = 20; /*default Intel PEF */
switch (prod_id) {
case 0x4311: /* Intel NSI2U w SE7520JR23 */
- fmBMC = 1; /* Intel miniBMC */
- if (pefnum == 12)
- pefnum = 14; /* change CritStop pefnum */
- pefdesc = &pefdesc2[0]; /*mini-BMC PEF */
- pefmax = 30;
- fsharedMAC = 1; /* shared-MAC BMC LAN port, same MAC */
- break;
+ fmBMC = 1; /* Intel miniBMC */
+ if (pefnum == 12) pefnum = 14; /* change CritStop pefnum */
+ pefdesc = &pefdesc2[0]; /*mini-BMC PEF */
+ pefmax = 30;
+ fsharedMAC = 1; /* shared-MAC BMC LAN port, same MAC */
+ break;
case 0x0022: /* Intel TIGI2U w SE7520JR23 +IMM */
- fsharedMAC = 1; /* shared-MAC BMC LAN port, same MAC */
- gcm_ch = 3; /* IMM GCM port, dedicated MAC */
- show_users = 4;
- break;
+ fsharedMAC = 1; /* shared-MAC BMC LAN port, same MAC */
+ gcm_ch = 3; /* IMM GCM port, dedicated MAC */
+ show_users = 4;
+ break;
case 0x000C: /*TSRLT2 */
case 0x001B: /*TIGPR2U */
- /* fmBMC=0; Intel Sahalee BMC */
- fsharedMAC = 1; /* shared-MAC BMC LAN port, same MAC */
- break;
+ /* fmBMC=0; Intel Sahalee BMC */
+ fsharedMAC = 1; /* shared-MAC BMC LAN port, same MAC */
+ break;
case 0x0026: /*S5000 Bridgeport */
case 0x0028: /*S5000PAL Alcolu */
case 0x0029: /*S5000PSL StarLake */
case 0x0811: /*S5000PHB TIGW1U */
- /* fmBMC=0; Intel Sahalee ESB2 BMC */
- fsharedMAC = 0; /* not-shared BMC LAN port, separate MAC */
- gcm_ch = 3;
- parm7 = &iparm7[0]; /*TTL=30 */
- break;
+ /* fmBMC=0; Intel Sahalee ESB2 BMC */
+ fsharedMAC = 0; /* not-shared BMC LAN port, separate MAC */
+ gcm_ch = 3;
+ parm7 = &iparm7[0]; /*TTL=30 */
+ break;
case 0x003E: /*NSN2U or CG2100 Urbanna */
- fiBMC = 1; /* Intel iBMC */
- fsharedMAC = 0; /* not-shared BMC LAN port, separate MAC */
- // gcm_ch = 3;
- parm7 = &iparm7[0]; /*TTL=30 */
- if (fsetarp == 0)
- arp_ctl = 0x02; /*grat arp disabled, arp resp enabled */
- arp_interval = 0x00; /*0 sec, since grat arp disabled */
- sol_accum[0] = 0x0c; /*Intel defaults */
- sol_accum[1] = 0x60; /*Intel defaults */
- sol_retry[0] = 0x07; /*Intel defaults */
- sol_retry[1] = 0x32; /*Intel defaults */
- set_max_kcs_loops (URNLOOPS); /*longer for SetLan cmds (default 300) */
- break;
+ fiBMC = 1; /* Intel iBMC */
+ fsharedMAC = 0; /* not-shared BMC LAN port, separate MAC */
+ // gcm_ch = 3;
+ parm7 = &iparm7[0]; /*TTL=30 */
+ if (fsetarp == 0) arp_ctl = 0x02; /*grat arp disabled,arp resp enabled*/
+ arp_interval = 0x00; /*0 sec, since grat arp disabled */
+ sol_accum[0] = 0x0c; /*Intel defaults */
+ sol_accum[1] = 0x60; /*Intel defaults */
+ sol_retry[0] = 0x07; /*Intel defaults */
+ sol_retry[1] = 0x32; /*Intel defaults */
+ set_max_kcs_loops (URNLOOPS); /*longer for SetLan cmds (default 300)*/
+ break;
case 0x0107: /* Intel Caneland */
- fsharedMAC = 0; /* not-shared BMC LAN port, separate MAC */
- gcm_ch = 3;
- break;
+ fsharedMAC = 0; /* not-shared BMC LAN port, separate MAC */
+ gcm_ch = 3;
+ break;
case 0x0100: /*Tiger2 ia64 */
- /* for ia64 set chan_pefon, chan_pefoff accordingly */
- chan_pefon = CHAN_ACC_PEFON64;
- chan_pefoff = CHAN_ACC_PEFOFF64;
- /* fall through */
+ /* for ia64 set chan_pefon, chan_pefoff accordingly */
+ chan_pefon = CHAN_ACC_PEFON64;
+ chan_pefoff = CHAN_ACC_PEFOFF64;
+ /* fall through */
default: /* else other Intel */
- /* fmBMC = 0; * Intel Sahalee BMC */
- if (fIPMI20)
- fsharedMAC = 0; /* recent, not-shared BMC MAC */
- else
- fsharedMAC = 1; /* usu IPMI 1.x has shared BMC MAC */
- break;
+ /* fmBMC = 0; * Intel Sahalee BMC */
+ if (fIPMI20) fsharedMAC = 0; /* recent, not-shared BMC MAC */
+ else fsharedMAC = 1; /* usu IPMI 1.x has shared BMC MAC */
+ break;
} /*end switch */
- if (is_romley (vend_id, prod_id))
- fRomley = 1;
- if (is_grantley (vend_id, prod_id))
- fGrantley = 1;
+ if (is_romley(vend_id, prod_id)) fRomley = 1;
+ if (is_grantley(vend_id, prod_id)) fGrantley = 1;
if (fRomley) {
- fiBMC = 1; /* Intel iBMC */
- fsharedMAC = 0; /* not-shared BMC LAN port, separate MAC */
- set_max_kcs_loops (URNLOOPS); /*longer for SetLan (default 300) */
- fipv6 = 1;
- if (fsetarp == 0)
- arp_ctl = 0x03; /*default to both for Romley */
+ fiBMC = 1; /* Intel iBMC */
+ fsharedMAC = 0; /* not-shared BMC LAN port, separate MAC */
+ set_max_kcs_loops (URNLOOPS); /*longer for SetLan (default 300) */
+ fipv6 = 1;
+ if (fsetarp == 0) arp_ctl = 0x03; /*default to both for Romley */
}
}
else { /* else other vendors */
- if (fIPMI20)
- fsharedMAC = 0; /* recent, not-shared BMC MAC */
- else
- fsharedMAC = 1; /* usu IPMI 1.x has shared BMC MAC */
+ if (fIPMI20) fsharedMAC = 0; /* recent, not-shared BMC MAC */
+ else fsharedMAC = 1; /* usu IPMI 1.x has shared BMC MAC */
pefdesc = NULL; /* unknown, see PefDesc() */
- if (pefnum == 12)
- pefnum = 15; /* change CritStop pefnum to 15? */
+ if (pefnum == 12) pefnum = 15; /* change CritStop pefnum to 15? */
pefmax = 20;
- if (!fUserPefNum)
- fAdjustPefNum = 1;
+ if (!fUserPefNum) fAdjustPefNum = 1;
}
- if (fmBMC)
- show_users = 1; /* mBMC doesn't support more than 1 user */
+ if (fmBMC) show_users = 1; /* mBMC doesn't support more than 1 user */
}
if (fshowchan) {
@@ -4578,16 +4556,15 @@ main(int argc, char **argv)
i = 0; /* default to eth0, lan_ch set already. */
if (vend_id == VENDOR_INTEL) {
if ((prod_id == 0x001B) || (prod_id == 0x000c)) {
- /* Intel TIGPR2U or TSRLT2 defaults are special */
- if (lan_ch_parm == 6) {
- i = 0;
- lan_ch = 6;
- }
- else {
- i = 1;
- lan_ch = 7;
- }
- ser_ch = 1;
+ /* Intel TIGPR2U or TSRLT2 defaults are special */
+ if (lan_ch_parm == 6) {
+ i = 0;
+ lan_ch = 6;
+ } else {
+ i = 1;
+ lan_ch = 7;
+ }
+ ser_ch = 1;
}
}
}
diff --git a/util/ipicmg.c b/util/ipicmg.c
index 67ce69e..4aaf87d 100644
--- a/util/ipicmg.c
+++ b/util/ipicmg.c
@@ -80,8 +80,13 @@
#define PICMG_EKEY_AMC_MAX_DEVICE 15 /* 4 bits */
/* Global data */
-static char * progname = "ipicmg";
+#ifdef METACOMMAND
+extern char * progver; /*from ipmiutil.c*/
+static char * progname = "ipmiutil picmg";
+#else
static char * progver = "3.08";
+static char * progname = "ipicmg";
+#endif
static char fdebug = 0;
static char fset_mc = 0;
static uint8_t g_bus = PUBLIC_BUS;
diff --git a/util/ipmiutil.c b/util/ipmiutil.c
index 3d7d91d..eea67d0 100644
--- a/util/ipmiutil.c
+++ b/util/ipmiutil.c
@@ -57,7 +57,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "ipmiutil.h"
static char *progname = "ipmiutil";
-static char *progver = "3.08";
+char *progver = "3.11";
// static char fdebug = 0;
/*int ipmiutil(int argc, char **argv); */
@@ -136,8 +136,8 @@ main(int argc, char **argv)
int i;
char *psubcmd = "";
- printf("%s ver %s\n", progname,progver);
if (argc < 2) {
+ printf("%s ver %s\n", progname,progver);
show_usage();
ret = ERR_USAGE;
goto do_exit;
@@ -168,7 +168,7 @@ main(int argc, char **argv)
for (i = 0; i < NSUBCMDS; i++)
{
if (strcmp(argv[1],subcmds[i].tag) == 0) {
- psubcmd = argv[1];
+ psubcmd = argv[1];
argc--;
argv++;
ret = subcmds[i].rtn(argc,argv);
diff --git a/util/ireset.c b/util/ireset.c
index 3853569..c668996 100644
--- a/util/ireset.c
+++ b/util/ireset.c
@@ -108,8 +108,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*
* Global variables
*/
+#ifdef METACOMMAND
+extern char * progver; /*from ipmiutil.c*/
+static char * progname = "ipmiutil reset";
+#else
static char * progver = "3.08";
static char * progname = "ireset";
+#endif
static uchar ipmi_maj;
static uchar ipmi_min;
static uchar sms_sa = 0x81;
diff --git a/util/isel.c b/util/isel.c
index ede4d52..63a1d42 100644
--- a/util/isel.c
+++ b/util/isel.c
@@ -161,8 +161,13 @@ typedef struct
#define RET_OFFSET 12 //byte offset to the record event trigger
#define RDATA_OFFSET 13 //byte offset to the record event data
-static char *progname = "isel";
-static char *progver = "3.08";
+#ifdef METACOMMAND
+extern char * progver; /*from ipmiutil.c*/
+static char * progname = "ipmiutil sel";
+#else
+static char * progver = "3.08";
+static char * progname = "isel";
+#endif
#ifdef WIN32
#define IDXFILE "sel.idx"
static char idxfile[80] = IDXFILE;
@@ -649,9 +654,10 @@ int i_sel(int argc, char **argv)
char DevRecord[16];
int c;
char *s1;
+ char *vend_param = NULL;
- printf("%s: version %s\n",progname,progver);
- while ((c = getopt(argc,argv,"a:b:cdef:h:i:l:m:np:rs:uwvxT:V:J:EYF:P:N:U:R:Z:?")) != EOF)
+ printf("%s version %s\n",progname,progver);
+ while ((c = getopt(argc,argv,"a:b:cdef:h:i:l:m:np:rs:uwvxM:T:V:J:EYF:P:N:U:R:Z:?")) != EOF)
switch(c) {
case 'a': faddsel = 1; /*undocumented option, to prevent misuse*/
addstr = optarg; /*text string, max 13 bytes, no date*/
@@ -696,6 +702,8 @@ int i_sel(int argc, char **argv)
case 'v': fonlyver = 1; break;
case 'w': fwritesel = 1; break;
case 'x': fdebug = 1; break;
+ case 'M': /* Manufacturing VendorId */
+ vend_param = optarg; break;
case 'p': /* port */
case 'N': /* nodename */
case 'U': /* remote username */
@@ -857,12 +865,13 @@ int i_sel(int argc, char **argv)
prod_id = DevRecord[9] + (DevRecord[10] << 8);
vend_id = DevRecord[6] + (DevRecord[7] << 8) + (DevRecord[8] << 16);
if (vend_id == VENDOR_INTEL) {
- if (prod_id == 0x003E) /*Urbanna NSN2U or CG2100*/
+ if (prod_id == 0x003E) /*Urbanna NSN2U or CG2100*/
set_max_kcs_loops(URNLOOPS); /*longer KCS timeout*/
}
} else {
goto do_exit;
}
+ if (vend_param != NULL) set_iana(atoi(vend_param));
ret = ReadSELinfo();
if (ret == 0 && !fonlyver) {
diff --git a/util/iseltime.c b/util/iseltime.c
index 41f628b..ee2144e 100644
--- a/util/iseltime.c
+++ b/util/iseltime.c
@@ -78,8 +78,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*
* Global variables
*/
+#ifdef METACOMMAND
+extern char * progver; /*from ipmiutil.c*/
+static char * progname = "ipmiutil seltime";
+#else
static char * progver = "3.08";
static char * progname = "iseltime";
+#endif
static char fdebug = 0;
static char fset = 0;
static uchar ipmi_maj = 0;
diff --git a/util/isensor.c b/util/isensor.c
index 286b19d..f140cdc 100644
--- a/util/isensor.c
+++ b/util/isensor.c
@@ -254,8 +254,13 @@ char *decode_entity_id(int id) {
/************************
* Global Data
************************/
-static char *progname = "isensor";
-static char *progver = "3.08";
+#ifdef METACOMMAND
+extern char * progver; /*from ipmiutil.c*/
+static char * progname = "ipmiutil sensor";
+#else
+static char * progver = "3.08";
+static char * progname = "isensor";
+#endif
#ifdef WIN32
static char savefile[] = "%ipmiutildir%\\thresholds.cmd";
#else
@@ -3247,7 +3252,7 @@ int i_sensor(int argc, char **argv)
char *p;
char *s1;
- printf("%s: version %s\n",progname,progver);
+ printf("%s version %s\n",progname,progver);
while ( (c = getopt( argc, argv,"a:bcd:ef:g:h:i:j:k:l:m:n:opqrstu:vwxT:V:J:L:EYF:P:N:R:U:Z:?")) != EOF )
switch(c) {
diff --git a/util/iserial.c b/util/iserial.c
index cf69129..a9f3436 100644
--- a/util/iserial.c
+++ b/util/iserial.c
@@ -155,8 +155,13 @@ typedef struct
/*
* Global variables
*/
+#ifdef METACOMMAND
+extern char * progver; /*from ipmiutil.c*/
+static char * progname = "ipmiutil serial";
+#else
static char * progver = "3.08";
static char * progname = "iserial";
+#endif
static int vend_id = 0;
static int prod_id = 0;
static char fdebug = 0;
diff --git a/util/isol.c b/util/isol.c
index b8ccb1f..6b72b14 100644
--- a/util/isol.c
+++ b/util/isol.c
@@ -165,8 +165,13 @@ void dbglog( char *pattn, ... ); /*local prototype*/
/*
* Global variables
*/
+#ifdef METACOMMAND
+extern char * progver; /*from ipmiutil.c*/
+static char * progname = "ipmiutil sol";
+#else
static char * progver = "3.08";
static char * progname = "isol";
+#endif
static char fdebug = 0;
static char fpicmg = 0;
static char factivate = 0;
diff --git a/util/itsol.c b/util/itsol.c
index 6f508ef..e84bd5a 100644
--- a/util/itsol.c
+++ b/util/itsol.c
@@ -97,8 +97,13 @@ int gettimeofday(struct timeval *tv, struct timezone *tz);
extern int verbose;
extern char fdebug; /*from ipmicmd.c*/
-static char * progname = "itsol";
+#ifdef METACOMMAND
+extern char * progver; /*from ipmiutil.c*/
+static char * progname = "ipmiutil tsol";
+#else
static char * progver = "3.08";
+static char * progname = "itsol";
+#endif
static uchar g_bus = PUBLIC_BUS;
static uchar g_sa = BMC_SA;
static uchar g_lun = BMC_LUN;
diff --git a/util/iuser.c b/util/iuser.c
index 9537f16..2a5e952 100644
--- a/util/iuser.c
+++ b/util/iuser.c
@@ -56,8 +56,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "ipmicmd.h"
/* global variables */
-static char * progname = "iuser";
+#ifdef METACOMMAND
+extern char * progver; /*from ipmiutil.c*/
+static char * progname = "ipmiutil user";
+#else
static char * progver = "3.08";
+static char * progname = "iuser";
+#endif
static char fdebug = 0;
static char fcanonical = 0;
static char bdelim = '|';
diff --git a/util/iwdt.c b/util/iwdt.c
index f73d045..de073a3 100644
--- a/util/iwdt.c
+++ b/util/iwdt.c
@@ -100,8 +100,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*
* Global variables
*/
+#ifdef METACOMMAND
+extern char * progver; /*from ipmiutil.c*/
+static char * progname = "ipmiutil wdt";
+#else
static char * progver = "3.08";
static char * progname = "iwdt";
+#endif
static char fdebug = 0;
static char fdontlog = 0;
static char fcanonical = 0;
diff --git a/util/mem_if.c b/util/mem_if.c
index 9be58a9..3fcc139 100644
--- a/util/mem_if.c
+++ b/util/mem_if.c
@@ -707,7 +707,7 @@ int get_MemDesc(UCHAR array, UCHAR dimm, char *desc, int *psize)
}
closeSmBios(VirtualAddress,SMBiosLen);
/* fill in a default if error */
- if ((rv != 0) && (desc != NULL)) sprintf(desc,"DIMM[%d]",dimm);
+ if ((rv != 0) && (desc != NULL)) sprintf(desc,"DIMM(%d)",dimm);
return rv;
} //get_MemDesc
diff --git a/util/oem_asus.c b/util/oem_asus.c
index 6aba5ba..ea971d0 100644
--- a/util/oem_asus.c
+++ b/util/oem_asus.c
@@ -60,8 +60,13 @@ extern uchar bitnum(ushort value); /*isensor.c*/
extern char fdebug; /*ipmicmd.c*/
void set_loglevel(int level); /*prototype */
-static char * progname = "iasusoem";
+#ifdef METACOMMAND
+extern char * progver; /*from ipmiutil.c*/
+static char * progname = "ipmiutil asusoem";
+#else
static char * progver = "3.08";
+static char * progname = "iasusoem";
+#endif
static int verbose = 0;
static uchar g_bus = PUBLIC_BUS;
static uchar g_sa = BMC_SA;
diff --git a/util/oem_dell.c b/util/oem_dell.c
index 9f13b12..b474ee3 100644
--- a/util/oem_dell.c
+++ b/util/oem_dell.c
@@ -132,8 +132,13 @@ char NIC_Selection_Mode_String_12g[] [50] = {
"shared with failover all loms"
};
+#ifdef METACOMMAND
+extern char * progver; /*from ipmiutil.c*/
+static char * progname = "ipmiutil delloem";
+#else
static char * progver = "3.08";
static char * progname = "idelloem";
+#endif
static int verbose = 0;
static char fdebug = 0;
static uchar g_bus = PUBLIC_BUS;
@@ -5673,6 +5678,7 @@ char * get_dell_evt_desc(uchar *sel_rec, int *psev)
}
if(data1 & 0x20 )
{
+ strcat(desc, "ECC Error,");
if(0x51 == version)
{
snprintf(tmpdesc, SIZE_OF_DESC, "DIMM %c", (char)('A'+ data3));
diff --git a/util/oem_fujitsu.c b/util/oem_fujitsu.c
index 5963df2..f707cc5 100644
--- a/util/oem_fujitsu.c
+++ b/util/oem_fujitsu.c
@@ -52,8 +52,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/* extern void get_mfgid(int *vend, int *prod); * from ipmicmd.h*/
/* extern int get_lan_options(); * from ipmicmd.h */
+#ifdef METACOMMAND
+extern char * progver; /*from ipmiutil.c*/
+static char * progname = "ipmiutil fujitsuoem";
+#else
static char * progver = "3.08";
static char * progname = "ifujitsuoem";
+#endif
static char fdebug = 0;
static char freadok = 1;
#define ERRLED 0 /*GEL - red Global Error LED*/
diff --git a/util/oem_hp.c b/util/oem_hp.c
index 705e8ed..f551176 100644
--- a/util/oem_hp.c
+++ b/util/oem_hp.c
@@ -44,8 +44,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "ievents.h"
#include "isensor.h"
+#ifdef METACOMMAND
+extern char * progver; /*from ipmiutil.c*/
+static char * progname = "ipmiutil hpoem";
+#else
static char * progver = "3.08";
static char * progname = "ihpoem";
+#endif
static char *redund_str(uchar b)
{
diff --git a/util/oem_intel.c b/util/oem_intel.c
index a79e73a..e6d397d 100644
--- a/util/oem_intel.c
+++ b/util/oem_intel.c
@@ -83,8 +83,13 @@ extern char fdebug; /*ipmicmd.c*/
/*
* Global variables
*/
+#ifdef METACOMMAND
+extern char * progver; /*from ipmiutil.c*/
+static char * progname = "ipmiutil inteloem";
+#else
static char * progver = "3.08";
static char * progname = "iinteloem";
+#endif
static char fRelayBits = 0;
static uchar g_bus = PUBLIC_BUS;
static uchar g_sa = BMC_SA;
@@ -1081,7 +1086,7 @@ int decode_mem_intel(int prod, uchar b2, uchar b3, char *desc, int *psz)
if (! is_remote()) {
fsm_debug = fdebug;
rv = get_MemDesc(array,dimm,desc,psz);
- /* if (rv != 0) desc has "DIMM[%d}" */
+ /* if (rv != 0) desc has "DIMM(%d)" */
}
if (rv != 0) {
/* either remote, or get_MemDesc failed, use common product defaults*/
@@ -1107,7 +1112,8 @@ int decode_mem_intel(int prod, uchar b2, uchar b3, char *desc, int *psz)
n = strlen_(pstr);
strncpy(desc, pstr, n+1);
} else {
- n = sprintf(desc,"DIMM[%d]",dimm);
+ if (bdata == 0xFF) n = sprintf(desc,DIMM_UNKNOWN); /* invalid */
+ else n = sprintf(desc,DIMM_NUM,dimm);
}
*psz = n;
}
diff --git a/util/oem_kontron.c b/util/oem_kontron.c
index 170a304..9a21131 100644
--- a/util/oem_kontron.c
+++ b/util/oem_kontron.c
@@ -73,8 +73,13 @@ typedef uint32_t socklen_t;
#define FRU_TYPE_COMPONENT 0x01
#define FRU_TYPE_BASEBOARD 0x07
+#ifdef METACOMMAND
+extern char * progver; /*from ipmiutil.c*/
+static char * progname = "ipmiutil kontronoem";
+#else
static char * progver = "3.08";
static char * progname = "ikontronoem";
+#endif
const struct valstr ktc5520_post[] = { /*from EAS*/
{ 0x0003, "Start POST Init" },
{ 0x0004, "Check CMOS" },
diff --git a/util/oem_lenovo.c b/util/oem_lenovo.c
index 1f23e0f..d190fbc 100644
--- a/util/oem_lenovo.c
+++ b/util/oem_lenovo.c
@@ -61,8 +61,13 @@ extern uchar bitnum(ushort value); /*isensor.c*/
extern char fdebug; /*ipmicmd.c*/
void set_loglevel(int level); /*prototype */
+#ifdef METACOMMAND
+extern char * progver; /*from ipmiutil.c*/
+static char * progname = "ipmiutil lenovooem";
+#else
static char * progver = "3.08";
static char * progname = "ilenovooem";
+#endif
static int verbose = 0;
static uchar g_bus = PUBLIC_BUS;
static uchar g_sa = BMC_SA;
@@ -71,6 +76,68 @@ static uchar g_addrtype = ADDR_SMI;
static int vend_id = 0;
static int prod_id = 0;
+/* See oem_ibm_sel_map from ipmitool contrib, interpretation not verified yet */
+#define NIBMEVT 16
+struct { uchar stype; uchar snum; uchar etype;
+ uchar data1; uchar data2; uchar data3;
+ uchar sev; char *desc; } oem_ibm_events[NIBMEVT] = {
+0xC1, 0xFF, 0xFF, 0xFF, 0x01, 0x00, SEV_MIN, "CPU shutdown - Potential cause 'triple fault' a software address problem",
+0xC1, 0xFF, 0xFF, 0xFF, 0x02, 0x01, SEV_INFO, "Memory Mirrored Failover Occurred - System running from mirrored memory image",
+0xC1, 0xFF, 0xFF, 0xFF, 0x02, 0x04, SEV_INFO, "Memory hot replace event",
+0xC1, 0xFF, 0xFF, 0xFF, 0x02, 0x05, SEV_INFO, "Memory hot add event",
+0xC1, 0xFF, 0xFF, 0xFF, 0x03, 0x00, SEV_INFO, "Scalability link down",
+0xC1, 0xFF, 0xFF, 0xFF, 0x03, 0x01, SEV_INFO, "Scalability link up",
+0xC1, 0xFF, 0xFF, 0xFF, 0x03, 0x02, SEV_INFO, "Scalability link double wide down",
+0xC1, 0xFF, 0xFF, 0xFF, 0x03, 0x03, SEV_INFO, "Scalability link double wide up",
+0xC1, 0xFF, 0xFF, 0xFF, 0x03, 0x80, SEV_INFO, "Scalability link PFA",
+0xC1, 0xFF, 0xFF, 0xFF, 0x03, 0x81, SEV_INFO, "Scalability link invalid port",
+0xC1, 0xFF, 0xFF, 0xFF, 0x03, 0x82, SEV_INFO, "Scalability link invalid node",
+0xC1, 0xFF, 0xFF, 0xFF, 0x03, 0x83, SEV_INFO, "Scalability link kill",
+0xE0, 0x00, 0x00, 0xFF, 0xFF, 0xFF, SEV_INFO, "Device OK",
+0xE0, 0x00, 0x01, 0xFF, 0xFF, 0xFF, SEV_MAJ, "Required ROM space not available",
+0xE0, 0x00, 0x02, 0xFF, 0xFF, 0xFF, SEV_MAJ, "Required I/O Space not available",
+0xE0, 0x00, 0x03, 0xFF, 0xFF, 0xFF, SEV_MAJ, "Required memory not available"
+};
+
+/*------------------------------------------------------------------------
+ * get_ibm_desc
+ * Uses the oem_ibm_events to decode IBM events not otherwise handled.
+ * Called by decode_sel_lenovo
+ *------------------------------------------------------------------------*/
+char * get_ibm_desc(uchar type, uchar num, uchar trig,
+ uchar data1, uchar data2, uchar data3, uchar *sev)
+{
+ int i;
+ char *pstr = NULL;
+
+ /* Use oem_ibm_events array for other misc descriptions */
+ data1 &= 0x0f; /*ignore top half of sensor offset for matching */
+ for (i = 0; i < NIBMEVT; i++) {
+ if ((oem_ibm_events[i].stype == 0xff) ||
+ (oem_ibm_events[i].stype == type)) {
+ if (oem_ibm_events[i].snum != 0xff &&
+ oem_ibm_events[i].snum != num)
+ continue;
+ if (oem_ibm_events[i].etype != 0xff &&
+ oem_ibm_events[i].etype != trig)
+ continue;
+ if (oem_ibm_events[i].data1 != 0xff &&
+ (oem_ibm_events[i].data1 & 0x0f) != (data1 & 0x0f))
+ continue;
+ if (oem_ibm_events[i].data2 != 0xff &&
+ oem_ibm_events[i].data2 != data2)
+ continue;
+ if (oem_ibm_events[i].data3 != 0xff &&
+ oem_ibm_events[i].data3 != data3)
+ continue;
+ /* have a match, use description */
+ pstr = (char *)oem_ibm_events[i].desc;
+ if (sev != NULL) *sev = oem_ibm_events[i].sev;
+ break;
+ }
+ } /*end for*/
+ return(pstr);
+} /* end get_ibm_desc() */
/*
* decode_sensor_lenovo
@@ -164,6 +231,15 @@ int decode_sensor_lenovo(uchar *sdr,uchar *reading,char *pstring, int slen)
rv = 0;
}
break;
+ case 0x17: /* RSA II Detect, Mem1 Detect (mfg=0002:0077) */
+ /* mfg=0002:0077 sensor type=17 evt=8 entity=b rval=0002, RSA II*/
+ /* mfg=0002:0077 sensor type=17 evt=8 entity=8 rval=0002, Mem1 */
+ switch(rval) {
+ case 0x02: pstr = "OK"; break;
+ default: pstr = "Unknown"; break;
+ }
+ rv = 0;
+ break;
case 0x1B: /* Front USB, nvDIMM Cable, etc. */
if (etype == 0x6F) {
/* 0x01 = connected/OK, 0x02 = cable connect error */
@@ -257,9 +333,9 @@ int decode_sel_lenovo(uchar *evt, char *outbuf, int outsz, char fdesc,
char mybuf[64];
char *type_str = "";
char *pstr = NULL;
- int sevid;
+ uchar sevid;
ushort genid;
- uchar snum;
+ uchar snum, etype;
uchar data1, data2, data3;
fdebug = fdbg;
@@ -269,21 +345,28 @@ int decode_sel_lenovo(uchar *evt, char *outbuf, int outsz, char fdesc,
snum = evt[11];
timestamp = evt[3] + (evt[4] << 8) + (evt[5] << 16) + (evt[6] << 24);
genid = evt[7] | (evt[8] << 8);
+ etype = evt[12];
data1 = evt[13];
data2 = evt[14];
data3 = evt[15];
- if (rectype == 0x02)
- {
- sprintf(mybuf,"%02x [%02x %02x %02x]", evt[12],data1,data2,data3);
- switch(evt[10]) { /*sensor type*/
- case 0xC0: /* OEM type */
- type_str = "OEM_type";
- pstr = "OEM Sensor ";
- sevid = SEV_MAJ;
- rv = -1;
- break;
- default: /*other sensor types*/
- break;
+
+ if (rectype == 0x02) {
+ sprintf(mybuf,"%02x [%02x %02x %02x]", etype,data1,data2,data3);
+ pstr = get_ibm_desc(evt[10], snum, etype, data1, data2, data3, &sevid);
+ if (pstr != NULL) {
+ type_str = "IBM_type";
+ rv = 0;
+ } else {
+ switch(evt[10]) { /*sensor type*/
+ case 0xC0: /* OEM type */
+ type_str = "OEM_type";
+ pstr = "OEM Sensor ";
+ sevid = SEV_MAJ;
+ rv = -1;
+ break;
+ default: /*other sensor types*/
+ break;
+ }
}
}
if (rv == 0) {
diff --git a/util/oem_newisys.c b/util/oem_newisys.c
index 62486d8..cf1d535 100644
--- a/util/oem_newisys.c
+++ b/util/oem_newisys.c
@@ -43,8 +43,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "ipmicmd.h"
#include "ievents.h"
+#ifdef METACOMMAND
+extern char * progver; /*from ipmiutil.c*/
+static char * progname = "ipmiutil newisysoem";
+#else
static char * progver = "3.08";
static char * progname = "inewisysoem";
+#endif
static char fdebug = 0;
static uchar g_bus = PUBLIC_BUS;
static uchar g_sa = BMC_SA;
diff --git a/util/oem_quanta.c b/util/oem_quanta.c
index f41e4d2..0d774b9 100644
--- a/util/oem_quanta.c
+++ b/util/oem_quanta.c
@@ -45,8 +45,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
extern int decode_sensor_intel_nm(uchar *sdr,uchar *reading,
char *pstring,int slen); /*oem_intel.c*/
+#ifdef METACOMMAND
+extern char * progver; /*from ipmiutil.c*/
+static char * progname = "ipmiutil quantaoem";
+#else
static char * progver = "3.08";
static char * progname = "iquantaoem";
+#endif
static char fdbg = 0;
/*
diff --git a/util/oem_sun.c b/util/oem_sun.c
index 604caa7..84aa50f 100644
--- a/util/oem_sun.c
+++ b/util/oem_sun.c
@@ -108,8 +108,13 @@ static const struct valstr sunoem_led_mode_optvals[] = {
};
/* global variables */
-static char * progname = "isunoem";
+#ifdef METACOMMAND
+extern char * progver; /*from ipmiutil.c*/
+static char * progname = "ipmiutil sunoem";
+#else
static char * progver = "3.08";
+static char * progname = "isunoem";
+#endif
static char fdebug = 0;
static uchar g_bus = PUBLIC_BUS;
static uchar g_sa = BMC_SA;
diff --git a/util/oem_supermicro.c b/util/oem_supermicro.c
index 82d6647..62ecbfe 100644
--- a/util/oem_supermicro.c
+++ b/util/oem_supermicro.c
@@ -68,8 +68,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
void set_loglevel(int level); /*prototype */
extern char fsm_debug; /*mem_if.c*/
+#ifdef METACOMMAND
+extern char * progver; /*from ipmiutil.c*/
+static char * progname = "ipmiutil smcoem";
+#else
static char * progver = "3.08";
static char * progname = "ismcoem";
+#endif
static int verbose = 0;
static char fdebug = 0;
static uchar g_bus = PUBLIC_BUS;
@@ -513,12 +518,13 @@ int decode_sensor_supermicro(uchar *sdr,uchar *reading,char *pstring, int slen,
return(rv);
}
+extern int get_MemDesc(int array, int dimm, char *desc, int *psz); /*mem_if.c*/
#define NPAIRS 26
char rgpair[NPAIRS] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int decode_mem_supermicro(int prod, uchar b2, uchar b3, char *desc, int *psz)
{
int cpu, pair, dimm, n;
- int rv = -1;
+ int rv = 0;
int ver = 0;
uchar bdata;
if ((desc == NULL) || (psz == NULL)) return -1;
@@ -564,18 +570,17 @@ int decode_mem_supermicro(int prod, uchar b2, uchar b3, char *desc, int *psz)
if (pair > NPAIRS) pair = NPAIRS - 1;
dimm = (bdata & 0x0F) - 9; /*0x0A=dimmX1, 0x0B=dimmX2*/
if (dimm < 0)
- n = sprintf(desc,"unknown DIMM"); /* was ver 0 */
+ n = sprintf(desc,DIMM_UNKNOWN); /* invalid */
else
n = sprintf(desc,"P%d_DIMM%c%d",cpu,rgpair[pair],dimm);
}
-#ifdef DMIOK
/* Use DMI if we get confirmation about cpu/dimm indices. */
if (! is_remote()) {
fsm_debug = fdebug;
rv = get_MemDesc(cpu,dimm,desc,psz);
/* if (rv != 0) desc has "DIMM[%d}" */
}
-#endif
+ if ((bdata == 0xFF) || (rv != 0)) n = sprintf(desc,DIMM_UNKNOWN);
if (fdebug)
printf("decode_mem_supermicro: v%d bdata=%02x(%d) cpu=%d dimm=%d pair=%d\n",ver,bdata,bdata,cpu,dimm,pair);
diff --git a/util/subs.c b/util/subs.c
index 8965283..2ffcd01 100644
--- a/util/subs.c
+++ b/util/subs.c
@@ -436,8 +436,8 @@ static struct { int val; char *pstr; } mfgs[N_MFG] = {
{VENDOR_QUANTA, "Quanta"}, /*=7244. */
{VENDOR_MAGNUM, "Magnum Technologies"}, /*=5593. */
{VENDOR_SUPERMICROX, "xSuperMicro"}, /* 47488. used by Winbond/SuperMicro*/
- {VENDOR_HP, "HP"}, /* 0x00000B for HP */
- {VENDOR_DELL, "Dell"}, /*0x0002A2*/
+ {VENDOR_HP, "HP"}, /* 0x00000B (11.) for HP */
+ {VENDOR_DELL, "Dell"}, /*0x0002A2 (674.) */
{VENDOR_KONTRON, "Kontron"}, /*=0x003A98, 15000.*/
{VENDOR_SUPERMICRO, "SuperMicro"}, /*=0x002A7C, 10876. used in AOC-SIMSO*/
{VENDOR_FUJITSU, "Fujitsu-Siemens"}, /* 0x002880, 10368. */