Windows universal serial bus controller driver

Universal Serial Bus (USB)

Universal Serial Bus (USB) provides an expandable, hot-pluggable Plug and Play serial interface that ensures a standard, low-cost connection for peripheral devices such as keyboards, mice, joysticks, printers, scanners, storage devices, modems, and video conferencing cameras. Migration to USB is recommended for all peripheral devices that use legacy ports such as PS/2, serial, and parallel ports.

The USB-IF is a Special Interest Groups (SIGs) that maintains the Official USB Specification, test specifications and tools.

Windows operating systems include native support for USB host controllers, hubs, and devices and systems that comply with the official USB specification. Windows also provides programming interfaces that you can use to develop device drivers and applications that communicate with a USB device.

USB in Windows

Overview of new features and improvements in USB in WindowsВ 10.

Frequently asked questions from driver developers about the USB stack and features that are supported in USB.

Windows defines MS OS descriptors that allows better enumeration when connected to system running Windows operating system

Microsoft-provided USB drivers

A set of drivers for handling common function logic for USB devices.

Microsoft provides a core stack of drivers that interoperate with devices that are connected to EHCI and xHCI controllers.

Windows provides in-box device class drivers for many USB-IF approved device classes, audio, mass storage, and so on.

Windows provides Winusb.sys that can be loaded as a function driver for a custom device and a function of a composite device.

Parent driver for USB devices with multiple functions. Usbccgp creates physical device objects (PDOs) for each of those functions. Those individual PDOs are managed by their respective USB function drivers, which could be the Winusb.sys driver or a USB device class driver.

WDF extension for developing USB drivers

  • USB connector manager class extension (UcmCx) reference
    • Ucmmanager.h
  • USB host controller (UCX) reference
    • Ucxclass.h
    • Ucxcontroller.h
    • Ucxroothub.h
    • Ucxusbdevice.h
    • Ucxendpoint.h
    • Ucxsstreams.h
  • USB function class extension (UFX) reference
    • Ufxbase.h
    • Ufxclient.h
    • Ufxproprietarycharger.h

Testing USB devices with Windows

Get information about the tools that you can use to test your USB hardware or software, capture traces of operations and other system events, and observe how the USB driver stack responds to a request sent by a client driver or an application.

Read an overview of tests in the Hardware Certification Kit that enable hardware vendors and device manufacturers to prepare their USB devices and host controllers for Windows Hardware Certification submission.

Other Resources for USB

Provides complete technical details for the USB protocol.

Check out posts written by the Microsoft USB Team. The blog focuses on the Windows USB driver stack that works with various USB Host controllers and USB hubs found in Windows PC. A useful resource for USB client driver developers and USB hardware designers understand the driver stack implementation, resolve common issues, and explain how to use tools for gathering traces and log files.

Discussion list managed by OSR Online for kernel-mode driver developers.

Miscellaneous resources based on frequently asked questions from developers who are new to developing USB devices and drivers that work with Windows operating systems.

USB-related videos

USB hardware for learning

MUTT and SuperMUTT devices and the accompanying software package are integrated into the HCK suite of USB tests. They provide automated testing that can be used during the development cycle of USB controllers, devices and systems, especially stress testing.

If you are new to USB driver development. The kit is the most suitable to study USB samples included in this documentation set. You can get the learning kit from OSR Online Store.

Write a USB client driver (KMDF, UMDF)

Introduces you to USB driver development. Provides information about choosing the most appropriate model for providing a USB driver for your device. This section also includes tutorials about writing your first user-mode and kernel-mode USB drivers by using the USB templates included with Microsoft Visual Studio.

Write a USB host controller driver

If you are developing an xHCI host controller that is not compliant with the specification or developing a custom non-xHCI hardware (such as a virtual host controller), you can write a host controller driver that communicates with UCX. For example, consider a wireless dock that supports USB devices. The PC communicates with USB devices through the wireless dock by using USB over TCP as a transport.

Write a function controller driver for a USB device

You can develop a controller driver that handles all USB data transfers and commands sent by the host to the device. This driver communicates with the Microsoft-provided USB function controller extension (UFX).

