Chapter 1. Introduction to USB on Linux

A Universal Serial Bus (USB) is used to connect a host, such as a PC or workstation, to a number of peripheral devices. USB uses a tree structure, with the host at the root (the system's master), hubs as interior nodes, and peripheral devices as leaves (and slaves). Modern PCs support several such trees of USB devices, usually one USB 2.0 tree (480 Mbit/sec each) with a few USB 1.1 trees (12 Mbit/sec each) that are used when you connect a USB 1.1 device directly to the machine's "root hub".

That master/slave asymmetry was designed in part for ease of use. It is not physically possible to assemble (legal) USB cables incorrectly: all upstream "to-the-host" connectors are the rectangular type, matching the sockets on root hubs, and the downstream type are the squarish type (or they are built in to the peripheral). Software doesn't need to deal with distributed autoconfiguration since the pre-designated master node manages all that. At the electrical level, bus protocol overhead is reduced by eliminating arbitration and moving scheduling into host software.

USB 1.0 was announced in January 1996, and was revised as USB 1.1 (with improvements in hub specification and support for interrupt-out transfers) in September 1998. USB 2.0 was released in April 2000, including high speed transfers and transaction translating hubs (used for USB 1.1 and 1.0 backward compatibility).

USB support was added to Linux early in the 2.2 kernel series shortly before the 2.3 development forked off. Updates from 2.3 were regularly folded back into 2.2 releases, bringing new features such as /sbin/hotplug support, more drivers, and more robustness. The 2.5 kernel series continued such improvements, and also worked on USB 2.0 support, higher performance, better consistency between host controller drivers, API simplification (to make bugs less likely), and providing internal "kerneldoc" documentation.

Linux can run inside USB devices as well as on the hosts that control the devices. Because the Linux 2.x USB support evolved to support mass market platforms such as Apple Macintosh or PC-compatible systems, it didn't address design concerns for those types of USB systems. So it can't be used inside mass-market PDAs, or other peripherals. USB device drivers running inside those Linux peripherals don't do the same things as the ones running inside hosts, and so they've been given a different name: they're called gadget drivers. This document does not present gadget drivers.