USB function class driver to UFX programming 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.
Here are the IOCTL codes that a function class driver can send to UFX.
| Topic | Description |
|---|---|
The USB class driver sends this request to activate the bus so that the driver can prepare to process bus events and handle traffic. |
|
The USB class driver sends this request to prepare for notifications received from the USB function class extension (UFX) in response to an event on the bus, such as a change in the port type or a receipt of a non-standard setup packet. |
|
The class driver sends this request to send a zero-length control status handshake on endpoint 0 in the IN direction. |
|
The class driver sends this request to send a zero-length control status handshake on endpoint 0 in the OUT direction. |
|
The class driver sends this request to deactivate the bus. |
|
The class driver sends this request IO control code to retrieve information about the available pipes for a device, as configured in the registry. |
|
The class driver sends this request to get the entire USB interface descriptor set for a function on the device. |
|
The class driver sends this request to get the stall state of the specified pipe. |
|
The class driver sends this request to initiate a data transfer to the host on the specified pipe. |
|
The class driver sends this request to initiate an IN transfer to the specified pipe and appends a zero-length packet to indicate the end of the transfer. |
|
The class driver sends this request to initiate a data transfer from the host on the specified pipe. |
|
The class driver sends this request to register a USB string descriptor. |
|
Not supported. |
|
The class driver sends this request to set the stall state of the specified USB pipe. |
|
The class driver sends this IOCTL to request the lower filter driver to exit Link Power Management (LPM). |
|
UFX sends this IOCTL to the client driver to communicate the current device state to the lower filter driver. |
|
The class driver sends this request to get remote wake-up notifications from endpoints. |