Bewerken

Delen via


PO_FX_DIRECTED_POWER_DOWN_CALLBACK callback function (wdm.h)

The PO_FX_DIRECTED_POWER_DOWN_CALLBACK callback function is implemented by the client driver to handle driver-specific power down activities on behalf of DFx (Directed PoFx).

Syntax

PO_FX_DIRECTED_POWER_DOWN_CALLBACK PoFxDirectedPowerDownCallback;

void PoFxDirectedPowerDownCallback(
  PVOID Context,
  ULONG Flags
)
{...}

Parameters

Context

Supplies a pointer to the context passed in to PoFxRegisterDevice.

Flags

Reserved for future use.

Return value

None

Remarks

WDM drivers that register with PoFx for runtime idle power management support need to implement this callback to add DFx support.

Register your implementation of this callback function by setting the appropriate member of the PO_FX_DEVICE_V3 structure and then calling PoFxRegisterDevice.

This callback is invoked during a Modern Standby session when this device or a dependent of this device has blocked DRIPS entry for at least two consecutive minutes (driver-configurable timeout, default 2 minutes) without any activator-brokered software activity running.

When this callback is invoked, the driver typically performs the following high-level tasks:

  • Stop processing new work.

  • Transition into low-power state immediately.

  • Remain in low-power state until the system calls the driver's PO_FX_DIRECTED_POWER_UP_CALLBACK.

Implementation steps and order may vary, but might include some of the following:

  • Request a Dx IRP.

  • After the Dx IRP arrives, block I/O queues.

  • Wait for in-progress operations to complete.

  • If those operations are taking too long, optionally cancel them.

  • Perform actions necessary to transition the device into Dx (for example save hardware state).

  • Arm for wake as necessary.

  • Call PoFxCompleteDirectedPowerDown.

  • Remain in Dx until the system calls PO_FX_DIRECTED_POWER_UP_CALLBACK.

The contract is very similar to S3/S4, although no S-IRPs are involved.

If a device hierarchy is involved, the directed power framework asks the child devices to power down before the parent device. For a given parent device, direct children (ones enumerated by the parent) and indirect children due to power relations are considered.

Requirements

Requirement Value
Minimum supported client Windows 10, version 1903
Header wdm.h (include Wdm.h)

See also

Introduction to the Directed Power Management Framework

PO_FX_DIRECTED_POWER_UP_CALLBACK