1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
|
From ee07a1b4249560d620d05194eb8ff61b40d3ce23 Mon Sep 17 00:00:00 2001
From: Jerry Hoemann <jerry.hoemann@hpe.com>
Date: Wed, 13 Sep 2017 15:54:22 -0600
Subject: dmioem: Reflect HPE's new company name
After Hewlett Packard Enterprise split from Hewlett-Packard, DMI OEM
tables reflect the new company name. Gen10 and subsequent systems will
use HPE. Gen9 and prior systems continue to use the old "HP" name.
Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
dmioem.c | 32 +++++++++++++++++++-------------
1 file changed, 19 insertions(+), 13 deletions(-)
diff --git a/dmioem.c b/dmioem.c
index 034ad9f..a032344 100644
--- a/dmioem.c
+++ b/dmioem.c
@@ -35,6 +35,7 @@ enum DMI_VENDORS
VENDOR_UNKNOWN,
VENDOR_HP,
VENDOR_ACER,
+ VENDOR_HPE,
};
static enum DMI_VENDORS dmi_vendor = VENDOR_UNKNOWN;
@@ -58,12 +59,14 @@ void dmi_set_vendor(const char *s)
if (strncmp(s, "HP", len) == 0 || strncmp(s, "Hewlett-Packard", len) == 0)
dmi_vendor = VENDOR_HP;
+ else if (strncmp(s, "HPE", len) == 0 || strncmp(s, "Hewlett Packard Enterprise", len) == 0)
+ dmi_vendor = VENDOR_HPE;
else if (strncmp(s, "Acer", len) == 0)
dmi_vendor = VENDOR_ACER;
}
/*
- * HP-specific data structures are decoded here.
+ * HPE-specific data structures are decoded here.
*
* Code contributed by John Cagle and Tyler Bell.
*/
@@ -98,14 +101,15 @@ static int dmi_decode_hp(const struct dmi_header *h)
u8 *data = h->data;
int nic, ptr;
u32 feat;
+ const char *company = (dmi_vendor == VENDOR_HP) ? "HP" : "HPE";
switch (h->type)
{
case 204:
/*
- * Vendor Specific: HP ProLiant System/Rack Locator
+ * Vendor Specific: HPE ProLiant System/Rack Locator
*/
- printf("HP ProLiant System/Rack Locator\n");
+ printf("%s ProLiant System/Rack Locator\n", company);
if (h->length < 0x0B) break;
printf("\tRack Name: %s\n", dmi_string(h, data[0x04]));
printf("\tEnclosure Name: %s\n", dmi_string(h, data[0x05]));
@@ -119,7 +123,7 @@ static int dmi_decode_hp(const struct dmi_header *h)
case 209:
case 221:
/*
- * Vendor Specific: HP ProLiant NIC MAC Information
+ * Vendor Specific: HPE ProLiant NIC MAC Information
*
* This prints the BIOS NIC number,
* PCI bus/device/function, and MAC address
@@ -137,9 +141,10 @@ static int dmi_decode_hp(const struct dmi_header *h)
*
* Type 221: is deprecated in the latest docs
*/
- printf(h->type == 221 ?
- "HP BIOS iSCSI NIC PCI and MAC Information\n" :
- "HP BIOS PXE NIC PCI and MAC Information\n");
+ printf("%s %s\n", company,
+ h->type == 221 ?
+ "BIOS iSCSI NIC PCI and MAC Information" :
+ "BIOS PXE NIC PCI and MAC Information");
nic = 1;
ptr = 4;
while (h->length >= ptr + 8)
@@ -155,7 +160,7 @@ static int dmi_decode_hp(const struct dmi_header *h)
case 233:
/*
- * Vendor Specific: HP ProLiant NIC MAC Information
+ * Vendor Specific: HPE ProLiant NIC MAC Information
*
* This prints the BIOS NIC number,
* PCI bus/device/function, and MAC address
@@ -171,7 +176,7 @@ static int dmi_decode_hp(const struct dmi_header *h)
* 0x08 | MAC | 32B | MAC addr padded w/ 0s
* 0x28 | Port No| BYTE | Each NIC maps to a Port
*/
- printf("HP BIOS PXE NIC PCI and MAC Information\n");
+ printf("%s BIOS PXE NIC PCI and MAC Information\n", company);
if (h->length < 0x0E) break;
/* If the record isn't long enough, we don't have an ID
* use 0xFF to use the internal counter.
@@ -183,11 +188,11 @@ static int dmi_decode_hp(const struct dmi_header *h)
case 212:
/*
- * Vendor Specific: HP 64-bit CRU Information
+ * Vendor Specific: HPE 64-bit CRU Information
*
* Source: hpwdt kernel driver
*/
- printf("HP 64-bit CRU Information\n");
+ printf("%s 64-bit CRU Information\n", company);
if (h->length < 0x18) break;
printf("\tSignature: 0x%08x", DWORD(data + 0x04));
if (is_printable(data + 0x04, 4))
@@ -208,11 +213,11 @@ static int dmi_decode_hp(const struct dmi_header *h)
case 219:
/*
- * Vendor Specific: HP ProLiant Information
+ * Vendor Specific: HPE ProLiant Information
*
* Source: hpwdt kernel driver
*/
- printf("HP ProLiant Information\n");
+ printf("%s ProLiant Information\n", company);
if (h->length < 0x08) break;
printf("\tPower Features: 0x%08x\n", DWORD(data + 0x04));
if (h->length < 0x0C) break;
@@ -281,6 +286,7 @@ int dmi_decode_oem(const struct dmi_header *h)
switch (dmi_vendor)
{
case VENDOR_HP:
+ case VENDOR_HPE:
return dmi_decode_hp(h);
case VENDOR_ACER:
return dmi_decode_acer(h);
--
cgit v1.0-41-gc330
|