ravil
ravil

Reputation: 607

Identify a PCIe device using PCI config space

Given the list of PCI devices installed in the system, I need to identify PCIe devices. So far, I've been using iteration over the list of capabilities to see if the device has extended cap structure (which would correspond to cap ID 0x10). And, if the device has an extended cap structure, then it is a PCIe device for sure. However, it seems like this method fails to identify some devices. I was wondering if anyone knows of a better method.

Thanks.

Upvotes: 0

Views: 2790

Answers (2)

shankar
shankar

Reputation: 9

PCI/PCIE device scanning, It is possible to have redundant addresses in the capabilities pointer(corrupted PCI config space).

Please check if there is any redundancy in capability pointer values in all B:D:F combinations, If you found any issues you can directly contact your BIOS vendor to get it rectified.

Upvotes: 0

liaoo
liaoo

Reputation: 201

I used below way to retrieve PCIe devices:

  1. check if PCI device config register 0x6 bit4 = 1(capability list exist status) ?
  2. check if PCI device config register 0x34 != 0(capability pointer valid) ?
  3. check if PCIe capability(ID = 0x10) exist ?

If all above are true then this device is a PCIe device !!!

I am curious about the situation that "this method fails to identify some devices" ?

Upvotes: 2

Related Questions