Itay Avraham
Itay Avraham

Reputation: 393

pci_find_capability return 0: "device does not support it"

I call pci_find_capability with PCI_CAP_ID_EXP and return code is zero, which means:

Tell if a device supports a given PCI capability. Returns the address of the requested capability structure within the device’s PCI configuration space or 0 in case the device does not support it

Why the device doesn't support?

 int pcie_cap_addr = pci_find_capability(pdev, PCI_CAP_ID_EXP);

PCI_CAP_ID_EXP is defined as 0x10.

Upvotes: 0

Views: 478

Answers (1)

prl
prl

Reputation: 12455

PCI_CAP_ID_EXP is defined as 0x10, which is the capability ID of the PCI Express Capability. The PCI Express Specification requires all PCIe devices to implement this capability. Thus any device that doesn't implement it isn't a PCIe device.

If you're using a system old enough to have built-in PCI slots, then it could be a PCI card in a PCI slot.

Otherwise, it could be a PCI device behind a PCIe-PCI bridge, or it could be a root complex integrated device (RCIEP) that doesn't use any new PCIe features so it identifies itself as a PCI device rather than a PCIe device.

Upvotes: 1

Related Questions