Data Structures

The kernel provides several data structures to manage the system's PCI structures. They are declared in <pci.h> and are interlinked by a network of pointers. I give an overview of the structure elements below before moving on to take a closer look at their definitions.

□ The individual buses in the system are represented by instances of pci_bus.

□ The pci_dev structure is provided for individual devices, cards, and function units.

□ Each driver is described by an instance of pci_driver.

The kernel makes two global list_heads available to head the network of PCI data structures (both are defined in <pci.h>).

□ pci_root_buses lists all the PCI buses in the system. It is the starting point when the data structures are scanned "downward" to find all devices attached to the individual buses.

□ pci_devices links all PCI devices in the system without taking the bus structure into account. This is useful when a driver wants to search for all devices it supports because the topology is of no interest in this situation (it is, of course, possible to find the bus associated with a device using the many links between the PCI data structures, as you will see below).

Continue reading here: Representation of Buses

Was this article helpful?

0 0