Blame SOURCES/0007-dmioem-Reflect-HPE-s-new-company-name.patch

60918b
From ee07a1b4249560d620d05194eb8ff61b40d3ce23 Mon Sep 17 00:00:00 2001
60918b
From: Jerry Hoemann <jerry.hoemann@hpe.com>
60918b
Date: Wed, 13 Sep 2017 15:54:22 -0600
60918b
Subject: [PATCH 07/10] dmioem: Reflect HPE's new company name
60918b
60918b
After Hewlett Packard Enterprise split from Hewlett-Packard, DMI OEM
60918b
tables reflect the new company name.  Gen10 and subsequent systems will
60918b
use HPE.  Gen9 and prior systems continue to use the old "HP" name.
60918b
60918b
Signed-off-by: Jerry Hoemann <jerry.hoemann@hpe.com>
60918b
Signed-off-by: Jean Delvare <jdelvare@suse.de>
60918b
---
60918b
 dmioem.c | 32 +++++++++++++++++++-------------
60918b
 1 file changed, 19 insertions(+), 13 deletions(-)
60918b
60918b
diff --git a/dmioem.c b/dmioem.c
60918b
index 034ad9f..a032344 100644
60918b
--- a/dmioem.c
60918b
+++ b/dmioem.c
60918b
@@ -35,6 +35,7 @@ enum DMI_VENDORS
60918b
 	VENDOR_UNKNOWN,
60918b
 	VENDOR_HP,
60918b
 	VENDOR_ACER,
60918b
+	VENDOR_HPE,
60918b
 };
60918b
 
60918b
 static enum DMI_VENDORS dmi_vendor = VENDOR_UNKNOWN;
60918b
@@ -58,12 +59,14 @@ void dmi_set_vendor(const char *s)
60918b
 
60918b
 	if (strncmp(s, "HP", len) == 0 || strncmp(s, "Hewlett-Packard", len) == 0)
60918b
 		dmi_vendor = VENDOR_HP;
60918b
+	else if (strncmp(s, "HPE", len) == 0 || strncmp(s, "Hewlett Packard Enterprise", len) == 0)
60918b
+		dmi_vendor = VENDOR_HPE;
60918b
 	else if (strncmp(s, "Acer", len) == 0)
60918b
 		dmi_vendor = VENDOR_ACER;
60918b
 }
60918b
 
60918b
 /*
60918b
- * HP-specific data structures are decoded here.
60918b
+ * HPE-specific data structures are decoded here.
60918b
  *
60918b
  * Code contributed by John Cagle and Tyler Bell.
60918b
  */
60918b
@@ -98,14 +101,15 @@ static int dmi_decode_hp(const struct dmi_header *h)
60918b
 	u8 *data = h->data;
60918b
 	int nic, ptr;
60918b
 	u32 feat;
60918b
+	const char *company = (dmi_vendor == VENDOR_HP) ? "HP" : "HPE";
60918b
 
60918b
 	switch (h->type)
