— Universal Serial Bus
To compile this driver into the kernel, place the following line in your kernel
Alternatively, to load the driver as a module at boot time, place the following
line in loader.conf(5)
USB functions can be accessed from userland through the libusb library. See
for more information.
provides machine-independent bus support and
drivers for USB devices in host and device side mode.
driver has three layers:
- USB Controller (Bus)
- USB Device
- USB Driver
The controller attaches to a physical bus like pci(4)
. The USB
bus attaches to the controller, and the root hub attaches to the controller.
Any devices attached to the bus will attach to the root hub or another hub
attached to the USB bus.
device will always be present as it is needed for the
INTRODUCTION TO USB¶
The USB is a system where external devices can be connected to a PC. The most
common USB speeds are:
- Low Speed (1.5MBit/sec)
- Full Speed (12MBit/sec)
- High Speed (480MBit/sec)
Each USB has a USB controller that is the master of the bus. The physical
communication is simplex which means the host controller only communicates
with one USB device at a time.
There can be up to 127 devices connected to an USB HUB tree. The addresses are
assigned dynamically by the host when each device is attached to the bus.
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
. 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 the control endpoint, is unidirectional.
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.
A device may operate in different configurations. Depending on the
configuration, the device may present different sets of endpoints and
The bus enumeration of the USB bus proceeds in several steps:
- Any interface specific driver can attach to the
- If none is found, generic interface class drivers can
The USB specifications can be found at:
module complies with the USB 2.0 standard.
module has been inspired by the NetBSD USB stack
initially written by Lennart Augustsson. The usb
Hans Petter Selasky