.\" Copyright (c) 1997, 1998 Nick Hibma .\" Copyright (c) 2008 Hans Petter Selasky. All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" .\" $FreeBSD: head/share/man/man4/usb.4 258618 2013-11-26 07:52:40Z lwhsu $ .\" .Dd July 3, 2021 .Dt USB 4 .Os .Sh NAME .Nm usb .Nd Universal Serial Bus .Sh SYNOPSIS To compile this driver into the kernel, place the following line in your kernel configuration file: .Bd -ragged -offset indent .Cd "device usb" .Ed .Pp Alternatively, to load the driver as a module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent usb_load="YES" .Ed .Sh USERLAND PROGRAMMING USB functions can be accessed from userland through the libusb library. See .Xr libusb 3 for more information. .Sh DESCRIPTION .Dx provides machine-independent bus support and drivers for .Tn USB devices in host and device side mode. .Pp The .Nm driver has three layers: .Bl -tag -width 6n -offset indent .It USB Controller (Bus) .It USB Device .It USB Driver .El .Pp The controller attaches to a physical bus like .Xr pci 4 . The .Tn 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 .Tn USB bus. .Pp The .Nm uhub device will always be present as it is needed for the root hub. .Pp .Dx provides support for the following devices. .Ss Storage devices .Bl -tag -width ".Xr umoscom 4" -offset indent -compact .\".It Xr natausb 4 .\"... .It Xr umass 4 Mass Storage Devices, e.g., external disk drives .It Xr urio 4 Diamond Rio 500 MP3 player .It Xr usfs 4 Mass storage driver for device-side mode .El .Ss Wired network interfaces .Bl -tag -width ".Xr umoscom 4" -offset indent -compact .It Xr aue 4 ADMtek AN986 Pegasus Ethernet driver .It Xr axe 4 ASIX Electronics AX88x7x/760 USB Ethernet driver .It Xr axge 4 ASIX Electronics AX88178A/AX88179 USB Gigabit Ethernet driver .It Xr cdce 4 USB Communication Device Class Ethernet driver .It Xr cue 4 CATC USB-EL1210A Ethernet driver .It Xr ipheth 4 USB Apple iPhone/iPad tethered Ethernet driver .It Xr kue 4 Kawasaki LSI KL5KUSB101B Ethernet driver .It Xr mos 4 Moschip MCS7730/MCS7830/MCS7832 USB Ethernet driver .It Xr udav 4 Davicom DM9601 USB Ethernet driver .El .Ss Wireless network interfaces .Bl -tag -width ".Xr umoscom 4" -offset indent -compact .It Xr rum 4 Ralink Technology RT2501USB/RT2601USB IEEE 802.11 driver .It Xr run 4 Ralink Technology RT2700U/RT2800U/RT3000U IEEE 802.11 driver .\".It Xr ubt 4 .\"Bluetooth adapters .It Xr urndis 4 RNDIS USB ethernet driver .It Xr urtwn 4 Realtek RTL8188CU/RTL8192CU IEEE 802.11 driver .El .Ss Serial and parallel interfaces .Bl -tag -width ".Xr umoscom 4" -offset indent -compact .It Xr u3g 4 support for 3G datacards .It Xr uark 4 Arkmicro Technologies ARK3116 based serial adapters .It Xr ubsa 4 Belkin serial adapters .It Xr ubser 4 support for BWCT console serial adapters .It Xr uchcom 4 WinChipHead CH341/CH340 serial adapters .It Xr ucom 4 tty support .It Xr ucycom 4 Cypress CY7C63743 and CY7C64013 USB to RS232 bridges .It Xr ufoma 4 mobile phone support .It Xr uftdi 4 serial devices based on the FTDI chips .It Xr ugensa 4 generic serial device .It Xr uipaq 4 support for iPAQ units .It Xr ulpt 4 printer support .It Xr umcs 4 serial adapters based on the MCS7820 and MCS7840 chips .It Xr umct 4 Magic Control Technology USB-232 based serial adapters .It Xr umodem 4 modem support .It Xr umoscom 4 serial adapters based on the MCS7703 chip .It Xr uplcom 4 Prolific PL-2303/2303X/2303HX serial adapters .It Xr uslcom 4 Silicon Laboratories CP2101, CP2102 and CP2103 USB to serial bridge .It Xr uvisor 4 support for the Handspring Visor, a Palmpilot compatible PDA .It Xr uvscom 4 SUNTAC Slipper U VS-10U serial adapters .El .Ss Audio devices .Bl -tag -width ".Xr umoscom 4" -offset indent -compact .It Xr uaudio 4 audio device driver .El .Ss Radio receiver devices .Bl -tag -width ".Xr umoscom 4" -offset indent -compact .It Xr ufm 4 Cypress Semiconductor FM Radio .El .Ss Human Interface Devices .Bl -tag -width ".Xr umoscom 4" -offset indent -compact .It Xr uep 4 eGalax touchscreen driver .It Xr uhid 4 generic driver for Human Interface Devices .It Xr ukbd 4 keyboards that follow the boot protocol .It Xr ums 4 mouse devices .It Xr wsp 4 Wellspring touchpad driver for Apple laptops .El .Sh INTRODUCTION TO USB The .Tn USB is a system where external devices can be connected to a PC. The most common USB speeds are: .Bl -tag -width 6n -offset indent .It Low Speed (1.5MBit/sec) .It Full Speed (12MBit/sec) .It High Speed (480MBit/sec) .El .Pp Each .Tn 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. .Pp 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. .Pp 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: .Em control , isochronous , bulk , or .Em 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 the control endpoint, is unidirectional. .Pp 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. .Pp A device may operate in different configurations. Depending on the configuration, the device may present different sets of endpoints and interfaces. .Pp The bus enumeration of the .Tn USB bus proceeds in several steps: .Bl -enum .It Any interface specific driver can attach to the device. .It If none is found, generic interface class drivers can attach. .El .Sh SEE ALSO The .Tn USB specifications can be found at: .Pp .D1 Pa http://www.usb.org/developers/docs/ .Pp .Xr usbhidaction 1 , .Xr usbhidctl 1 , .Xr libusb 3 , .Xr libusb20 3 , .Xr usbhid 3 , .Xr aue 4 , .Xr axe 4 , .Xr axge 4 , .Xr cdce 4 , .Xr cue 4 , .Xr ehci 4 , .Xr ipheth 4 , .Xr kue 4 , .Xr mos 4 , .Xr ohci 4 , .Xr pci 4 , .Xr rum 4 , .Xr run 4 , .Xr u3g 4 , .Xr uark 4 , .Xr uaudio 4 , .Xr ubsa 4 , .Xr ubser 4 , .Xr uchcom 4 , .Xr ucom 4 , .Xr ucycom 4 , .Xr udav 4 , .Xr uep 4 , .Xr ufm 4 , .Xr ufoma 4 , .Xr uftdi 4 , .Xr ugen 4 , .Xr ugensa 4 , .Xr uhci 4 , .Xr uhid 4 , .Xr uipaq 4 , .Xr ukbd 4 , .Xr ulpt 4 , .Xr umass 4 , .Xr umcs 4 , .Xr umct 4 , .Xr umodem 4 , .Xr umoscom 4 , .Xr ums 4 , .Xr uplcom 4 , .Xr urio 4 , .Xr urndis 4 , .Xr urtwn 4 , .Xr usb_template 4 , .Xr usfs 4 , .Xr uslcom 4 , .Xr uvisor 4 , .Xr uvscom 4 , .Xr wsp 4 , .Xr xhci 4 , .Xr usbconfig 8 , .Xr usbdi 9 .Sh STANDARDS The .Nm module complies with the USB 2.0 standard. .Sh HISTORY The .Nm module has been inspired by the .Nx USB stack initially written by Lennart Augustsson. The .Nm module was written by .An Hans Petter Selasky Aq Mt hselasky@FreeBSD.org .