p .Sh INTRODUCTION .Nx provides machine-independent bus support and drivers for USB devices.
p The .Nx driver has three layers (like .Xr scsi 4 and .Xr pcmcia 4 ): the controller, the bus, and the device layer. The controller attaches to a physical bus (like .Xr pci 4 ). The USB bus attaches to the controller and the root hub attaches to the controller. Further devices, which includes further hubs, attach to other hubs. The attachment forms the same tree structure as the physical USB device tree. For each USB device there may be further drivers attached to it.
p The .Cm uhub device controls USB hubs and must always be present (since there is at least a root hub in any USB system).
p .Sh INTRODUCTION TO USB The USB is a 12Mb/s serial bus (1.5 Mb/s for low speed devices). Each USB bus has a host controller that is the master of the bus; all other devices on the bus only speak when spoken to.
p There can be up to 127 devices (apart from the host controller) on a bus each with its own address. The addresses are assigned dynamically by the host when the device is attached to the bus.
p Within each device there can be up to 16 endpoints. Each endpoint is individually addressed and the addresses are static. Each of these endpoints will communicate in one of four different modes: control, isochronous, bulk, or interrupt. A device always has at least one endpoint. This endpoint has address 0 and is a control endpoint and is used to give commands to and extract basic data such as descriptors from the device. Each endpoint, except control endpoints, is unidirectional.
p The endpoints in a device are grouped into interfaces. An interface is a logical unit within a device. E.g., a compound device with both a keyboard and a trackball would present one interface for each. An interface can sometimes be set into different modes, called alternate settings, which affects how it operates. Different alternate settings can have different endpoints within it.
p A device may operate in different configurations. Depending on the configuration the device may present different sets of endpoints and interfaces.
p
The USB controller has a device that supports
.Xr ioctl 2
to manipulate it.
.Sh SEE ALSO
.Xr pci 4 ,
.Xr uaudio 4 ,
.Xr ugen 4 ,
.Xr uhid 4 ,
.Xr ukbd 4 ,
.Xr ulpt 4 ,
.Xr ums 4 ,
.Xr usbd 8
.Sh HISTORY
The
.Nm
driver
appeared in
.Nx 1.4 .