Hi,

Here's a WIP for chip power saving support for net80211 and ath:

http://people.freebsd.org/~adrian/ath/20140411-net80211-ath-sleep-3.diff

(ignore the stuff for non-net80211 and non-ath drivers.)

This implements:

* basic chip power management for ath(4), allowing the NIC to go into
network sleep in STA mode
* .. and all the fiddly places where I have to actually force wake the
thing up before I can access it!
* implements IEEE80211_S_SLEEP for ath(4), so net80211 can drive when
the VAP goes into sleep mode
* very basic (and I do mean _very_) sleep state support in net80211 -
it's just a timer that monitors for idle periods of greater than a
second and puts the VAP into IEEE80211_S_SLEEP state. I should be
triggering it off of beacon intervals and such.
* .. and hook into the beacon receive path to check for the TIM and
whether the VAP needs to wake up for active receive.

What it doesn't implement:

* ath(4) should only put the NIC into network sleep if all the VAPs
are capable of it and all the VAPs are currently asleep. Very notably,
STA+AP mode (ie, WDS) shouldn't put the NIC into network sleep.
* i haven't verified at all that the net80211 code is correctly
marking management frames with PWR=1 (ie, telling the peer that
although a frame is being transmitted, it should be considered
"asleep") if the sending VAP is asleep
* mesh or adhoc sleep state handling - mostly because the TIM stuff
needs checking _and_ we need to figure out how to handle ATIM stuff.
* We don't yet have support to send out PS-POLL frames to ask the AP
for individual data frames. I plan on yanking this out of madwifi at
some point as it'll make it much, much easier to stay asleep for
longer periods of time and thus get much better power savings.
* .. and yes, we still don't support uAPSD. I have no plans to
implement that at the moment.

To test:

* Apply to -HEAD and rebuild
* .. make sure you have ATH_DEBUG, AH_DEBUG, ATH_DIAGAPI,
IEEE80211_DEBUG in your kernel config files!
* ifconfig wlan0 create wlandev ath0 powersave
* wlandebug +power +state +debug to see the NIC go in and out of sleep state

It's working for me so far on the AR5416 test device I have. I'm sure
it'll work on the AR91xx and AR92xx series. The AR93xx stuff will need
some further digging into as I haven't verified yet whether I'm waking
the NIC up correctly before I do the FIFO descriptor programming.

But yes, there's a noticable (2W) drop when the NIC is actually in and
staying in power save state.


-a
_______________________________________________
freebsd-wireless@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-wireless
To unsubscribe, send any mail to "freebsd-wireless-unsubscr...@freebsd.org"

Reply via email to