io - what is the difference between accessing a pci device using procfs vs sysfs -


procfs file: /proc/bus/pci/00/00.0

vs.

sysfs file: /sys/bus/pci/devices/0000:00:00.0/resource

i have seen drivers use procfs file , use sysfs. difference? need, find mmap-ing sysfs/resource<n>? file , read/write works need to, similar operation on procfs file not work. procfs file used elsewhere.

the procfs file cite (/proc/bus/pci/00/00.0) provides access device's configuration header. accessible in sysfs /sys/bus/pci/devices/0000:00:00.0/config.

the sysfs file you're talking (/sys/bus/pci/devices/0000:00:00.0/resource<n>) provides access device's bar regions. see https://en.wikipedia.org/wiki/pci_configuration_space explanation of relationships. also, may want read linux kernel documentation @ https://www.kernel.org/doc/documentation/filesystems/sysfs-pci.txt


Comments