60918b
 	{
60918b
 		case 204:
60918b
 			/*
60918b
-			 * Vendor Specific: HP ProLiant System/Rack Locator
60918b
+			 * Vendor Specific: HPE ProLiant System/Rack Locator
60918b
 			 */
60918b
-			printf("HP ProLiant System/Rack Locator\n");
60918b
+			printf("%s ProLiant System/Rack Locator\n", company);
60918b
 			if (h->length < 0x0B) break;
60918b
 			printf("\tRack Name: %s\n", dmi_string(h, data[0x04]));
60918b
 			printf("\tEnclosure Name: %s\n", dmi_string(h, data[0x05]));
60918b
@@ -119,7 +123,7 @@ static int dmi_decode_hp(const struct dmi_header *h)
60918b
 		case 209:
60918b
 		case 221:
60918b
 			/*
60918b
-			 * Vendor Specific: HP ProLiant NIC MAC Information
60918b
+			 * Vendor Specific: HPE ProLiant NIC MAC Information
60918b
 			 *
60918b
 			 * This prints the BIOS NIC number,
60918b
 			 * PCI bus/device/function, and MAC address
60918b
@@ -137,9 +141,10 @@ static int dmi_decode_hp(const struct dmi_header *h)
60918b
 			 *
60918b
 			 * Type 221: is deprecated in the latest docs
60918b
 			 */
60918b
-			printf(h->type == 221 ?
60918b
-				"HP BIOS iSCSI NIC PCI and MAC Information\n" :
60918b
-				"HP BIOS PXE NIC PCI and MAC Information\n");
60918b
+			printf("%s %s\n", company,
60918b
+				h->type == 221 ?
60918b
+					"BIOS iSCSI NIC PCI and MAC Information" :
60918b
+					"BIOS PXE NIC PCI and MAC Information");
60918b
 			nic = 1;
60918b
 			ptr = 4;
60918b
 			while (h->length >= ptr + 8)
60918b
@@ -155,7 +160,7 @@ static int dmi_decode_hp(const struct dmi_header *h)
60918b
 
60918b
 		case 233:
60918b
 			/*
60918b
-			 * Vendor Specific: HP ProLiant NIC MAC Information
60918b
+			 * Vendor Specific: HPE ProLiant NIC MAC Information
60918b
 			 *
60918b
 			 * This prints the BIOS NIC number,
60918b
 			 * PCI bus/device/function, and MAC address
60918b
@@ -171,7 +176,7 @@ static int dmi_decode_hp(const struct dmi_header *h)
60918b
 			 *  0x08  |   MAC  | 32B   | MAC addr padded w/ 0s
60918b
 			 *  0x28  | Port No| BYTE  | Each NIC maps to a Port
60918b
 			 */
60918b
-			printf("HP BIOS PXE NIC PCI and MAC Information\n");
60918b
+			printf("%s BIOS PXE NIC PCI and MAC Information\n", company);
60918b
 			if (h->length < 0x0E) break;
60918b
 			/* If the record isn't long enough, we don't have an ID
60918b
 			 * use 0xFF to use the internal counter.
60918b
@@ -183,11 +188,11 @@ static int dmi_decode_hp(const struct dmi_header *h)
60918b
 
60918b
 		case 212:
60918b
 			/*
60918b
-			 * Vendor Specific: HP 64-bit CRU Information
60918b
+			 * Vendor Specific: HPE 64-bit CRU Information
60918b
 			 *
60918b
 			 * Source: hpwdt kernel driver
60918b
 			 */
60918b
-			printf("HP 64-bit CRU Information\n");
60918b
+			printf("%s 64-bit CRU Information\n", company);
60918b
 			if (h->length < 0x18) break;
60918b
 			printf("\tSignature: 0x%08x", DWORD(data + 0x04));
60918b
 			if (is_printable(data + 0x04, 4))
60918b
@@ -208,11 +213,11 @@ static int dmi_decode_hp(const struct dmi_header *h)
60918b
 
60918b
 		case 219:
60918b
 			/*
60918b
-			 * Vendor Specific: HP ProLiant Information
60918b
+			 * Vendor Specific: HPE ProLiant Information
60918b
 			 *
60918b
 			 * Source: hpwdt kernel driver
60918b
 			 */
60918b
-			printf("HP ProLiant Information\n");
60918b
+			printf("%s ProLiant Information\n", company);
60918b
 			if (h->length < 0x08) break;
60918b
 			printf("\tPower Features: 0x%08x\n", DWORD(data + 0x04));
60918b
 			if (h->length < 0x0C) break;
60918b
@@ -281,6 +286,7 @@ int dmi_decode_oem(const struct dmi_header *h)
60918b
 	switch (dmi_vendor)
60918b
 	{
60918b
 		case VENDOR_HP:
60918b
+		case VENDOR_HPE:
60918b
 			return dmi_decode_hp(h);
60918b
 		case VENDOR_ACER:
60918b
 			return dmi_decode_acer(h);
60918b
-- 
60918b
2.9.5
60918b