summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/dmi/dmi.c21
-rw-r--r--sys/include/dev/dmi/dmi.h1
2 files changed, 21 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);
}
diff --git a/sys/include/dev/dmi/dmi.h b/sys/include/dev/dmi/dmi.h
index a8f60d4..8b7030c 100644
--- a/sys/include/dev/dmi/dmi.h
+++ b/sys/include/dev/dmi/dmi.h
@@ -34,6 +34,7 @@
const char *dmi_vendor(void);
const char *dmi_prodver(void);
+const char *dmi_prodfam(void);
const char *dmi_product(void);
const char *dmi_cpu_manufact(void);
const char *dmi_cpu_version(void);