WiFi Power Save
The 802.11 specification includes a variety of power save techniques. Some of them are implemented in net80211.
This is currently under active development. This page is partly documentation and partly active development notes.
- Straight power save sleep and wakeup is currently supported.
- Stack-based powersave (ie, the net80211 stack queues frames and coordinates pushing the NIC into sleep states) is supported.
- NIC-based powersave (ie, it's done in the firmware on the NIC) is supported.
The iwn(4) driver supports NIC-based powersave. The ath(4) driver is currently being modified to support stack-based powersave.
All you need to do is add 'powersave' to the interface creation line:
# ifconfig wlan0 create wlandev iwn0 powersave
For stack-based powersave (eg, ath(4)) the powersave state can be monitored by using net80211 debugging:
# wlandebug -i wlan0 +power +debug +state
- Modify the raw and management frame paths to ensure that the pwrmgt bit is set if frames are transmitted whilst the NIC is in power save mode
- Investigate what it'd take to support ps-poll in station mode
- Investigate what it'd take to do power save in adhoc and mesh modes
- Look into uAPSD support from linux and madwifi
- Potentially use more aggressive power save modes where the NIC stays in power sleep whilst transmitting data frames (with pwrmgt set to 1.)
- It's all asynchronous. Linux mac80211 sends the power save up and down state as part of the transmit and receive frames, so it can know exactly when to start and stop power save. net80211 has separate hooks, so it may be that when a NIC enters power save state, it has some non-powersave frames queued.
- .. so it's likely worth investigating whether to add completion hooks to sending null data frames so once they have been ACKed by the other side, we then finish the state transition.
- .. and the driver can then modify its out bound frames with overrides for the pwrmgt bit - if stuff is in power save, then anything software queued will just be transmitted with pwrmgt=1.