git: c1e4d85c71df - stable/13 - LinuxKPI: add struct dmi_header and unsupported dmi_walk()

From: Bjoern A. Zeeb <bz_at_FreeBSD.org>
Date: Mon, 17 Oct 2022 20:41:41 UTC
The branch stable/13 has been updated by bz:

URL: https://cgit.FreeBSD.org/src/commit/?id=c1e4d85c71df7eb1d0ab5537430ef86a2c0ed523

commit c1e4d85c71df7eb1d0ab5537430ef86a2c0ed523
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2022-09-23 22:21:06 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2022-10-17 20:37:04 +0000

    LinuxKPI: add struct dmi_header and unsupported dmi_walk()
    
    Add a structure definition as well as a dummy dmi_walk for now
    which returns an error as not supported.  Our current dmi implementation
    is special but does not give access to all details but rather only
    information from kenv which does not suffice all use cases.
    
    Reviewed by:    hselasky
    Differential Revision: https://reviews.freebsd.org/D36687
    
    (cherry picked from commit f486b352470edc82142766c2f3da2b8220774b7f)
---
 sys/compat/linuxkpi/common/include/linux/dmi.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/sys/compat/linuxkpi/common/include/linux/dmi.h b/sys/compat/linuxkpi/common/include/linux/dmi.h
index 339f622f89b2..a3514c66f9cd 100644
--- a/sys/compat/linuxkpi/common/include/linux/dmi.h
+++ b/sys/compat/linuxkpi/common/include/linux/dmi.h
@@ -34,6 +34,12 @@
 #include <sys/types.h>
 #include <linux/mod_devicetable.h>
 
+struct dmi_header {
+	uint8_t		type;
+	uint8_t		length;
+	uint16_t	handle;
+};
+
 int linux_dmi_check_system(const struct dmi_system_id *);
 bool linux_dmi_match(enum dmi_field, const char *);
 const struct dmi_system_id *linux_dmi_first_match(const struct dmi_system_id *);
@@ -44,4 +50,11 @@ const char *linux_dmi_get_system_info(int);
 #define	dmi_first_match(sysid)	linux_dmi_first_match(sysid)
 #define	dmi_get_system_info(sysid)	linux_dmi_get_system_info(sysid)
 
+static inline int
+dmi_walk(void (*callbackf)(const struct dmi_header *, void *), void *arg)
+{
+
+	return (-ENXIO);
+}
+
 #endif	/* __LINUXKPI_LINUX_DMI_H__ */