dmi_firmware_inventory

Synopsis

#include <opendmi/entity/firmware-inventory.h>

typedef struct dmi_firmware_inventory {
    const char *name;
    const char *version;
    dmi_firmware_version_format_t version_format;
    const char *ident;
    dmi_firmware_ident_format_t ident_format;
    const char *release_date;
    const char *vendor;
    const char *lowest_version;
    dmi_size_t image_size;
    dmi_firmware_version_t parsed_version;
    dmi_firmware_version_t parsed_lowest_version;
    dmi_firmware_ident_t parsed_ident;
    dmi_firmware_inventory_chars_t characteristics;
    dmi_firmware_inventory_state_t state;
    size_t component_count;
    dmi_firmware_inventory_component_t *components;
} dmi_firmware_inventory_t;

Description

The dmi_firmware_inventory_t structure holds the decoded firmware inventory information structure (type 45) of SMBIOS: the name, version, identifier, vendor, release date, image size and state of one firmware component of the system, such as the platform firmware, the firmware of a BMC or the firmware of another device, together with the structures of the devices the firmware belongs to. A table carries one such structure for each firmware component.

The version strings and the identifier string are written in the formats the structure declares. The decoder parses them according to these formats into parsed_version, parsed_lowest_version and parsed_ident, and keeps the strings as they are.

The structure is returned by dmi_entity_info for the structures of type DMI_TYPE(firmware_inventory), and lives as long as the context it has been decoded in.

Fields

name

Name of the firmware component, for example "BMC Firmware", or nullptr if the structure has none.

version

Version of the firmware, written in the format version_format gives, or nullptr if the structure has none.

version_format

Format of version and lowest_version, see dmi_firmware_version_format.

ident

Identifier of the firmware, written in the format ident_format gives, or nullptr if the structure has none.

ident_format

Format of ident, see dmi_firmware_ident_format.

release_date

Release date of the firmware, as a date-time string in the format of DSP0266 (for example "2021-05-15T04:14:33+06:00", with a time of "T00:00:00Z" when the time is unknown), or nullptr if the structure has none.

vendor

Manufacturer or producer of the firmware, or nullptr if the structure has none.

lowest_version

Lowest version the firmware can be rolled back to, written in the format version_format gives, or nullptr if the structure has none.

image_size

Size of the firmware image currently programmed in the device, in bytes, or DMI_SIZE_MAX if unknown.

parsed_version

version parsed according to version_format, see dmi_firmware_version. Its format is DMI_FIRMWARE_VERSION_FORMAT_FREE if the string is absent or does not conform to the format.

parsed_lowest_version

lowest_version parsed according to version_format, see dmi_firmware_version.

parsed_ident

ident parsed according to ident_format, see dmi_firmware_ident.

characteristics

Characteristics of the firmware, see dmi_firmware_inventory_chars.

state

State of the firmware, see dmi_firmware_inventory_state.

component_count

Number of the elements of components: the number of associated components the structure declares, less the ones the data does not hold completely. 0 if the structure ends before the count.

components

Array of component_count components associated with the firmware, or nullptr if there are none, see dmi_firmware_inventory_component. These are the structures of the devices the firmware belongs to, such as system slots (type 9), memory devices (type 17), onboard devices (type 41) or TPM devices (type 43).

Examples

dmi_registry_t           *registry = dmi_get_registry(context);
dmi_entity_t             *entity   = dmi_registry_lookup_first(registry,
                                         DMI_TYPE(firmware_inventory), false);
dmi_firmware_inventory_t *firmware = dmi_entity_info(entity,
                                         DMI_TYPE(firmware_inventory));

if (firmware != nullptr) {
    printf("%s: %s\n", firmware->name ? firmware->name : "?",
           firmware->version ? firmware->version : "?");

    for (size_t i = 0; i < firmware->component_count; i++)
        printf("  component 0x%04X\n", firmware->components[i].handle);
}

Standards

DMTF SMBIOS Specification (DSP0134), version 3.5 or newer.