Skip to content

Commit 3b45f46

Browse files
committed
dmioem: Decode HP-specific DMI types 212 and 219
Some information about OEM DMI types 212 and 219 for HP machines is available from the hpwdt kernel driver. Include the available information in the output of dmidecode.
1 parent 3f70b35 commit 3b45f46

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

Diff for: CHANGELOG

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
2015-05-21 Jean Delvare <[email protected]>
22

33
* dmidecode.c: Fix up invalid DMI type 34 structure length.
4+
* dmioem.c: Decode HP-specific DMI types 212 and 219.
45

56
2015-05-13 Jean Delvare <[email protected]>
67

Diff for: dmioem.c

+55
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,17 @@ void dmi_set_vendor(const char *s)
6262
dmi_vendor = VENDOR_ACER;
6363
}
6464

65+
static int is_printable(const u8 *data, int len)
66+
{
67+
int i;
68+
69+
for (i = 0; i < len; i++)
70+
if (data[i] < 32 || data[i] >= 127)
71+
return 0;
72+
73+
return 1;
74+
}
75+
6576
/*
6677
* HP-specific data structures are decoded here.
6778
*
@@ -72,6 +83,7 @@ static int dmi_decode_hp(const struct dmi_header *h)
7283
{
7384
u8 *data = h->data;
7485
int nic, ptr;
86+
u32 feat;
7587

7688
switch (h->type)
7789
{
@@ -124,6 +136,49 @@ static int dmi_decode_hp(const struct dmi_header *h)
124136
}
125137
break;
126138

139+
case 212:
140+
/*
141+
* Vendor Specific: HP 64-bit CRU Information
142+
*
143+
* Source: hpwdt kernel driver
144+
*/
145+
printf("HP 64-bit CRU Information\n");
146+
if (h->length < 0x18) break;
147+
printf("\tSignature: 0x%08x", DWORD(data + 0x04));
148+
if (is_printable(data + 0x04, 4))
149+
printf(" (%c%c%c%c)", data[0x04], data[0x05],
150+
data[0x06], data[0x07]);
151+
printf("\n");
152+
if (DWORD(data + 0x04) == 0x55524324)
153+
{
154+
u64 paddr = QWORD(data + 0x08);
155+
paddr.l += DWORD(data + 0x14);
156+
if (paddr.l < DWORD(data + 0x14))
157+
paddr.h++;
158+
printf("\tPhysical Address: 0x%08x%08x\n",
159+
paddr.h, paddr.l);
160+
printf("\tLength: 0x%08x\n", DWORD(data + 0x10));
161+
}
162+
break;
163+
164+
case 219:
165+
/*
166+
* Vendor Specific: HP ProLiant Information
167+
*
168+
* Source: hpwdt kernel driver
169+
*/
170+
printf("HP ProLiant Information\n");
171+
if (h->length < 0x08) break;
172+
printf("\tPower Features: 0x%08x\n", DWORD(data + 0x04));
173+
if (h->length < 0x0C) break;
174+
printf("\tOmega Features: 0x%08x\n", DWORD(data + 0x08));
175+
if (h->length < 0x14) break;
176+
feat = DWORD(data + 0x10);
177+
printf("\tMisc. Features: 0x%08x\n", feat);
178+
printf("\t\tiCRU: %s\n", feat & 0x0001 ? "Yes" : "No");
179+
printf("\t\tUEFI: %s\n", feat & 0x0408 ? "Yes" : "No");
180+
break;
181+
127182
default:
128183
return 0;
129184
}

0 commit comments

Comments
 (0)