dmi.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. #ifndef __DMI_H__
  2. #define __DMI_H__
  3. #include <linux/list.h>
  4. enum dmi_field {
  5. DMI_NONE,
  6. DMI_BIOS_VENDOR,
  7. DMI_BIOS_VERSION,
  8. DMI_BIOS_DATE,
  9. DMI_SYS_VENDOR,
  10. DMI_PRODUCT_NAME,
  11. DMI_PRODUCT_VERSION,
  12. DMI_PRODUCT_SERIAL,
  13. DMI_BOARD_VENDOR,
  14. DMI_BOARD_NAME,
  15. DMI_BOARD_VERSION,
  16. DMI_STRING_MAX,
  17. };
  18. enum dmi_device_type {
  19. DMI_DEV_TYPE_ANY = 0,
  20. DMI_DEV_TYPE_OTHER,
  21. DMI_DEV_TYPE_UNKNOWN,
  22. DMI_DEV_TYPE_VIDEO,
  23. DMI_DEV_TYPE_SCSI,
  24. DMI_DEV_TYPE_ETHERNET,
  25. DMI_DEV_TYPE_TOKENRING,
  26. DMI_DEV_TYPE_SOUND,
  27. DMI_DEV_TYPE_IPMI = -1,
  28. DMI_DEV_TYPE_OEM_STRING = -2
  29. };
  30. struct dmi_header {
  31. u8 type;
  32. u8 length;
  33. u16 handle;
  34. };
  35. /*
  36. * DMI callbacks for problem boards
  37. */
  38. struct dmi_strmatch {
  39. u8 slot;
  40. char *substr;
  41. };
  42. struct dmi_system_id {
  43. int (*callback)(struct dmi_system_id *);
  44. const char *ident;
  45. struct dmi_strmatch matches[4];
  46. void *driver_data;
  47. };
  48. #define DMI_MATCH(a, b) { a, b }
  49. struct dmi_device {
  50. struct list_head list;
  51. int type;
  52. const char *name;
  53. void *device_data; /* Type specific data */
  54. };
  55. #ifdef CONFIG_DMI
  56. extern int dmi_check_system(struct dmi_system_id *list);
  57. extern char * dmi_get_system_info(int field);
  58. extern struct dmi_device * dmi_find_device(int type, const char *name,
  59. struct dmi_device *from);
  60. extern void dmi_scan_machine(void);
  61. extern int dmi_get_year(int field);
  62. extern int dmi_name_in_vendors(char *str);
  63. #else
  64. static inline int dmi_check_system(struct dmi_system_id *list) { return 0; }
  65. static inline char * dmi_get_system_info(int field) { return NULL; }
  66. static inline struct dmi_device * dmi_find_device(int type, const char *name,
  67. struct dmi_device *from) { return NULL; }
  68. static inline int dmi_get_year(int year) { return 0; }
  69. static inline int dmi_name_in_vendors(char *s) { return 0; }
  70. #endif
  71. #endif /* __DMI_H__ */