summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2016-08-24 05:56:37 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2016-08-24 05:56:37 +0200
commitdb5e8f26947114f06480dd22b9db7e22e50ee133 (patch)
treebb7418b545d295ea7cc4f5e7404d262e51082e0f /util
parent55adddbc16f65732b57ab8585c47001fced91d77 (diff)
Imported Upstream version 3.0.0upstream/3.0.0
Diffstat (limited to 'util')
-rw-r--r--util/ialarms.c20
-rw-r--r--util/icmd.c2
-rw-r--r--util/iconfig.c24
-rw-r--r--util/idcmi.c2
-rw-r--r--util/ievents.c28
-rw-r--r--util/ifirewall.c2
-rw-r--r--util/ifru.c2
-rw-r--r--util/ifruset.c2
-rw-r--r--util/igetevent.c2
-rw-r--r--util/ihealth.c52
-rw-r--r--util/ilan.c20
-rw-r--r--util/ipicmg.c2
-rw-r--r--util/ipmicmd.c5
-rw-r--r--util/ipmicmd.h2
-rw-r--r--util/ipmilanplus.c2
-rw-r--r--util/ipmiutil.c5
-rw-r--r--util/ipmiutil.mak23
-rw-r--r--util/ipmiutil64.mak16
-rw-r--r--util/ireset.c2
-rw-r--r--util/isel.c25
-rw-r--r--util/iseltime.c2
-rw-r--r--util/isensor.c13
-rw-r--r--util/iserial.c2
-rw-r--r--util/isol.c2
-rw-r--r--util/itsol.c2
-rw-r--r--util/iwdt.c2
-rw-r--r--util/oem_dell.c2
-rw-r--r--util/oem_intel.c128
-rw-r--r--util/oem_intel.h15
-rw-r--r--util/oem_sun.c2
-rw-r--r--util/oem_supermicro.c112
31 files changed, 371 insertions, 149 deletions
diff --git a/util/ialarms.c b/util/ialarms.c
index f9c80cc..460b3eb 100644
--- a/util/ialarms.c
+++ b/util/ialarms.c
@@ -75,7 +75,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*
* Global variables
*/
-static char * progver = "2.99";
+static char * progver = "3.00";
static char * progname = "ialarms";
static char fdebug = 0;
static char fbmctam = 0;
@@ -112,6 +112,7 @@ extern int get_led_status_intel(uchar *pstate);
static uchar busid = PRIVATE_BUS_ID;
static uchar enc_sa = HSC_SA;
static char fRomley = 0;
+static char fGrantley = 0;
static int get_enc_leds(uchar *val)
{
@@ -488,12 +489,13 @@ main(int argc, char **argv)
ret = detect_capab_intel(vend_id,prod_id,&flags,&maxdisks,fdebug);
busid = (uchar)ret;
if (fdebug) printf("prod_capab: busid=%x, flags=%02x\n",busid,flags);
- if ((flags & HAS_ALARMS_MASK) != 0) fHasAlarms = 1;
- if ((flags & HAS_BMCTAM_MASK) != 0) fbmctam = 1;
- if ((flags & HAS_ENCL_MASK) != 0) fHasEnc = 1;
- if ((flags & HAS_PICMG_MASK) != 0) fpicmg = 1;
- if ((flags & HAS_NSC_MASK) != 0) fNSC = 1;
- if ((flags & HAS_ROMLEY_MASK) != 0) fRomley = 1;
+ if ((flags & HAS_ALARMS_MASK) != 0) fHasAlarms = 1;
+ if ((flags & HAS_BMCTAM_MASK) != 0) fbmctam = 1;
+ if ((flags & HAS_ENCL_MASK) != 0) fHasEnc = 1;
+ if ((flags & HAS_PICMG_MASK) != 0) fpicmg = 1;
+ if ((flags & HAS_NSC_MASK) != 0) fNSC = 1;
+ if ((flags & HAS_ROMLEY_MASK) != 0) fRomley = 1;
+ if ((flags & HAS_GRANTLEY_MASK) != 0) fGrantley = 1;
/* get ID LED status */
ret = get_led_status_intel(&idstate);
if (ret == 0) {
@@ -613,11 +615,11 @@ main(int argc, char **argv)
}
if (fHasEnc && fdoencl) { /* disk enclosure exists */
- if (fRomley) { /* Romley (Patsburg) */
+ if (fRomley || fGrantley) { /* Romley (Patsburg) */
int rv; /*do not change ret*/
rv = get_enc_leds_intel(&encled);
if (rv == 0) {
- show_enc_leds_intel(encled,maxdisks);
+ show_enc_leds_intel(encled,maxdisks);
if (fsetdisk) {
/* Set fault if user param, and disk is present. */
if (fsetall) newvalue = 0x00; /* all LEDs off */
diff --git a/util/icmd.c b/util/icmd.c
index cbd35d1..3d55642 100644
--- a/util/icmd.c
+++ b/util/icmd.c
@@ -78,7 +78,7 @@ extern void ipmi_lan_set_timeout(int ipmito, int tries, int pingto);
/*
* Global variables
*/
-static char * progver = "2.99";
+static char * progver = "3.00";
static char * progname = "icmd";
static char fdebug = 0;
static char fquiet = 0;
diff --git a/util/iconfig.c b/util/iconfig.c
index 21eb76e..240e530 100644
--- a/util/iconfig.c
+++ b/util/iconfig.c
@@ -171,7 +171,7 @@ typedef struct
/*
* Global variables
*/
-static char * progver = "2.99";
+static char * progver = "3.00";
static char * progname = "iconfig";
static char fdebug = 0;
static char fipmilan = 0;
@@ -186,6 +186,7 @@ static char fpassword = 0; /* =1 user-specified a password, so set it. */
static uchar fmBMC = 0;
static uchar fiBMC = 0;
static uchar fRomley = 0;
+static uchar fGrantley = 0;
static char fipv6 = 0;
static char fcanonical = 0;
static char fchan2wart = 0; /* =1 if need wart to skip channel 2 */
@@ -1337,13 +1338,13 @@ static int Get_Mac(uchar *ipadr,uchar *macadr)
"arping -I %s -c 2 %d.%d.%d.%d |grep reply |tail -n1 >%s\n",
_ifname,ipadr[0],ipadr[1],ipadr[2],ipadr[3],alertfile);
if (fdebug) printf("%s", arping_cmd);
- system(arping_cmd);
+ i = system(arping_cmd);
fparp = fopen(alertfile,"r");
if (fparp == NULL) {
fprintf(stdout,"Get_Mac: Cannot open %s, errno = %d\n",
alertfile,get_errno());
- ret = -1;
+ ret = -1;
} else {
while (fgets(buff, 1023, fparp)) {
/* should only run through loop once */
@@ -2002,13 +2003,14 @@ main(int argc, char **argv)
#endif
break;
} /*end switch*/
- if (is_romley(vend_id,prod_id)) {
- fRomley = 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 cmds */
fipv6 = 1;
- }
+ }
} else if (vend_id == VENDOR_KONTRON) {
//if (prod_id == 0x1590) fchan2wart = 1; /* KTC5520 chan2 wart */
fsharedMAC = 0; /* not-shared BMC MAC */
@@ -2324,7 +2326,10 @@ main(int argc, char **argv)
case LAN_FAILOVER: /* Intel LAN Failover */
if (is_romley(vend_id,prod_id))
ret = lan_failover_intel(0xFF,&LanRecord[0]);
- else continue; /*skip if not Intel Romley */
+ else if ((vend_id == VENDOR_SUPERMICROX) || (vend_id == VENDOR_SUPERMICRO)) {
+ ret = oem_supermicro_get_lan_port(&LanRecord[0]);
+ if (fdebug) printf("SMC get_lan_port ret=%d val=%d\n",ret,LanRecord[0]);
+ } else continue; /*skip if not Intel Romley */
sz = 1;
fignore_err = 1;
break;
@@ -2641,7 +2646,10 @@ main(int argc, char **argv)
case LAN_FAILOVER: /* Intel LAN Failover */
if (is_romley(vend_id,prod_id))
ret = lan_failover_intel(LanRecord[0],(uchar *)&i);
- else continue; /*skip if not Intel Romley*/
+ else if ((vend_id == VENDOR_SUPERMICROX) || (vend_id == VENDOR_SUPERMICRO)) {
+ ret = oem_supermicro_set_lan_port(LanRecord[0]);
+ if (fdebug) printf("SMC set_lan_port(%d) = %d\n",LanRecord[0],ret);
+ } else continue; /*skip if not Intel Romley*/
break;
default:
ret = LAN_ERR_NOTSUPPORT;
diff --git a/util/idcmi.c b/util/idcmi.c
index a21ee2a..5731af5 100644
--- a/util/idcmi.c
+++ b/util/idcmi.c
@@ -62,7 +62,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "idcmi.h"
static char * progname = "idcmi";
-static char * progver = "2.99";
+static char * progver = "3.00";
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 6a34e16..7ff61e1 100644
--- a/util/ievents.c
+++ b/util/ievents.c
@@ -76,7 +76,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define SELprintf printf
#define SMS_SA 0x41
#define SMI_SA 0x21
-static char *progver = "2.99";
+static char *progver = "3.00";
static char *progname = "ievents";
static char fsensdesc = 0; /* 1= get extended sensor descriptions*/
static char fcanonical = 0; /* 1= show canonical, delimited output*/
@@ -1601,7 +1601,31 @@ int decode_sel_entry( uchar *pevt, char *outbuf, int szbuf)
j = decode_sel_oem(vend,pevt,outbuf,szbuf,fsensdesc,fdebug);
if (j == 0) return(0); /*successful, have the description*/
- if (psel->record_type == 0xDC) {
+ if (psel->record_type == RT_OEMIU) { /* 0xDB usu ipmiutil OEM string */
+ int ix = 0;
+ /* ipmiutil OEM event with 9-byte string */
+ pc = (uchar *)&psel->generator_id; /* offset 7 */
+ evtime = (uchar *)&psel->timestamp;
+ eventTime = evtime[0] + (evtime[1] << 8) +
+ (evtime[2] << 16) + (evtime[3] << 24);
+ fmt_time(eventTime, timebuf, sizeof(timebuf));
+ if (fcanonical)
+ sprintf(outbuf,"%04x %c %s %c %s %c %02x %c %06x %c %s %c OEM Event ",
+ psel->record_id, bdelim, timebuf, bdelim,
+ get_sev_str(sev), bdelim, psel->record_type, bdelim);
+ else
+ sprintf(outbuf,"%04x %s %s %02x OEM Event ",
+ psel->record_id, timebuf, get_sev_str(sev),
+ psel->record_type);
+ j = strlen_(outbuf);
+ for (i = 0; i < 9; i++) { /* 7:16 = 9 bytes string data */
+ if (pc[i] == 0) outbuf[j] = ' ';
+ else sprintf(&outbuf[j],"%c",pc[i]);
+ j += 1;
+ }
+ outbuf[j++] = '\n';
+ outbuf[j++] = 0;
+ } else if (psel->record_type == 0xDC) {
/* OEM Record: these are usually Microsoft */
char *mfgstr;
int mfg;
diff --git a/util/ifirewall.c b/util/ifirewall.c
index f81deda..9048de0 100644
--- a/util/ifirewall.c
+++ b/util/ifirewall.c
@@ -64,7 +64,7 @@
/* global variables */
static char * progname = "ifirewall";
-static char * progver = "2.99";
+static char * progver = "3.00";
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 5e6acf8..2390354 100644
--- a/util/ifru.c
+++ b/util/ifru.c
@@ -116,7 +116,7 @@ extern int ipmi_kontronoem_main(void * intf, int argc, char ** argv);
#endif
static char *progname = "ifru";
-static char *progver = "2.99";
+static char *progver = "3.00";
static int vend_id = 0;
static int prod_id = 0;
static char fdebug = 0;
diff --git a/util/ifruset.c b/util/ifruset.c
index 8ff4294..652167f 100644
--- a/util/ifruset.c
+++ b/util/ifruset.c
@@ -106,7 +106,7 @@ extern void fmt_time(time_t etime, char *buf, int bufsz); /*see ievents.c*/
#define IPROD_OEM 7
static char *progname = "ifruset";
-static char *progver = "2.99";
+static char *progver = "3.00";
static char fdebug = 0;
static char fpicmg = 0;
static char fonlybase = 0;
diff --git a/util/igetevent.c b/util/igetevent.c
index 1c420e2..f73c71f 100644
--- a/util/igetevent.c
+++ b/util/igetevent.c
@@ -169,7 +169,7 @@ extern void free_sdr_cache(uchar *pret); /*see isensor.c*/
* Global variables
*/
static char * progname = "igetevent";
-static char * progver = "2.99";
+static char * progver = "3.00";
static char fdebug = 0;
static char fipmilan = 0;
static char frunonce = 0;
diff --git a/util/ihealth.c b/util/ihealth.c
index abc7fdb..1389ba2 100644
--- a/util/ihealth.c
+++ b/util/ihealth.c
@@ -82,7 +82,7 @@ extern int oem_supermicro_get_firmware_str(char *pstr, int sz); /*oem_supermicro
* Global variables
*/
static char * progname = "ihealth";
-static char * progver = "2.99";
+static char * progver = "3.00";
static char fdebug = 0;
static char fipmilan = 0;
static char fcanonical = 0;
@@ -135,6 +135,36 @@ int oem_get_health(char *pstr, int sz)
return rv;
}
+char *getdmiprod(void)
+{
+ char *prod = "";
+#ifdef LINUX
+ static char dmiprod[32];
+ char cmd[160];
+ char *dmitmp = "/tmp/dmi.tmp";
+ FILE *fp;
+ int rv, i;
+ if (fipmilan) return(prod);
+ sprintf(cmd,"dmidecode | grep -A6 \"^Base Board\" |grep 'Product Name' |cut -f2 -d':' |awk '{ print $1 }' >%s",dmitmp);
+ rv = system(cmd);
+ if (rv == 0) {
+ fp = fopen(dmitmp,"r");
+ if (fp == NULL) rv = -1;
+ else {
+ if (fgets(dmiprod, sizeof(dmiprod), fp) == NULL) rv = -2;
+ else {
+ for (i=0; i<sizeof(dmiprod); i++) {
+ if (dmiprod[i] == '\n') { dmiprod[i] = '\0'; break; }
+ }
+ prod = dmiprod;
+ }
+ fclose(fp);
+ }
+ }
+#endif
+ return(prod);
+}
+
int get_lan_stats(uchar chan)
{
uchar idata[2];
@@ -616,7 +646,7 @@ void show_devid_all(int dtype, uchar *devrec, int sdevrec)
case VENDOR_INTEL: /*=0x000157*/
if (do_hsc && (dtype == BMC)) /*if HSC option, also show extra*/
sprintf(extraver," (Boot %x.%x PIA %x.%x)", /*BMC extra*/
- devrec[11],devrec[12],devrec[13],devrec[14]);
+ devrec[11],devrec[12],devrec[13],devrec[14]);
switch(prod) { /* show product names for some */
case 0x000C: prodstr = "(TSRLT2)"; /*SCB2*/
bChan = 7; break;
@@ -649,15 +679,18 @@ void show_devid_all(int dtype, uchar *devrec, int sdevrec)
fmBMC = 1; break;
default: prodstr = ""; break;
}
- if (is_romley(mfg,prod)) {
- intel_romley_desc(mfg,prod,&prodstr);
- snprintf(prodoem,sizeof(prodoem),"(%s)",prodstr);
- prodstr = prodoem;
- do_me = 1; kcs_loops = URNLOOPS;
- do_hsc = 1; /*the HSC is embedded, so not the same*/
+ if (is_romley(mfg,prod)) {
+ intel_romley_desc(mfg,prod,&prodstr);
+ snprintf(prodoem,sizeof(prodoem),"(%s)",prodstr);
+ prodstr = prodoem;
+ do_me = 1; kcs_loops = URNLOOPS;
+ do_hsc = 1; /*the HSC is embedded, so not the same*/
sprintf(extraver,".%d (Boot %x.%x)", /*BMC extra*/
(devrec[13] + (devrec[14] << 8)),devrec[11],devrec[12]);
- }
+ }
+ if (is_grantley(mfg,prod)) {
+ intel_grantley_desc(mfg,prod,&prodstr);
+ }
break;
case VENDOR_KONTRON: /*=0x003A98=15000.*/
i = devrec[11] + (devrec[12] << 8);
@@ -757,6 +790,7 @@ void show_devid_all(int dtype, uchar *devrec, int sdevrec)
prodstr = "";
break;
} /*end switch(prod)*/
+ if (prodstr == "") prodstr = getdmiprod();
if (kcs_loops != 0) set_max_kcs_loops(kcs_loops);
} /*end-else BMC*/
diff --git a/util/ilan.c b/util/ilan.c
index c81c7a9..91dda48 100644
--- a/util/ilan.c
+++ b/util/ilan.c
@@ -305,7 +305,7 @@ extern char *get_sensor_type_desc(uchar stype); /*from ievents.c*/
/*
* Global variables
*/
-static char * progver = "2.99";
+static char * progver = "3.00";
static char * progname = "ilan";
static char fdebug = 0;
static char fipmilan = 0;
@@ -342,6 +342,7 @@ static char fpassword = 0; /* =1 user-specified a password, so set it. */
static uchar fmBMC = 0; /* =1 mini-BMC, =0 Sahalee BMC */
static uchar fiBMC = 0; /* =1 Intel iBMC */
static uchar fRomley = 0; /* =1 Intel Romley BMC */
+static uchar fGrantley = 0;
static uchar fipv6 = 0; /* =1 if BMC supports IPv6 */
static uchar bmcpefctl = 0; /* existing BMC PEF Control, !0 = enabled */
static char alertnum = 1; /* alert dest num (usu 1 thru 4) */
@@ -4042,14 +4043,15 @@ main(int argc, char **argv)
else fsharedMAC = 1; /* usu IPMI 1.x has shared BMC MAC */
break;
} /*end switch*/
- if (is_romley(vend_id,prod_id)) {
- fRomley = 1;
- fiBMC = 1; /* Intel iBMC */
+ 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*/
- }
+ 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 */
@@ -4638,7 +4640,7 @@ main(int argc, char **argv)
if (ival == 17) ndest = 0; /*error getting num dest*/
}
} /*end for*/
- if (fRomley) { /*get LAN Failover param*/
+ if (fRomley || fGrantley) { /*get LAN Failover param*/
uchar b;
ret = lan_failover_intel(0xFF,(uchar *)&b);
if (ret != 0)
@@ -5125,7 +5127,7 @@ main(int argc, char **argv)
}
}
if (failover_enable != PARM_INIT) {
- if (fRomley) {
+ if (fRomley || fGrantley) {
if (failover_enable > 1) failover_enable = 0; /*default*/
ret = lan_failover_intel(failover_enable,(uchar *)&i);
printf("Set Intel Lan Failover (%d), ret = %d\n",
diff --git a/util/ipicmg.c b/util/ipicmg.c
index 6421f2b..a85bde9 100644
--- a/util/ipicmg.c
+++ b/util/ipicmg.c
@@ -81,7 +81,7 @@
/* Global data */
static char * progname = "ipicmg";
-static char * progver = "2.99";
+static char * progver = "3.00";
static char fdebug = 0;
static char fset_mc = 0;
static uint8_t g_bus = PUBLIC_BUS;
diff --git a/util/ipmicmd.c b/util/ipmicmd.c
index 369d2e4..ffb59e2 100644
--- a/util/ipmicmd.c
+++ b/util/ipmicmd.c
@@ -662,8 +662,9 @@ int ipmi_open(char fdebugcmd)
/* Use IPMI LAN 2.0 if BMC said it only supports LAN2 */
/* This is a violation of IPMI 2.0 Spec section 13.4,
* but some HP firmware behaves this way, so handle it. */
- rc = ipmi_open_lan2(gnode,lanp.user,lanp.pswd,fdebugcmd);
fDriverTyp = DRV_LAN2;
+ rc = ipmi_open_lan2(gnode,lanp.user,lanp.pswd,fdebugcmd);
+ if (rc != 0) fDriverTyp = DRV_UNKNOWN;
}
} else { /* local, not lan */
#ifdef WIN32
@@ -1364,7 +1365,7 @@ void parse_lan_options(int c, char *popt, char fdebugcmd)
break;
case 'F': /* force driver type */
i = set_driver_type(popt);
- if (i == 0) fset_dtype = 1;
+ if (i == 0) fset_dtype = 1;
break;
case 'T': /* auth type */
i = atoi(popt);
diff --git a/util/ipmicmd.h b/util/ipmicmd.h
index 5c41151..02a0052 100644
--- a/util/ipmicmd.h
+++ b/util/ipmicmd.h
@@ -325,6 +325,8 @@ struct oemvalstr {
#define BCOLON ':' /*delimeter some output with colons*/
#define BCOMMENT '#' /*delimeter '#' used for comments */
+#define RT_OEMIU 0xDB /*record type for OEM ipmiutil events*/
+
#ifndef LOG_WARN
#define LOG_EMERG 0 // system is unusable
#define LOG_ALERT 1 // action must be taken immediately
diff --git a/util/ipmilanplus.c b/util/ipmilanplus.c
index 13ed2bc..f018b36 100644
--- a/util/ipmilanplus.c
+++ b/util/ipmilanplus.c
@@ -50,7 +50,7 @@ int ipmi_close_lan2(char *node)
int ipmi_cmdraw_lan2(char *node, uchar cmd, uchar netfn, uchar lun,
uchar sa, uchar bus, uchar *pdata, int sdata,
uchar *presp, int *sresp, uchar *pcc, char fdebugcmd)
-{ return(LAN_ERR_INVPARAM); }
+{ printf("lanplus not configured\n"); return(LAN_ERR_INVPARAM); }
int ipmi_cmd_lan2(char *node, ushort cmd, uchar *pdata, int sdata,
uchar *presp, int *sresp, uchar *pcc, char fdebugcmd)
diff --git a/util/ipmiutil.c b/util/ipmiutil.c
index 765f5e6..167236d 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 = "2.99";
+static char *progver = "3.00";
// static char fdebug = 0;
/*int ipmiutil(int argc, char **argv); */
@@ -122,6 +122,8 @@ int i_discover(int argc, char **argv)
}
#endif
+#ifndef _WINDLL
+/* omit main if compiled as a Windows DLL */
#ifdef WIN32
int __cdecl
#else
@@ -225,5 +227,6 @@ do_exit:
}
return(ret);
}
+#endif
/*end ipmiutil.c*/
diff --git a/util/ipmiutil.mak b/util/ipmiutil.mak
index 5ead440..9d63953 100644
--- a/util/ipmiutil.mak
+++ b/util/ipmiutil.mak
@@ -26,7 +26,7 @@ CMD_OBJ = $(CMD_OBJ) ipmilanplus.obj
L2_OBJ = $(L2_D)\helper.obj $(L2_D)\ipmi_strings.obj $(L2_D)\lanplus.obj \
$(L2_D)\lanplus_crypt_impl.obj $(L2_D)\lanplus_dump.obj \
$(L2_D)\lanplus_strings.obj $(L2_D)\lanplus_crypt.obj
-LF_LANPLUS=/LIBPATH:$(LIB_D) $(L2_OBJ) ssleay32.lib libeay32.lib
+LF_LANPLUS=/LIBPATH:$(LIB_D) /LIBPATH:$(L2_D) $(L2_OBJ) ssleay32.lib libeay32.lib
CF_LANPLUS=/D HAVE_LANPLUS
# Set your compiler options
@@ -36,7 +36,7 @@ CF_LANPLUS=/D HAVE_LANPLUS
# CFLAGS_O=/W3 /O2 /Zi /MT /nologo
CFLAGS_O=/W3 /O2 /Zi /MT /nologo
CF_EX=/DWIN32 $(CF_LANPLUS) $(INC) /D_CONSOLE /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DHAVE_STRING_H
-CF_SAM=/DWIN32 $(INC) /D_CONSOLE /D_CRT_SECURE_NO_DEPRECATE /DHAVE_STRING_H
+CF_SAM=/DWIN32 $(INC) /D_CONSOLE /D_CRT_SECURE_NO_DEPRECATE /DHAVE_STRING_H $(CF_LANPLUS)
CFLAGS=$(CFLAGS_O) $(CF_EX) /DSKIP_MD2
CFLAGS_M=$(CFLAGS_O) $(CF_EX) /DSKIP_MD2 /DMETACOMMAND
CFLAGS_SAM=$(CFLAGS_O) $(CF_SAM)
@@ -58,7 +58,6 @@ MKLIB=lib
RM=del
CP=copy
-# added ws2_32.lib
LIBS_EX = advapi32.lib kernel32.lib wsock32.lib ws2_32.lib $(LIBS_W) $(LIBC_RT)
LIBS_PEF = /LIBPATH:$(LIB_D) iphlpapi.lib
# LIBS_EX+=wsock32.lib user32.lib gdi32.lib
@@ -67,7 +66,7 @@ HEADER=ipmicmd.h imb_api.h ipmilan.h ipmidir.h ipmilanplus.h \
ipmiutil.h
SHOWSEL = showsel
-TARG_EXE=ievents.exe $(SHOWSEL)msg.dll ipmi_sample.exe ipmi_sample_evt.exe $(SAMP_DLL)
+TARG_EXE=ievents.exe $(SHOWSEL)msg.dll ipmi_sample.exe ipmi_sample2.exe ipmi_sample_evt.exe $(SAMP_DLL)
# alarms.exe ihealth.exe $(SHOWSEL).exe $(SHOWSEL)msg.dll \
# ireset.exe ifru.exe ilan.exe iserial.exe wdt.exe \
# getevent.exe sensor.exe icmd.exe isolconsole.exe idiscover.exe \
@@ -120,14 +119,12 @@ clean:
$(RM) $(TARG_EXE) 2>NUL
$(RM) *.exe 2>NUL
-$(RM) $(TMP_D)\*.obj 2>NUL
- -$(RM) *.manifest 2>NUL
distclean:
$(RM) *.obj 2>NUL
$(RM) $(TARG_EXE) 2>NUL
$(RM) *.exe 2>NUL
-$(RM) $(TMP_D)\*.* 2>NUL
- -$(RM) *.manifest 2>NUL
rmdir $(TMP_D) 2>NUL
$(RM) *.rc 2>NUL
$(RM) *.bin 2>NUL
@@ -389,8 +386,6 @@ $(TMP_D)\iwdt.obj: iwdt.c
$(E_EXE): $(E_OBJ)
$(LINK) $(LFLAGS) /OUT:$(E_EXE) $(E_OBJ) $(LF_LANPLUS) $(LIBS_PEF) $(LIBS_EX)
-
-# mt.exe -manifest $(E_EXE).manifest -outputresource:$(E_EXE);1
ipmi_sample.obj: ipmi_sample.c
$(CC) /c $(CFLAGS_SAM) ipmi_sample.c
@@ -402,24 +397,24 @@ $(SAMP_LIB): $(CMD_OBJ) mem_if.obj
$(SAMP_DLL): $(CMD_OBJ) mem_if.obj
$(CC) /D_WINDLL /D_USRDLL /c $(CFLAGS_SAM) ipmilanplus.c
- $(LINK) /DLL $(LFLAGS) /OUT:$(SAMP_DLL) /def:ipmiutillib.def $(CMD_OBJ) mem_if.obj $(LIBS_PEF) $(LIBS_EX)
+ $(LINK) /DLL $(LFLAGS) /OUT:$(SAMP_DLL) /def:ipmiutillib.def $(CMD_OBJ) mem_if.obj $(LIBS_PEF) $(LF_LANPLUS) $(LIBS_EX)
del ipmilanplus.obj
ipmi_sample.exe: $(SAMP_LIB) ipmi_sample.obj
- $(LINK) $(LFLAGS) /OUT:ipmi_sample.exe ipmi_sample.obj $(SAMP_LIB) $(LIBS_PEF) $(LIBS_EX)
+ $(LINK) $(LFLAGS) /OUT:ipmi_sample.exe ipmi_sample.obj $(SAMP_LIB) $(LIBS_PEF) $(LF_LANPLUS) $(LIBS_EX)
ipmi_sample2.exe: $(SAMP_LIB) ipmi_sample.c isensor.c ievents.c
$(CC) /c $(CFLAGS_SAM) /DGET_SENSORS ipmi_sample.c
$(CC) /c $(CFLAGS_SAM) isensor.c
$(CC) /c $(CFLAGS_SAM) ievents.c
- $(LINK) $(LFLAGS) /OUT:ipmi_sample2.exe ipmi_sample.obj isensor.obj ievents.obj $(SAMP_LIB) $(LIBS_PEF) $(LIBS_EX)
- del isensor.obj ievents.obj
+ $(LINK) $(LFLAGS) /OUT:ipmi_sample2.exe ipmi_sample.obj isensor.obj ievents.obj $(SAMP_LIB) $(LIBS_PEF) $(LF_LANPLUS) $(LIBS_EX)
+ del isensor.obj ievents.obj ipmi_sample.obj
ifruset.obj: ifruset.c
$(CC) /c $(CFLAGS_SAM) ifruset.c
ifruset.exe: $(SAMP_LIB) ifruset.obj ifru_picmg.obj
- $(LINK) $(LFLAGS) /OUT:ifruset.exe ifruset.obj ifru_picmg.obj $(SAMP_LIB) $(LIBS_PEF) $(LIBS_EX)
+ $(LINK) $(LFLAGS) /OUT:ifruset.exe ifruset.obj ifru_picmg.obj $(SAMP_LIB) $(LIBS_PEF) $(LF_LANPLUS) $(LIBS_EX)
ipmi_sample_evt.obj: ipmi_sample_evt.c $(HEADER)
$(CC) /c $(CFLAGS_SAM) ipmi_sample_evt.c
@@ -431,5 +426,5 @@ ievents2.obj: ievents.c ievents.h $(HEADER)
$(CC) /c /Foievents2.obj $(CFLAGS_SAM) /DSENSORS_OK ievents.c
ipmi_sample_evt.exe: $(SAMP_LIB) ipmi_sample_evt.obj ievents2.obj isensor2.obj
- $(LINK) $(LFLAGS) /OUT:ipmi_sample_evt.exe ipmi_sample_evt.obj ievents2.obj isensor2.obj $(SAMP_LIB) $(LIBS_PEF) $(LIBS_EX)
+ $(LINK) $(LFLAGS) $(LF_LANPLUS) /OUT:ipmi_sample_evt.exe ipmi_sample_evt.obj ievents2.obj isensor2.obj $(SAMP_LIB) $(LIBS_PEF) $(LIBS_EX)
diff --git a/util/ipmiutil64.mak b/util/ipmiutil64.mak
index adb06a2..45e1bec 100644
--- a/util/ipmiutil64.mak
+++ b/util/ipmiutil64.mak
@@ -26,7 +26,7 @@ CMD_OBJ = $(CMD_OBJ) ipmilanplus.obj
L2_OBJ = $(L2_D)\helper.obj $(L2_D)\ipmi_strings.obj $(L2_D)\lanplus.obj \
$(L2_D)\lanplus_crypt_impl.obj $(L2_D)\lanplus_dump.obj \
$(L2_D)\lanplus_strings.obj $(L2_D)\lanplus_crypt.obj
-LF_LANPLUS=/LIBPATH:$(LIB_D) $(L2_OBJ) ssleay32.lib libeay32.lib
+LF_LANPLUS=/LIBPATH:$(LIB_D) /LIBPATH:$(L2_D) $(L2_OBJ) ssleay32.lib libeay32.lib
CF_LANPLUS=/D HAVE_LANPLUS
# Set your compiler options
@@ -36,7 +36,7 @@ CF_LANPLUS=/D HAVE_LANPLUS
# CFLAGS_O=/W3 /O2 /Zi /MT /nologo
CFLAGS_O=/W3 /O2 /Zi /MT /nologo
CF_EX=/DWIN32 $(CF_LANPLUS) $(INC) /D_CONSOLE /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DHAVE_STRING_H
-CF_SAM=/DWIN32 $(INC) /D_CONSOLE /D_CRT_SECURE_NO_DEPRECATE /DHAVE_STRING_H
+CF_SAM=/DWIN32 $(INC) /D_CONSOLE /D_CRT_SECURE_NO_DEPRECATE /DHAVE_STRING_H $(CF_LANPLUS)
CFLAGS=$(CFLAGS_O) $(CF_EX) /DSKIP_MD2
CFLAGS_M=$(CFLAGS_O) $(CF_EX) /DSKIP_MD2 /DMETACOMMAND
CFLAGS_SAM=$(CFLAGS_O) $(CF_SAM)
@@ -397,24 +397,24 @@ $(SAMP_LIB): $(CMD_OBJ) mem_if.obj
$(SAMP_DLL): $(CMD_OBJ) mem_if.obj
$(CC) /D_WINDLL /D_USRDLL /c $(CFLAGS_SAM) ipmilanplus.c
- $(LINK) /DLL $(LFLAGS) /OUT:$(SAMP_DLL) /def:ipmiutillib.def $(CMD_OBJ) mem_if.obj $(LIBS_PEF) $(LIBS_EX)
+ $(LINK) /DLL $(LFLAGS) /OUT:$(SAMP_DLL) /def:ipmiutillib.def $(CMD_OBJ) mem_if.obj $(LIBS_PEF) $(LF_LANPLUS) $(LIBS_EX)
del ipmilanplus.obj
ipmi_sample.exe: $(SAMP_LIB) ipmi_sample.obj
- $(LINK) $(LFLAGS) /OUT:ipmi_sample.exe ipmi_sample.obj $(SAMP_LIB) $(LIBS_PEF) $(LIBS_EX)
+ $(LINK) $(LFLAGS) /OUT:ipmi_sample.exe ipmi_sample.obj $(SAMP_LIB) $(LIBS_PEF) $(LF_LANPLUS) $(LIBS_EX)
ipmi_sample2.exe: $(SAMP_LIB) ipmi_sample.c isensor.c ievents.c
$(CC) /c $(CFLAGS_SAM) /DGET_SENSORS ipmi_sample.c
$(CC) /c $(CFLAGS_SAM) isensor.c
$(CC) /c $(CFLAGS_SAM) ievents.c
- $(LINK) $(LFLAGS) /OUT:ipmi_sample2.exe ipmi_sample.obj isensor.obj ievents.obj $(SAMP_LIB) $(LIBS_PEF) $(LIBS_EX)
- del isensor.obj ievents.obj
+ $(LINK) $(LFLAGS) /OUT:ipmi_sample2.exe ipmi_sample.obj isensor.obj ievents.obj $(SAMP_LIB) $(LIBS_PEF) $(LF_LANPLUS) $(LIBS_EX)
+ del isensor.obj ievents.obj ipmi_sample.obj
ifruset.obj: ifruset.c
$(CC) /c $(CFLAGS_SAM) ifruset.c
ifruset.exe: $(SAMP_LIB) ifruset.obj ifru_picmg.obj
- $(LINK) $(LFLAGS) /OUT:ifruset.exe ifruset.obj ifru_picmg.obj $(SAMP_LIB) $(LIBS_PEF) $(LIBS_EX)
+ $(LINK) $(LFLAGS) /OUT:ifruset.exe ifruset.obj ifru_picmg.obj $(SAMP_LIB) $(LIBS_PEF) $(LF_LANPLUS) $(LIBS_EX)
ipmi_sample_evt.obj: ipmi_sample_evt.c $(HEADER)
$(CC) /c $(CFLAGS_SAM) ipmi_sample_evt.c
@@ -426,5 +426,5 @@ ievents2.obj: ievents.c ievents.h $(HEADER)
$(CC) /c /Foievents2.obj $(CFLAGS_SAM) /DSENSORS_OK ievents.c
ipmi_sample_evt.exe: $(SAMP_LIB) ipmi_sample_evt.obj ievents2.obj isensor2.obj
- $(LINK) $(LFLAGS) /OUT:ipmi_sample_evt.exe ipmi_sample_evt.obj ievents2.obj isensor2.obj $(SAMP_LIB) $(LIBS_PEF) $(LIBS_EX)
+ $(LINK) $(LFLAGS) $(LF_LANPLUS) /OUT:ipmi_sample_evt.exe ipmi_sample_evt.obj ievents2.obj isensor2.obj $(SAMP_LIB) $(LIBS_PEF) $(LIBS_EX)
diff --git a/util/ireset.c b/util/ireset.c
index e95b597..679ce97 100644
--- a/util/ireset.c
+++ b/util/ireset.c
@@ -108,7 +108,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*
* Global variables
*/
-static char * progver = "2.99";
+static char * progver = "3.00";
static char * progname = "ireset";
static uchar ipmi_maj;
static uchar ipmi_min;
diff --git a/util/isel.c b/util/isel.c
index a6058e6..a2b5703 100644
--- a/util/isel.c
+++ b/util/isel.c
@@ -162,7 +162,7 @@ typedef struct
#define RDATA_OFFSET 13 //byte offset to the record event data
static char *progname = "isel";
-static char *progver = "2.99";
+static char *progver = "3.00";
#ifdef WIN32
#define IDXFILE "sel.idx"
static char idxfile[80] = IDXFILE;
@@ -651,14 +651,17 @@ int i_sel(int argc, char **argv)
char *s1;
printf("%s: version %s\n",progname,progver);
- while ((c = getopt(argc,argv,"a:b:cdef:h:l:m:np:rs:uwvx:T:V:J:EYF:P:N:U:R:Z:?")) != EOF)
+ while ((c = getopt(argc,argv,"a:b:cdef:h:i:l:m:np:rs:uwvxT: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*/
+ addstr = optarg; /*text string, max 13 bytes, no date*/
break;
- case 'h': faddsel = 1; /*undocumented option, to prevent misuse*/
+ case 'h': faddsel = 3; /*undocumented option, to prevent misuse*/
addhex = optarg; /*string of 16 hex characters, no spaces*/
break;
+ case 'i': faddsel = 2; /*undocumented option, to prevent misuse*/
+ addstr = optarg; /*text string, max 9 bytes, with date*/
+ break;
case 'b': fdecodebin = 1;
rawfile = optarg;
break;
@@ -805,15 +808,25 @@ int i_sel(int argc, char **argv)
/* use this sparingly, only for hardware-related events. */
char buf[16];
int i, len = 0;
- buf[0] = 0;
- buf[1] = 0;
+ memset(&buf[0],0,16);
if (addstr != NULL) { /*ASCII text string*/
+ if (faddsel == 1) { /* -a, Add a custom SEL record */
buf[2] = 0xf1; /*use SEL type OEM 0xF1*/
len = strlen_(addstr);
if (len > 13) len = 13;
if (len <= 0) ret = LAN_ERR_TOO_SHORT;
else memcpy(&buf[3],addstr,len);
len += 3;
+ }
+ if (faddsel == 2) { /* -i, Add a custom SEL record with date*/
+ buf[2] = RT_OEMIU; /*use SEL type OEM 0xDB*/
+ memset(&buf[3],0,4);
+ len = strlen_(addstr);
+ if (len > 9) len = 9;
+ if (len <= 0) ret = LAN_ERR_TOO_SHORT;
+ else memcpy(&buf[7],addstr,len);
+ len += 7;
+ }
}
if (addhex != NULL) { /*string of hex characters, no spaces*/
len = strlen_(addhex);
diff --git a/util/iseltime.c b/util/iseltime.c
index 687db22..1b2cc95 100644
--- a/util/iseltime.c
+++ b/util/iseltime.c
@@ -75,7 +75,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*
* Global variables
*/
-static char * progver = "2.99";
+static char * progver = "3.00";
static char * progname = "iseltime";
static char fdebug = 0;
static char fset = 0;
diff --git a/util/isensor.c b/util/isensor.c
index a8694f9..a59e18b 100644
--- a/util/isensor.c
+++ b/util/isensor.c
@@ -175,6 +175,11 @@ int is_romley(int vend, int prod) {
return(1);
return(0);
}
+int is_grantley(int vend, int prod) {
+ if ((vend == VENDOR_INTEL) && (prod == 0x0071))
+ return(1);
+ return(0);
+}
int is_thurley(int vend, int prod) {
if ((vend == VENDOR_INTEL) && ((prod >= 0x003A) && (prod <= 0x0040)))
return(1);
@@ -247,7 +252,7 @@ char *decode_entity_id(int id) {
* Global Data
************************/
static char *progname = "isensor";
-static char *progver = "2.99";
+static char *progver = "3.00";
#ifdef WIN32
static char savefile[] = "%ipmiutildir%\\thresholds.cmd";
#else
@@ -295,6 +300,7 @@ static double sensor_hi_f = 0;
static double sensor_lo_f = 0;
static int fmBMC = 0;
static int fRomley = 0;
+static int fGrantley = 0;
static char chEol = '\n'; /* newline by default, space if option -w */
static uchar resid[2] = {0,0};
static uchar g_bus = PUBLIC_BUS;
@@ -2231,7 +2237,7 @@ decode_comp_reading(uchar type, uchar evtype, uchar num,
else istr = bitnum(b); /* ECC or other error */
break;
case 0x0D: /* drive slot - usually HSC sens_ownid == 0xc0 */
- if (fRomley) { /* evtype==0x6f, has both status and presence */
+ if (fRomley || fGrantley) { /* evtype==0x6f, has both status and presence */
if (reading & 0x02) istr = 12; /*Faulty*/
else if (reading & 0x80) istr = STR_REBUILDING; /*Rebuilding*/
else if (reading & 0x01) istr = 9; /*Present (OK)*/
@@ -3343,9 +3349,10 @@ int i_sensor(int argc, char **argv)
pstr = "BMC";
fmBMC = 0;
if (is_romley(vend_id,prod_id)) fRomley = 1;
+ if (is_grantley(vend_id,prod_id)) fGrantley = 1;
if (prod_id == 0x003E || fRomley) /*Urbanna NSN2U,CG2100*/
set_max_kcs_loops(URNLOOPS); /*longer KCS timeout*/
- } else if ((vend_id == VENDOR_SUPERMICRO)
+ } else if ((vend_id == VENDOR_SUPERMICRO)
|| (vend_id == VENDOR_SUPERMICROX)) {
set_max_kcs_loops(URNLOOPS); /*longer KCS timeout*/
} else { /* Other products */
diff --git a/util/iserial.c b/util/iserial.c
index c34d10c..579d19d 100644
--- a/util/iserial.c
+++ b/util/iserial.c
@@ -155,7 +155,7 @@ typedef struct
/*
* Global variables
*/
-static char * progver = "2.99";
+static char * progver = "3.00";
static char * progname = "iserial";
static int vend_id = 0;
static int prod_id = 0;
diff --git a/util/isol.c b/util/isol.c
index d76f10d..1fddc98 100644
--- a/util/isol.c
+++ b/util/isol.c
@@ -165,7 +165,7 @@ void dbglog( char *pattn, ... ); /*local prototype*/
/*
* Global variables
*/
-static char * progver = "2.99";
+static char * progver = "3.00";
static char * progname = "isol";
static char fdebug = 0;
static char fpicmg = 0;
diff --git a/util/itsol.c b/util/itsol.c
index 410ce7f..20a0b8d 100644
--- a/util/itsol.c
+++ b/util/itsol.c
@@ -98,7 +98,7 @@ int gettimeofday(struct timeval *tv, struct timezone *tz);
extern int verbose;
extern char fdebug; /*from ipmicmd.c*/
static char * progname = "itsol";
-static char * progver = "2.99";
+static char * progver = "3.00";
static uchar g_bus = PUBLIC_BUS;
static uchar g_sa = BMC_SA;
static uchar g_lun = BMC_LUN;
diff --git a/util/iwdt.c b/util/iwdt.c
index bd06e0c..324bcf6 100644
--- a/util/iwdt.c
+++ b/util/iwdt.c
@@ -100,7 +100,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/*
* Global variables
*/
-static char * progver = "2.99";
+static char * progver = "3.00";
static char * progname = "iwdt";
static char fdebug = 0;
static char fdontlog = 0;
diff --git a/util/oem_dell.c b/util/oem_dell.c
index 4fa7e5f..bd11446 100644
--- a/util/oem_dell.c
+++ b/util/oem_dell.c
@@ -132,7 +132,7 @@ char NIC_Selection_Mode_String_12g[] [50] = {
"shared with failover all loms"
};
-static char * progver = "2.99";
+static char * progver = "3.00";
static char * progname = "idelloem";
static int verbose = 0;
static char fdebug = 0;
diff --git a/util/oem_intel.c b/util/oem_intel.c
index 638f08f..6f61010 100644
--- a/util/oem_intel.c
+++ b/util/oem_intel.c
@@ -370,41 +370,49 @@ int detect_capab_intel(int vend_id,int prod_id, int *cap, int *ndisk,char fdbg)
else fHasEnc = 6;
}
break;
- case 0x003E: /*S5520UR*/
- busid = PRIVATE_BUS_ID;
- fbmctam = 1; /* CG2100 has bmc tam */
- fHasAlarms = 1;
- fHasEnc = 8; /* CG2100 has 8 disks */
- fRelayBits = 1;
- set_max_kcs_loops(URNLOOPS); /*longer for cmds (default 300)*/
- break;
- case 0x005D: /* Copper Pass, CG2200*/
- busid = PRIVATE_BUS_ID;
- fbmctam = 1; /* CG2200 has bmc tam */
- fHasAlarms = 1;
- fRelayBits = 1;
- fHasEnc = 6; /* 6 disks */
+ case 0x003E: /*S5520UR*/
+ busid = PRIVATE_BUS_ID;
+ fbmctam = 1; /* CG2100 has bmc tam */
+ fHasAlarms = 1;
+ fHasEnc = 8; /* CG2100 has 8 disks */
+ fRelayBits = 1;
+ set_max_kcs_loops(URNLOOPS); /*longer for cmds (default 300)*/
+ break;
+ case 0x005D: /* Copper Pass, CG2200*/
+ busid = PRIVATE_BUS_ID;
+ fbmctam = 1; /* CG2200 has bmc tam */
+ fHasAlarms = 1;
+ fRelayBits = 1;
+ fHasEnc = 6; /* 6 disks */
+ set_max_kcs_loops(URNLOOPS); /*longer for cmds (default 300)*/
+ break;
+ case 0x0071: /* CG2300*/
+ busid = PRIVATE_BUS_ID;
+ fbmctam = 1; /* CG2300 has bmc tam */
+ fHasAlarms = 1;
+ fRelayBits = 1;
+ fHasEnc = 6; /* 6 disks */
set_max_kcs_loops(URNLOOPS); /*longer for cmds (default 300)*/
- break;
- case 0x0051: /* Eagle Pass */
- busid = PRIVATE_BUS_ID;
- fbmctam = 1; /* CG1200 has bmc tam */
- fHasAlarms = 1;
- fRelayBits = 1;
- fHasEnc = 4; /* 4 disks */
+ break;
+ case 0x0051: /* Eagle Pass */
+ busid = PRIVATE_BUS_ID;
+ fbmctam = 1; /* CG1200 has bmc tam */
+ fHasAlarms = 1;
+ fRelayBits = 1;
+ fHasEnc = 4; /* 4 disks */
+ set_max_kcs_loops(URNLOOPS); /*longer for cmds (default 300)*/
+ break;
+ case 0x0048: /* "(S1200BT)" *BearTooth Pass*/
+ case 0x004A: /* "(S2600CP)" *Canoe Pass*/
+ case 0x0055: /* Iron Pass */
+ case 0x005C: /* Lizard Head Pass */
+ fHasEnc = 8;
set_max_kcs_loops(URNLOOPS); /*longer for cmds (default 300)*/
- break;
- case 0x0048: /* "(S1200BT)" *BearTooth Pass*/
- case 0x004A: /* "(S2600CP)" *Canoe Pass*/
- case 0x0055: /* Iron Pass */
- case 0x005C: /* Lizard Head Pass */
- fHasEnc = 8;
- set_max_kcs_loops(URNLOOPS); /*longer for cmds (default 300)*/
- break;
- default:
- busid = PRIVATE_BUS_ID;
- fHasEnc = 8;
- break;
+ break;
+ default:
+ busid = PRIVATE_BUS_ID;
+ fHasEnc = 8;
+ break;
}
}
if (fHasAlarms) f |= HAS_ALARMS_MASK;
@@ -415,12 +423,21 @@ int detect_capab_intel(int vend_id,int prod_id, int *cap, int *ndisk,char fdbg)
}
if (fpicmg) f |= HAS_PICMG_MASK;
if (fChesnee) f |= HAS_NSC_MASK;
- if (is_romley(vend_id,prod_id)) {
- if (prod_id == 0x005D) fHasEnc = 6; /*CG2200*/
- fHasEnc = 8;
+ if (is_romley(vend_id,prod_id))
+ {
+ if (prod_id == 0x005D) fHasEnc = 6; /*CG2200*/
+ fHasEnc = 8;
set_max_kcs_loops(URNLOOPS); /*longer for cmds (default 300)*/
- f |= HAS_ROMLEY_MASK;
+ f |= HAS_ROMLEY_MASK;
}
+ if (is_grantley(vend_id,prod_id))
+ {
+ if (prod_id == 0x0071) fHasEnc = 6; /*CG2300*/
+ fHasEnc = 8;
+ set_max_kcs_loops(URNLOOPS); /*longer for cmds (default 300)*/
+ f |= HAS_ROMLEY_MASK;
+ }
+
*cap = f;
return(busid);
}
@@ -927,6 +944,13 @@ struct { ushort id; char *desc; } romleys[RIDS] = {
{ 0x005E, "Big Ridge"} /* Big Ridge */
};
+#define GIDS 3 /* Intel Grantley product ids: */
+struct { ushort id; char *desc; } grantleys[GIDS] = {
+ { 0x006F, "AXXRMM4" }, /* S2600, AXXRMM4LITE */
+ { 0x0070, "S2600" }, /* S2600CO, KP, TP, */
+ { 0x0071, "S2600CW" } /* CG2300, Kontron CG2300 */
+};
+
#define TIDS 5
ushort thurley_ids[TIDS] = { /* Intel Thurley product ids: */
0x003A, /* Snow Hill */
@@ -961,6 +985,36 @@ int intel_romley_desc(int vend, int prod, char **pdesc)
return(ret);
}
+int is_grantley(int vend, int prod)
+{
+ int ret = 0;
+ int i;
+ if (vend != VENDOR_INTEL) return(ret);
+ for (i = 0; i < GIDS; i++)
+ if ((ushort)prod == grantleys[i].id) { ret = 1; break; }
+ /* For now, assume all Intel prods > 0071 act same as Grantley */
+ if (((ushort)prod > grantleys[GIDS-1].id) && ((ushort)prod < 0x00FF))
+ ret = 1;
+ return(ret);
+}
+
+int intel_grantley_desc(int vend, int prod, char **pdesc)
+{
+ int ret = -1;
+ int i;
+ if (vend != VENDOR_INTEL) return(ret);
+ if (pdesc == NULL) return(ret);
+ for (i = 0; i < GIDS; i++) {
+ if ((ushort)prod == grantleys[i].id) {
+ *pdesc = grantleys[i].desc;
+ ret = 0;
+ break;
+ }
+ }
+ if (ret == 0 && (**pdesc == '\0')) *pdesc = "S2600";
+ return(ret);
+}
+
int is_thurley(int vend, int prod)
{
int ret = 0;
diff --git a/util/oem_intel.h b/util/oem_intel.h
index 79587d5..c3240c6 100644
--- a/util/oem_intel.h
+++ b/util/oem_intel.h
@@ -44,12 +44,13 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define DISK_LED_WRITE 0x44 // only used for Chesnee mBMC
#define DISK_LED_READ 0x45 // only used for Chesnee mBMC
-#define HAS_ALARMS_MASK 0x0001
-#define HAS_BMCTAM_MASK 0x0002
-#define HAS_ENCL_MASK 0x0004
-#define HAS_PICMG_MASK 0x0008
-#define HAS_NSC_MASK 0x0010
-#define HAS_ROMLEY_MASK 0x0020
+#define HAS_ALARMS_MASK 0x0001
+#define HAS_BMCTAM_MASK 0x0002
+#define HAS_ENCL_MASK 0x0004
+#define HAS_PICMG_MASK 0x0008
+#define HAS_NSC_MASK 0x0010
+#define HAS_ROMLEY_MASK 0x0020
+#define HAS_GRANTLEY_MASK 0x0040
uchar get_nsc_diskleds(uchar busid);
int set_nsc_diskleds(uchar val, uchar busid);
@@ -75,5 +76,7 @@ int lan_failover_intel(uchar func, uchar *mode);
int intel_romley_desc(int vend, int prod, char **pdesc);
int get_power_restore_delay_intel(int *delay);
int get_hsbp_version_intel(uchar *maj, uchar *min);
+int is_grantley(int vend, int prod);
+int intel_grantley_desc(int vend, int prod, char **pdesc);
/* end oem_intel.h */
diff --git a/util/oem_sun.c b/util/oem_sun.c
index 4f8e496..5cbf82c 100644
--- a/util/oem_sun.c
+++ b/util/oem_sun.c
@@ -109,7 +109,7 @@ static const struct valstr sunoem_led_mode_optvals[] = {
/* global variables */
static char * progname = "isunoem";
-static char * progver = "2.99";
+static char * progver = "3.00";
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 47838da..3937f0d 100644
--- a/util/oem_supermicro.c
+++ b/util/oem_supermicro.c
@@ -67,7 +67,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 = "2.99";
+static char * progver = "3.00";
static char * progname = "ismcoem";
static int verbose = 0;
static char fdebug = 0;
@@ -401,24 +401,34 @@ int decode_sensor_supermicro(uchar *sdr,uchar *reading,char *pstring, int slen)
//if (dbg) printf("supermicro %x sensor reading %x\n",stype,reading);
rv = 0;
switch(bval) {
- case 0x0000: pstr = "00 Low"; break;
- case 0x0001: pstr = "01 Medium"; break;
- case 0x0002: pstr = "02 High"; break;
- case 0x0004: pstr = "04 Overheat"; break;
- case 0x0007: pstr = "07 Not Installed"; break;
+ case 0x0000: pstr = "00_Low"; break;
+ case 0x0001: pstr = "01_Medium"; break;
+ case 0x0002: pstr = "02_High"; break;
+ case 0x0004: pstr = "04_Overheat"; break;
+ case 0x0007: pstr = "07_Not Installed"; break;
default: rv = -1; break;
}
break;
case 0x08: /* Power Supply Status (Full/Discrete) Table 42-3 */
- rv = 0;
- switch(bval) {
- case 0x00: pstr = "00 Absent"; break; /*bit 0*/
- case 0x01: pstr = "01 Present"; break; /*bit 0*/
- case 0x02: pstr = "02 Failure"; break; /*bit 1*/
- case 0x04: pstr = "04 Predict Fail"; break; /*bit 2*/
- case 0x08: pstr = "08 Input Lost"; break; /*bit 3*/
- default: rv = -1; break;
- }
+ rv = 0;
+ switch(bval) {
+ case 0x00: pstr = "00_Absent"; break; /*bit 0*/
+ case 0x01: pstr = "01_Present"; break; /*bit 0*/
+ case 0x02: pstr = "02_Failure"; break; /*bit 1*/
+ case 0x04: pstr = "04_Predict Fail"; break; /*bit 2*/
+ case 0x08: pstr = "08_Input Lost"; break; /*bit 3*/
+ default: rv = -1; break;
+ }
+ break;
+ case 0x0D: /* HDD Status (Full/Discrete) Table 42-3 */
+ rv = 0;
+ switch(bval) {
+ case 0x00: pstr = "00_Absent"; break; /*bit 0*/
+ case 0x01: pstr = "01_Present"; break; /*bit 0*/
+ case 0x02: pstr = "02_Failure"; break; /*bit 1*/
+ case 0x04: pstr = "04_Predict Fail"; break; /*bit 2*/
+ default: rv = -1; break;
+ }
break;
default:
break;
@@ -545,7 +555,7 @@ int decode_sel_supermicro(uchar *evt, char *outbuf, int outsz, char fdesc,
}
rv = 0;
break;
- default: pstr = "CpuTemp Event"; break;
+ default: pstr = "CpuTemp Event"; rv = 0; break;
}
break;
case 0xC2: /* CPLD Event */
@@ -557,7 +567,7 @@ int decode_sel_supermicro(uchar *evt, char *outbuf, int outsz, char fdesc,
else { pstr = "CPLD Event Asserted"; sevid = SEV_MIN; }
rv = 0;
break;
- default: pstr = "CPLD Event"; break;
+ default: pstr = "CPLD Event"; rv = 0; break;
}
break;
case 0xD0: /* BMC Event */
@@ -571,8 +581,20 @@ int decode_sel_supermicro(uchar *evt, char *outbuf, int outsz, char fdesc,
case 0x02: pstr = "BMC warm reset"; break;
}
}
+ rv = 0;
+ break;
+ case 0xC5: /* Observed Event: Storage, drive slot */
+ /* usually OEM(c5) #52 - 6f [01 00 00] */
+ pstr = "OEMC5: Storage/DriveSlot fault";
+ sevid = SEV_MAJ;
+ rv = 0;
+ break;
+ case 0xC8: /* Observed Event: Temp/Cooling issue, reboots */
+ /* usually OEM(c8) #ff - 6f [a0 ff ff] */
+ pstr = "OEMC8: Temp/Cooling fault";
+ sevid = SEV_MAJ;
+ rv = 0;
break;
- case 0xC8: /* Observed Event */
default: /*other sensor types*/
break;
}
@@ -584,12 +606,60 @@ int decode_sel_supermicro(uchar *evt, char *outbuf, int outsz, char fdesc,
return(rv);
}
+static int factory_defaults(int mode)
+{
+ int rv = -1;
+ int rlen;
+ uchar rdata[32];
+ uchar idata[16];
+ uchar cc;
+ /*
+ From SMC IPMICFG -fde session:
+ start_kcs_transaction - 18 01 (get_device_id)
+ start_kcs_transaction - 18 25 (watchdog get)
+ start_kcs_transaction - b0 00 00 (unknown, invalid)
+ start_kcs_transaction - 18 01 (get_device_id)
+ start_kcs_transaction - 18 37 (get_system_guid)
+ start_kcs_transaction - 18 01 (get_device_id)
+ start_kcs_transaction - c0 41 (reset_factory_defaults, -fde)
+ */
+
+ /* b0 00 00: cmd=00 netfn=2C */
+ rlen = sizeof(rdata);
+ idata[0] = 0x00;
+ rv = ipmi_cmdraw(0x00, (0xb0 >> 2), BMC_SA, PUBLIC_BUS, BMC_LUN,
+ idata, 1, rdata, &rlen, &cc, fdebug);
+ if ((rv == 0) && (cc != 0)) rv = cc;
+ if (fdebug) printf("b0 00 returned %d\n",rv);
+ /* if (rv != 0) return(rv); */
+
+ if (mode == 2) {
+ rlen = sizeof(rdata);
+ rv = ipmi_cmdraw(0x37, (0x18 >> 2), BMC_SA, PUBLIC_BUS, BMC_LUN,
+ idata, 0, rdata, &rlen, &cc, fdebug);
+ if ((rv == 0) && (cc != 0)) rv = cc;
+ if (fdebug) printf("get_guid returned %d\n",rv);
+ if (rv != 0) return(rv);
+ }
+
+ /* reset factory defaults cmd=0x41 netfn=0x30 (netfn/lun=0xC0) */
+ rlen = sizeof(rdata);
+ 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);
+
+ return(rv);
+}
+
static void usage(void)
{
printf("Usage: %s <command> [arg]\n",progname);
printf(" intrusion = reset chassis intrusion\n");
printf(" bmcstatus [enable| disable] = get/set BMC status\n");
printf(" firmware = get extra firmware info\n");
+ printf(" factory = reset to factory defaults\n");
printf(" lanport [dedicated| lan1| failover] = get/set IPMI LAN port\n");
printf(" powersupply <num> = get PMBus PowerSupply status\n");
printf("These commands may not work on all SuperMicro systems\n");
@@ -628,7 +698,11 @@ static int ipmi_smcoem_main(int argc, char **argv)
printf("Getting SMC Firmare Information ...\n");
rv = oem_supermicro_get_firmware_str(msg, sizeof(msg));
if (rv == 0) printf("%s\n",msg);
- } else if (strncmp(argv[0],"lanport",9) == 0) {
+ } else if (strncmp(argv[0],"factory",7) == 0) {
+ rv = factory_defaults(0);
+ if (rv == 0) printf("Reset firmware to factory defaults\n");
+ else printf("Error %d resetting firmware to factory defaults\n",rv);
+ } else if (strncmp(argv[0],"lanport",7) == 0) {
rv = oem_supermicro_get_lan_port(&val);
if (rv == 0) {
oem_supermicro_show_lan_port(val);