EVT_UDECX_USB_DEVICE_SET_FUNCTION_SUSPEND_AND_WAKE callback function (udecxusbdevice.h)

The USB device emulation class extension (UdeCx) invokes this callback function when it gets a request to change the function state of the specified interface of the virtual USB 3.0 device.

Syntax

EVT_UDECX_USB_DEVICE_SET_FUNCTION_SUSPEND_AND_WAKE EvtUdecxUsbDeviceSetFunctionSuspendAndWake;

NTSTATUS EvtUdecxUsbDeviceSetFunctionSuspendAndWake(
  [in] WDFDEVICE UdecxWdfDevice,
  [in] UDECXUSBDEVICE UdecxUsbDevice,
  [in] ULONG Interface,
  [in] UDECX_USB_DEVICE_FUNCTION_POWER FunctionPower
)
{...}

Parameters

[in] UdecxWdfDevice

A handle to a framework device object that represents the controller to which the USB device is attached. The client driver initialized this object in a previous call to UdecxWdfDeviceAddUsbDeviceEmulation.

[in] UdecxUsbDevice

A handle to UDE device object. The client driver created this object in a previous call to UdecxUsbDeviceCreate.

[in] Interface

This value is the bInterfaceNumber of the interface that is waking up.

[in] FunctionPower

A UDECX_USB_DEVICE_FUNCTION_POWER-type value that indicates whether the interface can suspend and send wake signal to the host controller.

Return value

If the operation is successful, the callback function must return STATUS_SUCCESS, or another status value for which NT_SUCCESS(status) equals TRUE.

Remarks

The client driver registered the function in a previous call to UdecxUsbDeviceInitSetStateChangeCallbacks by supplying a function pointer to its implementation.

In the callback implementation, the client driver for the USB device is expected to perform steps to enter working state.

This event callback function applies to USB 3.0+ devices. UdeCx invokes this function to notify the client driver of a request to change the power state of a particular function. It also informs the driver whether or not the function can wake from the new state.

The power request may be completed asynchronously by returning STATUS_PENDING, and then later completing it by calling UdecxUsbDeviceSetFunctionSuspendAndWakeComplete with the actual completion code.

Requirements

Requirement Value
Minimum supported client Windows 10
Minimum supported server Windows Server 2016
Target Platform Windows
Minimum KMDF version 1.15
Header udecxusbdevice.h (include Udecx.h)
IRQL <=DISPATCH_LEVEL

See also

Architecture: USB Device Emulation (UDE)

Write a UDE client driver