WinUSB Power Management
WinUSB uses the KMDF state machines for power management. Power policies are managed through calls to WinUsb_SetPowerPolicy.
In order to modify the power behavior of WinUSB, default registry settings can be modified in the device?s INF. These values must be written to the device specific location in the registry by adding the values in the HW.AddReg section of the INF.
The registry values described in the following list can be specified in the device?s INF to modify the power behavior.
- System Wake
This feature is controlled by the SystemWakeEnabled DWORD registry setting. This value indicates whether the device should be allowed to wake the system from a low power state.
- A value of zero, or the absence of this value indicates that the device is not allowed to wake the system.
- To allow a device to wake the system, set SystemWakeEnabled to a nonzero value. A check box in the device Properties page is automatically enabled so that the user can override the setting.
Note Changing the SystemWakeEnabled setting has no affect on selective suspend, this registry value only pertains to system suspend.
- Selective Suspend
Selective suspend can be disabled by any of several system or WinUSB settings. A single setting cannot force WinUSB to enable selective suspend.
The following power policy settings that are specified in WinUsb_SetPowerPolicy's PolicyType parameter affect the behavior of selective suspend:
- AUTO_SUSPEND When set to zero, it does not set the device to selective suspend mode.
- SUSPEND_DELAY Sets the time between when the device becomes idle and when WinUSB requests the device to go into selective suspend.
The following table shows how the registry keys affect the selective suspend feature.
Registry key Description DeviceIdleEnabled This is a DWORD value. This registry value indicates whether the device is capable of being powered down when idle (Selective Suspend).
- A value of zero, or the absence of this value indicates that the device does not support being powered down when idle.
- A nonzero value indicates that the device supports being powered down when idle.
- If DeviceIdleEnabled is not set, the value of the AUTO_SUSPEND power policy setting is ignored.
DeviceIdleIgnoreWakeEnable When set to a nonzero value, it suspends the device even if it does not support RemoteWake. UserSetDeviceIdleEnabled This value is a DWORD value. This registry value indicates whether a check box should be enabled in the device Properties page that allows a user to override the idle defaults. When UserSetDeviceIdleEnabled is set to a nonzero value the check box is enabled and the user can disable powering down the device when idle. A value of zero, or the absence of this value indicates that the check box is not enabled.
- If the user disables device power savings, the value of the AUTO_SUSPEND power policy setting is ignored.
- If the user enables device power savings, then the value of AUTO_SUSPEND is used to determine whether to suspend the device when idle.
The UserSetDeviceIdleEnabled is ignored if DeviceIdleEnabled is not set.
DefaultIdleState This is a DWORD value. This registry value sets the default value of the AUTO_SUSPEND power policy setting. This registry key is used to enable or disable selective suspend when a handle is not open to the device.
- A value of zero or the absence of this value indicates that by default, the device is not suspended when idle. The device be allowed to suspend when idle only when the AUTO_SUSPEND power policy is enabled.
- A nonzero value indicates that by default the device is allowed to be suspended when idle.
This value is ignored if DeviceIdleEnabled is not set.
DefaultIdleTimeout This is a DWORD value. This registry value sets the default state of the SUSPEND_DELAY power policy setting.
The value indicates the amount of time in milliseconds to wait before determining that a device is idle.
- Detecting Idle
All writes and control transfers force the device into the D0 power state and reset the idle timer. The IN endpoint queues are not power managed. Read requests wake the device when they are submitted. However, a device can become idle while a read request waits.
- WinUSB Architecture and Modules
- Choosing a driver model for developing a USB client driver
- WinUSB (Winusb.sys) Installation
- How to Access a USB Device by Using WinUSB Functions
- WinUSB Functions for Pipe Policy Modification
- WinUSB Functions
Build date: 1/21/2013