Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

335 lines
8.2 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. smbios.h
  5. Abstract:
  6. This module contains definitions that describe SMBIOS
  7. Author:
  8. Alan Warwick (AlanWar) 12-Feb-1998
  9. Revision History:
  10. --*/
  11. #ifndef _SMBIOS_
  12. #define _SMBIOS_
  13. //
  14. // SMBIOS error codes
  15. #define DMI_SUCCESS 0x00
  16. #define DMI_UNKNOWN_FUNCTION 0x81
  17. #define DMI_FUNCTION_NOT_SUPPORTED 0x82
  18. #define DMI_INVALID_HANDLE 0x83
  19. #define DMI_BAD_PARAMETER 0x84
  20. #define DMI_INVALID_SUBFUNCTION 0x85
  21. #define DMI_NO_CHANGE 0x86
  22. #define DMI_ADD_STRUCTURE_FAILED 0x87
  23. // @@BEGIN_DDKSPLIT
  24. //
  25. // SMBIOS registry values
  26. #define SMBIOSPARENTKEYNAME L"\\Registry\\Machine\\Hardware\\Description\\System\\MultifunctionAdapter"
  27. #define SMBIOSIDENTIFIERVALUENAME L"Identifier"
  28. #ifdef _IA64_
  29. #define SMBIOSIDENTIFIERVALUEDATA L"SMBIOS"
  30. #else
  31. #define SMBIOSIDENTIFIERVALUEDATA L"PNP BIOS"
  32. #endif
  33. #define SMBIOSDATAVALUENAME L"Configuration Data"
  34. #define MAXSMBIOSKEYNAMESIZE 256
  35. // @@END_DDKSPLIT
  36. //
  37. // SMBIOS table search
  38. #define SMBIOS_EPS_SEARCH_SIZE 0x10000
  39. #define SMBIOS_EPS_SEARCH_START 0x000f0000
  40. #define SMBIOS_EPS_SEARCH_INCREMENT 0x10
  41. #include <pshpack1.h>
  42. typedef struct _SMBIOS_TABLE_HEADER
  43. {
  44. UCHAR Signature[4]; // _SM_ (ascii)
  45. UCHAR Checksum;
  46. UCHAR Length;
  47. UCHAR MajorVersion;
  48. UCHAR MinorVersion;
  49. USHORT MaximumStructureSize;
  50. UCHAR EntryPointRevision;
  51. UCHAR Reserved[5];
  52. UCHAR Signature2[5]; // _DMI_ (ascii)
  53. UCHAR IntermediateChecksum;
  54. USHORT StructureTableLength;
  55. ULONG StructureTableAddress;
  56. USHORT NumberStructures;
  57. UCHAR Revision;
  58. } SMBIOS_EPS_HEADER, *PSMBIOS_EPS_HEADER;
  59. #define SMBIOS_EPS_SIGNATURE '_MS_'
  60. #define DMI_EPS_SIGNATURE 'IMD_'
  61. typedef struct _SMBIOS_STRUCT_HEADER
  62. {
  63. UCHAR Type;
  64. UCHAR Length;
  65. USHORT Handle;
  66. UCHAR Data[];
  67. } SMBIOS_STRUCT_HEADER, *PSMBIOS_STRUCT_HEADER;
  68. typedef struct _DMIBIOS_TABLE_HEADER
  69. {
  70. UCHAR Signature2[5]; // _DMI_ (ascii)
  71. UCHAR IntermediateChecksum;
  72. USHORT StructureTableLength;
  73. ULONG StructureTableAddress;
  74. USHORT NumberStructures;
  75. UCHAR Revision;
  76. } DMIBIOS_EPS_HEADER, *PDMIBIOS_EPS_HEADER;
  77. //
  78. // Definitions for the SMBIOS table BIOS INFORMATION
  79. //
  80. #define SMBIOS_BIOS_INFORMATION_TYPE 0
  81. typedef struct _SMBIOS_BIOS_INFORMATION_STRUCT
  82. {
  83. UCHAR Type;
  84. UCHAR Length;
  85. USHORT Handle;
  86. UCHAR Vendor;
  87. UCHAR Version;
  88. USHORT StartingAddressSegment;
  89. UCHAR ReleaseDate;
  90. UCHAR RomSize;
  91. ULONG Characteristics0;
  92. ULONG Characteristics1;
  93. UCHAR CharacteristicsExtension;
  94. } SMBIOS_BIOS_INFORMATION_STRUCT, *PSMBIOS_BIOS_INFORMATION_STRUCT;
  95. //
  96. // Definitions for the SMBIOS table SYSTEM INFORMATION STRUCTURE
  97. //
  98. #define SMBIOS_SYSTEM_INFORMATION 1
  99. typedef struct _SMBIOS_SYSTEM_INFORMATION_STRUCT
  100. {
  101. UCHAR Type;
  102. UCHAR Length;
  103. USHORT Handle;
  104. UCHAR Manufacturer; // string
  105. UCHAR ProductName; // string
  106. UCHAR Version; // string
  107. UCHAR SerialNumber; // string
  108. UCHAR Uuid[16]; // SMBIOS 2.1+
  109. UCHAR WakeupType; // SMBIOS 2.1+
  110. } SMBIOS_SYSTEM_INFORMATION_STRUCT, *PSMBIOS_SYSTEM_INFORMATION_STRUCT;
  111. #define SMBIOS_SYSTEM_INFORMATION_LENGTH_20 8
  112. //
  113. // Definitions for the SMBIOS table BASE BOARD INFORMATION
  114. //
  115. #define SMBIOS_BASE_BOARD_INFORMATION_TYPE 2
  116. typedef struct _SMBIOS_BASE_BOARD_INFORMATION_STRUCT
  117. {
  118. UCHAR Type;
  119. UCHAR Length;
  120. USHORT Handle;
  121. UCHAR Manufacturer;
  122. UCHAR Product;
  123. UCHAR Version;
  124. UCHAR SerialNumber;
  125. } SMBIOS_BASE_BOARD_INFORMATION_STRUCT, *PSMBIOS_BASE_BOARD_INFORMATION_STRUCT;
  126. //
  127. // Definitions for the SMBIOS table BASE BOARD INFORMATION
  128. //
  129. #define SMBIOS_SYSTEM_CHASIS_INFORMATION_TYPE 3
  130. typedef struct _SMBIOS_SYSTEM_CHASIS_INFORMATION_STRUCT
  131. {
  132. UCHAR Type;
  133. UCHAR Length;
  134. USHORT Handle;
  135. UCHAR Manufacturer;
  136. UCHAR ChasisType;
  137. UCHAR Version;
  138. UCHAR SerialNumber;
  139. UCHAR AssetTagNumber;
  140. UCHAR BootUpState;
  141. UCHAR PowerSupplyState;
  142. UCHAR ThernalState;
  143. UCHAR SecurityStatus;
  144. ULONG OEMDefined;
  145. } SMBIOS_SYSTEM_CHASIS_INFORMATION_STRUCT, *PSMBIOS_SYSTEM_CHASIS_INFORMATION_STRUCT;
  146. //
  147. // Definitions for the SMBIOS table PROCESSOR INFORMATION
  148. //
  149. #define SMBIOS_PROCESSOR_INFORMATION_TYPE 4
  150. typedef struct _SMBIOS_PROCESSOR_INFORMATION_STRUCT
  151. {
  152. UCHAR Type;
  153. UCHAR Length;
  154. USHORT Handle;
  155. UCHAR SocketDesignation;
  156. UCHAR ProcessorType;
  157. UCHAR ProcessorFamily;
  158. UCHAR ProcessorManufacturer;
  159. ULONG ProcessorID0;
  160. ULONG ProcessorID1;
  161. UCHAR ProcessorVersion;
  162. UCHAR Voltage;
  163. USHORT ExternalClock;
  164. USHORT MaxSpeed;
  165. USHORT CurrentSpeed;
  166. UCHAR Status;
  167. UCHAR ProcessorUpgrade;
  168. USHORT L1CacheHandle;
  169. USHORT L2CacheHandle;
  170. USHORT L3CacheHandle;
  171. UCHAR SerialNumber;
  172. UCHAR AssetTag;
  173. } SMBIOS_PROCESSOR_INFORMATION_STRUCT, *PSMBIOS_PROCESSOR_INFORMATION_STRUCT;
  174. //
  175. // Definitions for the SMBIOS table SYSTEM EVENTLOG STRUCTURE
  176. #define SMBIOS_SYSTEM_EVENTLOG 15
  177. //
  178. // ENUM for AccessMethod
  179. //
  180. #define ACCESS_METHOD_INDEXIO_1 0
  181. #define ACCESS_METHOD_INDEXIO_2 1
  182. #define ACCESS_METHOD_INDEXIO_3 2
  183. #define ACCESS_METHOD_MEMMAP 3
  184. #define ACCESS_METHOD_GPNV 4
  185. typedef struct _LOGTYPEDESCRIPTOR
  186. {
  187. UCHAR LogType;
  188. UCHAR DataFormatType;
  189. } LOGTYPEDESCRIPTOR, *PLOGTYPEDESCRIPTOR;
  190. typedef struct _ACCESS_METHOD_ADDRESS
  191. {
  192. union
  193. {
  194. struct
  195. {
  196. USHORT IndexAddr;
  197. USHORT DataAddr;
  198. } IndexIo;
  199. ULONG PhysicalAddress32;
  200. USHORT GPNVHandle;
  201. } AccessMethodAddress;
  202. } ACCESS_METHOD_ADDRESS, *PACCESS_METHOD_ADDRESS;
  203. typedef struct _SMBIOS_SYSTEM_EVENTLOG_STRUCT
  204. {
  205. UCHAR Type;
  206. UCHAR Length;
  207. USHORT Handle;
  208. USHORT LogAreaLength;
  209. USHORT LogHeaderStartOffset;
  210. USHORT LogDataStartOffset;
  211. UCHAR AccessMethod;
  212. UCHAR LogStatus;
  213. ULONG LogChangeToken;
  214. ACCESS_METHOD_ADDRESS AccessMethodAddress;
  215. UCHAR LogHeaderFormat;
  216. UCHAR NumLogTypeDescriptors;
  217. UCHAR LenLogTypeDescriptors;
  218. LOGTYPEDESCRIPTOR LogTypeDescriptor[1];
  219. } SMBIOS_SYSTEM_EVENTLOG_STRUCT, *PSMBIOS_SYSTEM_EVENTLOG_STRUCT;
  220. #define SMBIOS_SYSTEM_EVENTLOG_LENGTH_20 0x14
  221. #define SMBIOS_SYSTEM_EVENTLOG_LENGTH (FIELD_OFFSET(SMBIOS_SYSTEM_EVENTLOG_STRUCT, LogTypeDescriptor))
  222. //
  223. // SYSID table search
  224. //
  225. #define SYSID_EPS_SEARCH_SIZE 0x20000
  226. #define SYSID_EPS_SEARCH_START 0x000e0000
  227. #define SYSID_EPS_SEARCH_INCREMENT 0x10
  228. #define SYSID_EPS_SIGNATURE 'SYS_'
  229. #define SYSID_EPS_SIGNATURE2 'DI'
  230. typedef struct _SYSID_EPS_HEADER
  231. {
  232. UCHAR Signature[7]; // _SYSID_ (ascii)
  233. UCHAR Checksum;
  234. USHORT Length; // Length of SYSID_EPS_HEADER
  235. ULONG SysIdTableAddress; // Physical Address of SYSID table
  236. USHORT SysIdCount; // Count of SYSIDs in table
  237. UCHAR BiosRev; // SYSID Bios revision
  238. } SYSID_EPS_HEADER, *PSYSID_EPS_HEADER;
  239. typedef struct _SYSID_TABLE_ENTRY
  240. {
  241. UCHAR Type[6]; // _UUID_ or _1394_ (ascii)
  242. UCHAR Checksum;
  243. USHORT Length; // Length of this table
  244. UCHAR Data[1]; // Variable length UUID/1394 data
  245. } SYSID_TABLE_ENTRY, *PSYSID_TABLE_ENTRY;
  246. #define SYSID_UUID_DATA_SIZE 16
  247. typedef struct _SYSID_UUID_ENTRY
  248. {
  249. UCHAR Type[6]; // _UUID_ (ascii)
  250. UCHAR Checksum;
  251. USHORT Length; // Length of this table
  252. UCHAR UUID[SYSID_UUID_DATA_SIZE]; // UUID
  253. } SYSID_UUID_ENTRY, *PSYSID_UUID_ENTRY;
  254. #define SYSID_1394_DATA_SIZE 8
  255. typedef struct _SYSID_1394_ENTRY
  256. {
  257. UCHAR Type[6]; // _1394_ (ascii)
  258. UCHAR Checksum;
  259. USHORT Length; // Length of this table
  260. UCHAR x1394Id[SYSID_1394_DATA_SIZE]; // 1394 ID
  261. } SYSID_1394_ENTRY, *PSYSID_1394_ENTRY;
  262. #define LARGEST_SYSID_TABLE_ENTRY (sizeof(SYSID_UUID_ENTRY))
  263. #define SYSID_TYPE_UUID "_UUID_"
  264. #define SYSID_TYPE_1394 "_1394_"
  265. #include <poppack.h>
  266. #endif