USB software structure
Sep 01, 2022
Bus interface
The USB bus interface handles the interconnection between the electrical layer and the protocol layer. From the perspective of interconnection, similar bus interfaces are provided by the device and the host at the same time, such as serial interface machine (SIE). The USB bus interface is realized by the main controller.
The USB system uses the main controller to manage the data transmission between the host and the USB device. The interface between it and the main controller depends on the hardware definition of the main controller. At the same time, the USB system is also responsible for managing USB resources, such as bandwidth and bus energy, which makes it possible for customers to access USB. The USB system also has three basic components:
Host controller driver (HCD) this can map different host controller devices into the USB system. The interface between HCD and USB is called HCDI. The specific HCDI is defined by the operating system supporting different master controllers. The universal master controller driver (uhcd) is at the bottom of the soft structure, and it manages and controls the master controller. Uhcd communicates with and controls the USB host controller, and it is hidden from other parts of the system software. The highest layer in the system software communicates with the main controller through the software interface of uhcd.
USB driver (usbd), which is based on uhcd driver, provides driver level interface to meet the requirements of existing device driver design. Usbd provides a data transmission architecture in the form of I / O request packets (IRPs), which consists of the requirements for transmitting data through specific pipes. In addition, usbd makes the client appear as an abstraction of the device to facilitate abstraction and management. As part of the abstraction, usbd has a default pipeline. Through which all USB devices can be accessed for standard USB control. This default pipe describes a logical channel for communication between the usbd and the USB device.
Host software
In some operating systems, USB system software is not provided. These software are originally used to provide configuration information and loading structure to device drivers. In these operating systems, the device driver uses the interface provided by the application instead of directly accessing the USBDI (USB Driver Interface) structure.
USB client software
It is located at the highest level of the software structure and is responsible for handling specific USB device drivers. The client layer describes all software portals that directly act on the device. When the device is detected by the system, these client programs will directly act on the peripheral hardware. This shared feature places the USB system software between the client and its device, which needs to be processed by the client program according to the device image formed by usbd at the client.
Each layer of the host has the following functions:
Detect connected and removed USB devices.
Manage the data flow between the host and the USB device.
Connection USB status and activity statistics.
Control the electrical interface between the main controller and the USB device, including limited energy supply.
HCD provides an abstraction of the main controller and an abstraction of the main controller's perspective of data transmitted through USB. Usbd provides an abstraction of USB devices and data transmission between usbd customers and USB functions. The USB system promotes data transmission between customers and functions, and serves as a control point for the standardized interface of USB devices. The USB system provides buffer management capability and allows data transmission to be synchronized with the needs of customers and functions.







