I've read the configuration space, but a few fields are annoying me slightly. They're related to CardBus and its ilk. At offset 0x28 for a normal PCI device's configuration space, there is a CardBus CIS pointer. Additionally, when the Header Type is 2, the device is a CardBus bridge. However, both of these structures are defined in the PC Card Specification, which is expensive. Is there any way I can get the definitions for these structures?
Additionally, something else is troubling me slightly. At the moment, I iterate through each of the 256 buses, then going through every device and function. However, according to
this post by Combuster, there is an element of recursion involved. Is it simply a matter of doing the same as what I'm doing now, taking the bus to be 0 initially, then looking for the PCI bridges and calling oneself again, passing a bus number? Effectively, by going in a rather ad-hoc method, am I missing some devices? Also, which bus field do I use? Is it SubordinateBus, SecondaryBus, PrimaryBus or all of them?
Finally, writing to the address space. Do I repeat the first line of code which selects the bus, device and function, then doing an outLong(0xCFC, value), or is it something more complex?