From 495ab76e0d5f0eba83f9c86baf779a244ea1b60d Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Mon, 24 Aug 2020 14:42:44 +0200 Subject: [PATCH] Add SMBIOS 3.x support Handle only the path from sysfs for now. Signed-off-by: Takashi Iwai CC: Thomas Renninger CC: Michal Suchanek --- src/dmidecode/dmidecode.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/dmidecode/dmidecode.c b/src/dmidecode/dmidecode.c index f4c1269..f478cc5 100644 --- a/src/dmidecode/dmidecode.c +++ b/src/dmidecode/dmidecode.c @@ -236,7 +236,7 @@ static int dmi_table(u32 base, u16 len, u16 num, u16 ver, const char *devmem, co int i=0; /* Verify SMBIOS version */ - if (!isvalidsmbios(ver >> 8, ver & 0xFF)) { + if (ver && !isvalidsmbios(ver >> 8, ver & 0xFF)) { return 0; } @@ -253,7 +253,7 @@ static int dmi_table(u32 base, u16 len, u16 num, u16 ver, const char *devmem, co } data=buf; - while(i= 0x18 && memcmp(buf, "_SM3_", 5) == 0) + return smbios3_decode(buf, SYSFS_TABLE_DMI, state); return 0; } -- 2.44.0