From 8459b891cdbb2d4691bd188ced5a512be8734d10 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Thu, 13 Aug 2020 16:11:06 +0200 Subject: [PATCH 3/3] Add SMBIOS 3.x support Handle only the path from sysfs for now. Signed-off-by: Takashi Iwai --- 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 f4c12694ef13..f478cc58aeb6 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.16.4