Low Power for Wake on LAN
The wake on LAN (WOL) feature wakes the computer from a low power state when a network adapter detects a WOL event.
A miniport driver reports network adapter WOL capabilities during initialization. For more information about reporting WOL capabilities, see Reporting Power Management Capabilities.
Note that the lower power on the media disconnect (D3 on disconnect) feature is canceled when the computer enters a sleep state in order to prevent waking the computer when the link state is externally cycled; that is, when a switch is turned off and on. For more information about D3 on disconnect, see Low Power on Media Disconnect.
The following figure illustrates the sequence of events that occurs to set a network adapter to a low power state.
When NDIS puts a network adapter in a low power state, the following sequence occurs:
NDIS uses OID_PM_PARAMETERS to enable wake on LAN and to disable wake on media connect. NDIS_PM_WAKE_ON_LINK_CHANGE_ENABLED is cleared in the WakeUpFlags member.
NDIS uses OID_PNP_SET_POWER to notify the miniport driver of the new power state (D3).
The miniport driver may indicate an unknown media connect state using the NDIS_STATUS_LINK_STATE status indication. The MediaConnectStateUnknown value is set in the MediaConnectState member of the NDIS_LINK_STATE structure. For more information, see the NDIS_STATUS_LINK_STATE documentation.
NDIS sends the PCI Express (PCIe) bus an IRP_MN_WAIT_WAKE IRP to wait for a WOL event.
NDIS sends the PCIe bus an IRP_MN_SET_POWER IRP to set the bus to the D3 state.
The following figure illustrates the sequence of events that occurs to restore full power to a network adapter after a WOL event.
When the network adapter is waking the computer the following sequence occurs:
The network adapter wakes the system by asserting WAKE# on the PCIe bus or PME# on the PCI bus.
The bus completes the pending IRP_MN_WAIT_WAKE IRP. The IRP is pending completion from the last step in the power down sequence.
NDIS sets the bus to full power (D0) with the IRP_MN_SET_POWER IRP.
NDIS notifies the miniport driver that the network adapter is at full power (D0) with the OID set request of OID_PNP_SET_POWER.
The network adapter notifies NDIS of a media connect event with the NDIS_STATUS_LINK_STATE status indication. The MediaConnectStateConnected value is set in the MediaConnectState member of the NDIS_LINK_STATE structure.
Starting with NDIS 6.30, if the miniport driver supports NDIS_STATUS_PM_WAKE_REASON status indications, it must issue this status notification if the network adapter wakes the system. The driver issues this status notification while it is handling the OID set request of OID_PNP_SET_POWER for the transition to a full-power (D0) state.
For more information, see NDIS Wake Reason Status Indications.