Anonymous user
Universal Serial Bus: Difference between revisions
finished up, moved old information into more specific wiki entry stubs
[unchecked revision] | [unchecked revision] |
(finished framework section) |
(finished up, moved old information into more specific wiki entry stubs) |
||
Line 2,009:
|}
This section discusses how system software is typically, reasonably organized. This section also serves as an index to the wiki entries which provide, or will provide, farther information and perhaps programming examples.
▲* Typical organization of system software
==
As with any device driver, a USB device driver abstracts away from the low-level details on just how a specific device is being accessed, and provides the rest of the system and applications with a common interface (e.g, a file manager shouldn't have to know whether it is dealing with an external versus internal hard drive).
USB device drivers typically implement a certain class of device as per the appropriate specifications. Such classes of USB devices include, but are not limited to:
=== USB keyboards/mice ===▼
* [[USB Mass Storage Class Devices]]
* [[USB Human Input Devices]]
Even a USB device driver need not be concerned with some of the lower-level details. For instance, it shouldn't matter to the device driver if a device is connected directly to the root hub, or if it lies behind 3 hubs. The device driver shouldn't worry about how much power the device needs from the bus. This is where the USB driver comes in.
The USB driver essentially provides the USB framework interface to device drivers. The USB driver also handles connect and disconnect events on the USB, as well as determining which device driver is needed (according to the Class, Subclass, and Protocol codes), and if that device driver even exists.
===
Although the USB Driver knows some details about the USB topography, the responsibility of hub-specific communication (including split-transactions) is often separated from the USB Driver into another module called the USB Hub Driver.
Depending on the design of the system, the USB Driver might bypass the USB Hub Driver when communicating with devices on the root hub, or the system may use the reserved address of 0 to indicate the root hub to the USB Hub Driver (it appears that Linux does this).
Details on USB Hubs will eventually be discussed in the [[USB Hubs]] wiki entry.
=== Host Controller Driver ===
As a request for a data transfer moves from the device driver, through the USB Driver, and through the USB Hub Driver, the request gains all the information needed for the host controller to generate the appropriate transactions on the bus. However, depending on the host controller, this information needs to be formatted in a certain way and added for scheduling by the host controller.
This task if given to the host controller driver. Requests reach the host controller driver in a system-defined format, often called a USB Request Block (URB), or an I/O Request Packet (IRP).
Additionally, host controller drivers are loaded by the PCI subsystem when a corresponding host controller is discovered during PCI enumeration. The host controller driver is thus also responsible for initializing the host controller and perhaps loading the USB Hub Driver and the USB driver. Combined, the USB driver, USB hub driver, and the host controller driver make up a USB subsystem.
Details on implementing host controller drivers for a specific host controller may eventually be found at the following wiki entries:
* [[Programming the EHCI]]
* [[Programming the UHCI]]
* [[Programming the OHCI]]
== See Also ==
Line 2,031 ⟶ 2,047:
=== Links ===
* [http://www.usb.org/home USB.org]
* [http://www.usb.org/developers/docs/usb_20_052709.zip USB 2.0 Specifications]
* [http://www.usb.org/developers/hidpage/ information about the HID standard].
* [http://www.kernel.org/ The Linux kernel] (though things tends to be confusing there, and you have to be careful with educating yourself from Linux sources if your project isn't GPL'ed).
* In [http://developer.intel.com/ Intel] chipsets manuals.
* [http://www.beyondlogic.org/usbnutshell/usb1.htm USB in a Nutshell] may also interest you. It looks like a really good tutorial giving all the required knowledge to understand any other USB documentation/source code in a couple of HTML pages ...
=== Forum Topics ===
* [[Topic:8096|USB driver]] - suggests a few startup links about USB
* [[Topic:8692|support USB keyboard]] explained by Schol-R-Lea
|