Updated on 2022-03-13 GMT+08:00

Obtaining the PCIe Information

Obtains the Peripheral Component Interconnect Express (PCIe) information. This API is defined in c_graph.h.

Syntax

static HIAI_StatusT HIAI_GetPCIeInfo(const uint32_t devId,int32_t* bus, int32_t* dev, int32_t* func);

Parameter Description

Parameter

Description

Value Range

devId

Device ID to be queried

-

bus

Returned PCIe bus ID

-

dev

Returned PCIe device ID

-

func

Returned PCIe function ID

-

Return Value

For details about the returned error codes, see "Error Codes."

Error Codes

No.

Error Level

Error Code

Description

1

HIAI_INFO

HIAI_OK

The running is OK.

2

HIAI_ERROR

HIAI_GRAPH_GET_PCIEINFO_ERROR

The bus, dev, or func parameter has a null pointer or there is an error in obtaining the PCIe information.

Calling Example

uint32_t devId= 1;
uint32_t bus;
uint32_t dev;
uint32_t func;
HIAI_GetPCIeInfo(devId, &bus, &dev, &func);