blob: e5084eb5943a5f35fc82680e3a83103f19a46019 [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>
David Woodhoused945b692008-09-16 16:23:28 -07005#include <linux/mod_devicetable.h>
Andrey Paninebad6a42005-09-06 15:18:29 -07006
David Woodhoused945b692008-09-16 16:23:28 -07007/* enum dmi_field is in mod_devicetable.h */
Linus Torvalds1da177e2005-04-16 15:20:36 -07008
Andrey Paninebad6a42005-09-06 15:18:29 -07009enum dmi_device_type {
10 DMI_DEV_TYPE_ANY = 0,
11 DMI_DEV_TYPE_OTHER,
12 DMI_DEV_TYPE_UNKNOWN,
13 DMI_DEV_TYPE_VIDEO,
14 DMI_DEV_TYPE_SCSI,
15 DMI_DEV_TYPE_ETHERNET,
16 DMI_DEV_TYPE_TOKENRING,
17 DMI_DEV_TYPE_SOUND,
Wim Van Sebroeckb4bd7d52008-02-08 04:20:58 -080018 DMI_DEV_TYPE_PATA,
19 DMI_DEV_TYPE_SATA,
20 DMI_DEV_TYPE_SAS,
Shem Multinymous2e0c1f62006-09-29 01:59:37 -070021 DMI_DEV_TYPE_IPMI = -1,
Wim Van Sebroeckb4bd7d52008-02-08 04:20:58 -080022 DMI_DEV_TYPE_OEM_STRING = -2,
Andrey Paninebad6a42005-09-06 15:18:29 -070023};
24
25struct dmi_header {
26 u8 type;
27 u8 length;
28 u16 handle;
29};
30
Andrey Paninebad6a42005-09-06 15:18:29 -070031struct dmi_device {
32 struct list_head list;
33 int type;
34 const char *name;
35 void *device_data; /* Type specific data */
36};
Linus Torvalds1da177e2005-04-16 15:20:36 -070037
Andi Kleene9928672006-01-11 22:43:33 +010038#ifdef CONFIG_DMI
Linus Torvalds1da177e2005-04-16 15:20:36 -070039
Jeff Garzik18552562007-10-03 15:15:40 -040040extern int dmi_check_system(const struct dmi_system_id *list);
41extern const char * dmi_get_system_info(int field);
42extern const struct dmi_device * dmi_find_device(int type, const char *name,
43 const struct dmi_device *from);
Andi Kleene9928672006-01-11 22:43:33 +010044extern void dmi_scan_machine(void);
Andi Kleenf083a322006-03-25 16:30:19 +010045extern int dmi_get_year(int field);
Jeff Garzik18552562007-10-03 15:15:40 -040046extern int dmi_name_in_vendors(const char *str);
Len Brown81b4e1f2008-01-16 17:20:37 -050047extern int dmi_available;
Jean Delvare7fce0842007-11-03 17:29:20 +010048extern int dmi_walk(void (*decode)(const struct dmi_header *));
Andi Kleene9928672006-01-11 22:43:33 +010049
Linus Torvalds1da177e2005-04-16 15:20:36 -070050#else
51
Jeff Garzik18552562007-10-03 15:15:40 -040052static inline int dmi_check_system(const struct dmi_system_id *list) { return 0; }
53static inline const char * dmi_get_system_info(int field) { return NULL; }
54static inline const struct dmi_device * dmi_find_device(int type, const char *name,
55 const struct dmi_device *from) { return NULL; }
Thomas Petazzoni7ae93922008-04-28 02:14:14 -070056static inline void dmi_scan_machine(void) { return; }
Andi Kleenf083a322006-03-25 16:30:19 +010057static inline int dmi_get_year(int year) { return 0; }
Jeff Garzik18552562007-10-03 15:15:40 -040058static inline int dmi_name_in_vendors(const char *s) { return 0; }
Len Brown81b4e1f2008-01-16 17:20:37 -050059#define dmi_available 0
Jean Delvare7fce0842007-11-03 17:29:20 +010060static inline int dmi_walk(void (*decode)(const struct dmi_header *))
61 { return -1; }
Linus Torvalds1da177e2005-04-16 15:20:36 -070062
63#endif
64
65#endif /* __DMI_H__ */