| 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> | 
 | 5 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | enum dmi_field { | 
 | 7 | 	DMI_NONE, | 
 | 8 | 	DMI_BIOS_VENDOR, | 
 | 9 | 	DMI_BIOS_VERSION, | 
 | 10 | 	DMI_BIOS_DATE, | 
 | 11 | 	DMI_SYS_VENDOR, | 
 | 12 | 	DMI_PRODUCT_NAME, | 
 | 13 | 	DMI_PRODUCT_VERSION, | 
| Dmitry Torokhov | e70c9d5 | 2005-06-25 14:54:25 -0700 | [diff] [blame] | 14 | 	DMI_PRODUCT_SERIAL, | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 15 | 	DMI_BOARD_VENDOR, | 
 | 16 | 	DMI_BOARD_NAME, | 
 | 17 | 	DMI_BOARD_VERSION, | 
 | 18 | 	DMI_STRING_MAX, | 
 | 19 | }; | 
 | 20 |  | 
| Andrey Panin | ebad6a4 | 2005-09-06 15:18:29 -0700 | [diff] [blame] | 21 | enum dmi_device_type { | 
 | 22 | 	DMI_DEV_TYPE_ANY = 0, | 
 | 23 | 	DMI_DEV_TYPE_OTHER, | 
 | 24 | 	DMI_DEV_TYPE_UNKNOWN, | 
 | 25 | 	DMI_DEV_TYPE_VIDEO, | 
 | 26 | 	DMI_DEV_TYPE_SCSI, | 
 | 27 | 	DMI_DEV_TYPE_ETHERNET, | 
 | 28 | 	DMI_DEV_TYPE_TOKENRING, | 
 | 29 | 	DMI_DEV_TYPE_SOUND, | 
| Shem Multinymous | 2e0c1f6 | 2006-09-29 01:59:37 -0700 | [diff] [blame] | 30 | 	DMI_DEV_TYPE_IPMI = -1, | 
 | 31 | 	DMI_DEV_TYPE_OEM_STRING = -2 | 
| Andrey Panin | ebad6a4 | 2005-09-06 15:18:29 -0700 | [diff] [blame] | 32 | }; | 
 | 33 |  | 
 | 34 | struct dmi_header { | 
 | 35 | 	u8 type; | 
 | 36 | 	u8 length; | 
 | 37 | 	u16 handle; | 
 | 38 | }; | 
 | 39 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | /* | 
 | 41 |  *	DMI callbacks for problem boards | 
 | 42 |  */ | 
 | 43 | struct dmi_strmatch { | 
 | 44 | 	u8 slot; | 
 | 45 | 	char *substr; | 
 | 46 | }; | 
 | 47 |  | 
 | 48 | struct dmi_system_id { | 
 | 49 | 	int (*callback)(struct dmi_system_id *); | 
| Andrey Panin | ebad6a4 | 2005-09-06 15:18:29 -0700 | [diff] [blame] | 50 | 	const char *ident; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | 	struct dmi_strmatch matches[4]; | 
 | 52 | 	void *driver_data; | 
 | 53 | }; | 
 | 54 |  | 
| Andrey Panin | ebad6a4 | 2005-09-06 15:18:29 -0700 | [diff] [blame] | 55 | #define DMI_MATCH(a, b)	{ a, b } | 
 | 56 |  | 
 | 57 | struct dmi_device { | 
 | 58 | 	struct list_head list; | 
 | 59 | 	int type; | 
 | 60 | 	const char *name; | 
 | 61 | 	void *device_data;	/* Type specific data */ | 
 | 62 | }; | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 63 |  | 
| Andi Kleen | e992867 | 2006-01-11 22:43:33 +0100 | [diff] [blame] | 64 | #ifdef CONFIG_DMI | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 65 |  | 
 | 66 | extern int dmi_check_system(struct dmi_system_id *list); | 
 | 67 | extern char * dmi_get_system_info(int field); | 
| Andrey Panin | ebad6a4 | 2005-09-06 15:18:29 -0700 | [diff] [blame] | 68 | extern struct dmi_device * dmi_find_device(int type, const char *name, | 
 | 69 | 	struct dmi_device *from); | 
| Andi Kleen | e992867 | 2006-01-11 22:43:33 +0100 | [diff] [blame] | 70 | extern void dmi_scan_machine(void); | 
| Andi Kleen | f083a32 | 2006-03-25 16:30:19 +0100 | [diff] [blame] | 71 | extern int dmi_get_year(int field); | 
| Andi Kleen | a1bae67 | 2006-10-21 18:37:02 +0200 | [diff] [blame] | 72 | extern int dmi_name_in_vendors(char *str); | 
| Andi Kleen | e992867 | 2006-01-11 22:43:33 +0100 | [diff] [blame] | 73 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 74 | #else | 
 | 75 |  | 
 | 76 | static inline int dmi_check_system(struct dmi_system_id *list) { return 0; } | 
 | 77 | static inline char * dmi_get_system_info(int field) { return NULL; } | 
| Andi Kleen | c47a316 | 2005-09-12 18:49:25 +0200 | [diff] [blame] | 78 | static inline struct dmi_device * dmi_find_device(int type, const char *name, | 
| Andrey Panin | ebad6a4 | 2005-09-06 15:18:29 -0700 | [diff] [blame] | 79 | 	struct dmi_device *from) { return NULL; } | 
| Andi Kleen | f083a32 | 2006-03-25 16:30:19 +0100 | [diff] [blame] | 80 | static inline int dmi_get_year(int year) { return 0; } | 
| Andi Kleen | a1bae67 | 2006-10-21 18:37:02 +0200 | [diff] [blame] | 81 | static inline int dmi_name_in_vendors(char *s) { return 0; } | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 82 |  | 
 | 83 | #endif | 
 | 84 |  | 
 | 85 | #endif	/* __DMI_H__ */ |