A Device Returns to Its Working State

A device that is in a low-power state returns to its working state if one of the following occurs:

  • The device detects an external event and triggers a wake signal on its bus. The bus driver that detects the wake signal calls WdfDeviceIndicateWakeStatus. As a result, the framework calls the bus driver's EvtDeviceDisableWakeAtBus callback function.

  • The device has been idle and a driver calls WdfDeviceStopIdle.

  • The system's power state has changed from a low-power state to its working (S0) state.

In each of these situations, the framework calls the bus driver's EvtDeviceD0Entry callback function, which then restores the device (a child device of the bus) to its working (D0) state.

For each function and filter driver that supports the device, the framework does the following, in sequence, one driver at a time, starting with the driver that is lowest in the driver stack:

  1. The framework calls the driver's EvtDeviceD0Entry callback function (if it exists).

  2. The framework calls the driver's EvtInterruptEnable callback function (if it exists) for each interrupt, and then it calls the driver's EvtDeviceD0EntryPostInterruptsEnabled callback function (if it exists), so that the driver can enable device interrupts.

  3. If the hardware and driver support DMA, the framework calls the driver's EvtDmaEnablerFill, EvtDmaEnablerEnable, and EvtDmaEnablerSelfManagedIoStart callback functions (if they exist) for each DMA channel that was created.

  4. If the driver is the device's power policy owner, the framework calls its EvtDeviceDisarmWakeFromS0 or EvtDeviceDisarmWakeFromSx callback function.

  5. The framework calls the driver's EvtChildListScanForChildren callback function (if it exists).

  6. The framework restarts all of the driver's power-managed I/O queues and calls their EvtIoResume callback functions (if necessary).

  7. If the driver is using self-managed I/O, the framework calls the driver's EvtDeviceSelfManagedIoRestart callback function.