[...] > I would like to blame the vendors for doing weird things, however I > can't find anything in the specification that would prevent them from > putting the entries in the DMI table in any order they like. Therefore > I'm afraid we have to support all cases. >
Yeah, was on the same page but HPe exactly told me that. There is no enforcement of the specification to do in this logic. > > The only way I can think of to actually support that is to go for a > 2-pass decoding. First pass will only look for entry type 1, record the > vendor and stop. Second pass will be identical to what we have today, > except that it won't set the vendor when seeing type 1, because that > was already done during pass 1. This will make decoding a bit slower > obviously, but thankfully most vendors *do* sort the entries by type > number, so type 1 should be found quickly and the first pass should be > pretty fast in most cases. > > The following fix should do the trick: > Oh thanks for this patch, that's very reactive. I rebased my patch on top of yours and it works perfectly. Please find attached the v2 of my patch which is now into the hpe specific case. If you agree, I'd love to sort this hpe specific part into a numerical order ;) Erwan,
From ba3534c3e5143329d2a48e7ca28bc7ccc4bac851 Mon Sep 17 00:00:00 2001 From: Erwan Velu <e.v...@criteo.com> Date: Mon, 9 Nov 2020 12:59:45 +0100 Subject: [PATCH v2] oem: Adding HPE ProLiant HDD Backplane (type 236) HPE servers encodes some information about the HDD backplane into type 236. A typical output looks like: Handle 0x002F, DMI type 236, 21 bytes HPE HDD Backplane FRU Information FRU I2C Address: 0xAE Box Number: 4 NVRAM ID: 0x109 Sas Expander WWID: 0x0 Total SAS Bays: 4 Signed-off-by: Erwan Velu <e.v...@criteo.com> --- dmioem.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/dmioem.c b/dmioem.c index 60b667416563..7d8931500619 100644 --- a/dmioem.c +++ b/dmioem.c @@ -282,6 +282,32 @@ static int dmi_decode_hp(const struct dmi_header *h) pr_subattr("UEFI", "%s", feat & 0x1400 ? "Yes" : "No"); break; + case 236: + /* + * Vendor Specific: HPE ProLiant HDD Backplane + * + * + * Offset | Name | Width | Description + * --------------------------------------- + * 0x00 | I2C Address| BYTE | Backplane FRU I2C Address + * 0x01 | Box Number | WORD | Backplane Box Number + * 0x03 | NVRAM ID | WORD | Backplane NVRAM Id + * 0x05 | WWID | 64B | SAS Expander WWWID + * 0x0D | Total Bays | WORD | Total SAS Bays + */ + pr_handle_name("%s HDD Backplane FRU Information", company); + + /* If the record isn't 0x15, that's suspicious */ + if (h->length != 0x15) break; + + u8 *backplane = data + 0x4; + pr_attr("FRU I2C Address", "0x%X", backplane[0x0]); + pr_attr("Box Number", "%d", WORD(backplane + 0x1)); + pr_attr("NVRAM ID", "0x%X", WORD(backplane + 0x3)); + pr_attr("Sas Expander WWID", "0x%X", QWORD(backplane + 0x5)); + pr_attr("Total SAS Bays", "%d", WORD(backplane + 0x0D)); + break; + default: return 0; } -- 2.25.1
_______________________________________________ https://lists.nongnu.org/mailman/listinfo/dmidecode-devel