USB host controller driver programming 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.

UCX client driver support routines

These driver support methods that are implemented by UCX. Your client driver calls these methods to communicate with UCX.

Method Description

UcxInitializeDeviceInit method

Initializes device initialization operations when the Plug and Play (PnP) manager reports the existence of a device.

UcxIoDeviceControl method

Allows USB host controller extension (UCX) to handle an I/O control code (IOCTL) request from user mode.

UcxControllerCreate method

Creates a host controller object.

UcxControllerNeedsReset method

Initiates a non-Plug and Play (PnP) controller reset operation by queuing an event into the controller reset state machine.

UcxControllerResetComplete method

Informs USB Host Controller Extension (UCX) that the reset operation has competed.

UcxControllerSetFailed method

Informs USB Host Controller Extension (UCX) that the controller has encountered a critical failure.

UcxRootHubCreate method

Creates a root hub object for the specified host controller.

UcxRootHubPortChanged method

Notifies UCX about a new port change event on the host controller.

UcxUsbDeviceInitSetEventCallbacks method

Initializes a UCXUSBDEVICE_INIT structure with client driver's event callback functions.

UcxUsbDeviceCreate method

Creates a USB device object on the specified controller.

UcxUsbDeviceRemoteWakeNotification method

Notifies UCX that a remote wake signal from the device is received.

UcxEndpointInitSetEventCallbacks method

Initializes a UCXENDPOINT_INIT structure with client driver's event callback functions related to endpoints on the device.

UcxDefaultEndpointInitSetEventCallbacks method

Initializes a UCXENDPOINT_INIT structure with client driver's event callback functions related to the default endpoint.

UcxEndpointSetWdfIoQueue method

Sets a framework queue on the specified endpoint object.

UcxEndpointCreate method

Creates an endpoint on the specified USB device object.

UcxEndpointGetStaticStreamsReferenced method

Returns a referenced static streams object for the specified endpoint.

UcxEndpointPurgeComplete method

Notifies UCX that a purge operation has been completed on the specified endpoint object.

UcxEndpointAbortComplete method

Notifies UCX that a transfer abort operation has been completed on the specified endpoint object.

UcxEndpointNoPingResponseError method

Notifies UCX about a "No Ping Response" error for a transfer on the specified endpoint object

UcxEndpointNeedToCancelTransfers method

The client driver calls this method before it cancels transfers on the wire.

UcxStaticStreamsSetStreamInfo method

Sets stream information for each stream enabled by the client driver.

UcxStaticStreamsCreate method

Creates a static streams object.

 

Event callback functions

These event callback functions that are defined by the UCX and implemented by your client driver.

Function Description

EVT_UCX_CONTROLLER_GET_CURRENT_FRAMENUMBER

The client driver's implementation that UCX calls to retrieve the current 32-bit frame number.

EVT_UCX_CONTROLLER_GET_FRAME_NUMBER_AND_QPC_FOR_TIME_SYNC

UCX invokes this callback to retrieves the system query performance counter (QPC) value synchronized with the frame and microframe.

EVT_UCX_CONTROLLER_GET_TRANSPORT_CHARACTERISTICS

UCX invokes this callback to retrieve the host controller characteristics.

EVT_UCX_CONTROLLER_QUERY_USB_CAPABILITY

The client driver's implementation to determine if the controller supports a specific capability.

EVT_UCX_CONTROLLER_RESET

The client driver's implementation that UCX calls to reset the controller.

EVT_UCX_CONTROLLER_SET_TRANSPORT_CHARACTERISTICS_CHANGE_NOTIFICATION

UCX invokes this callback function to specify its preference in transport characteristics for which the client driver must send notifications when changes occur.

EVT_UCX_CONTROLLER_START_TRACKING_FOR_TIME_SYNC

UCX invokes this callback function to the start time tracking functionality in the controller.

EVT_UCX_CONTROLLER_STOP_TRACKING_FOR_TIME_SYNC

UCX invokes this callback function to the stop time tracking functionality in the controller.

EVT_UCX_CONTROLLER_USBDEVICE_ADD

