blob: b2cd2071d432d137b8d913134c21b0b93a920b25 [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,
Linus Torvalds1da177e2005-04-16 15:20:36 -070015 DMI_BOARD_VENDOR,
16 DMI_BOARD_NAME,
17 DMI_BOARD_VERSION,
18 DMI_STRING_MAX,
19};
20
Andrey Paninebad6a42005-09-06 15:18:29 -070021enum 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,
30 DMI_DEV_TYPE_IPMI = -1
31};
32
33struct dmi_header {
34 u8 type;
35 u8 length;
36 u16 handle;
37};
38
Linus Torvalds1da177e2005-04-16 15:20:36 -070039/*
40 * DMI callbacks for problem boards
41 */
42struct dmi_strmatch {
43 u8 slot;
44 char *substr;
45};
46
47struct dmi_system_id {
48 int (*callback)(struct dmi_system_id *);
Andrey Paninebad6a42005-09-06 15:18:29 -070049 const char *ident;
Linus Torvalds1da177e2005-04-16 15:20:36 -070050 struct dmi_strmatch matches[4];
51 void *driver_data;
52};
53
Andrey Paninebad6a42005-09-06 15:18:29 -070054#define DMI_MATCH(a, b) { a, b }
55
56struct dmi_device {
57 struct list_head list;
58 int type;
59 const char *name;
60 void *device_data; /* Type specific data */
61};
Linus Torvalds1da177e2005-04-16 15:20:36 -070062
Andi Kleene9928672006-01-11 22:43:33 +010063#ifdef CONFIG_DMI
Linus Torvalds1da177e2005-04-16 15:20:36 -070064
65extern int dmi_check_system(struct dmi_system_id *list);
66extern char * dmi_get_system_info(int field);
Andrey Paninebad6a42005-09-06 15:18:29 -070067extern struct dmi_device * dmi_find_device(int type, const char *name,
68 struct dmi_device *from);
Andi Kleene9928672006-01-11 22:43:33 +010069extern void dmi_scan_machine(void);
Andi Kleenf083a322006-03-25 16:30:19 +010070extern int dmi_get_year(int field);
Andi Kleene9928672006-01-11 22:43:33 +010071
Linus Torvalds1da177e2005-04-16 15:20:36 -070072#else
73
74static inline int dmi_check_system(struct dmi_system_id *list) { return 0; }
75static inline char * dmi_get_system_info(int field) { return NULL; }
Andi Kleenc47a3162005-09-12 18:49:25 +020076static inline struct dmi_device * dmi_find_device(int type, const char *name,
Andrey Paninebad6a42005-09-06 15:18:29 -070077 struct dmi_device *from) { return NULL; }
Andi Kleenf083a322006-03-25 16:30:19 +010078static inline int dmi_get_year(int year) { return 0; }
Linus Torvalds1da177e2005-04-16 15:20:36 -070079
80#endif
81
82#endif /* __DMI_H__ */