Write a USB Type-C connector driver

WindowsВ 10 introduces support for the new USB connector: USB Type-C. You can write a driver for the connector that communicates with the Microsoft-provided class extension module: UcmCx to handle scenarios related to Type-C connectors such as, which ports support Type-C, which ports support power delivery.

USB connector manager class extension (UcmCx) reference

  • Ucmmanager.h

Write a USB dual-role controller driver

USB Dual Role controllers are now supported in WindowsВ 10. Windows includes in-box client drivers for ChipIdea and Synopsys controllers. For other controllers, Microsoft provides a set of programming interfaces that allow the dual-role class extension (UrsCx) and its client driver to communicate with each other to handle the role-switching capability of a dual-role controller.

For more information about this feature, see:

USB dual-role controller driver programming reference

  • Ursdevice.h

Write a USB driver for emulated devices

WindowsВ 10 introduces support for emulated devices. Now you can develop an emulated Universal Serial Bus (USB) host controller driver and a connected virtual USB device. Both components are combined into a single KMDF driver that communicates with the Microsoft-provided USB device emulation class extension (UdeCx).

Write a UWP app

Provides step-by-step instructions about implementing USB features in a UWP app. To write such an app for a USB device you need Visual Studio and Microsoft Windows Software Development Kit (SDK) .

Write a Windows desktop app

Describes how an application can call WinUSB Functions to communicate with a USB device.

List of common tasks that a driver or an app performs in order to communicate with a USB device. Get quick info about the programming interfaces you need for each task.

Universal Serial Bus (USB)

This reference section describes the driver programming interfaces that are included in the Windows Driver Kit (WDK). The programming interfaces are used for developing drivers that interact with USB devices, host controllers, connectors. These include export functions that the drivers can call, callback routines that the driver can implement, I/O requests that the driver can send to the Microsoft-provided USB driver stack, and various data structures that are used in those requests.

For the programming guide, see Universal Serial Bus (USB).

Common USB client driver reference

A Windows Driver Model (WDM)-based USB client driver can call functions to communicate with the Microsoft-provided USB driver stack. These functions are defined in Usbdlib.h and the client driver requires the Usbdex.lib library. The library gets loaded and statically linked to the client driver module when it is built. A client driver that calls these routines can run on Windows Vista and later versions of Windows.

Programming Guide

Headers

Deprecated functions, IOCTL requests for all USB drivers

These functions have been deprecated.

  • USBD_CalculateUsbBandwidth
  • USBD_CreateConfigurationRequest
  • USBD_Debug_LogEntry
  • USBD_GetUSBDIVersion
  • USBD_ParseConfigurationDescriptor
  • USBD_QueryBusTime
  • USBD_RegisterHcFilter

These I/O requests have been deprecated or reserved for internal use.

USB client drivers must not use these I/O requests:

  • IOCTL_USB_DIAG_IGNORE_HUBS_OFF
  • IOCTL_USB_DIAG_IGNORE_HUBS_ON
  • IOCTL_USB_DIAGNOSTIC_MODE_OFF
  • IOCTL_USB_DIAGNOSTIC_MODE_ON
  • IOCTL_USB_GET_HUB_CAPABILITIES
  • IOCTL_USB_HCD_DISABLE_PORT
  • IOCTL_USB_HCD_ENABLE_PORT
  • IOCTL_USB_HCD_GET_STATS_1
  • IOCTL_USB_HCD_GET_STATS_2
  • IOCTL_USB_RESET_HUB

Kernel-Mode IOCTLs

USB client drivers can receive or send any of the following I/O requests in kernel mode:

User-Mode IOCTLs sent by applications and services

USB client drivers receive these user-mode I/O control requests at the kernel level:

Dual-role controller driver reference

A USB driver for a dual-role controller can behave as a host controller or a function controller depending on the hardware to which it is connected. These controllers are common on mobile devices and allow for connections to PCs, as well as USB peripherals like keyboards and mice. A mobile device can behave as a peripheral when it is connected to a PC, allowing you to transfer files between your PC and the mobile device. In that scenario, the controller on the device operates in the function role. Conversely, the controller can operate in the host role when connected to USB peripherals like storage drives, keyboard, mice.