The client driver's implementation that UCX calls when a new USB device is detected.

EVT_UCX_DEFAULT_ENDPOINT_UPDATE

The client driver's implementation that UCX calls with information about the default endpoint.

EVT_UCX_ENDPOINT_ABORT

The client driver's implementation that UCX calls to abort the queue associated with the endpoint.

EVT_UCX_ENDPOINT_GET_ISOCH_TRANSFER_PATH_DELAYS

UCX invokes this callback function to get information about transfer path delays for an isochronous endpoint.

EVT_UCX_ENDPOINT_OK_TO_CANCEL_TRANSFERS

The client driver's implementation that UCX calls to notify the controller driver that it can complete cancelled transfers on the endpoint.

EVT_UCX_ENDPOINT_PURGE

The client driver's implementation that completes all outstanding I/O requests on the endpoint.

EVT_UCX_ENDPOINT_RESET

The client driver's implementation that UCX calls to reset the controller’s programming for an endpoint.

EVT_UCX_ENDPOINT_START

The client driver's implementation that UCX calls to start the queue associated with the endpoint.

EVT_UCX_ENDPOINT_SET_CHARACTERISTIC

UCX invokes this callback function to set the priority on an endpoint.

EVT_UCX_ENDPOINT_STATIC_STREAMS_ADD

The client driver's implementation that UCX calls to create static streams.

EVT_UCX_ENDPOINT_STATIC_STREAMS_DISABLE

The client driver's implementation that UCX calls to release controller resources for all streams for an endpoint.

EVT_UCX_ENDPOINT_STATIC_STREAMS_ENABLE

The client driver's implementation that UCX calls to enable the static streams.

EVT_UCX_ROOTHUB_CONTROL_URB

The client driver uses this callback type to implement handlers that UCX calls when it receives feature control requests on the USB hub.

EVT_UCX_ROOTHUB_GET_20PORT_INFO

The client driver's implementation that UCX calls when it receives a request for information about USB 2.0 ports on the root hub.

EVT_UCX_ROOTHUB_GET_30PORT_INFO

The client driver's implementation that UCX calls when it receives a request for information about USB 3.0 ports on the root hub.

EVT_UCX_ROOTHUB_GET_INFO

The client driver's implementation that UCX calls when it receives a request for information about the root hub.

EVT_UCX_ROOTHUB_INTERRUPT_TX

The client driver's implementation that UCX calls when it receives a request for information about changed ports.

EVT_UCX_USBDEVICE_ADDRESS

The client driver's implementation that UCX calls to address the USB device.

EVT_UCX_USBDEVICE_DEFAULT_ENDPOINT_ADD

The client driver's implementation that UCX calls to add a new default endpoint for a USB device.

EVT_UCX_USBDEVICE_DISABLE

The client driver's implementation that UCX calls to release controller resources associated with the device and its default endpoint.

EVT_UCX_USBDEVICE_ENABLE

The client driver's implementation that UCX calls to program information about the device and its default control endpoint into the controller.

EVT_UCX_USBDEVICE_ENDPOINT_ADD

The client driver's implementation that UCX calls to add a new endpoint for a USB device.

EVT_UCX_USBDEVICE_ENDPOINTS_CONFIGURE

The client driver's implementation that UCX calls to configure endpoints in the controller.

EVT_UCX_USBDEVICE_GET_CHARACTERISTIC

UCX invokes this callback to retrieve the device characteristics.

EVT_UCX_USBDEVICE_HUB_INFO

The client driver's implementation that UCX calls to retrieve hub properties.

EVT_UCX_USBDEVICE_RESET

The client driver's implementation that UCX calls when the port to which the device is attached is reset.

EVT_UCX_USBDEVICE_RESUME

UCX invokes this callback function to resume a device from suspend state.

EVT_UCX_USBDEVICE_SUSPEND

UCX invokes this callback function to send a device suspend state.

EVT_UCX_USBDEVICE_UPDATE

The client driver's implementation that UCX calls to update device properties.

 

Developing Windows drivers for USB host controllers

 

 

Send comments about this topic to Microsoft