summaryrefslogtreecommitdiff
path: root/util/oem_supermicro.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2018-05-01 10:22:52 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2018-05-01 10:22:52 +0200
commited721d01939a81a2ebf1b240a029ace82ee953df (patch)
treed5acb063b3dc1d6734b8aa221cf93017a38c22e5 /util/oem_supermicro.c
parent7a765f655540e4e254f4aaaf6ea3326a57d76e59 (diff)
parent1d271f6ff272623c990d1cebe531002f22b248bd (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'util/oem_supermicro.c')
-rw-r--r--util/oem_supermicro.c13
1 files changed, 9 insertions, 4 deletions
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);