UfxDeviceNotifyReset function (ufxclient.h)

Notifies UFX about a USB bus reset event.

Syntax

void UfxDeviceNotifyReset(
  [in] UFXDEVICE        UfxDevice,
  [in] USB_DEVICE_SPEED DeviceSpeed
);

Parameters

[in] UfxDevice

A handle to a UFX device object that the driver created by calling UfxDeviceCreate.

[in] DeviceSpeed

Contains a value of type USB_DEVICE_SPEED that indicates the speed of the device.

Return value

None

Remarks

The client driver calls UfxDeviceNotifyReset when it receives a bus reset event. All non-default endpoints should be disabled and the default endpoint should be reset. The device moves to the default state.

The client driver typically calls UfxDeviceNotifyReset from its EvtInterruptDpc callback function. The following example shows how to handle a reset event.


VOID
HandleUsbConnect (
    WDFDEVICE WdfDevice
    )
/*++

Routine Description:

    Handles a connect event from the controller.

Arguments:

    WDfDevice - WDFDEVICE object representing the controller.

--*/
{
    PCONTROLLER_CONTEXT ControllerContext;
    USB_DEVICE_SPEED DeviceSpeed;

    TraceEntry();

    ControllerContext = DeviceGetControllerContext(WdfDevice);

    //
    // Read the device speed.
    //

    //
    // #### TODO: Add code to read device speed from the controller ####
    //
    
    // Sample will assume SuperSpeed operation for illustration purposes
    DeviceSpeed = UsbSuperSpeed;
    
    //
    // #### TODO: Add any code needed to configure the controller after connect has occurred ####
    //


    ControllerContext->Speed = DeviceSpeed;
    TraceInformation("Connected Speed is %d!", DeviceSpeed);

    //
    // Notify UFX about reset, which will take care of updating 
    // Max Packet Size for EP0 by calling descriptor update.
    //
    UfxDeviceNotifyReset(ControllerContext->UfxDevice, DeviceSpeed);

    ControllerContext->Connect = TRUE;

    TraceExit();
}

Requirements

Requirement Value
Minimum supported client Windows 10
Target Platform Windows
Header ufxclient.h
Library ufxstub.lib
IRQL DISPATCH_LEVEL