When connecting a device to a computer, the process of loading the driver behind the USB interface is a "black box" state for ordinary users, but this is the key to ensuring that the device can run normally and at high speed.

xHCI controller and USB 3.0 driver
When a device is connected to a USB 3.0 interface, the operating system will recognize the extended host controller interface (xHCI), and the system will immediately load a set of driver stacks designed for USB 3.0. The cornerstone of this stack is the xHCI driver, which directly talks to the hardware and is responsible for performing many low-level tasks such as initializing memory-mapped input and output registers and establishing necessary data structures.
The work carried out by the xHCI driver has the characteristics of a link between the previous and the next. It will convert the data transfer instructions sent by the upper-layer software into a specific .command format that the hardware can understand, that is, the transmission request block, and then accurately submit it to the controller hardware for execution. This process ensures that high-speed USB configurations, such as external solid-state drives, can achieve stable operation at a speed close to the theoretical value.
The role of USB host controller extension
On top of the xHCI driver, there is a key component, which is the USB host controller extension driver. This USB host controller extension driver is an extension module based on the KMDF framework. This driver provides a common, unified abstract interface for higher-level software, thus preventing those software from directly dealing with complex and diverse hardware controllers.
First of all, it should be noted that its core function is request queuing, which is the key. Then, the upper-layer software only needs to send the request to this common interface, and then the extension driver will take on the responsibility of arranging it efficiently and relatively orderly, and forward it to the specific hardware driver like xHCI. Another point is that it can replace some specific functions, which simplifies the design and operation process of the entire driver stack.
New center driver
Within the USB 3.0 driver stack, there is a new core driver that uses the KMDF driver model. It is at a central location and is responsible for analyzing various requests and information from the upper layer. Based on the analysis results, it makes key routing decisions.
For any request that needs to interact with hardware, the central driver will send it to the USB host controller extension mentioned earlier. For other types of requests or information, it may be handled by itself or transferred to other appropriate modules. This design enhances the modularity and processing flexibility of the driver stack.
USB 2.0 driver stack
For devices connected to legacy eHCI, oHCI or uHCI controllers, an additional USB 2.0 driver stack will be loaded. This stack is mainly used to support high-speed devices defined by the USB 2.0 specification. Its design goals and working methods are different from the USB 3.0 stack.
When the system starts up and detects the host controller hardware, it will automatically load the corresponding miniport driver according to the hardware type. For example, the usbuhci.sys driver for the universal host control interface replaces the old driver from the Windows 2000 era. After that, the system will load the usbehci.sys for the USB 2.0 controller and the usbuhci.sys or usbohci.sys driver for the USB 1.1 controller according to the specific configuration.
USB universal parent driver and feature updates
If there is a composite USB device with multiple functions, once a specific parent driver is missing, the system will load the USB universal parent driver (usbccgp.sys). As the parent driver of these composite devices, it is responsible for coordinating and managing each of its sub-function devices.
Since Windows 8, the USB driver stack has been significantly updated, adding support for the function suspend function defined in the USB 3.0 specification and adding support for the remote wake-up function defined in the USB 3.0 specification. This allows operating systems and devices to more granularly manage power states, which allows operating systems and devices to improve energy efficiency and allows devices to be woken up by specific events in low-power states.
Client Drivers and Help Libraries
Software called a USB client driver can communicate directly with USB devices. It can be either for a specific device class or for a specific device. These drivers create and send requests to communicate with the device by calling standard interfaces exposed by the USB driver stack.
The system's built-in usbstor.sys or usbhub.sys will be automatically installed as function drivers for many ordinary USB devices that do not require special custom functions. If the device provides a matching compatible ID in the MS OS descriptor, the system can automatically load the appropriate driver, simplifying the user installation process. Microsoft also provides a dedicated helper library to assist kernel-mode drivers and applications to communicate efficiently with the USB driver stack.
In your daily use, do you pay more attention to the transfer rate of the USB interface, or the convenience of plug-and-play and driver-free installation of the device? You are welcome to share your views in the comment area, and please like this article to support it.

