dmi_firmware
Synopsis
#include <opendmi/entity/firmware.h>
typedef struct dmi_firmware {
const char *vendor;
const char *version;
uint16_t bios_segment;
dmi_date_t release_date;
dmi_size_t rom_size;
dmi_firmware_features_t features;
dmi_firmware_features_ex_t features_ex;
dmi_version_t platform_version;
dmi_version_t controller_version;
} dmi_firmware_t;
Description
The dmi_firmware_t structure holds the decoded platform firmware
information structure (type 0) of SMBIOS: the vendor, version and release
date of the platform firmware (BIOS or UEFI), the size of the ROM holding it,
and the features it supports. A table has exactly one such structure.
The structure is returned by dmi_entity_info for the structures of type
DMI_TYPE(firmware), and lives as long as the context it has been decoded in.
The fields a structure is too short to carry are 0 or nullptr.
Fields
vendor-
Name of the firmware vendor, or
nullptr. version-
Firmware version, a free-form string, or
nullptr. bios_segment-
Segment of the starting address of the BIOS, for example 0xE800; the size of the runtime BIOS image is (0x10000 -
bios_segment) * 16 bytes. 0 where it does not apply, such as on UEFI systems. release_date-
Release date of the firmware, which the
dmi_date_year,dmi_date_monthanddmi_date_dayfunctions of<opendmi/utils/datetime.h>read.DMI_DATE_NONEif the structure carries no date, or one which cannot be parsed. Two-digit years are taken as 19xx. rom_size-
Size of the physical device(s) holding the firmware, in bytes, a multiple of 64 KiB. Sizes of 16 MiB and above are taken from the extended ROM size field, present since SMBIOS 3.1, in units of MiB or GiB; 0 if that field uses a reserved unit.
features-
Features the firmware supports, see
dmi_firmware_features. features_ex-
Extended features the firmware supports, see
dmi_firmware_features_ex. Present since SMBIOS 2.1. platform_version-
Major and minor release of the platform firmware, for example 10.22, which the
dmi_version_majoranddmi_version_minorfunctions of<opendmi/utils/version.h>read.DMI_VERSION_NONEif the system does not report it. Present since SMBIOS 2.4. controller_version-
Major and minor release of the embedded controller firmware.
DMI_VERSION_NONEif the system has no embedded controller firmware which can be upgraded in the field. Present since SMBIOS 2.4.
Examples
dmi_registry_t *registry = dmi_get_registry(context);
dmi_entity_t *entity = dmi_registry_lookup_first(registry,
DMI_TYPE(firmware),
false);
dmi_firmware_t *firmware = dmi_entity_info(entity, DMI_TYPE(firmware));
if ((firmware != nullptr) && (firmware->release_date != DMI_DATE_NONE))
printf("Firmware released on %04u-%02u-%02u\n",
dmi_date_year(firmware->release_date),
dmi_date_month(firmware->release_date),
dmi_date_day(firmware->release_date));