dmidecode-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 1/2] dmioem: Decode Dell-specific DMI type 218


From: Armin Wolf
Subject: Re: [PATCH 1/2] dmioem: Decode Dell-specific DMI type 218
Date: Mon, 24 Jun 2024 22:46:40 +0200
User-agent: Mozilla Thunderbird

Am 24.06.24 um 22:43 schrieb Armin Wolf via dmidecode-devel:

OEM DMI type 218 is used by the dell-smbios-base driver to retrieve
information about the Dell Token Interface. Include the available
information in the output of dmidecode.

I also attached the smbios dumps from two Dell machines which i used
to test those two patches.

Thanks,
Armin Wolf

Signed-off-by: Armin Wolf <W_Armin@gmx.de>
---
  dmioem.c | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
  1 file changed, 53 insertions(+)

diff --git a/dmioem.c b/dmioem.c
index 144bf3f..f24eacd 100644
--- a/dmioem.c
+++ b/dmioem.c
@@ -38,6 +38,7 @@ enum DMI_VENDORS
  {
        VENDOR_UNKNOWN,
        VENDOR_ACER,
+       VENDOR_DELL,
        VENDOR_HP,
        VENDOR_HPE,
        VENDOR_IBM,
@@ -56,6 +57,8 @@ void dmi_set_vendor(const char *v, const char *p)
  {
        const struct { const char *str; enum DMI_VENDORS id; } vendor[] = {
                { "Acer",                     VENDOR_ACER },
+               { "Dell Computer Corporation",        VENDOR_DELL },
+               { "Dell Inc.",                        VENDOR_DELL },
                { "HP",                               VENDOR_HP },
                { "Hewlett-Packard",          VENDOR_HP },
                { "HPE",                      VENDOR_HPE },
@@ -129,6 +132,54 @@ static int dmi_decode_acer(const struct dmi_header *h)
        return 1;
  }

+/*
+ * Dell-specific data structures are decoded here.
+ */
+
+static void dmi_dell_token_interface(const struct dmi_header *h)
+{
+       int tokens = (h->length - 0x0B) / 0x06;
+       u8 *data = h->data;
+       u8 *token;
+
+       pr_attr("Command IO Address", "0x%04x", WORD(data + 0x04));
+       pr_attr("Command IO Code", "0x%02x", data[0x06]);
+       pr_attr("Supported Command Classes Bitmap", "0x%08x", DWORD(data + 
0x07));
+
+       /*
+        * Final token is a terminator, so we ignore it.
+        */
+       if (tokens <= 1) {
+               return;
+       }
+
+       pr_list_start("Tokens", NULL);
+       for (int i = 0; i < tokens - 1; i++)
+       {
+               token = data + 0x0B + 0x06 * i;
+               pr_list_item("0x%04hx (Location: 0x%04hx, Value: 0x%04hx)", 
WORD(token + 0x00),
+                            WORD(token + 0x02), WORD(token + 0x04));
+       }
+       pr_list_end();
+}
+
+static int dmi_decode_dell(const struct dmi_header *h)
+{
+       switch (h->type)
+       {
+               case 218:
+                       pr_handle_name("Dell Token Interface");
+                       if (h->length < 0x0B) break;
+                       dmi_dell_token_interface(h);
+                       break;
+
+               default:
+                       return 0;
+       }
+
+       return 1;
+}
+
  /*
   * HPE-specific data structures are decoded here.
   *
@@ -1708,6 +1759,8 @@ int dmi_decode_oem(const struct dmi_header *h)
                        return dmi_decode_hp(h);
                case VENDOR_ACER:
                        return dmi_decode_acer(h);
+               case VENDOR_DELL:
+                       return dmi_decode_dell(h);
                case VENDOR_IBM:
                case VENDOR_LENOVO:
                        return dmi_decode_ibm_lenovo(h);
--
2.39.2

Attachment: inspiron.bin
Description: Binary data

Attachment: latitude.bin
Description: Binary data


reply via email to

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