Home | History | Annotate | Download | only in Protocol
      1 /** @file
      2   SMBIOS Protocol as defined in PI1.2 Specification VOLUME 5 Standard.
      3 
      4   SMBIOS protocol allows consumers to log SMBIOS data records, and enables the producer
      5   to create the SMBIOS tables for a platform.
      6 
      7   This protocol provides an interface to add, remove or discover SMBIOS records. The driver which
      8   produces this protocol is responsible for creating the SMBIOS data tables and installing the pointer
      9   to the tables in the EFI System Configuration Table.
     10   The caller is responsible for only adding SMBIOS records that are valid for the SMBIOS
     11   MajorVersion and MinorVersion. When an enumerated SMBIOS field's values are
     12   controlled by the DMTF, new values can be used as soon as they are defined by the DMTF without
     13   requiring an update to MajorVersion and MinorVersion.
     14   The SMBIOS protocol can only be called a TPL < TPL_NOTIFY.
     15 
     16   Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>
     17   This program and the accompanying materials
     18   are licensed and made available under the terms and conditions of the BSD License
     19   which accompanies this distribution.  The full text of the license may be found at
     20   http://opensource.org/licenses/bsd-license.php
     21 
     22   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
     23   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     24 
     25 **/
     26 
     27 #ifndef __SMBIOS_PROTOCOL_H__
     28 #define __SMBIOS_PROTOCOL_H__
     29 
     30 #include <IndustryStandard/SmBios.h>
     31 
     32 #define EFI_SMBIOS_PROTOCOL_GUID \
     33     { 0x3583ff6, 0xcb36, 0x4940, { 0x94, 0x7e, 0xb9, 0xb3, 0x9f, 0x4a, 0xfa, 0xf7 }}
     34 
     35 #define EFI_SMBIOS_TYPE_BIOS_INFORMATION                     SMBIOS_TYPE_BIOS_INFORMATION
     36 #define EFI_SMBIOS_TYPE_SYSTEM_INFORMATION                   SMBIOS_TYPE_SYSTEM_INFORMATION
     37 #define EFI_SMBIOS_TYPE_BASEBOARD_INFORMATION                SMBIOS_TYPE_BASEBOARD_INFORMATION
     38 #define EFI_SMBIOS_TYPE_SYSTEM_ENCLOSURE                     SMBIOS_TYPE_SYSTEM_ENCLOSURE
     39 #define EFI_SMBIOS_TYPE_PROCESSOR_INFORMATION                SMBIOS_TYPE_PROCESSOR_INFORMATION
     40 #define EFI_SMBIOS_TYPE_MEMORY_CONTROLLER_INFORMATION        SMBIOS_TYPE_MEMORY_CONTROLLER_INFORMATION
     41 #define EFI_SMBIOS_TYPE_MEMORY_MODULE_INFORMATON             SMBIOS_TYPE_MEMORY_MODULE_INFORMATON
     42 #define EFI_SMBIOS_TYPE_CACHE_INFORMATION                    SMBIOS_TYPE_CACHE_INFORMATION
     43 #define EFI_SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION           SMBIOS_TYPE_PORT_CONNECTOR_INFORMATION
     44 #define EFI_SMBIOS_TYPE_SYSTEM_SLOTS                         SMBIOS_TYPE_SYSTEM_SLOTS
     45 #define EFI_SMBIOS_TYPE_ONBOARD_DEVICE_INFORMATION           SMBIOS_TYPE_ONBOARD_DEVICE_INFORMATION
     46 #define EFI_SMBIOS_TYPE_OEM_STRINGS                          SMBIOS_TYPE_OEM_STRINGS
     47 #define EFI_SMBIOS_TYPE_SYSTEM_CONFIGURATION_OPTIONS         SMBIOS_TYPE_SYSTEM_CONFIGURATION_OPTIONS
     48 #define EFI_SMBIOS_TYPE_BIOS_LANGUAGE_INFORMATION            SMBIOS_TYPE_BIOS_LANGUAGE_INFORMATION
     49 #define EFI_SMBIOS_TYPE_GROUP_ASSOCIATIONS                   SMBIOS_TYPE_GROUP_ASSOCIATIONS
     50 #define EFI_SMBIOS_TYPE_SYSTEM_EVENT_LOG                     SMBIOS_TYPE_SYSTEM_EVENT_LOG
     51 #define EFI_SMBIOS_TYPE_PHYSICAL_MEMORY_ARRAY                SMBIOS_TYPE_PHYSICAL_MEMORY_ARRAY
     52 #define EFI_SMBIOS_TYPE_MEMORY_DEVICE                        SMBIOS_TYPE_MEMORY_DEVICE
     53 #define EFI_SMBIOS_TYPE_32BIT_MEMORY_ERROR_INFORMATION       SMBIOS_TYPE_32BIT_MEMORY_ERROR_INFORMATION
     54 #define EFI_SMBIOS_TYPE_MEMORY_ARRAY_MAPPED_ADDRESS          SMBIOS_TYPE_MEMORY_ARRAY_MAPPED_ADDRESS
     55 #define EFI_SMBIOS_TYPE_MEMORY_DEVICE_MAPPED_ADDRESS         SMBIOS_TYPE_MEMORY_DEVICE_MAPPED_ADDRESS
     56 #define EFI_SMBIOS_TYPE_BUILT_IN_POINTING_DEVICE             SMBIOS_TYPE_BUILT_IN_POINTING_DEVICE
     57 #define EFI_SMBIOS_TYPE_PORTABLE_BATTERY                     SMBIOS_TYPE_PORTABLE_BATTERY
     58 #define EFI_SMBIOS_TYPE_SYSTEM_RESET                         SMBIOS_TYPE_SYSTEM_RESET
     59 #define EFI_SMBIOS_TYPE_HARDWARE_SECURITY                    SMBIOS_TYPE_HARDWARE_SECURITY
     60 #define EFI_SMBIOS_TYPE_SYSTEM_POWER_CONTROLS                SMBIOS_TYPE_SYSTEM_POWER_CONTROLS
     61 #define EFI_SMBIOS_TYPE_VOLTAGE_PROBE                        SMBIOS_TYPE_VOLTAGE_PROBE
     62 #define EFI_SMBIOS_TYPE_COOLING_DEVICE                       SMBIOS_TYPE_COOLING_DEVICE
     63 #define EFI_SMBIOS_TYPE_TEMPERATURE_PROBE                    SMBIOS_TYPE_TEMPERATURE_PROBE
     64 #define EFI_SMBIOS_TYPE_ELECTRICAL_CURRENT_PROBE             SMBIOS_TYPE_ELECTRICAL_CURRENT_PROBE
     65 #define EFI_SMBIOS_TYPE_OUT_OF_BAND_REMOTE_ACCESS            SMBIOS_TYPE_OUT_OF_BAND_REMOTE_ACCESS
     66 #define EFI_SMBIOS_TYPE_BOOT_INTEGRITY_SERVICE               SMBIOS_TYPE_BOOT_INTEGRITY_SERVICE
     67 #define EFI_SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION              SMBIOS_TYPE_SYSTEM_BOOT_INFORMATION
     68 #define EFI_SMBIOS_TYPE_64BIT_MEMORY_ERROR_INFORMATION       SMBIOS_TYPE_64BIT_MEMORY_ERROR_INFORMATION
     69 #define EFI_SMBIOS_TYPE_MANAGEMENT_DEVICE                    SMBIOS_TYPE_MANAGEMENT_DEVICE
     70 #define EFI_SMBIOS_TYPE_MANAGEMENT_DEVICE_COMPONENT          SMBIOS_TYPE_MANAGEMENT_DEVICE_COMPONENT
     71 #define EFI_SMBIOS_TYPE_MANAGEMENT_DEVICE_THRESHOLD_DATA     SMBIOS_TYPE_MANAGEMENT_DEVICE_THRESHOLD_DATA
     72 #define EFI_SMBIOS_TYPE_MEMORY_CHANNEL                       SMBIOS_TYPE_MEMORY_CHANNEL
     73 #define EFI_SMBIOS_TYPE_IPMI_DEVICE_INFORMATION              SMBIOS_TYPE_IPMI_DEVICE_INFORMATION
     74 #define EFI_SMBIOS_TYPE_SYSTEM_POWER_SUPPLY                  SMBIOS_TYPE_SYSTEM_POWER_SUPPLY
     75 #define EFI_SMBIOS_TYPE_ADDITIONAL_INFORMATION               SMBIOS_TYPE_ADDITIONAL_INFORMATION
     76 #define EFI_SMBIOS_TYPE_ONBOARD_DEVICES_EXTENDED_INFORMATION SMBIOS_TYPE_ONBOARD_DEVICES_EXTENDED_INFORMATION
     77 #define EFI_SMBIOS_TYPE_MANAGEMENT_CONTROLLER_HOST_INTERFACE SMBIOS_TYPE_MANAGEMENT_CONTROLLER_HOST_INTERFACE
     78 #define EFI_SMBIOS_TYPE_INACTIVE                             SMBIOS_TYPE_INACTIVE
     79 #define EFI_SMBIOS_TYPE_END_OF_TABLE                         SMBIOS_TYPE_END_OF_TABLE
     80 #define EFI_SMBIOS_OEM_BEGIN                                 SMBIOS_OEM_BEGIN
     81 #define EFI_SMBIOS_OEM_END                                   SMBIOS_OEM_END
     82 
     83 typedef SMBIOS_TABLE_STRING EFI_SMBIOS_STRING;
     84 typedef SMBIOS_TYPE         EFI_SMBIOS_TYPE;
     85 typedef SMBIOS_HANDLE       EFI_SMBIOS_HANDLE;
     86 typedef SMBIOS_STRUCTURE    EFI_SMBIOS_TABLE_HEADER;
     87 
     88 typedef struct _EFI_SMBIOS_PROTOCOL EFI_SMBIOS_PROTOCOL;
     89 
     90 /**
     91   Add an SMBIOS record.
     92 
     93   This function allows any agent to add SMBIOS records. The caller is responsible for ensuring
     94   Record is formatted in a way that matches the version of the SMBIOS specification as defined in
     95   the MajorRevision and MinorRevision fields of the EFI_SMBIOS_PROTOCOL.
     96   Record must follow the SMBIOS structure evolution and usage guidelines in the SMBIOS
     97   specification. Record starts with the formatted area of the SMBIOS structure and the length is
     98   defined by EFI_SMBIOS_TABLE_HEADER.Length. Each SMBIOS structure is terminated by a
     99   double-null (0x0000), either directly following the formatted area (if no strings are present) or
    100   directly following the last string. The number of optional strings is not defined by the formatted area,
    101   but is fixed by the call to Add(). A string can be a place holder, but it must not be a NULL string as
    102   two NULL strings look like the double-null that terminates the structure.
    103 
    104   @param[in]        This                The EFI_SMBIOS_PROTOCOL instance.
    105   @param[in]        ProducerHandle      The handle of the controller or driver associated with the SMBIOS information. NULL means no handle.
    106   @param[in, out]   SmbiosHandle        On entry, the handle of the SMBIOS record to add. If FFFEh, then a unique handle
    107                                         will be assigned to the SMBIOS record. If the SMBIOS handle is already in use,
    108                                         EFI_ALREADY_STARTED is returned and the SMBIOS record is not updated.
    109   @param[in]        Record              The data for the fixed portion of the SMBIOS record. The format of the record is
    110                                         determined by EFI_SMBIOS_TABLE_HEADER.Type. The size of the formatted
    111                                         area is defined by EFI_SMBIOS_TABLE_HEADER.Length and either followed
    112                                         by a double-null (0x0000) or a set of null terminated strings and a null.
    113 
    114   @retval EFI_SUCCESS                   Record was added.
    115   @retval EFI_OUT_OF_RESOURCES          Record was not added.
    116   @retval EFI_ALREADY_STARTED           The SmbiosHandle passed in was already in use.
    117 **/
    118 typedef
    119 EFI_STATUS
    120 (EFIAPI *EFI_SMBIOS_ADD)(
    121   IN CONST      EFI_SMBIOS_PROTOCOL     *This,
    122   IN            EFI_HANDLE              ProducerHandle OPTIONAL,
    123   IN OUT        EFI_SMBIOS_HANDLE       *SmbiosHandle,
    124   IN            EFI_SMBIOS_TABLE_HEADER *Record
    125 );
    126 
    127 /**
    128   Update the string associated with an existing SMBIOS record.
    129 
    130   This function allows the update of specific SMBIOS strings. The number of valid strings for any
    131   SMBIOS record is defined by how many strings were present when Add() was called.
    132 
    133   @param[in]    This            The EFI_SMBIOS_PROTOCOL instance.
    134   @param[in]    SmbiosHandle    SMBIOS Handle of structure that will have its string updated.
    135   @param[in]    StringNumber    The non-zero string number of the string to update.
    136   @param[in]    String          Update the StringNumber string with String.
    137 
    138   @retval EFI_SUCCESS           SmbiosHandle had its StringNumber String updated.
    139   @retval EFI_INVALID_PARAMETER SmbiosHandle does not exist.
    140   @retval EFI_UNSUPPORTED       String was not added because it is longer than the SMBIOS Table supports.
    141   @retval EFI_NOT_FOUND         The StringNumber.is not valid for this SMBIOS record.
    142 **/
    143 typedef
    144 EFI_STATUS
    145 (EFIAPI *EFI_SMBIOS_UPDATE_STRING)(
    146    IN CONST EFI_SMBIOS_PROTOCOL *This,
    147    IN       EFI_SMBIOS_HANDLE   *SmbiosHandle,
    148    IN       UINTN               *StringNumber,
    149    IN       CHAR8               *String
    150 );
    151 
    152 /**
    153   Remove an SMBIOS record.
    154 
    155   This function removes an SMBIOS record using the handle specified by SmbiosHandle.
    156 
    157   @param[in]    This                The EFI_SMBIOS_PROTOCOL instance.
    158   @param[in]    SmbiosHandle        The handle of the SMBIOS record to remove.
    159 
    160   @retval EFI_SUCCESS               SMBIOS record was removed.
    161   @retval EFI_INVALID_PARAMETER     SmbiosHandle does not specify a valid SMBIOS record.
    162 **/
    163 typedef
    164 EFI_STATUS
    165 (EFIAPI *EFI_SMBIOS_REMOVE)(
    166    IN CONST EFI_SMBIOS_PROTOCOL *This,
    167    IN       EFI_SMBIOS_HANDLE   SmbiosHandle
    168 );
    169 
    170 /**
    171   Allow the caller to discover all or some of the SMBIOS records.
    172 
    173   This function allows all of the SMBIOS records to be discovered. It's possible to find
    174   only the SMBIOS records that match the optional Type argument.
    175 
    176   @param[in]        This            The EFI_SMBIOS_PROTOCOL instance.
    177   @param[in, out]   SmbiosHandle    On entry, points to the previous handle of the SMBIOS record. On exit, points to the
    178                                     next SMBIOS record handle. If it is FFFEh on entry, then the first SMBIOS record
    179                                     handle will be returned. If it returns FFFEh on exit, then there are no more SMBIOS records.
    180   @param[in]        Type            On entry, it points to the type of the next SMBIOS record to return. If NULL, it
    181                                     indicates that the next record of any type will be returned. Type is not
    182                                     modified by the this function.
    183   @param[out]       Record          On exit, points to a pointer to the the SMBIOS Record consisting of the formatted area
    184                                     followed by the unformatted area. The unformatted area optionally contains text strings.
    185   @param[out]       ProducerHandle  On exit, points to the ProducerHandle registered by Add(). If no
    186                                     ProducerHandle was passed into Add() NULL is returned. If a NULL pointer is
    187                                     passed in no data will be returned.
    188   @retval EFI_SUCCESS               SMBIOS record information was successfully returned in Record.
    189                                     SmbiosHandle is the handle of the current SMBIOS record
    190   @retval EFI_NOT_FOUND             The SMBIOS record with SmbiosHandle was the last available record.
    191 **/
    192 typedef
    193 EFI_STATUS
    194 (EFIAPI *EFI_SMBIOS_GET_NEXT)(
    195    IN     CONST EFI_SMBIOS_PROTOCOL     *This,
    196    IN OUT       EFI_SMBIOS_HANDLE       *SmbiosHandle,
    197    IN           EFI_SMBIOS_TYPE         *Type              OPTIONAL,
    198    OUT          EFI_SMBIOS_TABLE_HEADER **Record,
    199    OUT          EFI_HANDLE              *ProducerHandle    OPTIONAL
    200 );
    201 
    202 struct _EFI_SMBIOS_PROTOCOL {
    203   EFI_SMBIOS_ADD           Add;
    204   EFI_SMBIOS_UPDATE_STRING UpdateString;
    205   EFI_SMBIOS_REMOVE        Remove;
    206   EFI_SMBIOS_GET_NEXT      GetNext;
    207   UINT8                    MajorVersion;    ///< The major revision of the SMBIOS specification supported.
    208   UINT8                    MinorVersion;    ///< The minor revision of the SMBIOS specification supported.
    209 };
    210 
    211 extern EFI_GUID gEfiSmbiosProtocolGuid;
    212 
    213 #endif // __SMBIOS_PROTOCOL_H__
    214