Quick Reference
This section, as usual, summarizes the symbols introduced in the chapter.
-
#include <linux/config.h>,CONFIG_PCI This macro should be used to conditionally compile PCI-related code. When a PCI module is loaded to a non-PCI kernel, insmod complains about several symbols being unresolved.
-
#include <linux/pci.h> This header includes symbolic names for the PCI registers and several vendor and device ID values.
-
int pci_present(void); This function returns a boolean value that tells whether the computer we’re running on has PCI capabilities or not.
-
struct pci_dev;,struct pci_bus;,struct pci_driver;,struct pci_device_id; These structures represent the objects involved in PCI management. The concept of
pci_driveris new as of Linux 2.4, andstruct pci_device_idis central to it.-
struct pci_dev *pci_find_device(unsigned int vendor, unsigned int device, struct pci_dev *from);,struct pci_dev *pci_find_class(unsigned int class, struct pci_dev *from); These functions are used to look up the device list looking for devices with a specific signature or belonging to a specific class. The return value is
NULLif none is found.fromis used to continue a search; it must beNULLthe first time you call either function, and it must point to the device just found if you are searching for more devices.-
int pci_read_config_byte(struct pci_dev *dev, int where, u8 *val);,int pci_read_config_word(struct pci_dev *dev, int where, u16 *val);,int pci_read_config_dword(struct ...