]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/Smbios.h
MdePkg: Add UEFI2.5 EFI_NVM_EXPRESS_PASS_THRU_PROTOCOL definitions
[mirror_edk2.git] / MdePkg / Include / Protocol / Smbios.h
CommitLineData
6a0cd52d 1/** @file\r
2 SMBIOS Protocol as defined in PI1.2 Specification VOLUME 5 Standard.\r
3\r
4 SMBIOS protocol allows consumers to log SMBIOS data records, and enables the producer \r
5 to create the SMBIOS tables for a platform.\r
6\r
7 This protocol provides an interface to add, remove or discover SMBIOS records. The driver which\r
8 produces this protocol is responsible for creating the SMBIOS data tables and installing the pointer\r
9 to the tables in the EFI System Configuration Table.\r
10 The caller is responsible for only adding SMBIOS records that are valid for the SMBIOS\r
11 MajorVersion and MinorVersion. When an enumerated SMBIOS field's values are\r
12 controlled by the DMTF, new values can be used as soon as they are defined by the DMTF without\r
13 requiring an update to MajorVersion and MinorVersion.\r
14 The SMBIOS protocol can only be called a TPL < TPL_NOTIFY.\r
15\r
2002bf5d 16 Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
9df063a0 17 This program and the accompanying materials \r
6a0cd52d 18 are licensed and made available under the terms and conditions of the BSD License \r
19 which accompanies this distribution. The full text of the license may be found at \r
20 http://opensource.org/licenses/bsd-license.php \r
21\r
22 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
23 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
24\r
25**/\r
26\r
27#ifndef __SMBIOS_PROTOCOL_H__\r
28#define __SMBIOS_PROTOCOL_H__\r
29\r
30#define EFI_SMBIOS_PROTOCOL_GUID \\r
31 { 0x3583ff6, 0xcb36, 0x4940, { 0x94, 0x7e, 0xb9, 0xb3, 0x9f, 0x4a, 0xfa, 0xf7 }}\r
32 \r
33//\r
2002bf5d
SZ
34// SMBIOS type macros which is according to SMBIOS 2.7 specification.\r
35//\r
6a0cd52d 36#define EFI_SMBIOS_TYPE_BIOS_INFORMATION 0\r
37#define EFI_SMBIOS_TYPE_SYSTEM_INFORMATION 1\r
38#define EFI_SMBIOS_TYPE_BASEBOARD_INFORMATION 2\r
39#define EFI_SMBIOS_TYPE_SYSTEM_ENCLOSURE 3\r
40#define EFI_SMBIOS_TYPE_PROCESSOR_INFORMATION 4\r
41#define EFI_SMBIOS_TYPE_MEMORY_CONTROLLER_INFORMATION 5\r
42#define EFI_SMBIOS_TYPE_MEMORY_MODULE_INFORMATON 6\r
43#define EFI_SMBIOS_TYPE_CACHE_INFORMATION 7\r
44#define EFI_SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION 8\r
45#define EFI_SMBIOS_TYPE_SYSTEM_SLOTS 9\r
46#define EFI_SMBIOS_TYPE_ONBOARD_DEVICE_INFORMATION 10\r
47#define EFI_SMBIOS_TYPE_OEM_STRINGS 11\r
48#define EFI_SMBIOS_TYPE_SYSTEM_CONFIGURATION_OPTIONS 12\r
49#define EFI_SMBIOS_TYPE_BIOS_LANGUAGE_INFORMATION 13\r
50#define EFI_SMBIOS_TYPE_GROUP_ASSOCIATIONS 14\r
51#define EFI_SMBIOS_TYPE_SYSTEM_EVENT_LOG 15\r
52#define EFI_SMBIOS_TYPE_PHYSICAL_MEMORY_ARRAY 16\r
53#define EFI_SMBIOS_TYPE_MEMORY_DEVICE 17\r
54#define EFI_SMBIOS_TYPE_32BIT_MEMORY_ERROR_INFORMATION 18\r
55#define EFI_SMBIOS_TYPE_MEMORY_ARRAY_MAPPED_ADDRESS 19\r
56#define EFI_SMBIOS_TYPE_MEMORY_DEVICE_MAPPED_ADDRESS 20\r
57#define EFI_SMBIOS_TYPE_BUILT_IN_POINTING_DEVICE 21\r
58#define EFI_SMBIOS_TYPE_PORTABLE_BATTERY 22\r
59#define EFI_SMBIOS_TYPE_SYSTEM_RESET 23\r
60#define EFI_SMBIOS_TYPE_HARDWARE_SECURITY 24\r
61#define EFI_SMBIOS_TYPE_SYSTEM_POWER_CONTROLS 25\r
62#define EFI_SMBIOS_TYPE_VOLTAGE_PROBE 26\r
63#define EFI_SMBIOS_TYPE_COOLING_DEVICE 27\r
64#define EFI_SMBIOS_TYPE_TEMPERATURE_PROBE 28\r
65#define EFI_SMBIOS_TYPE_ELECTRICAL_CURRENT_PROBE 29\r
66#define EFI_SMBIOS_TYPE_OUT_OF_BAND_REMOTE_ACCESS 30\r
67#define EFI_SMBIOS_TYPE_BOOT_INTEGRITY_SERVICE 31\r
68#define EFI_SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION 32\r
69#define EFI_SMBIOS_TYPE_64BIT_MEMORY_ERROR_INFORMATION 33\r
70#define EFI_SMBIOS_TYPE_MANAGEMENT_DEVICE 34\r
71#define EFI_SMBIOS_TYPE_MANAGEMENT_DEVICE_COMPONENT 35\r
72#define EFI_SMBIOS_TYPE_MANAGEMENT_DEVICE_THRESHOLD_DATA 36\r
73#define EFI_SMBIOS_TYPE_MEMORY_CHANNEL 37\r
74#define EFI_SMBIOS_TYPE_IPMI_DEVICE_INFORMATION 38\r
75#define EFI_SMBIOS_TYPE_SYSTEM_POWER_SUPPLY 39\r
2002bf5d
SZ
76#define EFI_SMBIOS_TYPE_ADDITIONAL_INFORMATION 40\r
77#define EFI_SMBIOS_TYPE_ONBOARD_DEVICES_EXTENDED_INFORMATION 41\r
78#define EFI_SMBIOS_TYPE_MANAGEMENT_CONTROLLER_HOST_INTERFACE 42\r
6a0cd52d 79#define EFI_SMBIOS_TYPE_INACTIVE 126\r
80#define EFI_SMBIOS_TYPE_END_OF_TABLE 127\r
81#define EFI_SMBIOS_OEM_BEGIN 128\r
82#define EFI_SMBIOS_OEM_END 255\r
83\r
84///\r
85/// Text strings associated with a given SMBIOS structure are returned in the dmiStrucBuffer, appended directly after\r
86/// the formatted portion of the structure. This method of returning string information eliminates the need for\r
87/// application software to deal with pointers embedded in the SMBIOS structure. Each string is terminated with a null\r
88/// (00h) BYTE and the set of strings is terminated with an additional null (00h) BYTE. When the formatted portion of\r
17664848 89/// a SMBIOS structure references a string, it does so by specifying a non-zero string number within the structure's\r
6a0cd52d 90/// string-set. For example, if a string field contains 02h, it references the second string following the formatted portion\r
91/// of the SMBIOS structure. If a string field references no string, a null (0) is placed in that string field. If the\r
92/// formatted portion of the structure contains string-reference fields and all the string fields are set to 0 (no string\r
93/// references), the formatted section of the structure is followed by two null (00h) BYTES.\r
94///\r
95typedef UINT8 EFI_SMBIOS_STRING; \r
96\r
97///\r
98/// Types 0 through 127 (7Fh) are reserved for and defined by this\r
99/// specification. Types 128 through 256 (80h to FFh) are available for system- and OEM-specific information. \r
100///\r
101typedef UINT8 EFI_SMBIOS_TYPE;\r
102\r
103///\r
17664848 104/// Specifies the structure's handle, a unique 16-bit number in the range 0 to 0FFFEh (for version\r
6a0cd52d 105/// 2.0) or 0 to 0FEFFh (for version 2.1 and later). The handle can be used with the Get SMBIOS\r
106/// Structure function to retrieve a specific structure; the handle numbers are not required to be\r
107/// contiguous. For v2.1 and later, handle values in the range 0FF00h to 0FFFFh are reserved for\r
108/// use by this specification.\r
109/// If the system configuration changes, a previously assigned handle might no longer exist.\r
110/// However once a handle has been assigned by the BIOS, the BIOS cannot re-assign that handle\r
111/// number to another structure.\r
112///\r
113typedef UINT16 EFI_SMBIOS_HANDLE;\r
114 \r
115typedef struct {\r
116 EFI_SMBIOS_TYPE Type;\r
117 UINT8 Length;\r
118 EFI_SMBIOS_HANDLE Handle;\r
119} EFI_SMBIOS_TABLE_HEADER;\r
120 \r
121typedef struct _EFI_SMBIOS_PROTOCOL EFI_SMBIOS_PROTOCOL;\r
122\r
123/**\r
124 Add an SMBIOS record.\r
125 \r
126 This function allows any agent to add SMBIOS records. The caller is responsible for ensuring\r
127 Record is formatted in a way that matches the version of the SMBIOS specification as defined in\r
128 the MajorRevision and MinorRevision fields of the EFI_SMBIOS_PROTOCOL.\r
129 Record must follow the SMBIOS structure evolution and usage guidelines in the SMBIOS\r
130 specification. Record starts with the formatted area of the SMBIOS structure and the length is\r
131 defined by EFI_SMBIOS_TABLE_HEADER.Length. Each SMBIOS structure is terminated by a\r
132 double-null (0x0000), either directly following the formatted area (if no strings are present) or\r
133 directly following the last string. The number of optional strings is not defined by the formatted area,\r
134 but is fixed by the call to Add(). A string can be a place holder, but it must not be a NULL string as\r
135 two NULL strings look like the double-null that terminates the structure.\r
136 \r
137 @param[in] This The EFI_SMBIOS_PROTOCOL instance.\r
138 @param[in] ProducerHandle The handle of the controller or driver associated with the SMBIOS information. NULL means no handle.\r
eb2423c9
SZ
139 @param[in, out] SmbiosHandle On entry, the handle of the SMBIOS record to add. If FFFEh, then a unique handle\r
140 will be assigned to the SMBIOS record. If the SMBIOS handle is already in use,\r
6a0cd52d 141 EFI_ALREADY_STARTED is returned and the SMBIOS record is not updated.\r
142 @param[in] Record The data for the fixed portion of the SMBIOS record. The format of the record is\r
143 determined by EFI_SMBIOS_TABLE_HEADER.Type. The size of the formatted\r
144 area is defined by EFI_SMBIOS_TABLE_HEADER.Length and either followed\r
145 by a double-null (0x0000) or a set of null terminated strings and a null.\r
146 \r
147 @retval EFI_SUCCESS Record was added.\r
148 @retval EFI_OUT_OF_RESOURCES Record was not added.\r
149 @retval EFI_ALREADY_STARTED The SmbiosHandle passed in was already in use.\r
150**/\r
151typedef\r
152EFI_STATUS\r
153(EFIAPI *EFI_SMBIOS_ADD)(\r
154 IN CONST EFI_SMBIOS_PROTOCOL *This,\r
3e22fec9 155 IN EFI_HANDLE ProducerHandle OPTIONAL,\r
6a0cd52d 156 IN OUT EFI_SMBIOS_HANDLE *SmbiosHandle,\r
157 IN EFI_SMBIOS_TABLE_HEADER *Record\r
158);\r
159\r
160/**\r
161 Update the string associated with an existing SMBIOS record.\r
162 \r
163 This function allows the update of specific SMBIOS strings. The number of valid strings for any\r
164 SMBIOS record is defined by how many strings were present when Add() was called.\r
165 \r
166 @param[in] This The EFI_SMBIOS_PROTOCOL instance.\r
167 @param[in] SmbiosHandle SMBIOS Handle of structure that will have its string updated.\r
168 @param[in] StringNumber The non-zero string number of the string to update.\r
169 @param[in] String Update the StringNumber string with String.\r
170 \r
171 @retval EFI_SUCCESS SmbiosHandle had its StringNumber String updated.\r
172 @retval EFI_INVALID_PARAMETER SmbiosHandle does not exist.\r
eb2423c9 173 @retval EFI_UNSUPPORTED String was not added because it is longer than the SMBIOS Table supports.\r
6a0cd52d 174 @retval EFI_NOT_FOUND The StringNumber.is not valid for this SMBIOS record. \r
175**/\r
176typedef\r
177EFI_STATUS\r
178(EFIAPI *EFI_SMBIOS_UPDATE_STRING)(\r
179 IN CONST EFI_SMBIOS_PROTOCOL *This,\r
180 IN EFI_SMBIOS_HANDLE *SmbiosHandle,\r
181 IN UINTN *StringNumber,\r
182 IN CHAR8 *String\r
183);\r
184\r
185/**\r
186 Remove an SMBIOS record.\r
187 \r
188 This function removes an SMBIOS record using the handle specified by SmbiosHandle.\r
189 \r
190 @param[in] This The EFI_SMBIOS_PROTOCOL instance.\r
191 @param[in] SmbiosHandle The handle of the SMBIOS record to remove.\r
192 \r
193 @retval EFI_SUCCESS SMBIOS record was removed.\r
194 @retval EFI_INVALID_PARAMETER SmbiosHandle does not specify a valid SMBIOS record.\r
195**/\r
196typedef\r
197EFI_STATUS\r
198(EFIAPI *EFI_SMBIOS_REMOVE)(\r
199 IN CONST EFI_SMBIOS_PROTOCOL *This,\r
200 IN EFI_SMBIOS_HANDLE SmbiosHandle\r
201);\r
202\r
203/**\r
204 Allow the caller to discover all or some of the SMBIOS records.\r
205 \r
206 This function allows all of the SMBIOS records to be discovered. It's possible to find\r
207 only the SMBIOS records that match the optional Type argument.\r
208 \r
209 @param[in] This The EFI_SMBIOS_PROTOCOL instance.\r
210 @param[in, out] SmbiosHandle On entry, points to the previous handle of the SMBIOS record. On exit, points to the\r
eb2423c9
SZ
211 next SMBIOS record handle. If it is FFFEh on entry, then the first SMBIOS record\r
212 handle will be returned. If it returns FFFEh on exit, then there are no more SMBIOS records.\r
6a0cd52d 213 @param[in] Type On entry, it points to the type of the next SMBIOS record to return. If NULL, it\r
214 indicates that the next record of any type will be returned. Type is not\r
215 modified by the this function.\r
216 @param[out] Record On exit, points to a pointer to the the SMBIOS Record consisting of the formatted area\r
217 followed by the unformatted area. The unformatted area optionally contains text strings.\r
218 @param[out] ProducerHandle On exit, points to the ProducerHandle registered by Add(). If no\r
219 ProducerHandle was passed into Add() NULL is returned. If a NULL pointer is\r
220 passed in no data will be returned.\r
221 @retval EFI_SUCCESS SMBIOS record information was successfully returned in Record.\r
222 SmbiosHandle is the handle of the current SMBIOS record\r
223 @retval EFI_NOT_FOUND The SMBIOS record with SmbiosHandle was the last available record.\r
224**/\r
225typedef\r
226EFI_STATUS\r
227(EFIAPI *EFI_SMBIOS_GET_NEXT)(\r
228 IN CONST EFI_SMBIOS_PROTOCOL *This,\r
229 IN OUT EFI_SMBIOS_HANDLE *SmbiosHandle,\r
3e22fec9 230 IN EFI_SMBIOS_TYPE *Type OPTIONAL,\r
6a0cd52d 231 OUT EFI_SMBIOS_TABLE_HEADER **Record,\r
3e22fec9 232 OUT EFI_HANDLE *ProducerHandle OPTIONAL\r
6a0cd52d 233);\r
234\r
235struct _EFI_SMBIOS_PROTOCOL {\r
236 EFI_SMBIOS_ADD Add;\r
237 EFI_SMBIOS_UPDATE_STRING UpdateString;\r
238 EFI_SMBIOS_REMOVE Remove;\r
239 EFI_SMBIOS_GET_NEXT GetNext;\r
240 UINT8 MajorVersion; ///< The major revision of the SMBIOS specification supported.\r
241 UINT8 MinorVersion; ///< The minor revision of the SMBIOS specification supported.\r
242};\r
243 \r
244extern EFI_GUID gEfiSmbiosProtocolGuid;\r
245 \r
246#endif // __SMBIOS_PROTOCOL_H__\r