1 /* SPDX-License-Identifier: GPL-2.0 */
5 #include <linux/list.h>
6 #include <linux/kobject.h>
7 #include <linux/mod_devicetable.h>
9 /* enum dmi_field is in mod_devicetable.h */
11 enum dmi_device_type {
17 DMI_DEV_TYPE_ETHERNET,
18 DMI_DEV_TYPE_TOKENRING,
23 DMI_DEV_TYPE_IPMI = -1,
24 DMI_DEV_TYPE_OEM_STRING = -2,
25 DMI_DEV_TYPE_DEV_ONBOARD = -3,
26 DMI_DEV_TYPE_DEV_SLOT = -4,
35 DMI_ENTRY_MEM_CONTROLLER,
38 DMI_ENTRY_PORT_CONNECTOR,
39 DMI_ENTRY_SYSTEM_SLOT,
40 DMI_ENTRY_ONBOARD_DEVICE,
44 DMI_ENTRY_GROUP_ASSOC,
45 DMI_ENTRY_SYSTEM_EVENT_LOG,
46 DMI_ENTRY_PHYS_MEM_ARRAY,
48 DMI_ENTRY_32_MEM_ERROR,
49 DMI_ENTRY_MEM_ARRAY_MAPPED_ADDR,
50 DMI_ENTRY_MEM_DEV_MAPPED_ADDR,
51 DMI_ENTRY_BUILTIN_POINTING_DEV,
52 DMI_ENTRY_PORTABLE_BATTERY,
53 DMI_ENTRY_SYSTEM_RESET,
54 DMI_ENTRY_HW_SECURITY,
55 DMI_ENTRY_SYSTEM_POWER_CONTROLS,
56 DMI_ENTRY_VOLTAGE_PROBE,
57 DMI_ENTRY_COOLING_DEV,
59 DMI_ENTRY_ELECTRICAL_CURRENT_PROBE,
60 DMI_ENTRY_OOB_REMOTE_ACCESS,
62 DMI_ENTRY_SYSTEM_BOOT,
64 DMI_ENTRY_MGMT_DEV_COMPONENT,
65 DMI_ENTRY_MGMT_DEV_THRES,
66 DMI_ENTRY_MEM_CHANNEL,
68 DMI_ENTRY_SYS_POWER_SUPPLY,
70 DMI_ENTRY_ONBOARD_DEV_EXT,
71 DMI_ENTRY_MGMT_CONTROLLER_HOST,
72 DMI_ENTRY_INACTIVE = 126,
73 DMI_ENTRY_END_OF_TABLE = 127,
83 struct list_head list;
86 void *device_data; /* Type specific data */
91 struct dmi_dev_onboard {
92 struct dmi_device dev;
99 extern struct kobject *dmi_kobj;
100 extern int dmi_check_system(const struct dmi_system_id *list);
101 const struct dmi_system_id *dmi_first_match(const struct dmi_system_id *list);
102 extern const char * dmi_get_system_info(int field);
103 extern const struct dmi_device * dmi_find_device(int type, const char *name,
104 const struct dmi_device *from);
105 extern void dmi_setup(void);
106 extern bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp);
107 extern int dmi_get_bios_year(void);
108 extern int dmi_name_in_vendors(const char *str);
109 extern int dmi_name_in_serial(const char *str);
110 extern int dmi_available;
111 extern int dmi_walk(void (*decode)(const struct dmi_header *, void *),
113 extern bool dmi_match(enum dmi_field f, const char *str);
114 extern void dmi_memdev_name(u16 handle, const char **bank, const char **device);
115 extern u64 dmi_memdev_size(u16 handle);
116 extern u8 dmi_memdev_type(u16 handle);
117 extern u16 dmi_memdev_handle(int slot);
121 static inline int dmi_check_system(const struct dmi_system_id *list) { return 0; }
122 static inline const char * dmi_get_system_info(int field) { return NULL; }
123 static inline const struct dmi_device * dmi_find_device(int type, const char *name,
124 const struct dmi_device *from) { return NULL; }
125 static inline void dmi_setup(void) { }
126 static inline bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp)
136 static inline int dmi_get_bios_year(void) { return -ENXIO; }
137 static inline int dmi_name_in_vendors(const char *s) { return 0; }
138 static inline int dmi_name_in_serial(const char *s) { return 0; }
139 #define dmi_available 0
140 static inline int dmi_walk(void (*decode)(const struct dmi_header *, void *),
141 void *private_data) { return -ENXIO; }
142 static inline bool dmi_match(enum dmi_field f, const char *str)
144 static inline void dmi_memdev_name(u16 handle, const char **bank,
145 const char **device) { }
146 static inline u64 dmi_memdev_size(u16 handle) { return ~0ul; }
147 static inline u8 dmi_memdev_type(u16 handle) { return 0x0; }
148 static inline u16 dmi_memdev_handle(int slot) { return 0xffff; }
149 static inline const struct dmi_system_id *
150 dmi_first_match(const struct dmi_system_id *list) { return NULL; }
154 #endif /* __DMI_H__ */