blob: 64fd6c366604c08e4b7f53a2322cf731bba340ab [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>
Andi Kleene9928672006-01-11 22:43:33 +01005#include <linux/config.h>
Andrey Paninebad6a42005-09-06 15:18:29 -07006
Linus Torvalds1da177e2005-04-16 15:20:36 -07007enum dmi_field {
8 DMI_NONE,
9 DMI_BIOS_VENDOR,
10 DMI_BIOS_VERSION,
11 DMI_BIOS_DATE,
12 DMI_SYS_VENDOR,
13 DMI_PRODUCT_NAME,
14 DMI_PRODUCT_VERSION,
Dmitry Torokhove70c9d52005-06-25 14:54:25 -070015 DMI_PRODUCT_SERIAL,
Linus Torvalds1da177e2005-04-16 15:20:36 -070016 DMI_BOARD_VENDOR,
17 DMI_BOARD_NAME,
18 DMI_BOARD_VERSION,
19 DMI_STRING_MAX,
20};
21
Andrey Paninebad6a42005-09-06 15:18:29 -070022enum dmi_device_type {
23 DMI_DEV_TYPE_ANY = 0,
24 DMI_DEV_TYPE_OTHER,
25 DMI_DEV_TYPE_UNKNOWN,
26 DMI_DEV_TYPE_VIDEO,
27 DMI_DEV_TYPE_SCSI,
28 DMI_DEV_TYPE_ETHERNET,
29 DMI_DEV_TYPE_TOKENRING,
30 DMI_DEV_TYPE_SOUND,
31 DMI_DEV_TYPE_IPMI = -1
32};
33
34struct dmi_header {
35 u8 type;
36 u8 length;
37 u16 handle;
38};
39
Linus Torvalds1da177e2005-04-16 15:20:36 -070040/*
41 * DMI callbacks for problem boards
42 */
43struct dmi_strmatch {
44 u8 slot;
45 char *substr;
46};
47
48struct dmi_system_id {
49 int (*callback)(struct dmi_system_id *);
Andrey Paninebad6a42005-09-06 15:18:29 -070050 const char *ident;
Linus Torvalds1da177e2005-04-16 15:20:36 -070051 struct dmi_strmatch matches[4];
52 void *driver_data;
53};
54
Andrey Paninebad6a42005-09-06 15:18:29 -070055#define DMI_MATCH(a, b) { a, b }
56
57struct dmi_device {
58 struct list_head list;
59 int type;
60 const char *name;
61 void *device_data; /* Type specific data */
62};
Linus Torvalds1da177e2005-04-16 15:20:36 -070063
Andi Kleene9928672006-01-11 22:43:33 +010064#ifdef CONFIG_DMI
Linus Torvalds1da177e2005-04-16 15:20:36 -070065
66extern int dmi_check_system(struct dmi_system_id *list);
67extern char * dmi_get_system_info(int field);
Andrey Paninebad6a42005-09-06 15:18:29 -070068extern struct dmi_device * dmi_find_device(int type, const char *name,
69 struct dmi_device *from);
Andi Kleene9928672006-01-11 22:43:33 +010070extern void dmi_scan_machine(void);
Andi Kleenf083a322006-03-25 16:30:19 +010071extern int dmi_get_year(int field);
Andi Kleene9928672006-01-11 22:43:33 +010072
Linus Torvalds1da177e2005-04-16 15:20:36 -070073#else
74
75static inline int dmi_check_system(struct dmi_system_id *list) { return 0; }
76static inline char * dmi_get_system_info(int field) { return NULL; }
Andi Kleenc47a3162005-09-12 18:49:25 +020077static inline struct dmi_device * dmi_find_device(int type, const char *name,
Andrey Paninebad6a42005-09-06 15:18:29 -070078 struct dmi_device *from) { return NULL; }
Andi Kleenf083a322006-03-25 16:30:19 +010079static inline int dmi_get_year(int year) { return 0; }
Linus Torvalds1da177e2005-04-16 15:20:36 -070080
81#endif
82
83#endif /* __DMI_H__ */