dmi.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. #else
  72. static inline int dmi_check_system(const struct dmi_system_id *list) { return 0; }
  73. static inline const char * dmi_get_system_info(int field) { return NULL; }
  74. static inline const struct dmi_device * dmi_find_device(int type, const char *name,
  75. const struct dmi_device *from) { return NULL; }
  76. static inline int dmi_get_year(int year) { return 0; }
  77. static inline int dmi_name_in_vendors(const char *s) { return 0; }
  78. #endif
  79. #endif /* __DMI_H__ */