Leaked source code of windows server 2003
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.

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