[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[dmidecode] [PATCH 3/7] dmidecode: Add new fields and enumerated values
From: |
Jean Delvare |
Subject: |
[dmidecode] [PATCH 3/7] dmidecode: Add new fields and enumerated values from SMBIOS 3.5.0 |
Date: |
Mon, 30 May 2022 14:14:13 +0200 |
Version 3.5.0 of the SMBIOS specification added the following:
* BIOS Information: Manufacturing mode flags.
* System Slots: Slot height field.
* Built-in Pointing Device: 2 new interface types.
* Onboard Devices Extended Information: 7 new device types.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
---
dmidecode.c | 47 ++++++++++++++++++++++++++++++++++++++---------
1 file changed, 38 insertions(+), 9 deletions(-)
--- dmidecode.orig/dmidecode.c 2022-05-30 11:59:28.529575362 +0200
+++ dmidecode/dmidecode.c 2022-05-30 12:39:53.020450729 +0200
@@ -426,11 +426,13 @@ static void dmi_bios_characteristics_x2(
"Function key-initiated network boot is supported",
"Targeted content distribution is supported",
"UEFI is supported",
- "System is a virtual machine" /* 4 */
+ "System is a virtual machine",
+ "Manufacturing mode is supported",
+ "Manufacturing mode is enabled" /* 6 */
};
int i;
- for (i = 0; i <= 4; i++)
+ for (i = 0; i <= 6; i++)
if (code & (1 << i))
pr_list_item("%s", characteristics[i]);
}
@@ -2335,6 +2337,22 @@ static void dmi_slot_pitch(u16 code)
pr_attr("Pitch", "%u.%02u mm", code / 100, code % 100);
}
+static const char *dmi_slot_height(u8 code)
+{
+ /* 7.10.3 */
+ static const char *height[] = {
+ "Not applicable", /* 0x00 */
+ "Other",
+ "Unknown",
+ "Full height",
+ "Low-profile" /* 0x04 */
+ };
+
+ if (code <= 0x04)
+ return height[code];
+ return out_of_spec;
+}
+
/*
* 7.11 On Board Devices Information (Type 10)
*/
@@ -2352,10 +2370,16 @@ static const char *dmi_on_board_devices_
"Sound",
"PATA Controller",
"SATA Controller",
- "SAS Controller" /* 0x0A */
+ "SAS Controller",
+ "Wireless LAN",
+ "Bluetooth",
+ "WWAN",
+ "eMMC",
+ "NVMe Controller",
+ "UFS Controller" /* 0x10 */
};
- if (code >= 0x01 && code <= 0x0A)
+ if (code >= 0x01 && code <= 0x10)
return type[code - 0x01];
return out_of_spec;
}
@@ -3135,12 +3159,14 @@ static const char *dmi_pointing_device_i
static const char *interface_0xA0[] = {
"Bus Mouse DB-9", /* 0xA0 */
"Bus Mouse Micro DIN",
- "USB" /* 0xA2 */
+ "USB",
+ "I2C",
+ "SPI" /* 0xA4 */
};
if (code >= 0x01 && code <= 0x08)
return interface[code - 0x01];
- if (code >= 0xA0 && code <= 0xA2)
+ if (code >= 0xA0 && code <= 0xA4)
return interface_0xA0[code - 0xA0];
return out_of_spec;
}
@@ -4220,9 +4246,9 @@ static void dmi_decode(const struct dmi_
pr_attr("Release Date", "%s",
dmi_string(h, data[0x08]));
/*
- * On IA-64, the BIOS base address will read 0 because
- * there is no BIOS. Skip the base address and the
- * runtime size in this case.
+ * On IA-64 and UEFI-based systems, the BIOS base
+ * address will read 0 because there is no BIOS. Skip
+ * the base address and the runtime size in this case.
*/
if (WORD(data + 0x06) != 0)
{
@@ -4510,6 +4536,9 @@ static void dmi_decode(const struct dmi_
dmi_slot_information(data[0x05], data[0x13 + data[0x12]
* 5]);
dmi_slot_physical_width(data[0x14 + data[0x12] * 5]);
dmi_slot_pitch(WORD(data + 0x15 + data[0x12] * 5));
+ if (h->length < 0x18 + data[0x12] * 5) break;
+ pr_attr("Height", "%s",
+ dmi_slot_height(data[0x17 + data[0x12] * 5]));
break;
case 10: /* 7.11 On Board Devices Information */
--
Jean Delvare
SUSE L3 Support
- [dmidecode] [PATCH 0/7] dmidecode: Add support for SMBIOS 3.5.0, Jean Delvare, 2022/05/30
- [dmidecode] [PATCH 1/7] dmidecode: Make dmi_slot_bus_width() reusable, Jean Delvare, 2022/05/30
- [dmidecode] [PATCH 2/7] dmidecode: Add missing bits from SMBIOS 3.4.0 specification, Jean Delvare, 2022/05/30
- [dmidecode] [PATCH 3/7] dmidecode: Add new fields and enumerated values from SMBIOS 3.5.0,
Jean Delvare <=
- [dmidecode] [PATCH 4/7] dmidecode: Add support for type 45 records (Firmware Inventory Information), Jean Delvare, 2022/05/30
- [dmidecode] [PATCH 5/7] dmidecode: Enumerate the new struct types, Jean Delvare, 2022/05/30
- [dmidecode] [PATCH 6/7] dmidecode: Drop outdated references, Jean Delvare, 2022/05/30
- [dmidecode] [PATCH 7/7] dmidecode: Set supported version to 3.5.0, Jean Delvare, 2022/05/30