On Wed, Nov 30, 2005 at 07:56:54AM +0100, Roderick Colenbrander wrote:
The way I would recommend for pci bus scanning is to parse /proc/bus/pci/devices the only problem is that this is linux specific. Something similar can be done on other OSes though. Another way which is more portable is to use libpci but it isn't installed on all systems.
Guess
something like this would need to be added to some 'kernel' dll...
Better use libsysfs or /sys/ directly if you do that.
Ciao, Marcus
The use of /sys is an option too but it is 2.6x specific. The same holds for libsysfs and I'm not sure if everyone has the library installed. Parsing of the devices file is very easy and the file format has been the same for a long while (atleast from 2.2x to 2.6x). Each line just contains the device/vendor ids, pci device class and everything else we might need. In case of /sys a lot of dirctories/files need to be checked for detection whereas for /proc/bus/pci/devices only one simple file needs to be checked.
Roderick