diff options
author | Oliver Neukum <oneukum@suse.com> | 2016-10-20 09:15:00 -0400 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2016-10-27 19:01:25 -0400 |
commit | 2797cd03f5cca4d9fb2875c9f9c995737ce73469 (patch) | |
tree | 8ca34b1d9df09f95f59087566ed562519ab258e8 /Documentation/DocBook/usb.tmpl | |
parent | fdd91a3dfadfa73bbb54702f1e951e7c17a507d6 (diff) |
USB: update intro of documentation
It does no good to mention The 2.4 kernel series and neglect
USB 3.x and XHCI. Also with type C and micro/mini USB we better
not talk about the shape of connectors.
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'Documentation/DocBook/usb.tmpl')
-rw-r--r-- | Documentation/DocBook/usb.tmpl | 68 |
1 files changed, 30 insertions, 38 deletions
diff --git a/Documentation/DocBook/usb.tmpl b/Documentation/DocBook/usb.tmpl index bc776be0f19c..8ec4d595b218 100644 --- a/Documentation/DocBook/usb.tmpl +++ b/Documentation/DocBook/usb.tmpl | |||
@@ -47,39 +47,24 @@ | |||
47 | root (the system's master), hubs as interior nodes, and | 47 | root (the system's master), hubs as interior nodes, and |
48 | peripherals as leaves (and slaves). | 48 | peripherals as leaves (and slaves). |
49 | Modern PCs support several such trees of USB devices, usually | 49 | Modern PCs support several such trees of USB devices, usually |
50 | one USB 2.0 tree (480 Mbit/sec each) with | 50 | a few USB 3.0 (5 GBit/s) or USB 3.1 (10 GBit/s) and some legacy |
51 | a few USB 1.1 trees (12 Mbit/sec each) that are used when you | 51 | USB 2.0 (480 MBit/s) busses just in case. |
52 | connect a USB 1.1 device directly to the machine's "root hub". | ||
53 | </para> | 52 | </para> |
54 | 53 | ||
55 | <para>That master/slave asymmetry was designed-in for a number of | 54 | <para>That master/slave asymmetry was designed-in for a number of |
56 | reasons, one being ease of use. It is not physically possible to | 55 | reasons, one being ease of use. It is not physically possible to |
57 | assemble (legal) USB cables incorrectly: all upstream "to the host" | 56 | mistake upstream and downstream or it does not matter with a type C |
58 | connectors are the rectangular type (matching the sockets on | 57 | plug |
59 | root hubs), and all downstream connectors are the squarish type | ||
60 | (or they are built into the peripheral). | 58 | (or they are built into the peripheral). |
61 | Also, the host software doesn't need to deal with distributed | 59 | Also, the host software doesn't need to deal with distributed |
62 | auto-configuration since the pre-designated master node manages all that. | 60 | auto-configuration since the pre-designated master node manages all that. |
63 | And finally, at the electrical level, bus protocol overhead is reduced by | ||
64 | eliminating arbitration and moving scheduling into the host software. | ||
65 | </para> | ||
66 | |||
67 | <para>USB 1.0 was announced in January 1996 and was revised | ||
68 | as USB 1.1 (with improvements in hub specification and | ||
69 | support for interrupt-out transfers) in September 1998. | ||
70 | USB 2.0 was released in April 2000, adding high-speed | ||
71 | transfers and transaction-translating hubs (used for USB 1.1 | ||
72 | and 1.0 backward compatibility). | ||
73 | </para> | 61 | </para> |
74 | 62 | ||
75 | <para>Kernel developers added USB support to Linux early in the 2.2 kernel | 63 | <para>Kernel developers added USB support to Linux early in the 2.2 kernel |
76 | series, shortly before 2.3 development forked. Updates from 2.3 were | 64 | series and have been developing it further since then. Besides support |
77 | regularly folded back into 2.2 releases, which improved reliability and | 65 | for each new generation of USB, various host controllers gained support, |
78 | brought <filename>/sbin/hotplug</filename> support as well more drivers. | 66 | new drivers for peripherals have been added and advanced features for latency |
79 | Such improvements were continued in the 2.5 kernel series, where they added | 67 | measurement and improved power management introduced. |
80 | USB 2.0 support, improved performance, and made the host controller drivers | ||
81 | (HCDs) more consistent. They also simplified the API (to make bugs less | ||
82 | likely) and added internal "kerneldoc" documentation. | ||
83 | </para> | 68 | </para> |
84 | 69 | ||
85 | <para>Linux can run inside USB devices as well as on | 70 | <para>Linux can run inside USB devices as well as on |
@@ -121,12 +106,17 @@ | |||
121 | 106 | ||
122 | <listitem><para>The device description model includes one or more | 107 | <listitem><para>The device description model includes one or more |
123 | "configurations" per device, only one of which is active at a time. | 108 | "configurations" per device, only one of which is active at a time. |
124 | Devices that are capable of high-speed operation must also support | 109 | Devices are supposed to be capable of operating at lower than their top |
125 | full-speed configurations, along with a way to ask about the | 110 | speeds and may provide a BOS descriptor showing the lowest speed they |
126 | "other speed" configurations which might be used. | 111 | remain fully operational at. |
112 | </para></listitem> | ||
113 | |||
114 | <listitem><para>From USB 3.0 on configurations have one or more "functions", which | ||
115 | provide a common functionality and are grouped together for purposes | ||
116 | of power management. | ||
127 | </para></listitem> | 117 | </para></listitem> |
128 | 118 | ||
129 | <listitem><para>Configurations have one or more "interfaces", each | 119 | <listitem><para>Configurations or functions have one or more "interfaces", each |
130 | of which may have "alternate settings". Interfaces may be | 120 | of which may have "alternate settings". Interfaces may be |
131 | standardized by USB "Class" specifications, or may be specific to | 121 | standardized by USB "Class" specifications, or may be specific to |
132 | a vendor or device.</para> | 122 | a vendor or device.</para> |
@@ -135,7 +125,7 @@ | |||
135 | Think of them as "interface drivers", though you | 125 | Think of them as "interface drivers", though you |
136 | may not see many devices where the distinction is important. | 126 | may not see many devices where the distinction is important. |
137 | <emphasis>Most USB devices are simple, with only one configuration, | 127 | <emphasis>Most USB devices are simple, with only one configuration, |
138 | one interface, and one alternate setting.</emphasis> | 128 | one function, one interface, and one alternate setting.</emphasis> |
139 | </para></listitem> | 129 | </para></listitem> |
140 | 130 | ||
141 | <listitem><para>Interfaces have one or more "endpoints", each of | 131 | <listitem><para>Interfaces have one or more "endpoints", each of |
@@ -161,26 +151,25 @@ | |||
161 | 151 | ||
162 | <para>Accordingly, the USB Core API exposed to device drivers | 152 | <para>Accordingly, the USB Core API exposed to device drivers |
163 | covers quite a lot of territory. You'll probably need to consult | 153 | covers quite a lot of territory. You'll probably need to consult |
164 | the USB 2.0 specification, available online from www.usb.org at | 154 | the USB 3.0 specification, available online from www.usb.org at |
165 | no cost, as well as class or device specifications. | 155 | no cost, as well as class or device specifications. |
166 | </para> | 156 | </para> |
167 | 157 | ||
168 | <para>The only host-side drivers that actually touch hardware | 158 | <para>The only host-side drivers that actually touch hardware |
169 | (reading/writing registers, handling IRQs, and so on) are the HCDs. | 159 | (reading/writing registers, handling IRQs, and so on) are the HCDs. |
170 | In theory, all HCDs provide the same functionality through the same | 160 | In theory, all HCDs provide the same functionality through the same |
171 | API. In practice, that's becoming more true on the 2.5 kernels, | 161 | API. In practice, that's becoming mostly true, |
172 | but there are still differences that crop up especially with | 162 | but there are still differences that crop up especially with |
173 | fault handling. Different controllers don't necessarily report | 163 | fault handling on the less common controllers. |
164 | Different controllers don't necessarily report | ||
174 | the same aspects of failures, and recovery from faults (including | 165 | the same aspects of failures, and recovery from faults (including |
175 | software-induced ones like unlinking an URB) isn't yet fully | 166 | software-induced ones like unlinking an URB) isn't yet fully |
176 | consistent. | 167 | consistent. |
177 | Device driver authors should make a point of doing disconnect | 168 | Device driver authors should make a point of doing disconnect |
178 | testing (while the device is active) with each different host | 169 | testing (while the device is active) with each different host |
179 | controller driver, to make sure drivers don't have bugs of | 170 | controller driver, to make sure drivers don't have bugs of |
180 | their own as well as to make sure they aren't relying on some | 171 | thei1r own as well as to make sure they aren't relying on some |
181 | HCD-specific behavior. | 172 | HCD-specific behavior. |
182 | (You will need external USB 1.1 and/or | ||
183 | USB 2.0 hubs to perform all those tests.) | ||
184 | </para> | 173 | </para> |
185 | 174 | ||
186 | </chapter> | 175 | </chapter> |
@@ -216,7 +205,7 @@ | |||
216 | <para>There are two basic I/O models in the USB API. | 205 | <para>There are two basic I/O models in the USB API. |
217 | The most elemental one is asynchronous: drivers submit requests | 206 | The most elemental one is asynchronous: drivers submit requests |
218 | in the form of an URB, and the URB's completion callback | 207 | in the form of an URB, and the URB's completion callback |
219 | handle the next step. | 208 | handles the next step. |
220 | All USB transfer types support that model, although there | 209 | All USB transfer types support that model, although there |
221 | are special cases for control URBs (which always have setup | 210 | are special cases for control URBs (which always have setup |
222 | and status stages, but may not have a data stage) and | 211 | and status stages, but may not have a data stage) and |
@@ -252,7 +241,7 @@ | |||
252 | 241 | ||
253 | <para>These APIs are only for use by host controller drivers, | 242 | <para>These APIs are only for use by host controller drivers, |
254 | most of which implement standard register interfaces such as | 243 | most of which implement standard register interfaces such as |
255 | EHCI, OHCI, or UHCI. | 244 | XHCI, EHCI, OHCI, or UHCI. |
256 | UHCI was one of the first interfaces, designed by Intel and | 245 | UHCI was one of the first interfaces, designed by Intel and |
257 | also used by VIA; it doesn't do much in hardware. | 246 | also used by VIA; it doesn't do much in hardware. |
258 | OHCI was designed later, to have the hardware do more work | 247 | OHCI was designed later, to have the hardware do more work |
@@ -260,13 +249,16 @@ | |||
260 | EHCI was designed with USB 2.0; its design has features that | 249 | EHCI was designed with USB 2.0; its design has features that |
261 | resemble OHCI (hardware does much more work) as well as | 250 | resemble OHCI (hardware does much more work) as well as |
262 | UHCI (some parts of ISO support, TD list processing). | 251 | UHCI (some parts of ISO support, TD list processing). |
252 | XHCI was designed with USB 3.0. It continues to shift support | ||
253 | for functionality into hardware. | ||
263 | </para> | 254 | </para> |
264 | 255 | ||
265 | <para>There are host controllers other than the "big three", | 256 | <para>There are host controllers other than the "big three", |
266 | although most PCI based controllers (and a few non-PCI based | 257 | although most PCI based controllers (and a few non-PCI based |
267 | ones) use one of those interfaces. | 258 | ones) use one of those interfaces. |
268 | Not all host controllers use DMA; some use PIO, and there | 259 | Not all host controllers use DMA; some use PIO, and there |
269 | is also a simulator. | 260 | is also a simulator and a virtual host controller to pipe |
261 | USB over the network. | ||
270 | </para> | 262 | </para> |
271 | 263 | ||
272 | <para>The same basic APIs are available to drivers for all | 264 | <para>The same basic APIs are available to drivers for all |
@@ -275,7 +267,7 @@ | |||
275 | <structname>struct usb_bus</structname> is a rather thin | 267 | <structname>struct usb_bus</structname> is a rather thin |
276 | layer that became available in the 2.2 kernels, while | 268 | layer that became available in the 2.2 kernels, while |
277 | <structname>struct usb_hcd</structname> is a more featureful | 269 | <structname>struct usb_hcd</structname> is a more featureful |
278 | layer (available in later 2.4 kernels and in 2.5) that | 270 | layer that |
279 | lets HCDs share common code, to shrink driver size | 271 | lets HCDs share common code, to shrink driver size |
280 | and significantly reduce hcd-specific behaviors. | 272 | and significantly reduce hcd-specific behaviors. |
281 | </para> | 273 | </para> |