diff options
author | adrian <adrian@FreeBSD.org> | 2012-10-02 17:45:19 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2012-10-02 17:45:19 +0000 |
commit | b7889929b9889306bae9b98146edb7ac84bdedab (patch) | |
tree | 9d46706685e332fdbf0bc395bff936c78059a973 /sys/net80211/ieee80211_sta.c | |
parent | 001794b735018a8bbdbac013a520940cd521bb71 (diff) | |
download | FreeBSD-src-b7889929b9889306bae9b98146edb7ac84bdedab.zip FreeBSD-src-b7889929b9889306bae9b98146edb7ac84bdedab.tar.gz |
Migrate the power-save functions to be overridable VAP methods.
This turns ieee80211_node_pwrsave(), ieee80211_sta_pwrsave() and
ieee80211_recv_pspoll() into methods.
The intent is to let drivers override these and tie into the power save
management pathway.
For ath(4), this is the beginning of forcing a node software queue to
stop and start as needed, as well as supporting "leaking" single frames
from the software queue to the hardware.
Right now, ieee80211_recv_pspoll() will attempt to transmit a single frame
to the hardware (whether it be a data frame on the power-save queue or
a NULL data frame) but the driver may have hardware/software queued frames
queued up. This initial work is an attempt at providing the hooks required
to implement correct behaviour.
Allowing ieee80211_node_pwrsave() to be overridden allows the ath(4)
driver to pause and unpause the entire software queue for a given node.
It doesn't make sense to transmit anything whilst the node is asleep.
Please note that there are other corner cases to correctly handle -
specifically, setting the MORE data bit correctly on frames to a station,
as well as keeping the TIM updated. Those particular issues can be
addressed later.
Diffstat (limited to 'sys/net80211/ieee80211_sta.c')
-rw-r--r-- | sys/net80211/ieee80211_sta.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/net80211/ieee80211_sta.c b/sys/net80211/ieee80211_sta.c index 139fa37..88146f3 100644 --- a/sys/net80211/ieee80211_sta.c +++ b/sys/net80211/ieee80211_sta.c @@ -402,7 +402,7 @@ sta_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) arg == IEEE80211_FC0_SUBTYPE_ASSOC_RESP); break; case IEEE80211_S_SLEEP: - ieee80211_sta_pwrsave(vap, 0); + vap->iv_sta_ps(vap, 0); break; default: goto invalid; @@ -438,7 +438,7 @@ sta_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) goto invalid; break; case IEEE80211_S_SLEEP: - ieee80211_sta_pwrsave(vap, 1); + vap->iv_sta_ps(vap, 1); break; default: invalid: @@ -1396,7 +1396,7 @@ sta_recv_mgmt(struct ieee80211_node *ni, struct mbuf *m0, * we are expecting data. */ ic->ic_lastdata = ticks; - ieee80211_sta_pwrsave(vap, 0); + vap->iv_sta_ps(vap, 0); } #endif ni->ni_dtim_count = tim->tim_count; |