summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRaymond Mao <[email protected]>2026-02-13 17:52:51 -0500
committerTom Rini <[email protected]>2026-02-18 08:27:51 -0600
commit4c816ddbadb1bd8bfe09a457538d4f518151fd6d (patch)
tree630f1dfdaf876521778ff7f45e729e2650410b3b /include
parent41b7a09d24d878f748eba87ae85575043224148b (diff)
smbios: print the properties only when they exist in a specified version of spec
By checking the payload length, we can know the version of the spec and skip the ones which are not expected to exist. Signed-off-by: Raymond Mao <[email protected]> Tested-by: Ilias Apalodimas <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/smbios.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/include/smbios.h b/include/smbios.h
index e4b5ff314d9..39090d3ba18 100644
--- a/include/smbios.h
+++ b/include/smbios.h
@@ -110,10 +110,42 @@ struct __packed smbios_type0 {
char eos[SMBIOS_STRUCT_EOS_BYTES];
};
+#define SMBIOS_TYPE0_LENGTH_V24 0x18
+#define SMBIOS_TYPE0_LENGTH_V31 0x1a
+
#define SMBIOS_TYPE1_LENGTH_V20 0x08
#define SMBIOS_TYPE1_LENGTH_V21 0x19
#define SMBIOS_TYPE1_LENGTH_V24 0x1b
+#define SMBIOS_TYPE4_LENGTH_V20 0x1a
+#define SMBIOS_TYPE4_LENGTH_V23 0x23
+#define SMBIOS_TYPE4_LENGTH_V25 0x28
+#define SMBIOS_TYPE4_LENGTH_V26 0x2a
+#define SMBIOS_TYPE4_LENGTH_V30 0x30
+#define SMBIOS_TYPE4_LENGTH_V36 0x32
+
+#define SMBIOS_TYPE7_LENGTH_V20 0x0f
+#define SMBIOS_TYPE7_LENGTH_V21 0x13
+#define SMBIOS_TYPE7_LENGTH_V31 0x1b
+
+#define SMBIOS_TYPE9_LENGTH_V20 0x0c
+#define SMBIOS_TYPE9_LENGTH_V21 0x0d
+#define SMBIOS_TYPE9_LENGTH_V26 0x11
+
+#define SMBIOS_TYPE16_LENGTH_V21 0x0f
+#define SMBIOS_TYPE16_LENGTH_V27 0x17
+
+#define SMBIOS_TYPE17_LENGTH_V21 0x15
+#define SMBIOS_TYPE17_LENGTH_V23 0x1b
+#define SMBIOS_TYPE17_LENGTH_V26 0x1c
+#define SMBIOS_TYPE17_LENGTH_V27 0x22
+#define SMBIOS_TYPE17_LENGTH_V28 0x28
+#define SMBIOS_TYPE17_LENGTH_V32 0x54
+#define SMBIOS_TYPE17_LENGTH_V33 0x5c
+
+#define SMBIOS_TYPE19_LENGTH_V21 0x0f
+#define SMBIOS_TYPE19_LENGTH_V27 0x1f
+
struct __packed smbios_type1 {
struct smbios_header hdr;
u8 manufacturer;