NDIS Power Management

Power management for PC Card–based NICs is identical to power management for other PC Cards. The miniport driver performs the same power-cycle processing required of all PC Card device drivers; no additional processing is necessary. After power returns, the Device Manager calls the appropriate unbind and bind functions in the miniport driver.

For a miniport driver for a built-in NIC, the miniport driver’s reset function is called when power returns. Miniport drivers for IrDA must support the OID_IRDA_REACQUIRE_HW_RESOURCES and OID_IRDA_RELEASE_HW_RESOURCES messages to perform power management properly. A miniport for IrDA starts without any resources; when the first IrDA socket is created, the IrDA protocol stack acquires the miniport’s resources. When all IrDA sockets are closed, the protocol stack releases the resources. This ensures that the miniport driver and its NIC are not consuming power when the IrDA stack is not in use. For an example of how these object identifiers are implemented, see the FastIR sample miniport driver.

In some cases, miniport drivers may need to prevent a Windows CE–based platform from suspending—for example, due to lack of user input—while the driver is engaged in active operations. In such cases, the miniport driver can use the SystemIdleTimerReset function to prevent Windows CE from entering suspend mode. However, if the miniport driver is active because of a high-level protocol connection, such as an open TCP/IP socket, the miniport driver generally can let the upper-level protocol stack prevent Windows CE from shutting down. The upper-level protocol stacks ensure that the system does not shut down while there are open sockets because such connections do not survive a power cycle.