[Q] NDIS_PM_WAKE_ON_MEDIA_DISCONNECT_SUPPORTED for Windows 8

The Windows WDK says the following about this SupportedWakeUpEvents flag for
NDIS_PM_CAPABILITIES:

NDIS_PM_WAKE_ON_MEDIA_DISCONNECT_SUPPORTED
If this flag is set, the network adapter can generate a wake-up event when
it becomes disconnected to the networking interface.

For more information about this WOL capability, see Low Power on Media
Disconnect.

This link doesn’t seem correct. That topic describes D3 on disconnect for
NDIS 6.20 (and later). In that feature, the driver is put into D3 if it
reports a media disconect and then wakes the system up if it detects a media
connection. For NDIS 6.30, it would appear that the driver is already
connected when it goes to D3 and only wakes the system up if it detects a
media disconnect. So,
NDIS_PM_WAKE_ON_MEDIA_DISCONNECT_SUPPORTED doesn’t seem to the same as D3 on
disconnect.

However, under what conditions will the OS set the
NDIS_PM_WAKE_ON_MEDIA_DISCONNECT_ENABLED flag in
NDIS_PM_PARAMETERS.WakeUpFlags? My Windows 8 WLAN miniport advertises
NDIS_PM_WAKE_ON_MEDIA_DISCONNECT_SUPPORTED but I never see the WakeUpFlags
bit get set.

Thanks!

Good catch - there’s some confusion in the documentation. The “For more information … Low Power on Media Disconnect” text is somewhat out-of-place. The reason it’s there is that wake-on-connect (and *only* wake-on-connect) is needed for the “Low Power on Media Disconnect” feature. Therefore, Windows 7 added support for wake-on-connect, which at the time was just called “wake on link change”. In Windows 8, the AOAC feature has a use for *both* wake-on-connect and wake-on-disconnect. So Windows 8 adds support for wake-on-disconnect. Since there are now *two* link-related capabilities, we sort of retroactively renamed “wake-on-link” to “wake-on-connect”, and put it alongside wake-on-disconnect.

I’ll get the docs fixed.

So now in summary:

  1. To get “Low Power on Media Disconnect” in either Win7 or Win8, you need to put a D2 or D3 value into MinLinkChangeWakeUp.
  2. To get AOAC in Win8, you need to put NDIS_PM_WAKE_ON_MEDIA_CONNECT_SUPPORTED|NDIS_PM_WAKE_ON_MEDIA_DISCONNECT_SUPPORTED into SupportedWakeUpEvents.

The wake-on-disconnect flag is mostly meant for AOAC scenarios in Windows 8. That’s not to say it’s bad for non-AOAC hardware to support it; the OS may someday find a non-AOAC use for that feature. But if you are not targeting AOAC, and you’re busy and overworked (like all of us), then you can safely put wake-on-disconnect onto the “nice to have someday” section of your priority queue todo list, since Windows 8 won’t take advantage of it today.