blob: b8ac7b01c45e4964d25ac07cb5c23509ad21621a [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef __DMI_H__
2#define __DMI_H__
3
Andrey Paninebad6a42005-09-06 15:18:29 -07004#include <linux/list.h>
5
Linus Torvalds1da177e2005-04-16 15:20:36 -07006enum 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 Torokhove70c9d52005-06-25 14:54:25 -070014 DMI_PRODUCT_SERIAL,
Lennart Poettering4f5c7912007-05-08 22:07:02 +020015 DMI_PRODUCT_UUID,
Linus Torvalds1da177e2005-04-16 15:20:36 -070016 DMI_BOARD_VENDOR,
17 DMI_BOARD_NAME,
18 DMI_BOARD_VERSION,
Lennart Poettering4f5c7912007-05-08 22:07:02 +020019 DMI_BOARD_SERIAL,
20 DMI_BOARD_ASSET_TAG,
21 DMI_CHASSIS_VENDOR,
22 DMI_CHASSIS_TYPE,
23 DMI_CHASSIS_VERSION,
24 DMI_CHASSIS_SERIAL,
25 DMI_CHASSIS_ASSET_TAG,
Linus Torvalds1da177e2005-04-16 15:20:36 -070026 DMI_STRING_MAX,
27};
28
Andrey Paninebad6a42005-09-06 15:18:29 -070029enum dmi_device_type {
30 DMI_DEV_TYPE_ANY = 0,
31 DMI_DEV_TYPE_OTHER,
32 DMI_DEV_TYPE_UNKNOWN,
33 DMI_DEV_TYPE_VIDEO,
34 DMI_DEV_TYPE_SCSI,
35 DMI_DEV_TYPE_ETHERNET,
36 DMI_DEV_TYPE_TOKENRING,
37 DMI_DEV_TYPE_SOUND,
Shem Multinymous2e0c1f62006-09-29 01:59:37 -070038 DMI_DEV_TYPE_IPMI = -1,
39 DMI_DEV_TYPE_OEM_STRING = -2
Andrey Paninebad6a42005-09-06 15:18:29 -070040};
41
42struct dmi_header {
43 u8 type;
44 u8 length;
45 u16 handle;
46};
47
Linus Torvalds1da177e2005-04-16 15:20:36 -070048/*
49 * DMI callbacks for problem boards
50 */
51struct dmi_strmatch {
52 u8 slot;
53 char *substr;
54};
55
56struct dmi_system_id {
57 int (*callback)(struct dmi_system_id *);
Andrey Paninebad6a42005-09-06 15:18:29 -070058 const char *ident;
Linus Torvalds1da177e2005-04-16 15:20:36 -070059 struct dmi_strmatch matches[4];
60 void *driver_data;
61};
62
Andrey Paninebad6a42005-09-06 15:18:29 -070063#define DMI_MATCH(a, b) { a, b }
64
65struct dmi_device {
66 struct list_head list;
67 int type;
68 const char *name;
69 void *device_data; /* Type specific data */
70};
Linus Torvalds1da177e2005-04-16 15:20:36 -070071
Andi Kleene9928672006-01-11 22:43:33 +010072#ifdef CONFIG_DMI
Linus Torvalds1da177e2005-04-16 15:20:36 -070073
74extern int dmi_check_system(struct dmi_system_id *list);
75extern char * dmi_get_system_info(int field);
Andrey Paninebad6a42005-09-06 15:18:29 -070076extern struct dmi_device * dmi_find_device(int type, const char *name,
77 struct dmi_device *from);
Andi Kleene9928672006-01-11 22:43:33 +010078extern void dmi_scan_machine(void);
Andi Kleenf083a322006-03-25 16:30:19 +010079extern int dmi_get_year(int field);
Andi Kleena1bae672006-10-21 18:37:02 +020080extern int dmi_name_in_vendors(char *str);
Andi Kleene9928672006-01-11 22:43:33 +010081
Linus Torvalds1da177e2005-04-16 15:20:36 -070082#else
83
84static inline int dmi_check_system(struct dmi_system_id *list) { return 0; }
85static inline char * dmi_get_system_info(int field) { return NULL; }
Andi Kleenc47a3162005-09-12 18:49:25 +020086static inline struct dmi_device * dmi_find_device(int type, const char *name,
Andrey Paninebad6a42005-09-06 15:18:29 -070087 struct dmi_device *from) { return NULL; }
Andi Kleenf083a322006-03-25 16:30:19 +010088static inline int dmi_get_year(int year) { return 0; }
Andi Kleena1bae672006-10-21 18:37:02 +020089static inline int dmi_name_in_vendors(char *s) { return 0; }
Linus Torvalds1da177e2005-04-16 15:20:36 -070090
91#endif
92
93#endif /* __DMI_H__ */