blob: 34161907b2f8c2c397867468395541cf7b78d10b [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);
Alok Katariafd8cd7e2008-11-03 15:50:38 -080047extern int dmi_name_in_serial(const char *str);
Len Brown81b4e1f2008-01-16 17:20:37 -050048extern int dmi_available;
Jean Delvare7fce0842007-11-03 17:29:20 +010049extern int dmi_walk(void (*decode)(const struct dmi_header *));
Jiri Slabyd61c72e2008-12-10 14:07:21 +010050extern bool dmi_match(enum dmi_field f, const char *str);
Andi Kleene9928672006-01-11 22:43:33 +010051
Linus Torvalds1da177e2005-04-16 15:20:36 -070052#else
53
Jeff Garzik18552562007-10-03 15:15:40 -040054static inline int dmi_check_system(const struct dmi_system_id *list) { return 0; }
55static inline const char * dmi_get_system_info(int field) { return NULL; }
56static inline const struct dmi_device * dmi_find_device(int type, const char *name,
57 const struct dmi_device *from) { return NULL; }
Thomas Petazzoni7ae93922008-04-28 02:14:14 -070058static inline void dmi_scan_machine(void) { return; }
Andi Kleenf083a322006-03-25 16:30:19 +010059static inline int dmi_get_year(int year) { return 0; }
Jeff Garzik18552562007-10-03 15:15:40 -040060static inline int dmi_name_in_vendors(const char *s) { return 0; }
Alok Katariafd8cd7e2008-11-03 15:50:38 -080061static inline int dmi_name_in_serial(const char *s) { return 0; }
Len Brown81b4e1f2008-01-16 17:20:37 -050062#define dmi_available 0
Jean Delvare7fce0842007-11-03 17:29:20 +010063static inline int dmi_walk(void (*decode)(const struct dmi_header *))
64 { return -1; }
Jiri Slabyd61c72e2008-12-10 14:07:21 +010065static inline bool dmi_match(enum dmi_field f, const char *str)
66 { return false; }
Linus Torvalds1da177e2005-04-16 15:20:36 -070067
68#endif
69
70#endif /* __DMI_H__ */