Skip to content
Advertisement

pci device info access in linux from userspace

I want to access the pci device tree information from user space programatically. Like the root complex and the devices connected to it. How can I do it please let me know.

Regards, Pradeep

Advertisement

Answer

libpci or pcilib (on which lspci is based) uses sysfs, procfs, and possibly other means to access PCI information. You can check pciutils package source code for further reference:

https://github.com/gittup/pciutils

https://github.com/gittup/pciutils/blob/gittup/lspci.c

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement