Power Management Responsibilities for Drivers
Drivers that support power management are responsible for:
Reporting device power capabilities during PnP enumeration.
Handling power IRPs sent by the power manager or a driver.
Powering up a device as soon as needed after system start-up or idle shutdown.
Powering down a device at system shutdown time or putting it to sleep when idle.
Enabling device wake-up, if the device supports wake-up capabilities.
Managing device performance states, if the device supports decreasing performance or features to reduce power consumption.
Not every driver in every device stack performs all of these tasks. Typically, the bus driver reports capabilities, sets flags, and manipulates the physical device, and the device power policy manager (usually the function driver) issues requests to put the device to sleep and to enable wake-up.
With few exceptions, drivers power on and power off their devices, and they enable devices for wake-up in response to power IRPs, that is, IRPs with the major code IRP_MJ_POWER. Power IRPs can be sent by the power manager and, in some cases, by a driver.