Linux Kernel Architecture

(Jacob Rumans) #1

Chapter 6: Device Drivers


0x8086is the vendor ID for Intel, the manufacturer of the chipset (the driver could also have used the
pre-processor constantPCI_VENDOR_ID_INTELdefined with the same value). Each entry holds a specific
device ID that identifies all versions currently on the market. Subvendor and subdevice ID are of no
relevance and are therefore represented byPCI_ANY_ID; this means that any subvendor or any subdevice
is recognized as valid.

The kernel provides thepci_match_idfunction to compare the PCI device data with the data in an ID
table. It refers to the given ID table of apci_devinstance to ascertain whether the device is included in
the table.

drivers/pci/pci-driver.c
const struct pci_device_id *pci_match_id(const struct pci_device_id *ids,
struct pci_dev *dev);

A match is found when all elements in an ID table entry and all elements in the device configuration are
identical. If a field in the ID table contains the special entryPCI_ANY_ID,everyvalue in the corresponding
field of thepci_deviceinstance is interpreted as a match.

6.7.3 USB


USB (Universal Serial Bus) was developed at the end of the′90s of what is now the last century as an exter-
nal bus to satisfy ever-more-demanding PC requirements and to produce solutions for new computer
types such as handhelds, PDAs, and the like. As a universal external bus, USB delivers its benefits when
used in conjunction with devices requiring low to medium data transfer rates such as mice, Webcams,
and keyboards. However, more broadband-intensive devices such as external hard disks, CD-ROMs,
and CD writers can also be operated on USB buses. The maximum transfer rate for USB 1.1 is limited to
12 MBit/second but Version 2.0 of the standardsupports higher rates of up to 480 MBit/second.

When the bus was designed, special attention was focused on ease of use for inexperienced computer
users. As a consequence, hotplugging and the associated transparent installation of drivers are core
aspects of the USB design. In contrast to earlier PCIhotplug cards (which were difficult to obtain) and
PCMCIA/PC cards (which were little used because of their high price), USB is the first bus that has made
the hotplugging capabilities of the kernel available to a wide audience.

Featuresand Modeof Operation


There are three versions of the USB standard. The most important are the first version (1.0) and its suc-
cessor (1.1), as most hardware has adopted this standard. The more recent version (2.0) is designed to
eliminate the speed disadvantages of USB as compared with other external buses (primarily FireWire),
and is nowadays in widespread use. Kernel support isavailable for both protocols. The in-kernel data
structures employed to manage devices are identical for all versions, and since I will concentrate on
these in the following, I will not be much concerned with the technical differences between the different
versions of the standard.

What are the special features of USB as compared to other buses? In addition to ease of use for end-users,
mention must be made of the topological structure used to sort attached devices, which is reminiscent
of network structures. Starting from a single root controller, devices are connected via hubs in a tree-like
structure, as illustrated in Figure 6-24. Up to 127terminal devices can be attached to a system in this
manner.
Free download pdf