pci_device_find_capid()

Updated: October 26, 2022

Get the index of a capability for a device

Synopsis:

#include <pci/pci.h>

int_t pci_device_find_capid( pci_bdf_t bdf,
                             pci_capid_t capid );

Arguments:

bdf
The Bus/Device/Function associated with a device.
capid
The identifier for a capability.

Library:

libpci

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

Description:

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.

Note: This function doesn't cause a capability module to be loaded.

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().

Returns:

The index for the specific capability, or -1 if the capability doesn't exist.

Classification:

QNX Neutrino

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

See also:

pci_device_read_cap(), pci_device_read_capid()