Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | #ifndef __DMI_H__ |
2 | #define __DMI_H__ | |
3 | ||
ebad6a42 | 4 | #include <linux/list.h> |
d7f96f97 | 5 | #include <linux/kobject.h> |
d945b697 | 6 | #include <linux/mod_devicetable.h> |
ebad6a42 | 7 | |
d945b697 | 8 | /* enum dmi_field is in mod_devicetable.h */ |
1da177e4 | 9 | |
ebad6a42 AP |
10 | enum dmi_device_type { |
11 | DMI_DEV_TYPE_ANY = 0, | |
12 | DMI_DEV_TYPE_OTHER, | |
13 | DMI_DEV_TYPE_UNKNOWN, | |
14 | DMI_DEV_TYPE_VIDEO, | |
15 | DMI_DEV_TYPE_SCSI, | |
16 | DMI_DEV_TYPE_ETHERNET, | |
17 | DMI_DEV_TYPE_TOKENRING, | |
18 | DMI_DEV_TYPE_SOUND, | |
b4bd7d59 WVS |
19 | DMI_DEV_TYPE_PATA, |
20 | DMI_DEV_TYPE_SATA, | |
21 | DMI_DEV_TYPE_SAS, | |
2e0c1f6c | 22 | DMI_DEV_TYPE_IPMI = -1, |
b4bd7d59 | 23 | DMI_DEV_TYPE_OEM_STRING = -2, |
911e1c9b | 24 | DMI_DEV_TYPE_DEV_ONBOARD = -3, |
e5b6c151 | 25 | DMI_DEV_TYPE_DEV_SLOT = -4, |
ebad6a42 AP |
26 | }; |
27 | ||
93c890db MW |
28 | enum dmi_entry_type { |
29 | DMI_ENTRY_BIOS = 0, | |
30 | DMI_ENTRY_SYSTEM, | |
31 | DMI_ENTRY_BASEBOARD, | |
32 | DMI_ENTRY_CHASSIS, | |
33 | DMI_ENTRY_PROCESSOR, | |
34 | DMI_ENTRY_MEM_CONTROLLER, | |
35 | DMI_ENTRY_MEM_MODULE, | |
36 | DMI_ENTRY_CACHE, | |
37 | DMI_ENTRY_PORT_CONNECTOR, | |
38 | DMI_ENTRY_SYSTEM_SLOT, | |
39 | DMI_ENTRY_ONBOARD_DEVICE, | |
40 | DMI_ENTRY_OEMSTRINGS, | |
41 | DMI_ENTRY_SYSCONF, | |
42 | DMI_ENTRY_BIOS_LANG, | |
43 | DMI_ENTRY_GROUP_ASSOC, | |
44 | DMI_ENTRY_SYSTEM_EVENT_LOG, | |
45 | DMI_ENTRY_PHYS_MEM_ARRAY, | |
46 | DMI_ENTRY_MEM_DEVICE, | |
47 | DMI_ENTRY_32_MEM_ERROR, | |
48 | DMI_ENTRY_MEM_ARRAY_MAPPED_ADDR, | |
49 | DMI_ENTRY_MEM_DEV_MAPPED_ADDR, | |
50 | DMI_ENTRY_BUILTIN_POINTING_DEV, | |
51 | DMI_ENTRY_PORTABLE_BATTERY, | |
52 | DMI_ENTRY_SYSTEM_RESET, | |
53 | DMI_ENTRY_HW_SECURITY, | |
54 | DMI_ENTRY_SYSTEM_POWER_CONTROLS, | |
55 | DMI_ENTRY_VOLTAGE_PROBE, | |
56 | DMI_ENTRY_COOLING_DEV, | |
57 | DMI_ENTRY_TEMP_PROBE, | |
58 | DMI_ENTRY_ELECTRICAL_CURRENT_PROBE, | |
59 | DMI_ENTRY_OOB_REMOTE_ACCESS, | |
60 | DMI_ENTRY_BIS_ENTRY, | |
61 | DMI_ENTRY_SYSTEM_BOOT, | |
62 | DMI_ENTRY_MGMT_DEV, | |
63 | DMI_ENTRY_MGMT_DEV_COMPONENT, | |
64 | DMI_ENTRY_MGMT_DEV_THRES, | |
65 | DMI_ENTRY_MEM_CHANNEL, | |
66 | DMI_ENTRY_IPMI_DEV, | |
67 | DMI_ENTRY_SYS_POWER_SUPPLY, | |
68 | DMI_ENTRY_ADDITIONAL, | |
69 | DMI_ENTRY_ONBOARD_DEV_EXT, | |
70 | DMI_ENTRY_MGMT_CONTROLLER_HOST, | |
71 | DMI_ENTRY_INACTIVE = 126, | |
72 | DMI_ENTRY_END_OF_TABLE = 127, | |
73 | }; | |
74 | ||
ebad6a42 AP |
75 | struct dmi_header { |
76 | u8 type; | |
77 | u8 length; | |
78 | u16 handle; | |
9ea650c8 | 79 | } __packed; |
ebad6a42 | 80 | |
ebad6a42 AP |
81 | struct dmi_device { |
82 | struct list_head list; | |
83 | int type; | |
84 | const char *name; | |
85 | void *device_data; /* Type specific data */ | |
86 | }; | |
1da177e4 | 87 | |
e9928674 | 88 | #ifdef CONFIG_DMI |
1da177e4 | 89 | |
911e1c9b N |
90 | struct dmi_dev_onboard { |
91 | struct dmi_device dev; | |
92 | int instance; | |
93 | int segment; | |
94 | int bus; | |
95 | int devfn; | |
96 | }; | |
97 | ||
d7f96f97 | 98 | extern struct kobject *dmi_kobj; |
1855256c | 99 | extern int dmi_check_system(const struct dmi_system_id *list); |
d7b1956f | 100 | const struct dmi_system_id *dmi_first_match(const struct dmi_system_id *list); |
1855256c JG |
101 | extern const char * dmi_get_system_info(int field); |
102 | extern const struct dmi_device * dmi_find_device(int type, const char *name, | |
103 | const struct dmi_device *from); | |
e9928674 | 104 | extern void dmi_scan_machine(void); |
dd6dad42 | 105 | extern void dmi_memdev_walk(void); |
98e5e1bf | 106 | extern void dmi_set_dump_stack_arch_desc(void); |
3e5cd1f2 | 107 | extern bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp); |
1855256c | 108 | extern int dmi_name_in_vendors(const char *str); |
fd8cd7e1 | 109 | extern int dmi_name_in_serial(const char *str); |
81b4e1f6 | 110 | extern int dmi_available; |
e7a19c56 JD |
111 | extern int dmi_walk(void (*decode)(const struct dmi_header *, void *), |
112 | void *private_data); | |
d61c72e5 | 113 | extern bool dmi_match(enum dmi_field f, const char *str); |
dd6dad42 | 114 | extern void dmi_memdev_name(u16 handle, const char **bank, const char **device); |
e9928674 | 115 | |
1da177e4 LT |
116 | #else |
117 | ||
1855256c JG |
118 | static inline int dmi_check_system(const struct dmi_system_id *list) { return 0; } |
119 | static inline const char * dmi_get_system_info(int field) { return NULL; } | |
120 | static inline const struct dmi_device * dmi_find_device(int type, const char *name, | |
121 | const struct dmi_device *from) { return NULL; } | |
7ae9392c | 122 | static inline void dmi_scan_machine(void) { return; } |
dd6dad42 | 123 | static inline void dmi_memdev_walk(void) { } |
98e5e1bf | 124 | static inline void dmi_set_dump_stack_arch_desc(void) { } |
3e5cd1f2 TH |
125 | static inline bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp) |
126 | { | |
127 | if (yearp) | |
128 | *yearp = 0; | |
129 | if (monthp) | |
130 | *monthp = 0; | |
131 | if (dayp) | |
132 | *dayp = 0; | |
133 | return false; | |
134 | } | |
1855256c | 135 | static inline int dmi_name_in_vendors(const char *s) { return 0; } |
fd8cd7e1 | 136 | static inline int dmi_name_in_serial(const char *s) { return 0; } |
81b4e1f6 | 137 | #define dmi_available 0 |
e7a19c56 JD |
138 | static inline int dmi_walk(void (*decode)(const struct dmi_header *, void *), |
139 | void *private_data) { return -1; } | |
d61c72e5 JS |
140 | static inline bool dmi_match(enum dmi_field f, const char *str) |
141 | { return false; } | |
dd6dad42 CG |
142 | static inline void dmi_memdev_name(u16 handle, const char **bank, |
143 | const char **device) { } | |
d8204ee2 KG |
144 | static inline const struct dmi_system_id * |
145 | dmi_first_match(const struct dmi_system_id *list) { return NULL; } | |
1da177e4 LT |
146 | |
147 | #endif | |
148 | ||
149 | #endif /* __DMI_H__ */ |