Universal Serial Bus (USB) is a type of interface used to connect various types of peripherals, ranging from keyboards and mice, to hard drives, scanners, digital cameras, and printers. The USB Objective covers the general architecture of USB, USB modules, and configuring USB devices .
USB devices are attached to a host in a tree through some number of hub devices. The lsusb command can be used to see how devices are physically attached to a Linux system.
# lsusb -t
Bus# 4
'-Dev# 1 Vendor 0x0000 Product 0x0000
Bus# 3
'-Dev# 1 Vendor 0x0000 Product 0x0000
|-Dev# 2 Vendor 0x046d Product 0xc501
'-Dev# 3 Vendor 0x0781 Product 0x0002
Bus# 2
'-Dev# 1 Vendor 0x0000 Product 0x0000
|-Dev# 2 Vendor 0x0451 Product 0x2036
| |-Dev# 5 Vendor 0x04b8 Product 0x0005
| '-Dev# 6 Vendor 0x04b8 Product 0x0602
'-Dev# 3 Vendor 0x0451 Product 0x2046
'-Dev# 4 Vendor 0x056a Product 0x0011
Bus# 1
'-Dev# 1 Vendor 0x0000 Product 0x0000
There are three types of USB host controllers :
OHCI and UHCI controllers are both USB 1.1 controllers, which are capable of a maximum of 12 Mbps. EHCI controllers are USB 2.0 controllers, which are capable of a theoretical maximum of 480 Mbps. To get greater than USB 1.1 speeds, you must have a USB 2.0 controller, as well as USB 2.0 devices, hubs, and cables. A USB 2.0 device attached to a USB 1.1 hub will only be able to run at USB 1.1 speeds.
There are several classes of USB devices , including the following:
Input devices (mice, keyboards, etc.)
Modems
Disk devices, flash readers, etc.
Sound devices
Infrared devices
Printers and USB-to-parallel cables
USB support was added to the Linux kernel in the 2.3.x development kernel series, then back-ported to 2.2.x, minus support for USB mass storage devices (due to SCSI changes in 2.3.x). The back-port was included in the 2.2.18 kernel release.
The Linux kernel USB drivers fall into three categories:
The USB host controller drivers include usb-ohci.o (OHCI driver), usb-uhci.o (UHCI driver), uhci.o (old "alternate" UHCI driver), and ehci-hcd.o (EHCI driver).
The USB class drivers include hid.o, usb-storage.o (mass storage driver), acm.o (Automated Control Model [ACM] communications class driver, which deals with modems that emulate the standard serial modem AT command interface), printer.o, and audio.o.
There are many drivers for devices that either don't fit into one of the standard USB classes or don't work with one of the standard class drivers. Examples include rio500.o (the driver for the Diamond Rio 500 MP3 player) and pwc.o (the driver for various Philips webcams).
The Linux drivers implement USB support in layers. At the bottom is usbcore.o, which provides all of the generic USB support for the higher-level drivers as well as USB hub support. The host controller drivers load in the middle of the stack. On top are the device and class drivers and any modules they require.
The following is an example of what you might see in /proc/modules (or from the output of lsmod) on a system with several USB devices:
Module Size Used by usb-storage 68628 0 scsi_mod 106168 2 [usb-storage] evdev 5696 0 (unused) printer 8832 0 wacom 7896 0 (unused) keybdev 2912 0 (unused) mousedev 5428 1 hid 21700 0 (unused) input 5824 0 [evdev wacom keybdev mousedev hid] ehci-hcd 19432 0 (unused) usb-uhci 25964 0 (unused) usbcore 77760 1 [usb-storage printer wacom hid ehci-hcd usb-uhci]