Power Management Issues

< BACK  NEXT >
[oR]

As part of the OnNow initiative, Microsoft, working with hardware system developers, established the Advanced Configuration and Power Interface (ACPI) BIOS. ACPI replaces the outdated Advanced Power Management (APM) BIOS interface for power management. Proper operation of Windows 2000 power management features depend upon BIOS support of ACPI. When installed on non-ACPI-compliant platforms, Windows 2000 degrades to the capability extended by APM-compliant BIOS.

To fully exercise WDM driver power management code, a system with ACPI BIOS enabled must be used. Further, Windows 2000 should be installed with ACPI enabled (typically a BIOS setup screen option).

While APM-only support is suitable for gross-level power management, the full blown ACPI feature set is required to gain the full range of device power management supported by Windows 2000. APM support is sufficient for battery management in mobile devices.

Idle Management

Since the most obvious form of power savings that occurs is the power down of idle devices (i.e., devices that remain unused for an extended period of time), Windows 2000 provides a convenient mechanism for device drivers to request a power IRP IRP_MN_SET_POWER after a specified timeout period. The Power Manager function PoRegisterDeviceForIdleDetection, described in Table 10.8, provides this functionality.

The return value from PoRegisterDeviceForIdleDetection is a pointer to an idle counter that is incremented each second. When and if the counter reaches the timeout value specified (argument two or three), the Power Manager sends an IRP_MN_SET_POWER request of the power state specified in argument four.

The timer/counter must be manually reset by driver code, as appropriate, by calling PoSetDeviceBusy, described in Table 10.9. Of course, setting too short a timeout interval burdens a driver with frequent calls to PoSetDeviceBusy, so conservative timeout values would seem appropriate.

Table 10.8. Function Prototype for PoRegisterDeviceForIdleDetection
PULONG PoRegisterDevice ForIdleDetection IRQL < DISPATCH_LEVEL
Parameter Description
IN PDEVICE_OBJECT pDevObj Pointer to device object to receive power IRP
IN ULONG ConservationIdleTime Timeout value (seconds) when system is running with scarce power (battery-driven)
IN ULONG PerformanceIdleTime Timeout value (seconds) when system is running with abundant power (docked)
IN DEVICE_POWER_STATE State Power state requested when timeout exceeded
Return value Pointer to "idle counter"
NULL - Idle timeout could not be enabled

Table 10.9. Function Prototype for PoSetDeviceBusy
VOID PoSetDeviceBusy IRQL < DISPATCH_LEVEL
Parameter Description
IN PULONG pIdleCounter Pointer to "idle counter"
Return value - void -

User Interface for Power Management

The suggested user interface for Power Management is the Control Panel applet of Windows 2000, Power Options. To extend the Power Options applet with a driver-customized property sheet requires the use of Microsoft's COM object model and registration of the property sheet. An example of providing such an extension is provided on the companion Web site of this book, www.W2KdriverBook.com

Some knowledge of ATL (Active Template Library) is required to understand the example.

< BACK  NEXT >


The Windows 2000 Device Driver Book(c) A Guide for Programmers
The Windows 2000 Device Driver Book: A Guide for Programmers (2nd Edition)
ISBN: 0130204315
EAN: 2147483647
Year: 2000
Pages: 156

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net