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:13:09 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2018-05-01 10:13:09 +0200
commitfc806628dbeecd34f41b2f6d04290631dca3955e (patch)
treee9ee96c4b97b1ca9b9f100eae402185859f6539b /util/oem_supermicro.c
parentd5cdf594f2678cf690b802fbf4eb687dd9d98c4f (diff)
New upstream version 3.1.0upstream/3.1.0
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);