Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu
[pandora-kernel.git] / include / linux / dmi.h
1 #ifndef __DMI_H__
2 #define __DMI_H__
3
4 #include <linux/list.h>
5 #include <linux/mod_devicetable.h>
6
7 /* enum dmi_field is in mod_devicetable.h */
8
9 enum 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,
18         DMI_DEV_TYPE_PATA,
19         DMI_DEV_TYPE_SATA,
20         DMI_DEV_TYPE_SAS,
21         DMI_DEV_TYPE_IPMI = -1,
22         DMI_DEV_TYPE_OEM_STRING = -2,
23         DMI_DEV_TYPE_DEV_ONBOARD = -3,
24 };
25
26 struct dmi_header {
27         u8 type;
28         u8 length;
29         u16 handle;
30 };
31
32 struct dmi_device {
33         struct list_head list;
34         int type;
35         const char *name;
36         void *device_data;      /* Type specific data */
37 };
38
39 #ifdef CONFIG_DMI
40
41 struct dmi_dev_onboard {
42         struct dmi_device dev;
43         int instance;
44         int segment;
45         int bus;
46         int devfn;
47 };
48
49 extern int dmi_check_system(const struct dmi_system_id *list);
50 const struct dmi_system_id *dmi_first_match(const struct dmi_system_id *list);
51 extern const char * dmi_get_system_info(int field);
52 extern const struct dmi_device * dmi_find_device(int type, const char *name,
53         const struct dmi_device *from);
54 extern void dmi_scan_machine(void);
55 extern bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp);
56 extern int dmi_name_in_vendors(const char *str);
57 extern int dmi_name_in_serial(const char *str);
58 extern int dmi_available;
59 extern int dmi_walk(void (*decode)(const struct dmi_header *, void *),
60         void *private_data);
61 extern bool dmi_match(enum dmi_field f, const char *str);
62
63 #else
64
65 static inline int dmi_check_system(const struct dmi_system_id *list) { return 0; }
66 static inline const char * dmi_get_system_info(int field) { return NULL; }
67 static inline const struct dmi_device * dmi_find_device(int type, const char *name,
68         const struct dmi_device *from) { return NULL; }
69 static inline void dmi_scan_machine(void) { return; }
70 static inline bool dmi_get_date(int field, int *yearp, int *monthp, int *dayp)
71 {
72         if (yearp)
73                 *yearp = 0;
74         if (monthp)
75                 *monthp = 0;
76         if (dayp)
77                 *dayp = 0;
78         return false;
79 }
80 static inline int dmi_name_in_vendors(const char *s) { return 0; }
81 static inline int dmi_name_in_serial(const char *s) { return 0; }
82 #define dmi_available 0
83 static inline int dmi_walk(void (*decode)(const struct dmi_header *, void *),
84         void *private_data) { return -1; }
85 static inline bool dmi_match(enum dmi_field f, const char *str)
86         { return false; }
87 static inline const struct dmi_system_id *
88         dmi_first_match(const struct dmi_system_id *list) { return NULL; }
89
90 #endif
91
92 #endif  /* __DMI_H__ */