PO_FX_DIRECTED_POWER_DOWN_CALLBACK callback function

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

Flags

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.

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.

Note that 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

   
Minimum supported client Windows 10, version 1903
Header wdm.h

See Also