Hello all,
I am new to windows driver development, especially power management related stuffs, So please correct me If I am wrong.
In Windows, I could see that various wake events are supported to wake the system. In that I came across, these 3 events mainly,
- Magic Packet
- Pattern Match
- Wake-On-Link Change (WAKE_ON_MEDIA_CONNECT, WAKE_ON_MEDIA_DISCONNECT).
Besides this, I came to know that there is a one more feature called, Low Power on Media Disconnect. This feature can be used to put the device to low power state when the media is disconnected. After that Media Connect event from Wake-On-Link Change can be used to wake the device. This is what I understood from the below article: Low Power on Media Disconnect - Windows drivers | Microsoft Learn
- If I understood the things correctly, the Low Power on Media Disconnect and WAKE_ON_MEDIA_DISCONNECT both are different and used for different purposes, respectively sleep and wake. Am I right?
Also from the above article, I understood that “D3 on disconnect is only available while the computer is fully powered in the working state (S0). This feature is canceled when the computer enters a sleep state“.
I am using the below setups in my case:
Node1 : USB (MAC-PHY) device With RPi4, which sends some kind of pulse signal to the PHY which will be used to wake the another node
Node2: USB (MAC-PHY) with Windows machine, which receives the signal.
If I put my Windows machine to sleep state, my node2 also goes to Dx sleep state. So Whenever my Node2 receives the pulse signal, the PHY link will be in up state. So I would like to use the WAKE_ON_MEDIA_CONNECT event here as my wake-up event source. And for my case I am not interested in WAKE_ON_MEDIA_DISCONNECT event. So I won’t use that event.
If I do the above things I am facing the below problems/Or the confusions I have:
-
I can’t use the Low Power on Media Disconnect feature to put my device into sleep state. But I am doubting that only in that mode only, “NDIS uses OID_PM_PARAMETERS to disable Wake-on-LAN and to enable wake on media connect (NDIS_PM_WAKE_ON_LINK_CHANGE_ENABLED is set in the WakeUpFlags member”, after detecting the device disconnect event. Is it so?
Because, the WakeUpFlags is 0 in my case. -
If I put my system into sleep state, The device goes to D3 Device power state when the Wake-On-Link Change feature is enabled. (I am using WakeMediaConDisConnect INF keyword).
-
With the same setup from step number 3, If I check the option in power management tab “Only Allow a magic packet to wake the computer“ the device goes to D2 Device power state. I am confused about the D3 and D2 states of the devices in this scenario. Can anyone have an idea what is happening over there?
-
I must use the Low Power on Media Disconnect feature with WAKE_ON_MEDIA_CONNECT event. So that Wake will happen properly. Is it so?
Can’t I use the WAKE_ON_MEDIA_CONNECT event alone to achieve my goal as described above?