dmi.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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_PRODUCT_UUID,
  14. DMI_BOARD_VENDOR,
  15. DMI_BOARD_NAME,
  16. DMI_BOARD_VERSION,
  17. DMI_BOARD_SERIAL,
  18. DMI_BOARD_ASSET_TAG,
  19. DMI_CHASSIS_VENDOR,
  20. DMI_CHASSIS_TYPE,
  21. DMI_CHASSIS_VERSION,
  22. DMI_CHASSIS_SERIAL,
  23. DMI_CHASSIS_ASSET_TAG,
  24. DMI_STRING_MAX,
  25. };
  26. enum dmi_device_type {
  27. DMI_DEV_TYPE_ANY = 0,
  28. DMI_DEV_TYPE_OTHER,
  29. DMI_DEV_TYPE_UNKNOWN,
  30. DMI_DEV_TYPE_VIDEO,
  31. DMI_DEV_TYPE_SCSI,
  32. DMI_DEV_TYPE_ETHERNET,
  33. DMI_DEV_TYPE_TOKENRING,
  34. DMI_DEV_TYPE_SOUND,
  35. DMI_DEV_TYPE_IPMI = -1,
  36. DMI_DEV_TYPE_OEM_STRING = -2
  37. };
  38. struct dmi_header {
  39. u8 type;
  40. u8 length;
  41. u16 handle;
  42. };
  43. /*
  44. * DMI callbacks for problem boards
  45. */
  46. struct dmi_strmatch {
  47. u8 slot;
  48. char *substr;
  49. };
  50. struct dmi_system_id {
  51. int (*callback)(const struct dmi_system_id *);
  52. const char *ident;
  53. struct dmi_strmatch matches[4];
  54. void *driver_data;
  55. };
  56. #define DMI_MATCH(a, b) { a, b }
  57. struct dmi_device {
  58. struct list_head list;
  59. int type;
  60. const char *name;
  61. void *device_data; /* Type specific data */
  62. };
  63. #ifdef CONFIG_DMI
  64. extern int dmi_check_system(const struct dmi_system_id *list);
  65. extern const char * dmi_get_system_info(int field);
  66. extern const struct dmi_device * dmi_find_device(int type, const char *name,
  67. const struct dmi_device *from);
  68. extern void dmi_scan_machine(void);
  69. extern int dmi_get_year(int field);
  70. extern int dmi_name_in_vendors(const char *str);
  71. extern int dmi_available;
  72. extern char *dmi_get_slot(int slot);
  73. #else
  74. static inline int dmi_check_system(const struct dmi_system_id *list) { return 0; }
  75. static inline const char * dmi_get_system_info(int field) { return NULL; }
  76. static inline const struct dmi_device * dmi_find_device(int type, const char *name,
  77. const struct dmi_device *from) { return NULL; }
  78. static inline int dmi_get_year(int year) { return 0; }
  79. static inline int dmi_name_in_vendors(const char *s) { return 0; }
  80. #define dmi_available 0
  81. static inline char *dmi_get_slot(int slot) { return NULL; }
  82. #endif
  83. #endif /* __DMI_H__ */