One of the main responsibilities of a driver for a dual-role controller is to switch between those two roles, tearing down the previous role’s device node and loading the device node for the new role. When writing the driver, use the WDF class extension-client driver model. For more information about the WDF class extension-client driver model, see Ursdevice.h.

Dual-role controller driver programming guide

For information about enabling a Windows system for USB dual-role support, see USB Dual Role Driver Stack Architecture.

Dual-role controller driver headers

Emulated host controller driver reference

Windows drivers can present non-USB devices as emulated USB devices. By using the WDF class extension-client driver model, you can write a driver that translates USB-level constructs (reset, data transfers) to the actual underlying bus by using the hardware’s interface. The class extension and the client driver represent an emulated host controller with a root hub that is capable of presenting an attached device to the system as an USB device.

  • USB device emulation class extension (UdeCx). This is an in-box driver included Windows 10.
  • The client driver is written by an IHV/OEM. This driver is referred to as the UDE client driver.

The driver pair loads as the FDO in the host controller device stack. The UDE client driver communicates with Udecx by using a set of methods and event callback functions to handle device requests and notify the class extension about various events.

Emulated host controller programming guide

Emulated host controller headers

Function class driver reference

A USB function class driver implements the functionality of a specific interface (or group of interfaces) on the USB device. The class driver handle requests issued by user mode services, or it can forwards requests to USB function class extension (UFX) and its function client driver. Certain class drivers are included in Windows, such as MTP and IpOverUsb. Windows also provides a generic kernel-mode class driver, Generic USBFN (GenericUSBFn.sys). If a particular interface or functionality is not provided by a system-supplied driver, you might need write a function class driver. The class driver may be implemented as a kernel-mode driver by using Windows Driver Frameworks (WDF). Alternatively, you may implement it as a user-mode service. In that case, your class driver must be paired with the system-supplied class driver, Generic USBFN. For example, the MTP class driver runs as a user-mode service that transferring files to and from the device.

Function class driver headers

USB function controller client driver reference

The USB function client driver is responsible for implementing a function controller-specific operations. The client driver communicates with the USB function class extension (UFX) module to handle endpoint data transfers, USB device state changes (reset, suspend, resume), attach/detach detection, port/charger detection. The client driver is also responsible for handling power management, and PnP events.

USB function controller client driver programming guide

USB function controller client driver headers

Filter driver for supporting USB chargers

Write a filter driver that supports detection of chargers, if the function controller uses the in-box Synopsys and ChipIdea drivers. If you are writing a client driver for a proprietary function controller, charger/attach detection is integrated in the client driver by implementing EVT_UFX_DEVICE_PROPRIETARY_CHARGER_SET_PROPERTY, EVT_UFX_DEVICE_PROPRIETARY_CHARGER_RESET, and EVT_UFX_DEVICE_DETECT_PROPRIETARY_CHARGER.

Filter driver for supporting USB chargers programming guide

Filter driver for supporting USB chargers headers

Host controller driver reference

The USB host controller extension is a system-supplied extension to the Kernel-Mode Driver Framework (KMDF). Within the Microsoft USB Driver Stack Architecture, UCX provides functionality to assist a host controller client driver in managing a USB host controller device. The client driver handles hardware operations and events, power management, and PnP events. UCX serves as an abstracted interface to the rest of the Microsoft USB 3.0 stack, queues requests to the client driver, and performs other tasks.

If you are developing an xHCI host controller that is not compliant with the specification or developing a custom non-xHCI hardware (such as a virtual host controller), you can write a host controller driver that communicates with the UCX class extension.

Host controller driver programming guide

Host controller driver headers

Type-C driver reference

Windows 10 introduces support for the new USB connector: USB Type-C. You can write a driver for these scenarios:

Читайте также:  Intel gma 500 драйвер для windows 10
Оцените статью