EVT_UFX_DEVICE_SUPER_SPEED_POWER_FEATURE回调函数 (ufxclient.h)
客户端驱动程序的实现,用于在函数控制器上设置或清除指定的电源功能。
语法
EVT_UFX_DEVICE_SUPER_SPEED_POWER_FEATURE EvtUfxDeviceSuperSpeedPowerFeature;
void EvtUfxDeviceSuperSpeedPowerFeature(
[in] UFXDEVICE unnamedParam1,
[in] USHORT unnamedParam2,
[in] BOOLEAN unnamedParam3
)
{...}
参数
[in] unnamedParam1
客户端驱动程序在对 UfxDeviceCreate的上一次调用中收到的 USB 设备对象的句柄。
[in] unnamedParam2
已设置或清除电源功能的功能选择器,如 USB 3.0 规范的第 9.4 节中所述。 功能选择器可以是以下值之一:
- U1_ENABLE
- U2_ENABLE
[in] unnamedParam3
如果为 TRUE,请设置该功能。
如果为 FALSE,请清除该功能。
返回值
没有
言论
函数主机控制器的客户端驱动程序通过调用 UfxDeviceCreate 方法向 USB 函数类扩展(UFX)注册其 EVT_UFX_DEVICE_SUPER_SPEED_POWER_FEATURE 实现。
仅支持 SuperSpeed作的控制器需要此事件回调。
客户端驱动程序通过调用 UfxDeviceEventComplete 方法指示完成此事件。
例子
EVT_UFX_DEVICE_SUPER_SPEED_POWER_FEATURE UfxDevice_EvtDeviceSuperSpeedPowerFeature;
VOID
UfxDevice_EvtDeviceSuperSpeedPowerFeature (
_In_ UFXDEVICE Device,
_In_ USHORT Feature,
_In_ BOOLEAN Set
)
/*++
Routine Description:
EvtDeviceSuperSpeedPowerFeature handler for the UFXDEVICE object.
Handles a set or clear U1/U2 request from the host.
Arguments:
UfxDevice - UFXDEVICE object representing the device.
Feature - Indicates the feature being set or cleared. Either U1 or U2 enable.
Set - Indicates if the feature should be set or cleared
--*/
{
TraceEntry();
if (Feature == USB_FEATURE_U1_ENABLE) {
if (Set == TRUE) {
//
// #### TODO: Insert code to initiate U1 ####
//
} else {
//
// #### TODO: Insert code to exit U1 ####
//
}
} else if (Feature == USB_FEATURE_U2_ENABLE) {
if (Set == TRUE) {
//
// #### TODO: Insert code to initiate U2 ####
//
} else {
//
// #### TODO: Insert code to exit U2 ####
//
}
} else {
NT_ASSERT(FALSE);
}
UfxDeviceEventComplete(Device, STATUS_SUCCESS);
TraceExit();
}
要求
要求 | 价值 |
---|---|
目标平台 | 窗户 |
最低 KMDF 版本 | 1.0 |
最低 UMDF 版本 | 2.0 |
标头 | ufxclient.h |
IRQL | <=DISPATCH_LEVEL |