blob: 2a063b64133fcd23307e57b6b396fa935eb7c808 [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,
Wim Van Sebroeckb4bd7d52008-02-08 04:20:58 -080038 DMI_DEV_TYPE_PATA,
39 DMI_DEV_TYPE_SATA,
40 DMI_DEV_TYPE_SAS,
Shem Multinymous2e0c1f62006-09-29 01:59:37 -070041 DMI_DEV_TYPE_IPMI = -1,
Wim Van Sebroeckb4bd7d52008-02-08 04:20:58 -080042 DMI_DEV_TYPE_OEM_STRING = -2,
Andrey Paninebad6a42005-09-06 15:18:29 -070043};
44
45struct dmi_header {
46 u8 type;
47 u8 length;
48 u16 handle;
49};
50
Linus Torvalds1da177e2005-04-16 15:20:36 -070051/*
52 * DMI callbacks for problem boards
53 */
54struct dmi_strmatch {
55 u8 slot;
56 char *substr;
57};
58
59struct dmi_system_id {
Jeff Garzik18552562007-10-03 15:15:40 -040060 int (*callback)(const struct dmi_system_id *);
Andrey Paninebad6a42005-09-06 15:18:29 -070061 const char *ident;
Linus Torvalds1da177e2005-04-16 15:20:36 -070062 struct dmi_strmatch matches[4];
63 void *driver_data;
64};
65
Andrey Paninebad6a42005-09-06 15:18:29 -070066#define DMI_MATCH(a, b) { a, b }
67
68struct dmi_device {
69 struct list_head list;
70 int type;
71 const char *name;
72 void *device_data; /* Type specific data */
73};
Linus Torvalds1da177e2005-04-16 15:20:36 -070074
Andi Kleene9928672006-01-11 22:43:33 +010075#ifdef CONFIG_DMI
Linus Torvalds1da177e2005-04-16 15:20:36 -070076
Jeff Garzik18552562007-10-03 15:15:40 -040077extern int dmi_check_system(const struct dmi_system_id *list);
78extern const char * dmi_get_system_info(int field);
79extern const struct dmi_device * dmi_find_device(int type, const char *name,
80 const struct dmi_device *from);
Andi Kleene9928672006-01-11 22:43:33 +010081extern void dmi_scan_machine(void);
Andi Kleenf083a322006-03-25 16:30:19 +010082extern int dmi_get_year(int field);
Jeff Garzik18552562007-10-03 15:15:40 -040083extern int dmi_name_in_vendors(const char *str);
Len Brown81b4e1f2008-01-16 17:20:37 -050084extern int dmi_available;
Jean Delvare7fce0842007-11-03 17:29:20 +010085extern int dmi_walk(void (*decode)(const struct dmi_header *));
Andi Kleene9928672006-01-11 22:43:33 +010086
Linus Torvalds1da177e2005-04-16 15:20:36 -070087#else
88
Jeff Garzik18552562007-10-03 15:15:40 -040089static inline int dmi_check_system(const struct dmi_system_id *list) { return 0; }
90static inline const char * dmi_get_system_info(int field) { return NULL; }
91static inline const struct dmi_device * dmi_find_device(int type, const char *name,
92 const struct dmi_device *from) { return NULL; }
Thomas Petazzoni7ae93922008-04-28 02:14:14 -070093static inline void dmi_scan_machine(void) { return; }
Andi Kleenf083a322006-03-25 16:30:19 +010094static inline int dmi_get_year(int year) { return 0; }
Jeff Garzik18552562007-10-03 15:15:40 -040095static inline int dmi_name_in_vendors(const char *s) { return 0; }
Len Brown81b4e1f2008-01-16 17:20:37 -050096#define dmi_available 0
Jean Delvare7fce0842007-11-03 17:29:20 +010097static inline int dmi_walk(void (*decode)(const struct dmi_header *))
98 { return -1; }
Linus Torvalds1da177e2005-04-16 15:20:36 -070099
100#endif
101
102#endif /* __DMI_H__ */