Get the index of a capability for a device
#include <pci/pci.h> int_t pci_device_find_capid( pci_bdf_t bdf, pci_capid_t capid );
You can use pci_device_read_capid() and pci_device_find_capid() to identify which capabilities the device identified by bdf supports. The pci_device_find_capid() function returns the index of the capability capid for the device identified by bdf.
The purpose of this function is to obtain the capability index for a capability that the software wishes to enable for the device. You'll use this index when you call pci_device_read_cap().
The index for the specific capability, or -1 if the capability doesn't exist.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | No |
Signal handler | No |
Thread | Yes |