Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef __DMI_H__ |
| 2 | #define __DMI_H__ |
| 3 | |
Andrey Panin | ebad6a4 | 2005-09-06 15:18:29 -0700 | [diff] [blame] | 4 | #include <linux/list.h> |
David Woodhouse | d945b69 | 2008-09-16 16:23:28 -0700 | [diff] [blame] | 5 | #include <linux/mod_devicetable.h> |
Andrey Panin | ebad6a4 | 2005-09-06 15:18:29 -0700 | [diff] [blame] | 6 | |
David Woodhouse | d945b69 | 2008-09-16 16:23:28 -0700 | [diff] [blame] | 7 | /* enum dmi_field is in mod_devicetable.h */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | |
Andrey Panin | ebad6a4 | 2005-09-06 15:18:29 -0700 | [diff] [blame] | 9 | enum dmi_device_type { |
| 10 | DMI_DEV_TYPE_ANY = 0, |
| 11 | DMI_DEV_TYPE_OTHER, |
| 12 | DMI_DEV_TYPE_UNKNOWN, |
| 13 | DMI_DEV_TYPE_VIDEO, |
| 14 | DMI_DEV_TYPE_SCSI, |
| 15 | DMI_DEV_TYPE_ETHERNET, |
| 16 | DMI_DEV_TYPE_TOKENRING, |
| 17 | DMI_DEV_TYPE_SOUND, |
Wim Van Sebroeck | b4bd7d5 | 2008-02-08 04:20:58 -0800 | [diff] [blame] | 18 | DMI_DEV_TYPE_PATA, |
| 19 | DMI_DEV_TYPE_SATA, |
| 20 | DMI_DEV_TYPE_SAS, |
Shem Multinymous | 2e0c1f6 | 2006-09-29 01:59:37 -0700 | [diff] [blame] | 21 | DMI_DEV_TYPE_IPMI = -1, |
Wim Van Sebroeck | b4bd7d5 | 2008-02-08 04:20:58 -0800 | [diff] [blame] | 22 | DMI_DEV_TYPE_OEM_STRING = -2, |
Andrey Panin | ebad6a4 | 2005-09-06 15:18:29 -0700 | [diff] [blame] | 23 | }; |
| 24 | |
| 25 | struct dmi_header { |
| 26 | u8 type; |
| 27 | u8 length; |
| 28 | u16 handle; |
| 29 | }; |
| 30 | |
Andrey Panin | ebad6a4 | 2005-09-06 15:18:29 -0700 | [diff] [blame] | 31 | struct dmi_device { |
| 32 | struct list_head list; |
| 33 | int type; |
| 34 | const char *name; |
| 35 | void *device_data; /* Type specific data */ |
| 36 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 37 | |
Andi Kleen | e992867 | 2006-01-11 22:43:33 +0100 | [diff] [blame] | 38 | #ifdef CONFIG_DMI |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | |
Jeff Garzik | 1855256 | 2007-10-03 15:15:40 -0400 | [diff] [blame] | 40 | extern int dmi_check_system(const struct dmi_system_id *list); |
| 41 | extern const char * dmi_get_system_info(int field); |
| 42 | extern const struct dmi_device * dmi_find_device(int type, const char *name, |
| 43 | const struct dmi_device *from); |
Andi Kleen | e992867 | 2006-01-11 22:43:33 +0100 | [diff] [blame] | 44 | extern void dmi_scan_machine(void); |
Andi Kleen | f083a32 | 2006-03-25 16:30:19 +0100 | [diff] [blame] | 45 | extern int dmi_get_year(int field); |
Jeff Garzik | 1855256 | 2007-10-03 15:15:40 -0400 | [diff] [blame] | 46 | extern int dmi_name_in_vendors(const char *str); |
Alok Kataria | fd8cd7e | 2008-11-03 15:50:38 -0800 | [diff] [blame] | 47 | extern int dmi_name_in_serial(const char *str); |
Len Brown | 81b4e1f | 2008-01-16 17:20:37 -0500 | [diff] [blame] | 48 | extern int dmi_available; |
Jean Delvare | 7fce084 | 2007-11-03 17:29:20 +0100 | [diff] [blame] | 49 | extern int dmi_walk(void (*decode)(const struct dmi_header *)); |
Jiri Slaby | d61c72e | 2008-12-10 14:07:21 +0100 | [diff] [blame] | 50 | extern bool dmi_match(enum dmi_field f, const char *str); |
Andi Kleen | e992867 | 2006-01-11 22:43:33 +0100 | [diff] [blame] | 51 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | #else |
| 53 | |
Jeff Garzik | 1855256 | 2007-10-03 15:15:40 -0400 | [diff] [blame] | 54 | static inline int dmi_check_system(const struct dmi_system_id *list) { return 0; } |
| 55 | static inline const char * dmi_get_system_info(int field) { return NULL; } |
| 56 | static inline const struct dmi_device * dmi_find_device(int type, const char *name, |
| 57 | const struct dmi_device *from) { return NULL; } |
Thomas Petazzoni | 7ae9392 | 2008-04-28 02:14:14 -0700 | [diff] [blame] | 58 | static inline void dmi_scan_machine(void) { return; } |
Andi Kleen | f083a32 | 2006-03-25 16:30:19 +0100 | [diff] [blame] | 59 | static inline int dmi_get_year(int year) { return 0; } |
Jeff Garzik | 1855256 | 2007-10-03 15:15:40 -0400 | [diff] [blame] | 60 | static inline int dmi_name_in_vendors(const char *s) { return 0; } |
Alok Kataria | fd8cd7e | 2008-11-03 15:50:38 -0800 | [diff] [blame] | 61 | static inline int dmi_name_in_serial(const char *s) { return 0; } |
Len Brown | 81b4e1f | 2008-01-16 17:20:37 -0500 | [diff] [blame] | 62 | #define dmi_available 0 |
Jean Delvare | 7fce084 | 2007-11-03 17:29:20 +0100 | [diff] [blame] | 63 | static inline int dmi_walk(void (*decode)(const struct dmi_header *)) |
| 64 | { return -1; } |
Jiri Slaby | d61c72e | 2008-12-10 14:07:21 +0100 | [diff] [blame] | 65 | static inline bool dmi_match(enum dmi_field f, const char *str) |
| 66 | { return false; } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 67 | |
| 68 | #endif |
| 69 | |
| 70 | #endif /* __DMI_H__ */ |