First, Introduction
The Linux PCI driver actually consists of two parts: the PCI driver and the device itself, and the PCI driver is usually the Linux kernel, and the device itself is the driver of the developer. There are three address spaces on the PCI device: I/O space, configuration space, memory space, the CPU can access all address space on the PCI device, and I/O space and memory space are provided for device-driven access, and the configuration space is used when the kernel initializes PCI.
In PCI device drivers, several key data structures are:
1. Pci_driver used to identify the id_table structure of the device and the probe () and removed () functions
2. Pci_dev describes all hardware information for a PCI device
Each pci_dev struct is joined to two queue lists, one of which is global_list to the total Pci_dev structure queue (the queue header is pci_devices), and the other is the bus_list that is attached to the owning bus via Pci_dev Queue (The queue header is pci_bus.devices), while the bus pointer in the PCI_DEV structure points to the bus to which the device belongs.
Second, the driving framework
Reference: http://blog.csdn.net/h_armony/article/details/7191104
Linux PCI Driver Summary