WDF_DEVICE_POWER_CAPABILITIES structure (wdfdevice.h)

[Applies to KMDF and UMDF]

The WDF_DEVICE_POWER_CAPABILITIES structure describes a device's power capabilities.

Syntax

typedef struct _WDF_DEVICE_POWER_CAPABILITIES {
  ULONG              Size;
  WDF_TRI_STATE      DeviceD1;
  WDF_TRI_STATE      DeviceD2;
  WDF_TRI_STATE      WakeFromD0;
  WDF_TRI_STATE      WakeFromD1;
  WDF_TRI_STATE      WakeFromD2;
  WDF_TRI_STATE      WakeFromD3;
  DEVICE_POWER_STATE DeviceState[PowerSystemMaximum];
  DEVICE_POWER_STATE DeviceWake;
  SYSTEM_POWER_STATE SystemWake;
  ULONG              D1Latency;
  ULONG              D2Latency;
  ULONG              D3Latency;
  DEVICE_POWER_STATE IdealDxStateForSx;
} WDF_DEVICE_POWER_CAPABILITIES, *PWDF_DEVICE_POWER_CAPABILITIES;

Members

Size

The size, in bytes, of this structure.

DeviceD1

A WDF_TRI_STATE-typed value that indicates, if set to WdfTrue, that the device supports device sleeping state D1. For more information about the WDF_TRI_STATE value, see the following Remarks section.

DeviceD2

A WDF_TRI_STATE-typed value that indicates, if set to WdfTrue, that the device supports device sleeping state D2.

WakeFromD0

A WDF_TRI_STATE-typed value that indicates, if set to WdfTrue, that the device can respond to a wake signal while in its D0 state.

WakeFromD1

A WDF_TRI_STATE-typed value that indicates, if set to WdfTrue, that the device can respond to a wake signal while in its D1 state.

WakeFromD2

A WDF_TRI_STATE-typed value that indicates, if set to WdfTrue, that the device can respond to a wake signal while in its D2 state.

WakeFromD3

A WDF_TRI_STATE-typed value that indicates, if set to WdfTrue, that the device can respond to a wake signal while in its D3 state.

DeviceState[PowerSystemMaximum]

An array of DEVICE_POWER_STATE-typed values that indicates the most-powered device state that the device supports for each system power state. This array uses the SYSTEM_POWER_STATE enumeration as index values. If an array element's value is PowerDeviceMaximum, the framework uses whatever value that the operating system has stored for that element. The DEVICE_POWER_STATE and SYSTEM_POWER_STATE enumerations are defined in wdm.h. For more information about the DeviceState member, see DeviceState.

DeviceWake

A DEVICE_POWER_STATE-typed value that indicates the lowest device power state from which the device can send a wake signal to the system. If this value is PowerDeviceMaximum, the framework uses whatever value is currently stored in the system for this member.

SystemWake

A SYSTEM_POWER_STATE-typed value that indicates the lowest system power state from which the device can send a wake signal to the system. If this value is PowerSystemMaximum, the framework uses whatever value is currently stored in the system for this member. SYSTEM_POWER_STATE values are defined in wdm.h.

D1Latency

The approximate time, in 100-nanosecond units, that the device requires to return to its D0 state from its D1 state. If this value is -1, the framework uses whatever value is currently stored in the system for this member.

D2Latency

The approximate time, in 100-nanosecond units, that the device requires to return to its D0 state from its D2 state. If this value is -1, the framework uses whatever value is currently stored in the system for this member.

D3Latency

The approximate time, in 100-nanosecond units, that the device requires to return to its D0 state from its D3 state. If this value is -1, the framework uses whatever value is currently stored in the system for this member.

IdealDxStateForSx

A DEVICE_POWER_STATE-typed value that indicates the device sleeping state that the device should enter when the system enters any system sleeping state and the device is not enabled to wake the system. If this value is zero, the framework uses PowerDeviceD3. This value cannot be PowerDeviceD0.

If a driver specifies an IdealDxStateForSx value that represents a higher-powered device sleeping state than the device's stack has specified in the device's DeviceState array, the framework uses the lower-powered state that is in the array. For example, if the driver specifies an IdealDxStateForSx value of D1 and the device's DeviceState array specifies D2, the framework uses D2.

Remarks

The WDF_DEVICE_POWER_CAPABILITIES structure is used as input to WdfDeviceSetPowerCapabilities.

Several members use the WDF_TRI_STATE type. For these members, the following rules apply:

  • A value of WdfTrue indicates that the device supports the capability and a value of WdfFalse indicates it does not.
  • Function drivers and filter drivers can specify WdfTrue or WdfFalse, or a value of WdfUseDefault to indicate that the framework should use the value that was provided by a lower driver in the stack. For example, if a bus driver specifies WdfTrue for DeviceD1 and the device's function driver specifies WdfUseDefault, the framework uses WdfTrue for the capability.
  • When a bus driver calls WdfDeviceSetPowerCapabilities after it creates a device object for a child device, it should specify WdfTrue or WdfFalse. A bus driver can specify WdfUseDefault for a child device, but in this case WdfUseDefault is the same as WdfFalse.
To initialize a WDF_DEVICE_POWER_CAPABILITIES structure, a driver should call WDF_DEVICE_POWER_CAPABILITIES_INIT.

Requirements

Requirement Value
Minimum KMDF version 1.0
Minimum UMDF version 2.0
Header wdfdevice.h (include Wdf.h)

See also

WDF_DEVICE_PNP_CAPABILITIES