开发者

Identify a PCIe device using PCI config space

开发者 https://www.devze.com 2023-03-01 02:53 出处:网络
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

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.


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" ?


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消