USB function controller client driver programming 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.
Here are the methods that are exported by UFX that the function client driver calls.
| Method | Description |
|---|---|
Initializes the WDFDEVICE_INIT structure that the client driver subsequently provides when it calls WdfDeviceCreate. |
|
Creates a UFX device object, registers event callback routines, and specifies capabilities specific to the controller. |
|
Informs UFX that the client driver has completed processing a UFX callback function. |
|
Notifies UFX that the hardware is ready. |
|
Notifies UFX that the device's USB cable has been attached. |
|
Notifies UFX that the device's USB cable has been detached. |
|
Notifies UFX about a USB bus suspend event. |
|
Notifies UFX about a USB bus resume event. |
|
Notifies UFX about a USB bus reset event. |
|
Notifies UFX about the port type that was detected. |
|
Notifies UFX about the port type that was detected, and optionally requests an action. |
|
Notifies UFX about a detected proprietary port/charger type. |
|
Notifies UFX about a non-recoverable hardware failure in the controller. |
|
Passes non-internal IOCTLs from user-mode to UFX. |
|
Passes kernel mode IOCTLs to UFX. |
|
Creates an endpoint object. |
|
Initialize a UFXENDPOINT_INIT structure. |
|
Notifies UFX when the client driver receives a setup packet from the host. |
|
Returns the transfer queue previously created by UfxEndpointCreate. |
|
Returns the command queue previously created by UfxEndpointCreate. |
Here are the event callback functions implemented in the client driver and invoked by UFX.
| Function | Description |
|---|---|
The client driver's implementation to initiate connection with the host. |
|
The client driver's implementation to disable the function controller's communication with the host. |
|
The client driver's implementation to assign an address on the function controller. |
|
The client driver's implementation to create a default endpoint object. |
|
The client driver's implementation to create a default control endpoint. |
|
The client driver's implementation to update the state of the USB device. |
|
The client driver's implementation to update the type of the new port to which the USB device is connected. |
|
The client driver's implementation to initiate port detection |
|
The client driver's implementation to initiate remote wake-up on the function controller. |
|
The client driver's implementation to set the test mode of the function controller. |
|
Not supported. |
|
The client driver's implementation to reset the function controller to its initial state. |
|
The client driver's implementation to set or clear the specified power feature on the function controller. |
|
The client driver's implementation to initiate proprietary charger detection. |
|
The client driver's implementation to resets proprietary charger. |
|
The client driver's implementation to set charger information that it uses to enable charging over USB. |
UFX can send IOCTL codes to the client driver.
| Control Code | Description |
|---|---|
The USB function class extension sends this request to the client driver to update to the endpoint descriptor for the specified endpoint. |