WoW - Wake on Wireless
Wake on Wireless is a feature which allows a WLAN-enabled client system to enter a low-power system state (S1-S4) while still maintaining WLAN association with its current AP. WoW allows remote systems to wake up the sleeping client by sending a frame of a specific format which the client anticipates. WoW is very similar to Wake-on-LAN for Ethernet NICs in that no specialized support is required on any intervening devices in the network (e.g., switches, routers, APs, etc.)
WoW support in Linux
This is currently being worked on. Note that this document is mostly ath9k specific.
How WoW works
Wireless devices have a capability list of events which will allow the wireless device to trigger on the system while in a low power state (S1-S4). The wireless device driver must expose this to the operating system and users can then enable particular events.
- Reception of a user specified pattern
- Reception of a Magic Packet frame
- A change in Link status
Going to suspend
When the operating system is about to go to suspend it will inform the device driver. For Linux this is done through the pci suspend callback. To enable WoW normal operation is discontinued and WoW is enabled:
- Wake up patterns are written to hardware
- Magic Packet detection is enabled
- Keep alive frame (can be a NULL data frame sent to the AP to keep association alive) is constructed and keep alive interval is programmed
- WoW interrupts should be enabled
- Deauthenticate and disassociate patterns should be added
- Beacon miss interval can be expanded to enhance robustness and avoid false triggers of disassociation
Upon suspend the wireless device's power is switched from Vcc to Vaux (auxiliary power: battery).The wireless device hardware will wake up for every beacon, the TIM IE will be analyzed for matched patterns for all received frames. In order to keep the association to the access point alive the wireless device will send a keep alive frame (can be a NULL data frame).
The wireless device can try to wake up the system upon a pattern match, Magic Packet, or a beacon miss interrupt. In order to wake up the system the wireless device will trigger a wake up event through the PCI/PCIE signal.
- PCI-Express: The wireless device will send a PCI-Express Power Management Event (PME) message and/or assert the PCIE_WAKE_L signal. The PME message can only be sent if the device's PME Enable bit is set. With PCI-Express devices can still use the PCIE_WAKE_L signal even if the PME Enable bit is cleared.
- PCI: The wireless device will assert the PCI_PME_L signal to the PCI host. In order to send this signal the PME Enable bit must be enabled on the device.
Note: BIOS will usually need to enable PME signals for PCI devices – otherwise WoW may not work
This will resume the system to a normal power operation at which point the device driver will take over. The device driver can inform the upper layers of the reason why it was woken up (if it received such trigger). Once the system is up the device driver can try to associate to the access point as it normally would.
Receiving buffered data
When PS mode is enabled the wireless device will wake up for every DTIM beacon and check the TIM IE as it normally would (asking the AP with NULL data frame and power management bit set off). It will then receive the buffered frames and eventually go back to PS mode (NULL data sent with power management bit set).
Non-WoW frames which are received are ignored (dropped), but frames received should be ACKed by the STA wireless hardware without any help from the host CPU.
There are issues with Multicast frames and Broadcast frames when using WPA and encryption is handled on the host CPU as rekeying will not be possible.
802.11 Power Save *can* be used while in WoW mode to save more power.
Keep alive frame format can be configurable. Keep alive frames will usually be sent right after a TBTT, it can be configured to be sent in the order of 10 to 60 seconds.
Most (if not all) wireless devices require the host to be powered to a power source for WoW signals to be enabled.
It depends on how the hardware is implemented but generally you must not disassociate the device when going to suspend as otherwise your device won't know its associated. If you have firmware and therefore a CPU on the chip it may do re-association on its own but that's up to each vendor to decide. The frames received during WoW are processed by the hardware as they would normally with enough logic to send a signal for the WoW triggers enabled.