pci_device_find_capid_next()
Get the index of the next occurrence of a specific capability of a device
Synopsis:
#include <pci/pci.h>
int_t pci_device_find_capid_next( pci_bdf_t bdf,
pci_capid_t capid,
int_t start_idx );
Arguments:
- bdf
- The Bus/Device/Function associated with a device.
- capid
- The identifier for a capability.
- start_idx
- The index of a specific capability.
Library:
libpci
Use the -l pci option to qcc to link against this library.
Description:
You can use pci_device_find_capid_next() to locate the next occurrence of a capability which the device identified by bdf supports, starting at the capability index start_idx.
You can locate each instance of a specific capability by using pci_device_find_capid_next() with the index returned from a previous call as long as the returned index is a not a negative value.
In the case a negative value is returned (e.g. -1), calling pci_device_find_capid_next() will return the same value calling pci_device_find_capid() will. Returning a negative value also means that there are no more instances of the specific capability present.
On success, when a non-negative 0 based index value is returned, you can use it to call pci_device_read_cap().
Returns:
The index for the next occurrence of a specific capability, or -1 if there is not more than one occurence.
Classification:
Safety: | |
---|---|
Cancellation point | No |
Signal handler | No |
Thread | Yes |