|
|
4a6338 |
From d8c15575b412431f9e43b32e65419a83b11802aa Mon Sep 17 00:00:00 2001
|
|
|
4a6338 |
From: Jean Delvare <jdelvare@suse.de>
|
|
|
4a6338 |
Date: Wed, 23 Oct 2019 12:44:20 +0200
|
|
|
4a6338 |
Subject: [PATCH 11/11] dmidecode: Decode system slot base bus width and peers
|
|
|
4a6338 |
|
|
|
4a6338 |
SMBIOS version 3.2.0 added extra fields are the end of structure type
|
|
|
4a6338 |
9. Decode these extra fields (base data bus width and peers) when
|
|
|
4a6338 |
present.
|
|
|
4a6338 |
|
|
|
4a6338 |
Signed-off-by: Jean Delvare <jdelvare@suse.de>
|
|
|
4a6338 |
---
|
|
|
4a6338 |
dmidecode.c | 15 +++++++++++++++
|
|
|
4a6338 |
1 file changed, 15 insertions(+)
|
|
|
4a6338 |
|
|
|
4a6338 |
diff --git a/dmidecode.c b/dmidecode.c
|
|
|
4a6338 |
index 9b8f917ef22a..e09f12116e9a 100644
|
|
|
4a6338 |
--- a/dmidecode.c
|
|
|
4a6338 |
+++ b/dmidecode.c
|
|
|
4a6338 |
@@ -2028,6 +2028,16 @@ static void dmi_slot_segment_bus_func(u16 code1, u8 code2, u8 code3, const char
|
|
|
4a6338 |
prefix, code1, code2, code3 >> 3, code3 & 0x7);
|
|
|
4a6338 |
}
|
|
|
4a6338 |
|
|
|
4a6338 |
+static void dmi_slot_peers(u8 n, const u8 *data, const char *prefix)
|
|
|
4a6338 |
+{
|
|
|
4a6338 |
+ int i;
|
|
|
4a6338 |
+
|
|
|
4a6338 |
+ for (i = 1; i <= n; i++, data += 5)
|
|
|
4a6338 |
+ printf("%sPeer Device %d: %04x:%02x:%02x.%x (Width %u)\n",
|
|
|
4a6338 |
+ prefix, i, WORD(data), data[2], data[3] >> 3,
|
|
|
4a6338 |
+ data[3] & 0x07, data[4]);
|
|
|
4a6338 |
+}
|
|
|
4a6338 |
+
|
|
|
4a6338 |
/*
|
|
|
4a6338 |
* 7.11 On Board Devices Information (Type 10)
|
|
|
4a6338 |
*/
|
|
|
4a6338 |
@@ -4208,6 +4218,11 @@ static void dmi_decode(const struct dmi_header *h, u16 ver)
|
|
|
4a6338 |
dmi_slot_characteristics(data[0x0B], data[0x0C], "\t\t");
|
|
|
4a6338 |
if (h->length < 0x11) break;
|
|
|
4a6338 |
dmi_slot_segment_bus_func(WORD(data + 0x0D), data[0x0F], data[0x10], "\t");
|
|
|
4a6338 |
+ if (h->length < 0x13) break;
|
|
|
4a6338 |
+ printf("\tData Bus Width: %u\n", data[0x11]);
|
|
|
4a6338 |
+ printf("\tPeer Devices: %u\n", data[0x12]);
|
|
|
4a6338 |
+ if (h->length - 0x13 >= data[0x12] * 5)
|
|
|
4a6338 |
+ dmi_slot_peers(data[0x12], data + 0x13, "\t");
|
|
|
4a6338 |
break;
|
|
|
4a6338 |
|
|
|
4a6338 |
case 10: /* 7.11 On Board Devices Information */
|
|
|
4a6338 |
--
|
|
|
4a6338 |
2.17.1
|
|
|
4a6338 |
|