pci_bdf()

Updated: April 19, 2023

Get the Bus/Device/Function associated with a device handle

Synopsis:

#include <pci/pci.h>

pci_bdf_t pci_bdf( pci_devhdl_t hdl );

Arguments:

hdl
The handle of the device, obtained by calling pci_device_attach().

Library:

libpci

Use the -l pci option to qcc to link against this library.

Description:

The pci_bdf() function is a convenience function that allows software to keep only the pci_devhdl_t handle for any devices that it manages. After the device is found and successfully attached, you can use this function to obtain the Bus/Device/Function (of type pci_bdf_t) associated with hdl in order to use the read APIs. Drivers can keep the pci_bdf_t as well.

Returns:

If hdl is valid, the pci_bdf_t associated with the device when it was successfully attached; otherwise PCI_BDF_NONE.

Classification:

QNX Neutrino

Safety:  
Cancellation point No
Interrupt handler No
Signal handler No
Thread Yes