]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man4/usb.4
disk(9): Fix a few mandoc related errors
[FreeBSD/FreeBSD.git] / share / man / man4 / usb.4
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$
26 .\"
27 .Dd September 7, 2020
28 .Dt USB 4
29 .Os
30 .Sh NAME
31 .Nm usb
32 .Nd Universal Serial Bus
33 .Sh SYNOPSIS
34 To compile this driver into the kernel,
35 place the following line in your
36 kernel configuration file:
37 .Bd -ragged -offset indent
38 .Cd "device usb"
39 .Ed
40 .Pp
41 Alternatively, to load the driver as a
42 module at boot time, place the following line in
43 .Xr loader.conf 5 :
44 .Bd -literal -offset indent
45 usb_load="YES"
46 .Ed
47 .Sh USERLAND PROGRAMMING
48 USB functions can be accessed from userland through the libusb library.
49 See
50 .Xr libusb 3
51 for more information.
52 .Sh DESCRIPTION
53 .Fx
54 provides machine-independent bus support and drivers for
55 USB devices in host and device side mode.
56 .Pp
57 The
58 .Nm
59 driver has three layers:
60 .Bl -tag -width 6n -offset indent
61 .It USB Controller (Bus)
62 .It USB Device
63 .It USB Driver
64 .El
65 .Pp
66 The controller attaches to a physical bus
67 like
68 .Xr pci 4 .
69 The USB bus attaches to the controller, and the root hub attaches
70 to the controller.
71 Any devices attached to the bus will attach to the root hub
72 or another hub attached to the USB bus.
73 .Pp
74 The
75 .Nm uhub
76 device will always be present as it is needed for the root hub.
77 .Sh INTRODUCTION TO USB
78 The USB is a system where external devices can be connected to a PC.
79 The most common USB speeds are:
80 .Bl -tag -width 6n -offset indent
81 .It Low Speed (1.5 MBit/sec)
82 .It Full Speed (12 MBit/sec)
83 .It High Speed (480 MBit/sec)
84 .It SuperSpeed (5 GBit/sec)
85 .El
86 .Pp
87 Each USB has a USB controller that is the master of the bus.
88 The physical communication is simplex which means the host controller only
89 communicates with one USB device at a time.
90 .Pp
91 There can be up to 127 devices connected to an USB HUB tree.
92 The addresses are assigned dynamically by the host when each device is
93 attached to the bus.
94 .Pp
95 Within each device there can be up to 16 endpoints.
96 Each endpoint is individually addressed and the addresses are static.
97 Each of these endpoints will communicate in one of four different modes:
98 .Em control , isochronous , bulk ,
99 or
100 .Em interrupt .
101 A device always has at least one endpoint.
102 This endpoint has address 0 and is a control endpoint and is used to give
103 commands to and extract basic data, such as descriptors, from the device.
104 Each endpoint, except the control endpoint, is unidirectional.
105 .Pp
106 The endpoints in a device are grouped into interfaces.
107 An interface is a logical unit within a device, e.g., a compound device with
108 both a keyboard and a trackball, would present one interface for each.
109 An interface can sometimes be set into different modes, called alternate
110 settings, which affects how it operates.
111 Different alternate settings can have different endpoints within it.
112 .Pp
113 A device may operate in different configurations.
114 Depending on the configuration, the device may present different sets of
115 endpoints and interfaces.
116 .Pp
117 The bus enumeration of the USB bus proceeds in several steps:
118 .Bl -enum
119 .It
120 Any interface specific driver can attach to the device.
121 .It
122 If none is found, generic interface class drivers can attach.
123 .El
124 .Sh SYSCTL VARIABLES
125 The following variables are available as both
126 .Xr sysctl 8
127 variables and
128 .Xr loader 8
129 tunables:
130 .Bl -tag -width indent
131 .It Va hw.usb.debug
132 Debug output level, where 0 is debugging disabled and larger values increase
133 debug message verbosity.
134 Default is 0.
135 .El
136 .Sh SEE ALSO
137 The USB specifications can be found at:
138 .Pp
139 .D1 Pa https://www.usb.org/documents
140 .Pp
141 .Xr libusb 3 ,
142 .Xr aue 4 ,
143 .Xr axe 4 ,
144 .Xr axge 4 ,
145 .Xr cue 4 ,
146 .Xr ehci 4 ,
147 .Xr kue 4 ,
148 .Xr mos 4 ,
149 .Xr ohci 4 ,
150 .Xr pci 4 ,
151 .Xr rue 4 ,
152 .Xr ucom 4 ,
153 .Xr udav 4 ,
154 .Xr uhci 4 ,
155 .Xr uhid 4 ,
156 .Xr ukbd 4 ,
157 .Xr ulpt 4 ,
158 .Xr umass 4 ,
159 .Xr ums 4 ,
160 .Xr uplcom 4 ,
161 .Xr urio 4 ,
162 .Xr uvscom 4 ,
163 .Xr xhci 4
164 .Xr usbconfig 8 ,
165 .Xr usbdi 9
166 .Sh STANDARDS
167 The
168 .Nm
169 module complies with the USB 3.0 standard.
170 .Sh HISTORY
171 The
172 .Nm
173 module has been inspired by the
174 .Nx
175 USB stack initially written by
176 .An Lennart Augustsson .
177 The
178 .Nm
179 module was written by
180 .An Hans Petter Selasky Aq Mt hselasky@FreeBSD.org .