dmi_ipmi_device
Synopsis
#include <opendmi/entity/ipmi-device.h>
typedef struct dmi_ipmi_device {
dmi_ipmi_iface_type_t interface_type;
dmi_version_t specification_version;
dmi_i2c_addr_t i2c_target_address;
uint8_t nv_storage_address;
dmi_size_t base_address;
dmi_ipmi_addr_type_t base_address_type;
bool base_address_lsb;
dmi_ipmi_intr_trigger_mode_t interrupt_trigger_mode;
dmi_ipmi_intr_polarity_t interrupt_polarity;
unsigned short register_spacing;
unsigned short interrupt_number;
} dmi_ipmi_device_t;
Description
The dmi_ipmi_device_t structure holds the decoded IPMI device information
structure (type 38) of SMBIOS: it describes the baseboard management
controller (BMC) of the Intelligent Platform Management Interface (IPMI), and
how software reaches its system interface. The IPMI specifications tell how
to use this information.
The byte which follows the base address in the structure, holding the base
address modifier and the interrupt information, is spread over the
base_address_lsb, register_spacing, interrupt_trigger_mode and interrupt_polarity
fields; see dmi_ipmi_device_details for its layout.
The structure is returned by dmi_entity_info for the structures of type
DMI_TYPE(ipmi_device), and lives as long as the context it has been decoded
in.
Fields
interface_type-
Type of the system interface of the BMC, see
dmi_ipmi_iface_type. specification_version-
Revision of the IPMI specification the BMC has been designed for, such as 1.5 or 2.0. The structure stores the major revision in the high nibble and the minor one in the low nibble; use
dmi_version_majoranddmi_version_minorto read it. i2c_target_address-
Target address of the BMC on the I2C bus, as stored.
nv_storage_address-
Bus ID of the non-volatile storage device of the BMC,
UINT8_MAX(0xFF) if the BMC has none. base_address-
Base address of the BMC. For the memory and I/O address spaces, this is the full address, with its least-significant bit taken from the base address modifier;
base_address_typetells which space it is in. For the SSIF interface, it is the 7-bit SMBus target address of the BMC. base_address_type-
Address space of
base_address, seedmi_ipmi_addr_type:DMI_IPMI_ADDR_TYPE_SMBUSfor the SSIF interface, otherwise memory or I/O space, as the least-significant bit of the stored address says. base_address_lsb-
Least-significant bit of the base address, as given by the base address modifier.
interrupt_trigger_mode-
Trigger mode of the interrupt of the system interface, see
dmi_ipmi_intr_trigger_mode;DMI_IPMI_INTR_TRIGGER_MODE_UNSPECwhen the structure does not specify the interrupt information. interrupt_polarity-
Polarity of the interrupt of the system interface, see
dmi_ipmi_intr_polarity;DMI_IPMI_INTR_POLARITY_UNSPECwhen the structure does not specify the interrupt information. register_spacing-
Distance between the interface registers, in bytes: 1, 4 or 16, or 0 when the structure holds the reserved code.
interrupt_number-
Interrupt number of the system interface, 0 if it is unspecified or not supported.
Examples
dmi_registry_t *registry = dmi_get_registry(context);
dmi_entity_t *entity = dmi_registry_lookup_first(registry,
DMI_TYPE(ipmi_device), false);
dmi_ipmi_device_t *ipmi = dmi_entity_info(entity, DMI_TYPE(ipmi_device));
if (ipmi != nullptr) {
const char *interface = dmi_ipmi_iface_type_name(ipmi->interface_type);
printf("IPMI %u.%u, %s interface at 0x%llx (%s)\n",
dmi_version_major(ipmi->specification_version),
dmi_version_minor(ipmi->specification_version),
interface != nullptr ? interface : "unknown",
(unsigned long long)ipmi->base_address,
dmi_ipmi_addr_type_name(ipmi->base_address_type));
}