6. SMBIOS Protocol
6.1. EFI_SMBIOS_PROTOCOL
Summary
Allows consumers to log SMBIOS data records, and enables the producer to create the SMBIOS tables for a platform.
GUID
#define EFI_SMBIOS_PROTOCOL_GUID \\
{ 0x3583ff6, 0xcb36, 0x4940, { 0x94, 0x7e, 0xb9, 0xb3, 0x9f,\\
0x4a, 0xfa, 0xf7 } }
Protocol Interface Structure
typedef struct _EFI_SMBIOS_PROTOCOL {
EFI_SMBIOS_ADD *Add* ;
EFI_SMBIOS_UPDATE_STRING *UpdateString* ;
EFI_SMBIOS_REMOVE *Remove* ;
EFI_SMBIOS_GET_NEXT *GetNext* ;
UINT8 *MajorVersion* ;
UINT8 *MinorVersion* ;
} EFI_SMBIOS_PROTOCOL;
Member Description
- Add
Add an SMBIOS record including the formatted area and the optional strings that follow the formatted area.
- UpdateString
Update a string in the SMBIOS record.
- Remove
Remove an SMBIOS record.
- GetNext
Discover all SMBIOS records.
- MajorVersion
The major revision of the SMBIOS specification supported.
- MinorVersion
The minor revision of the SMBIOS specification supported.
Desscription
This protocol provides an interface to add, remove or discover SMBIOS records. The driver which produces this protocol is responsible for creating the SMBIOS data tables and installing the pointer to the tables in the EFI System Configuration Table.
The caller is responsible for only adding SMBIOS records that are valid for the SMBIOS MajorVersion and MinorVersion . When an enumerated SMBIOS field’s values are controlled by the DMTF, new values can be used as soon as they are defined by the DMTF without requiring an update to MajorVersion and MinorVersion .
The SMBIOS protocol can only be called a TPL < TPL_NOTIFY
.
6.2. EFI_SMBIOS_PROTOCOL.Add()
Summary
Add an SMBIOS record.
Prototype
typedef
EFI_STATUS
(EFIAPI \*EFI_SMBIOS_ADD) (
IN CONST EFI_SMBIOS_PROTOCOL *\*This* ,
IN EFI_HANDLE *ProducerHandle* , OPTIONAL
IN OUT EFI_SMBIOS_HANDLE *\*SmbiosHandle* ,
IN EFI_SMBIOS_TABLE_HEADER *\*Record*
);
Parameters
- This
The EFI_SMBIOS_PROTOCOL instance.
- ProducerHandle
The handle of the controller or driver associated with the SMBIOS information. NULL means no handle.
- SmbiosHandle
On entry, the handle of the SMBIOS record to add. If FFFEh, then a unique handle will be assigned to the SMBIOS record. If the SMBIOS handle is already in use, EFI_ALREADY_STARTED is returned and the SMBIOS record is not updated.
- Record
The data for the fixed portion of the SMBIOS record. The format of the record is determined by EFI_SMBIOS_TABLE_HEADER.*Type* . The size of the formatted area is defined by EFI_SMBIOS_TABLE_HEADER.*Length* and either followed by a double-null (0x0000) or a set of null terminated strings and a null.
Description
This function allows any agent to add SMBIOS records. The caller is responsible for ensuring Record is formatted in a way that matches the version of the SMBIOS specification as defined in the MajorRevision and MinorRevision fields of the EFI_SMBIOS_PROTOCOL .
Record must follow the SMBIOS structure evolution and usage guidelines in the SMBIOS specification. Record starts with the formatted area of the SMBIOS structure and the length is defined by EFI_SMBIOS_TABLE_HEADER. Length . Each SMBIOS structure is terminated by a double-null (0x0000), either directly following the formatted area (if no strings are present) or directly following the last string. The number of optional strings is not defined by the formatted area, but is fixed by the call to Add() . A string can be a place holder, but it must not be a NULL string as two NULL strings look like the double-null that terminates the structure.
*typedef UINT8 EFI_SMBIOS_TYPE;*
*typedef UINT16 EFI_SMBIOS_HANDLE;*
typedef struct {
EFI_SMBIOS_TYPE *Type* ;
UINT8 *Length* ;
EFI_SMBIOS_HANDLE *Handle* ;
} EFI_SMBIOS_TABLE_HEADER;
#define EFI_SMBIOS_TYPE_BIOS_INFORMATION 0
#define EFI_SMBIOS_TYPE_SYSTEM_INFORMATION 1
#define EFI_SMBIOS_TYPE_BASEBOARD_INFORMATION 2
#define EFI_SMBIOS_TYPE_SYSTEM_ENCLOSURE 3
#define EFI_SMBIOS_TYPE_PROCESSOR_INFORMATION 4
#define EFI_SMBIOS_TYPE_MEMORY_CONTROLLER_INFORMATION 5
#define EFI_SMBIOS_TYPE_MEMORY_MODULE_INFORMATON 6
#define EFI_SMBIOS_TYPE_CACHE_INFORMATION 7
#define EFI_SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION 8
#define EFI_SMBIOS_TYPE_SYSTEM_SLOTS 9
#define EFI_SMBIOS_TYPE_ONBOARD_DEVICE_INFORMATION 10
#define EFI_SMBIOS_TYPE_OEM_STRINGS 11
#define EFI_SMBIOS_TYPE_SYSTEM_CONFIGURATION_OPTIONS 12
#define EFI_SMBIOS_TYPE_BIOS_LANGUAGE_INFORMATION 13
#define EFI_SMBIOS_TYPE_GROUP_ASSOCIATIONS 14
#define EFI_SMBIOS_TYPE_SYSTEM_EVENT_LOG 15
#define EFI_SMBIOS_TYPE_PHYSICAL_MEMORY_ARRAY 16
#define EFI_SMBIOS_TYPE_MEMORY_DEVICE 17
#define EFI_SMBIOS_TYPE_32BIT_MEMORY_ERROR_INFORMATION 18
#define EFI_SMBIOS_TYPE_MEMORY_ARRAY_MAPPED_ADDRESS 19
#define EFI_SMBIOS_TYPE_MEMORY_DEVICE_MAPPED_ADDRESS 20
#define EFI_SMBIOS_TYPE_BUILT_IN_POINTING_DEVICE 21
#define EFI_SMBIOS_TYPE_PORTABLE_BATTERY 22
#define EFI_SMBIOS_TYPE_SYSTEM_RESET 23
#define EFI_SMBIOS_TYPE_HARDWARE_SECURITY 24
#define EFI_SMBIOS_TYPE_SYSTEM_POWER_CONTROLS 25
#define EFI_SMBIOS_TYPE_VOLTAGE_PROBE 26
#define EFI_SMBIOS_TYPE_COOLING_DEVICE 27
#define EFI_SMBIOS_TYPE_TEMPERATURE_PROBE 28
#define EFI_SMBIOS_TYPE_ELECTRICAL_CURRENT_PROBE 29
#define EFI_SMBIOS_TYPE_OUT_OF_BAND_REMOTE_ACCESS 30
#define EFI_SMBIOS_TYPE_BOOT_INTEGRITY_SERVICE 31
#define EFI_SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION 32
#define EFI_SMBIOS_TYPE_64BIT_MEMORY_ERROR_INFORMATION 33
#define EFI_SMBIOS_TYPE_MANAGEMENT_DEVICE 34
#define EFI_SMBIOS_TYPE_MANAGEMENT_DEVICE_COMPONENT 35
#define EFI_SMBIOS_TYPE_MANAGEMENT_DEVICE_THRESHOLD_DATA 36
#define EFI_SMBIOS_TYPE_MEMORY_CHANNEL 37
#define EFI_SMBIOS_TYPE_IPMI_DEVICE_INFORMATION 38
#define EFI_SMBIOS_TYPE_SYSTEM_POWER_SUPPLY 39
#define EFI_SMBIOS_TYPE_ADDITIONAL_INFORMATION 40
#define EFI_SMBIOS_TYPE_ONBOARD_DEVICES_EXTENDED_INFORMATION 41
#define EFI_SMBIOS_TYPE_MANAGEMENT_CONTROLLER_HOST_INTERFACE 42
#define EFI_SMBIOS_TYPE_INACTIVE 126
#define EFI_SMBIOS_TYPE_END_OF_TABLE 127
#define EFI_SMBIOS_OEM_BEGIN 128
#define EFI_SMBIOS_OEM_END 255
typedef UINT8 EFI_SMBIOS_STRING;
Note: These types are consistent with the DMTF SMBIOS 2.7 specification
Status Codes Returned
EFI_SUCCESS |
Record was added. |
EFI_OUT_OF_RESOURCES |
Record was not added. |
EFI_ALREADY_STARTED |
The SmbiosHandle passed in was already in use. |
6.3. EFI_SMBIOS_PROTOCOL.UpdateString()
Summary
Update the string associated with an existing SMBIOS record.
Prototype
typedef
EFI_STATUS
(EFIAPI \*EFI_SMBIOS_UPDATE_STRING) (
IN CONST EFI_SMBIOS_PROTOCOL *\*This* ,
IN EFI_SMBIOS_HANDLE *\*SmbiosHandle* ,
IN UINTN *\*StringNumber* ,
IN CHAR8 *\*String*
);
Parameters
- This
The EFI_SMBIOS_PROTOCOL instance.
- SmbiosHandle
SMBIOS Handle of structure that will have its string updated.
- StringNumber
The non-zero string number of the string to update
- String
Update the StringNumber string with String .
Description
This function allows the update of specific SMBIOS strings. The number of valid strings for any SMBIOS record is defined by how many strings were present when Add() was called.
Status Codes Returned
EFI_SUCCESS |
SmbiosHandle had its StringNumber String updated |
EFI_INVALID_PARAMETER |
SmbiosHandle does not exist |
EFI_UNSUPPORTED |
String was not added because it is longer than the SMBIOS Table supports |
EFI_NOT_FOUND |
The StringNumber is not valid for this SMBIOS record |
6.4. EFI_SMBIOS_PROTOCOL.Remove()
Summary
Remove an SMBIOS record.
Prototype
typedef
EFI_STATUS
(EFIAPI \*EFI_SMBIOS_REMOVE) (
IN CONST EFI_SMBIOS_PROTOCOL *\*This* ,
IN EFI_SMBIOS_HANDLE *SmbiosHandle*
);
Parameters
- This
The EFI_SMBIOS_PROTOCOL instance.
- SmbiosHandle
The handle of the SMBIOS record to remove.
Description
This function removes an SMBIOS record using the handle specified by SmbiosHandle.
Status Codes Returned
EFI_SUCCESS |
SMBIOS record was removed |
EFI_INVALID_PARAMETER |
SmbiosHandle does not specify a valid SMBIOS record |
6.5. EFI_SMBIOS_PROTOCOL.GetNext()
Summary
Allow the caller to discover all or some of the SMBIOS records.
Prototype
typedef
EFI_STATUS
(EFIAPI \*EFI_SMBIOS_GET_NEXT) (
IN CONST EFI_SMBIOS_PROTOCOL *\*This* ,
IN OUT EFI_SMBIOS_HANDLE *\*SmbiosHandle* ,
IN EFI_SMBIOS_TYPE *\*Type* , OPTIONAL
OUT EFI_SMBIOS_TABLE_HEADER *\**Record,*
OUT EFI_HANDLE *\*ProducerHandle* OPTIONAL
);
Parameters
- This
The EFI_SMBIOS_PROTOCOL instance.
- SmbiosHandle
On entry, points to the previous handle of the SMBIOS record. On exit, points to the next SMBIOS record handle. If it is FFFEh on entry, then the first SMBIOS record handle will be returned. If it returns FFFEh on exit, then there are no more SMBIOS records.
- Type
On entry, it points to the type of the next SMBIOS record to return. If NULL, it indicates that the next record of any type will be returned. Type is not modified by the this function.
- Record
On exit, points to a pointer to the the SMBIOS Record consisting of the formatted area followed by the unformatted area. The unformatted area optionally contains text strings.
- ProducerHandle
On exit, points to the ProducerHandle registered by Add() . If no ProducerHandle was passed into Add() NULL is returned. If a NULL pointer is passed in no data will be returned
Description
This function allows all of the SMBIOS records to be discovered. It’s possible to find only the SMBIOS records that match the optional Type argument.
Status Codes Returned
EFI_SUCCESS |
SMBIOS record information was successfully returned in Record . SmbiosHandle is the handle of the current SMBIOS record |
EFI_INVALID_PARAMETER |
The SMBIOS record with SmbiosHandle was the last available record. |