Get the Bus/Device/Function associated with a device handle
#include <pci/pci.h> pci_bdf_t pci_bdf( pci_devhdl_t hdl );
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.
If hdl is valid, the pci_bdf_t associated with the device when it was successfully attached; otherwise PCI_BDF_NONE.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | No |
Thread | Yes |