xref: /dragonfly/share/man/man4/usb.4 (revision 655933d6)
1.\" Copyright (c) 1997, 1998 Nick Hibma <n_hibma@FreeBSD.org>
2.\" Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" $FreeBSD: head/share/man/man4/usb.4 258618 2013-11-26 07:52:40Z lwhsu $
26.\"
27.Dd July 3, 2021
28.Dt USB 4
29.Os
30.Sh NAME
31.Nm usb
32.Nd Universal Serial Bus
33.Sh SYNOPSIS
34To compile this driver into the kernel,
35place the following line in your
36kernel configuration file:
37.Bd -ragged -offset indent
38.Cd "device usb"
39.Ed
40.Pp
41Alternatively, to load the driver as a
42module at boot time, place the following line in
43.Xr loader.conf 5 :
44.Bd -literal -offset indent
45usb_load="YES"
46.Ed
47.Sh USERLAND PROGRAMMING
48USB functions can be accessed from userland through the libusb library.
49See
50.Xr libusb 3
51for more information.
52.Sh DESCRIPTION
53.Dx
54provides machine-independent bus support and drivers for
55.Tn USB
56devices in host and device side mode.
57.Pp
58The
59.Nm
60driver has three layers:
61.Bl -tag -width 6n -offset indent
62.It USB Controller (Bus)
63.It USB Device
64.It USB Driver
65.El
66.Pp
67The controller attaches to a physical bus
68like
69.Xr pci 4 .
70The
71.Tn USB
72bus attaches to the controller, and the root hub attaches
73to the controller.
74Any devices attached to the bus will attach to the root hub
75or another hub attached to the
76.Tn USB
77bus.
78.Pp
79The
80.Nm uhub
81device will always be present as it is needed for the
82root hub.
83.Pp
84.Dx
85provides support for the following devices.
86.Ss Storage devices
87.Bl -tag -width ".Xr umoscom 4" -offset indent -compact
88.\".It Xr natausb 4
89.\"...
90.It Xr umass 4
91Mass Storage Devices, e.g., external disk drives
92.It Xr urio 4
93Diamond Rio 500 MP3 player
94.It Xr usfs 4
95Mass storage driver for device-side mode
96.El
97.Ss Wired network interfaces
98.Bl -tag -width ".Xr umoscom 4" -offset indent -compact
99.It Xr aue 4
100ADMtek AN986 Pegasus Ethernet driver
101.It Xr axe 4
102ASIX Electronics AX88x7x/760 USB Ethernet driver
103.It Xr axge 4
104ASIX Electronics AX88178A/AX88179 USB Gigabit Ethernet driver
105.It Xr cdce 4
106USB Communication Device Class Ethernet driver
107.It Xr cue 4
108CATC USB-EL1210A Ethernet driver
109.It Xr ipheth 4
110USB Apple iPhone/iPad tethered Ethernet driver
111.It Xr kue 4
112Kawasaki LSI KL5KUSB101B Ethernet driver
113.It Xr mos 4
114Moschip MCS7730/MCS7830/MCS7832 USB Ethernet driver
115.It Xr udav 4
116Davicom DM9601 USB Ethernet driver
117.El
118.Ss Wireless network interfaces
119.Bl -tag -width ".Xr umoscom 4" -offset indent -compact
120.It Xr rum 4
121Ralink Technology RT2501USB/RT2601USB IEEE 802.11 driver
122.It Xr run 4
123Ralink Technology RT2700U/RT2800U/RT3000U IEEE 802.11 driver
124.\".It Xr ubt 4
125.\"Bluetooth adapters
126.It Xr urndis 4
127RNDIS USB ethernet driver
128.It Xr urtwn 4
129Realtek RTL8188CU/RTL8192CU IEEE 802.11 driver
130.El
131.Ss Serial and parallel interfaces
132.Bl -tag -width ".Xr umoscom 4" -offset indent -compact
133.It Xr u3g 4
134support for 3G datacards
135.It Xr uark 4
136Arkmicro Technologies ARK3116 based serial adapters
137.It Xr ubsa 4
138Belkin serial adapters
139.It Xr ubser 4
140support for BWCT console serial adapters
141.It Xr uchcom 4
142WinChipHead CH341/CH340 serial adapters
143.It Xr ucom 4
144tty support
145.It Xr ucycom 4
146Cypress CY7C63743 and CY7C64013 USB to RS232 bridges
147.It Xr ufoma 4
148mobile phone support
149.It Xr uftdi 4
150serial devices based on the FTDI chips
151.It Xr ugensa 4
152generic serial device
153.It Xr uipaq 4
154support for iPAQ units
155.It Xr ulpt 4
156printer support
157.It Xr umcs 4
158serial adapters based on the MCS7820 and MCS7840 chips
159.It Xr umct 4
160Magic Control Technology USB-232 based serial adapters
161.It Xr umodem 4
162modem support
163.It Xr umoscom 4
164serial adapters based on the MCS7703 chip
165.It Xr uplcom 4
166Prolific PL-2303/2303X/2303HX serial adapters
167.It Xr uslcom 4
168Silicon Laboratories CP2101, CP2102 and CP2103 USB to serial bridge
169.It Xr uvisor 4
170support for the Handspring Visor, a Palmpilot compatible PDA
171.It Xr uvscom 4
172SUNTAC Slipper U VS-10U serial adapters
173.El
174.Ss Audio devices
175.Bl -tag -width ".Xr umoscom 4" -offset indent -compact
176.It Xr uaudio 4
177audio device driver
178.El
179.Ss Radio receiver devices
180.Bl -tag -width ".Xr umoscom 4" -offset indent -compact
181.It Xr ufm 4
182Cypress Semiconductor FM Radio
183.El
184.Ss Human Interface Devices
185.Bl -tag -width ".Xr umoscom 4" -offset indent -compact
186.It Xr uep 4
187eGalax touchscreen driver
188.It Xr uhid 4
189generic driver for Human Interface Devices
190.It Xr ukbd 4
191keyboards that follow the boot protocol
192.It Xr ums 4
193mouse devices
194.It Xr wsp 4
195Wellspring touchpad driver for Apple laptops
196.El
197.Sh INTRODUCTION TO USB
198The
199.Tn USB
200is a system where external devices can be connected to a PC.
201The most common USB speeds are:
202.Bl -tag -width 6n -offset indent
203.It Low Speed (1.5MBit/sec)
204.It Full Speed (12MBit/sec)
205.It High Speed (480MBit/sec)
206.El
207.Pp
208Each
209.Tn USB
210has a USB controller that is the master of the bus.
211The physical communication is simplex which means the host controller only communicates with one USB device at a time.
212.Pp
213There can be up to 127 devices connected to an USB HUB tree.
214The addresses are assigned
215dynamically by the host when each device is attached to the bus.
216.Pp
217Within each device there can be up to 16 endpoints.
218Each endpoint
219is individually addressed and the addresses are static.
220Each of these endpoints will communicate in one of four different modes:
221.Em control , isochronous , bulk ,
222or
223.Em interrupt .
224A device always has at least one endpoint.
225This endpoint has address 0 and is a control
226endpoint and is used to give commands to and extract basic data,
227such as descriptors, from the device.
228Each endpoint, except the control endpoint, is unidirectional.
229.Pp
230The endpoints in a device are grouped into interfaces.
231An interface is a logical unit within a device; e.g.\&
232a compound device with both a keyboard and a trackball would present
233one interface for each.
234An interface can sometimes be set into different modes,
235called alternate settings, which affects how it operates.
236Different alternate settings can have different endpoints
237within it.
238.Pp
239A device may operate in different configurations.
240Depending on the
241configuration, the device may present different sets of endpoints
242and interfaces.
243.Pp
244The bus enumeration of the
245.Tn USB
246bus proceeds in several steps:
247.Bl -enum
248.It
249Any interface specific driver can attach to the device.
250.It
251If none is found, generic interface class drivers can attach.
252.El
253.Sh SEE ALSO
254The
255.Tn USB
256specifications can be found at:
257.Pp
258.D1 Pa http://www.usb.org/developers/docs/
259.Pp
260.Xr usbhidaction 1 ,
261.Xr usbhidctl 1 ,
262.Xr libusb 3 ,
263.Xr libusb20 3 ,
264.Xr usbhid 3 ,
265.Xr aue 4 ,
266.Xr axe 4 ,
267.Xr axge 4 ,
268.Xr cdce 4 ,
269.Xr cue 4 ,
270.Xr ehci 4 ,
271.Xr ipheth 4 ,
272.Xr kue 4 ,
273.Xr mos 4 ,
274.Xr ohci 4 ,
275.Xr pci 4 ,
276.Xr rum 4 ,
277.Xr run 4 ,
278.Xr u3g 4 ,
279.Xr uark 4 ,
280.Xr uaudio 4 ,
281.Xr ubsa 4 ,
282.Xr ubser 4 ,
283.Xr uchcom 4 ,
284.Xr ucom 4 ,
285.Xr ucycom 4 ,
286.Xr udav 4 ,
287.Xr uep 4 ,
288.Xr ufm 4 ,
289.Xr ufoma 4 ,
290.Xr uftdi 4 ,
291.Xr ugen 4 ,
292.Xr ugensa 4 ,
293.Xr uhci 4 ,
294.Xr uhid 4 ,
295.Xr uipaq 4 ,
296.Xr ukbd 4 ,
297.Xr ulpt 4 ,
298.Xr umass 4 ,
299.Xr umcs 4 ,
300.Xr umct 4 ,
301.Xr umodem 4 ,
302.Xr umoscom 4 ,
303.Xr ums 4 ,
304.Xr uplcom 4 ,
305.Xr urio 4 ,
306.Xr urndis 4 ,
307.Xr urtwn 4 ,
308.Xr usb_template 4 ,
309.Xr usfs 4 ,
310.Xr uslcom 4 ,
311.Xr uvisor 4 ,
312.Xr uvscom 4 ,
313.Xr wsp 4 ,
314.Xr xhci 4 ,
315.Xr usbconfig 8 ,
316.Xr usbdi 9
317.Sh STANDARDS
318The
319.Nm
320module complies with the USB 2.0 standard.
321.Sh HISTORY
322The
323.Nm
324module has been inspired by the
325.Nx
326USB stack initially written by Lennart Augustsson.
327The
328.Nm
329module was written by
330.An Hans Petter Selasky Aq Mt hselasky@FreeBSD.org .
331