Commit 2797cd03 authored by Oliver Neukum's avatar Oliver Neukum Committed by Jonathan Corbet

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: default avatarOliver Neukum <oneukum@suse.com>
Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent fdd91a3d
...@@ -47,39 +47,24 @@ ...@@ -47,39 +47,24 @@
root (the system's master), hubs as interior nodes, and root (the system's master), hubs as interior nodes, and
peripherals as leaves (and slaves). peripherals as leaves (and slaves).
Modern PCs support several such trees of USB devices, usually Modern PCs support several such trees of USB devices, usually
one USB 2.0 tree (480 Mbit/sec each) with a few USB 3.0 (5 GBit/s) or USB 3.1 (10 GBit/s) and some legacy
a few USB 1.1 trees (12 Mbit/sec each) that are used when you USB 2.0 (480 MBit/s) busses just in case.
connect a USB 1.1 device directly to the machine's "root hub".
</para> </para>
<para>That master/slave asymmetry was designed-in for a number of <para>That master/slave asymmetry was designed-in for a number of
reasons, one being ease of use. It is not physically possible to reasons, one being ease of use. It is not physically possible to
assemble (legal) USB cables incorrectly: all upstream "to the host" mistake upstream and downstream or it does not matter with a type C
connectors are the rectangular type (matching the sockets on plug
root hubs), and all downstream connectors are the squarish type
(or they are built into the peripheral). (or they are built into the peripheral).
Also, the host software doesn't need to deal with distributed Also, the host software doesn't need to deal with distributed
auto-configuration since the pre-designated master node manages all that. auto-configuration since the pre-designated master node manages all that.
And finally, at the electrical level, bus protocol overhead is reduced by
eliminating arbitration and moving scheduling into the host software.
</para>
<para>USB 1.0 was announced in January 1996 and was revised
as USB 1.1 (with improvements in hub specification and
support for interrupt-out transfers) in September 1998.
USB 2.0 was released in April 2000, adding high-speed
transfers and transaction-translating hubs (used for USB 1.1
and 1.0 backward compatibility).
</para> </para>
<para>Kernel developers added USB support to Linux early in the 2.2 kernel <para>Kernel developers added USB support to Linux early in the 2.2 kernel
series, shortly before 2.3 development forked. Updates from 2.3 were series and have been developing it further since then. Besides support
regularly folded back into 2.2 releases, which improved reliability and for each new generation of USB, various host controllers gained support,
brought <filename>/sbin/hotplug</filename> support as well more drivers. new drivers for peripherals have been added and advanced features for latency
Such improvements were continued in the 2.5 kernel series, where they added measurement and improved power management introduced.
USB 2.0 support, improved performance, and made the host controller drivers
(HCDs) more consistent. They also simplified the API (to make bugs less
likely) and added internal "kerneldoc" documentation.
</para> </para>
<para>Linux can run inside USB devices as well as on <para>Linux can run inside USB devices as well as on
...@@ -121,12 +106,17 @@ ...@@ -121,12 +106,17 @@
<listitem><para>The device description model includes one or more <listitem><para>The device description model includes one or more
"configurations" per device, only one of which is active at a time. "configurations" per device, only one of which is active at a time.
Devices that are capable of high-speed operation must also support Devices are supposed to be capable of operating at lower than their top
full-speed configurations, along with a way to ask about the speeds and may provide a BOS descriptor showing the lowest speed they
"other speed" configurations which might be used. remain fully operational at.
</para></listitem>
<listitem><para>From USB 3.0 on configurations have one or more "functions", which
provide a common functionality and are grouped together for purposes
of power management.
</para></listitem> </para></listitem>
<listitem><para>Configurations have one or more "interfaces", each <listitem><para>Configurations or functions have one or more "interfaces", each
of which may have "alternate settings". Interfaces may be of which may have "alternate settings". Interfaces may be
standardized by USB "Class" specifications, or may be specific to standardized by USB "Class" specifications, or may be specific to
a vendor or device.</para> a vendor or device.</para>
...@@ -135,7 +125,7 @@ ...@@ -135,7 +125,7 @@
Think of them as "interface drivers", though you Think of them as "interface drivers", though you
may not see many devices where the distinction is important. may not see many devices where the distinction is important.
<emphasis>Most USB devices are simple, with only one configuration, <emphasis>Most USB devices are simple, with only one configuration,
one interface, and one alternate setting.</emphasis> one function, one interface, and one alternate setting.</emphasis>
</para></listitem> </para></listitem>
<listitem><para>Interfaces have one or more "endpoints", each of <listitem><para>Interfaces have one or more "endpoints", each of
...@@ -161,26 +151,25 @@ ...@@ -161,26 +151,25 @@
<para>Accordingly, the USB Core API exposed to device drivers <para>Accordingly, the USB Core API exposed to device drivers
covers quite a lot of territory. You'll probably need to consult covers quite a lot of territory. You'll probably need to consult
the USB 2.0 specification, available online from www.usb.org at the USB 3.0 specification, available online from www.usb.org at
no cost, as well as class or device specifications. no cost, as well as class or device specifications.
</para> </para>
<para>The only host-side drivers that actually touch hardware <para>The only host-side drivers that actually touch hardware
(reading/writing registers, handling IRQs, and so on) are the HCDs. (reading/writing registers, handling IRQs, and so on) are the HCDs.
In theory, all HCDs provide the same functionality through the same In theory, all HCDs provide the same functionality through the same
API. In practice, that's becoming more true on the 2.5 kernels, API. In practice, that's becoming mostly true,
but there are still differences that crop up especially with but there are still differences that crop up especially with
fault handling. Different controllers don't necessarily report fault handling on the less common controllers.
Different controllers don't necessarily report
the same aspects of failures, and recovery from faults (including the same aspects of failures, and recovery from faults (including
software-induced ones like unlinking an URB) isn't yet fully software-induced ones like unlinking an URB) isn't yet fully
consistent. consistent.
Device driver authors should make a point of doing disconnect Device driver authors should make a point of doing disconnect
testing (while the device is active) with each different host testing (while the device is active) with each different host
controller driver, to make sure drivers don't have bugs of controller driver, to make sure drivers don't have bugs of
their own as well as to make sure they aren't relying on some thei1r own as well as to make sure they aren't relying on some
HCD-specific behavior. HCD-specific behavior.
(You will need external USB 1.1 and/or
USB 2.0 hubs to perform all those tests.)
</para> </para>
</chapter> </chapter>
...@@ -216,7 +205,7 @@ ...@@ -216,7 +205,7 @@
<para>There are two basic I/O models in the USB API. <para>There are two basic I/O models in the USB API.
The most elemental one is asynchronous: drivers submit requests The most elemental one is asynchronous: drivers submit requests
in the form of an URB, and the URB's completion callback in the form of an URB, and the URB's completion callback
handle the next step. handles the next step.
All USB transfer types support that model, although there All USB transfer types support that model, although there
are special cases for control URBs (which always have setup are special cases for control URBs (which always have setup
and status stages, but may not have a data stage) and and status stages, but may not have a data stage) and
...@@ -252,7 +241,7 @@ ...@@ -252,7 +241,7 @@
<para>These APIs are only for use by host controller drivers, <para>These APIs are only for use by host controller drivers,
most of which implement standard register interfaces such as most of which implement standard register interfaces such as
EHCI, OHCI, or UHCI. XHCI, EHCI, OHCI, or UHCI.
UHCI was one of the first interfaces, designed by Intel and UHCI was one of the first interfaces, designed by Intel and
also used by VIA; it doesn't do much in hardware. also used by VIA; it doesn't do much in hardware.
OHCI was designed later, to have the hardware do more work OHCI was designed later, to have the hardware do more work
...@@ -260,13 +249,16 @@ ...@@ -260,13 +249,16 @@
EHCI was designed with USB 2.0; its design has features that EHCI was designed with USB 2.0; its design has features that
resemble OHCI (hardware does much more work) as well as resemble OHCI (hardware does much more work) as well as
UHCI (some parts of ISO support, TD list processing). UHCI (some parts of ISO support, TD list processing).
XHCI was designed with USB 3.0. It continues to shift support
for functionality into hardware.
</para> </para>
<para>There are host controllers other than the "big three", <para>There are host controllers other than the "big three",
although most PCI based controllers (and a few non-PCI based although most PCI based controllers (and a few non-PCI based
ones) use one of those interfaces. ones) use one of those interfaces.
Not all host controllers use DMA; some use PIO, and there Not all host controllers use DMA; some use PIO, and there
is also a simulator. is also a simulator and a virtual host controller to pipe
USB over the network.
</para> </para>
<para>The same basic APIs are available to drivers for all <para>The same basic APIs are available to drivers for all
...@@ -275,7 +267,7 @@ ...@@ -275,7 +267,7 @@
<structname>struct usb_bus</structname> is a rather thin <structname>struct usb_bus</structname> is a rather thin
layer that became available in the 2.2 kernels, while layer that became available in the 2.2 kernels, while
<structname>struct usb_hcd</structname> is a more featureful <structname>struct usb_hcd</structname> is a more featureful
layer (available in later 2.4 kernels and in 2.5) that layer that
lets HCDs share common code, to shrink driver size lets HCDs share common code, to shrink driver size
and significantly reduce hcd-specific behaviors. and significantly reduce hcd-specific behaviors.
</para> </para>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment