next up previous contents
Next: The PCI Device Driver Up: Linux PCI Initialization Previous: Linux PCI Initialization

The Linux Kernel PCI Data Structures

   figure5729
Figure: Linux Kernel PCI Data Structures

As the Linux kernel initialises the PCI system it builds data structures mirroring the real PCI topology of the system. Figure gif shows the relationships of the data structures that it would build for the example PCI system in Figure gif on page gif.

Each PCI device (including the PCI-PCI Bridges) is described by a pci_dev  data structure. Each PCI bus is described by a pci_bus  data structure. The result is a tree structure of PCI buses each of which has a number of child PCI devices attached to them. As a PCI bus can only be reached using a PCI-PCI Bridge (except the primary PCI bus, bus 0), each pci_bus  contains a pointer to the PCI device (the PCI-PCI Bridge) that it is accessed through. That PCI device is a child of the the PCI Buses parent PCI bus.

Not shown in the Figure gif is a pointer to all of the PCI devices in the system, pci_devices . All of the PCI devices in the system have their pci_dev  data structures queued onto this queue.. This queue is used by the Linux kernel to quickly find all of the PCI devices in the system.



David A. Rusling
david.rusling@reo.mts.dec.com