Device API

Overview

These APIs are for device More…

// global functions

XPUM_API xpum_result_t xpumGetDeviceList(
    xpum_device_basic_info deviceList[],
    int* count
    );

XPUM_API xpum_result_t xpumGetDeviceProperties(
    xpum_device_id_t deviceId,
    xpum_device_properties_t* pXpumProperties
    );

XPUM_API const char* getXpumDevicePropertyNameString(xpum_device_property_name_t name);

XPUM_API xpum_result_t xpumGetDeviceIdByBDF(
    const char* bdf,
    xpum_device_id_t* deviceId
    );

XPUM_API xpum_result_t xpumGetAMCFirmwareVersions(
    xpum_amc_fw_version_t versionList[],
    int* count,
    const char* username,
    const char* password
    );

XPUM_API xpum_result_t xpumGetAMCFirmwareVersionsErrorMsg(
    char* buffer,
    int* count
    );

XPUM_API xpum_result_t xpumGetSerialNumberAndAmcFwVersion(
    xpum_device_id_t deviceId,
    const char* username,
    const char* password,
    char serialNumber[XPUM_MAX_STR_LENGTH],
    char amcFwVersion[XPUM_MAX_STR_LENGTH]
    );

Detailed Documentation

These APIs are for device

Global Functions

XPUM_API xpum_result_t xpumGetDeviceList(
    xpum_device_basic_info deviceList[],
    int* count
    )

Get all device basic info.

This method is used to get identifiers corresponding to all the devices on the system. The identifier represents device id corresponding to each device on the system and is immutable during the lifespan of the engine. The list should be queried again if the engine is restarted.

Support Platform: Linux, Windows

Parameters:

deviceList

OUT: The array to store device infos

count

IN/OUT: When deviceList is NULL, count will be filled with the number of

available devices, and return.

When deviceList is not NULL, count denotes the length of deviceList,

count should be equal to or larger than the number of available devices,

when return, the count will store real number of devices returned by

deviceList

Returns:

xpum_result_t

XPUM_API xpum_result_t xpumGetDeviceProperties(
    xpum_device_id_t deviceId,
    xpum_device_properties_t* pXpumProperties
    )

Get device properties corresponding to the deviceId.

Support Platform: Linux, Windows

Parameters:

deviceId

IN: Device id

pXpumProperties

OUT: Device properties

Returns:

xpum_result_t

XPUM_API const char* getXpumDevicePropertyNameString(xpum_device_property_name_t name)

Get device property name string.

Support Platform: Linux, Windows

Parameters:

name

IN: Device property name enum value

Returns:

const char*

XPUM_API xpum_result_t xpumGetDeviceIdByBDF(
    const char* bdf,
    xpum_device_id_t* deviceId
    )

Get device id corresponding to the PCI BDF address.

Support Platform: Linux, Windows

Parameters:

bdf

IN: The PCI BDF address string

deviceId

OUT: Device id

Returns:

xpum_result_t

XPUM_API xpum_result_t xpumGetAMCFirmwareVersions(
    xpum_amc_fw_version_t versionList[],
    int* count,
    const char* username,
    const char* password
    )

Get all AMC firmware versions.

Support Platform: Linux, Windows

Parameters:

versionList

IN/OUT: The array to store AMC firmware version

count

IN/OUT: When versionList is NULL, count will be filled with the number of AMC firmware versions, and return. When versionList is not NULL, count denotes the length of versionList, count should be equal to or larger than the number of AMC firmware versions, when return, the count will store real number of AMC firmware versions returned by versionList

username

IN: Username used for redfish host authentication

password

IN: Password used for redfish host authentication

Returns:

xpum_result_t

XPUM_API xpum_result_t xpumGetAMCFirmwareVersionsErrorMsg(
    char* buffer,
    int* count
    )

Get error message when fail to get amc firmware versions.

Support Platform: Linux

Parameters:

buffer

IN/OUT: The buffer to store error message

count

IN/OUT: When buffer is NULL, count will be filled with the length of buffer needed, and return. When buffer is not NULL, count denotes the length of buffer, count should be equal to or larger than needed length, if not, it will return XPUM_BUFFER_TOO_SMALL; if return successfully, the error message will be stored in buffer

Returns:

xpum_result_t

XPUM_API xpum_result_t xpumGetSerialNumberAndAmcFwVersion(
    xpum_device_id_t deviceId,
    const char* username,
    const char* password,
    char serialNumber[XPUM_MAX_STR_LENGTH],
    char amcFwVersion[XPUM_MAX_STR_LENGTH]
    )

Get device serial number from AMC.

Support Platform: Linux

Parameters:

deviceId

IN: Device id

username

IN: Username used for redfish host authentication

password

IN: Password used for redfish host authentication

serialNumber

OUT: Device serial number

amcFwVersion

OUT: AMC firmware version

Returns:

xpum_result_t