2003-06-01 01:58:19

by Albert Cahalan

[permalink] [raw]
Subject: PCI in /proc, /sys, and so on

In /proc/bus/pci, there is a tree containing
files to access PCI config space (only, no BARs)
and a seemingly out-of-place "devices" file.
There is no support for multiple domains.
Like this:
.
|-- 00
| |-- 0b.0
| `-- 10.0
|-- 01
| |-- 0b.0
| |-- 17.0
| |-- 18.0
| |-- 19.0
| `-- 1a.0
|-- 02
| |-- 0b.0
| `-- 0f.0
`-- devices

Over in /sys/devices, there is a tree with more
info. At first glance I thought "pci0" would be
the first domain, but really it is just the bus
number. So that duplicates part of the name
lower down the tree: /sys/devices/pci2/02:0b.0
has a pair of "2" that are redundant.

So, there's no PCI domain support anywhere except
in some nasty ioctl, and no interface to allow
simple file-based access to PCI MMIO regions.

Future directions? Where would file-based access
be most acceptable? (in /proc, in /sys, or ???)

It sure would be nice to have all the stuff for
any given device end up in the same directory.