dmidecode-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[dmidecode] [PATCH] dmidecode: Add new system slot types from SMBIOS spe


From: Jean Delvare
Subject: [dmidecode] [PATCH] dmidecode: Add new system slot types from SMBIOS spec 3.4.0
Date: Thu, 15 Oct 2020 11:59:14 +0200

From: Jean Delvare <jdelvare@suse.de>
Subject: dmidecode: Add new system slot types from SMBIOS spec 3.4.0

Based on an earlier patch from Prabhakar Pujeri (Dell).

Version 3.4.0 of the SMBIOS specification adds 14 new system slot
types and updates 2 (DMI type 9). 

Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
Changes from Prabhakar's patch:
 * Adjusted the name strings for types 0x1F and 0x20 in line with the
   new specification.
 * Added 9 more new values (0xBE to 0xC6).
 * Fixed a regression that would cause the "CXL Flexbus 1.0" type to
   trigger an array overrun (0x30 is NOT the next integer after
   0x29). 
 * Stripped stray blank line.
 * Improved commit message.

 dmidecode.c |   26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)

--- dmidecode.orig/dmidecode.c  2020-10-15 10:27:06.039595370 +0200
+++ dmidecode/dmidecode.c       2020-10-15 11:09:47.610204691 +0200
@@ -1931,11 +1931,16 @@ static const char *dmi_slot_type(u8 code
                "MXM Type IV",
                "MXM 3.0 Type A",
                "MXM 3.0 Type B",
-               "PCI Express 2 SFF-8639",
-               "PCI Express 3 SFF-8639",
+               "PCI Express 2 SFF-8639 (U.2)",
+               "PCI Express 3 SFF-8639 (U.2)",
                "PCI Express Mini 52-pin with bottom-side keep-outs",
                "PCI Express Mini 52-pin without bottom-side keep-outs",
-               "PCI Express Mini 76-pin" /* 0x23 */
+               "PCI Express Mini 76-pin"
+               "PCI Express 4 SFF-8639 (U.2)",
+               "PCI Express 5 SFF-8639 (U.2)",
+               "OCP NIC 3.0 Small Form Factor (SFF)",
+               "OCP NIC 3.0 Large Form Factor (LFF)",
+               "OCP NIC Prior to 3.0" /* 0x28 */
        };
        static const char *type_0x30[] = {
                "CXL FLexbus 1.0" /* 0x30 */
@@ -1970,18 +1975,27 @@ static const char *dmi_slot_type(u8 code
                "PCI Express 4 x2",
                "PCI Express 4 x4",
                "PCI Express 4 x8",
-               "PCI Express 4 x16" /* 0xBD */
+               "PCI Express 4 x16",
+               "PCI Express 5",
+               "PCI Express 5 x1",
+               "PCI Express 5 x2",
+               "PCI Express 5 x4",
+               "PCI Express 5 x8",
+               "PCI Express 5 x16",
+               "PCI Express 6+",
+               "EDSFF E1",
+               "EDSFF E3" /* 0xC6 */
        };
        /*
         * Note to developers: when adding entries to these lists, check if
         * function dmi_slot_id below needs updating too.
         */
 
-       if (code >= 0x01 && code <= 0x23)
+       if (code >= 0x01 && code <= 0x28)
                return type[code - 0x01];
        if (code == 0x30)
                return type_0x30[code - 0x30];
-       if (code >= 0xA0 && code <= 0xBD)
+       if (code >= 0xA0 && code <= 0xC6)
                return type_0xA0[code - 0xA0];
        return out_of_spec;
 }


-- 
Jean Delvare
SUSE L3 Support



reply via email to

[Prev in Thread] Current Thread [Next in Thread]