Skip to content

Commit 0720e6d

Browse files
committed
Fixed and enhanced decoding of DMI type 38 (IPMI).
1 parent e2d4bc1 commit 0720e6d

File tree

2 files changed

+61
-6
lines changed

2 files changed

+61
-6
lines changed

CHANGELOG

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,26 @@
1+
2003-03-07 Jean Delvare <[email protected]>
2+
3+
Fixed IPMI device information (DMI case 38). Thanks to Richard Sharpe
4+
for pointing the bugs out.
5+
6+
* dmidecode.c: Fixed IPMI interface type being shifted by one.
7+
* dmidecode.c: Fixed NV storage device being improperly displayed.
8+
* dmidecode.c: Reword IPMI specification revision into specification
9+
version, as suggested in the IPMI specification itself.
10+
* dmidecode.c: Added a reference to the IPMI specification.
11+
* dmidecode.c: Show I2C address as hexadecimal.
12+
* dmidecode.c: Base address is a QWORD, not DWORD.
13+
* dmidecode.c: Decode some extra fields according to the IPMI
14+
specification.
15+
116
2003-03-06 Jean Delvare <[email protected]>
217

318
* dmidecode.c, biosdecode.c: Moved all changelog entries to CHANGELOG.
419
* CHANGELOG: New. Format inspired by Heroes' ChangeLog file.
20+
* dmidecode.c, biosdecode.c, Makefile: Updated copyright years.
21+
* dmidecode.c, biosdecode.c, Makefile: Moved version definition to
22+
version.h. Updated dependencies accordingly.
23+
* version.h: New.
524

625
2002-10-21 Jean Delvare <[email protected]>
726

dmidecode.c

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
* - DMTF Master MIF version 020507
4444
* "DMTF approved standard groups"
4545
* http://www.dmtf.org/standards/standard_dmi.php
46+
* - IPMI 1.5 revision 1.1
47+
* "Intelligent Platform Management Interface Specification"
48+
* http://developer.intel.com/design/servers/ipmi/spec.htm
4649
*/
4750

4851
#include <sys/types.h>
@@ -2765,7 +2768,21 @@ static const char *dmi_ipmi_interface_type(u8 code)
27652768
};
27662769

27672770
if(code<=0x03)
2768-
return type[code-0x01];
2771+
return type[code];
2772+
return out_of_spec;
2773+
}
2774+
2775+
static const char *dmi_ipmi_register_spacing(u8 code)
2776+
{
2777+
/* IPMI 1.5 */
2778+
static const char *spacing[]={
2779+
"Successive Byte Boundaries", /* 0x00 */
2780+
"32-bit Boundaries",
2781+
"16 bit Boundaries" /* 0x02 */
2782+
};
2783+
2784+
if(code<=0x02)
2785+
return spacing[code];
27692786
return out_of_spec;
27702787
}
27712788

@@ -3651,20 +3668,39 @@ static void dmi_decode(u8 *data, u16 ver)
36513668
dmi_memory_channel_devices(data[0x06], data+0x07, "\t\t\t");
36523669
break;
36533670

3671+
/*
3672+
* We use the word "Version" instead of "Revision", conforming to
3673+
* IPMI 1.5 specification. This specification isn't very clear
3674+
* regarding the I2C slave address. I couldn't understand wether
3675+
* or not we are supposed to shift it by one bit to the right, so
3676+
* I leave it untouched. Beware it might be wrong.
3677+
*/
36543678
case 38: /* 3.3.39 IPMI Device Information */
36553679
printf("\tIPMI Device Information\n");
36563680
if(h->length<0x10) break;
36573681
printf("\t\tInterface Type: %s\n",
36583682
dmi_ipmi_interface_type(data[0x04]));
3659-
printf("\t\tSpecification Revision: %u.%u\n",
3683+
printf("\t\tSpecification Version: %u.%u\n",
36603684
data[0x05]>>4, data[0x05]&0x0F);
3661-
printf("\t\tI2C Slave Address: %u\n",
3685+
printf("\t\tI2C Slave Address: 0x%02x\n",
36623686
data[0x06]);
3663-
if(data[0x07]==0xFF)
3687+
if(data[0x07]!=0xFF)
36643688
printf("\t\tNV Storage Device Address: %u\n",
36653689
data[0x07]);
3666-
printf("\t\tBase Address: 0x%08X (%s)\n",
3667-
DWORD(data+0x08), DWORD(data+0x08)&1?"I/O":"memory-mapped");
3690+
else
3691+
printf("\t\tNV Storage Device: Not Present\n");
3692+
if(h->length<0x12)
3693+
{
3694+
printf("\t\tBase Address: 0x%08X%08X (%s)\n",
3695+
QWORD(data+0x08).h, QWORD(data+0x08).l,
3696+
QWORD(data+0x08).l&1?"I/O":"Memory-mapped");
3697+
break;
3698+
}
3699+
printf("\t\tBase Address: 0x%08X%08X (%s)\n",
3700+
QWORD(data+0x08).h, (QWORD(data+0x08).l&~1)|((data[0x10]>>5)&1),
3701+
QWORD(data+0x08).l&1?"I/O":"Memory-mapped");
3702+
printf("\t\tRegister Spacing: %s\n",
3703+
dmi_ipmi_register_spacing(data[0x10]>>6));
36683704
break;
36693705

36703706
case 39: /* 3.3.40 System Power Supply */

0 commit comments

Comments
 (0)