summaryrefslogtreecommitdiff
path: root/sys/dev/dmi/dmi.c
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2025-08-02 01:36:46 -0400
committerIan Moffett <ian@osmora.org>2025-08-02 01:36:46 -0400
commit0dde279349881cf8c8005654f40713c07106ad0f (patch)
treed3237938d0c62f772901133babae948d17b63af3 /sys/dev/dmi/dmi.c
parentf68f62622239833ef214930c33d45409a616babe (diff)
kernel: dmi: Add dmi_prodfam()
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/dev/dmi/dmi.c')
-rw-r--r--sys/dev/dmi/dmi.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/sys/dev/dmi/dmi.c b/sys/dev/dmi/dmi.c
index dc4b363..f9750c1 100644
--- a/sys/dev/dmi/dmi.c
+++ b/sys/dev/dmi/dmi.c
@@ -46,7 +46,8 @@
/* String offsets */
#define BIOSINFO_VENDOR 0x01
#define SYSINFO_PRODUCT 0x02
-#define SYSINFO_FAMILY 0x03
+#define SYSINFO_VERSION 0x03
+#define SYSINFO_FAMILY 0x06
#define PROCINFO_MANUFACT 0x02
#define PROCINFO_VERSION 0x03
#define PROCINFO_PARTNO 0x06
@@ -178,6 +179,24 @@ dmi_prodver(void)
return NULL;
}
+ return dmi_str_index(hdr, SYSINFO_VERSION);
+}
+
+/*
+ * Return the product family from the DMI/SMBIOS
+ * System Info structure
+ *
+ * Returns NULL if not found
+ */
+const char *
+dmi_prodfam(void)
+{
+ struct dmi_shdr *hdr;
+
+ if ((hdr = dmi_shdr(DMI_SYSTEM_INFO)) == NULL) {
+ return NULL;
+ }
+
return dmi_str_index(hdr, SYSINFO_FAMILY);
}