Hi Alex, > It sounds like you're saying something like: > > lspci.c:scan_device() calls pci_fill_info with PCI_FILL_PHYS_SLOT > > This actually calls pci_fill_info_v31 which does: > > if (flags & ~d->known_fields) > d->known_fields |= d->methods->fill_info(d, flags & ~d->known_fields); Yes. > That will call pci_generic_fill_info(), which should then get > some logic like: > > + if (flags & PCI_FILL_PHYS_SLOT) > + flags |= pci_scan_slots(d, flags); > > Then you want me to implement pci_scan_slots() in lib/sysfs.c? No, that would not compile on systems which do not use the sysfs backend. Better: let the sysfs back-end have its own fill_info function, which will call pci_generic_fill_info(), but also take care of the slots. > Opening and scanning the sysfs slots directory is pretty easy, > but is there some way to iterate across all the devices? Do you > really want me to re-implement scan_devices() from lspci.c? No :) You have the list of devices at your hand: pci_access->devices is the first device, then follow device->next. > Sorry for the confusion, I feel pretty stupid for not > understanding exactly what you're asking for. Do not worry, I was just too terse. Have a nice fortnight -- Martin `MJ' Mares <mj@xxxxxx> http://mj.ucw.cz/ Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth Top ten reasons to procrastinate: 1. -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html