]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - share/man/man4/usb.4
MFC r317584:
[FreeBSD/stable/10.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 November 26, 2013
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 .Tn USB
56 devices in host and device side mode.
57 .Pp
58 The
59 .Nm
60 driver 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
67 The controller attaches to a physical bus
68 like
69 .Xr pci 4 .
70 The
71 .Tn USB
72 bus attaches to the controller, and the root hub attaches
73 to the controller.
74 Any devices attached to the bus will attach to the root hub
75 or another hub attached to the
76 .Tn USB
77 bus.
78 .Pp
79 The
80 .Nm uhub
81 device will always be present as it is needed for the
82 root hub.
83 .Sh INTRODUCTION TO USB
84 The
85 .Tn USB
86 is a system where external devices can be connected to a PC.
87 The most common USB speeds are:
88 .Bl -tag -width 6n -offset indent
89 .It Low Speed (1.5MBit/sec)
90 .It Full Speed (12MBit/sec)
91 .It High Speed (480MBit/sec)
92 .El
93 .Pp
94 Each
95 .Tn USB
96 has a USB controller that is the master of the bus.
97 The physical communication is simplex which means the host controller only communicates with one USB device at a time.
98 .Pp
99 There can be up to 127 devices connected to an USB HUB tree.
100 The addresses are assigned
101 dynamically by the host when each device is attached to the bus.
102 .Pp
103 Within each device there can be up to 16 endpoints.
104 Each endpoint
105 is individually addressed and the addresses are static.
106 Each of these endpoints will communicate in one of four different modes:
107 .Em control , isochronous , bulk ,
108 or
109 .Em interrupt .
110 A device always has at least one endpoint.
111 This endpoint has address 0 and is a control
112 endpoint and is used to give commands to and extract basic data,
113 such as descriptors, from the device.
114 Each endpoint, except the control endpoint, is unidirectional.
115 .Pp
116 The endpoints in a device are grouped into interfaces.
117 An interface is a logical unit within a device; e.g.\&
118 a compound device with both a keyboard and a trackball would present
119 one interface for each.
120 An interface can sometimes be set into different modes,
121 called alternate settings, which affects how it operates.
122 Different alternate settings can have different endpoints
123 within it.
124 .Pp
125 A device may operate in different configurations.
126 Depending on the
127 configuration, the device may present different sets of endpoints
128 and interfaces.
129 .Pp
130 The bus enumeration of the
131 .Tn USB
132 bus proceeds in several steps:
133 .Bl -enum
134 .It
135 Any interface specific driver can attach to the device.
136 .It
137 If none is found, generic interface class drivers can attach.
138 .El
139 .Sh SEE ALSO
140 The
141 .Tn USB
142 specifications can be found at:
143 .Pp
144 .D1 Pa http://www.usb.org/developers/docs/
145 .Pp
146 .Xr libusb 3 ,
147 .Xr usbdi 9 ,
148 .Xr aue 4 ,
149 .Xr axe 4 ,
150 .Xr axge 4 ,
151 .Xr cue 4 ,
152 .Xr ehci 4 ,
153 .Xr kue 4 ,
154 .Xr mos 4 ,
155 .Xr ohci 4 ,
156 .Xr pci 4 ,
157 .Xr rue 4 ,
158 .Xr ucom 4 ,
159 .Xr udav 4 ,
160 .Xr uhci 4 ,
161 .Xr uhid 4 ,
162 .Xr ukbd 4 ,
163 .Xr ulpt 4 ,
164 .Xr umass 4 ,
165 .Xr ums 4 ,
166 .Xr uplcom 4 ,
167 .Xr urio 4 ,
168 .Xr uvscom 4 ,
169 .Xr usbconfig 8 ,
170 .Xr xhci 4
171 .Sh STANDARDS
172 The
173 .Nm
174 module complies with the USB 2.0 standard.
175 .Sh HISTORY
176 The
177 .Nm
178 module has been inspired by the NetBSD USB stack initially written by
179 Lennart Augustsson. The
180 .Nm
181 module was written by
182 .An Hans Petter Selasky Aq hselasky@FreeBSD.org .