aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/main.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2009-05-19 10:01:42 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-05-20 14:46:33 -0400
commitdc8c4585d2e6f3bf5c9d8c0a6036b591bd3baf2e (patch)
treef5d1d1ca8e5c00ada9c46edfffb87eee54ce2c31 /drivers/net/wireless/ath/ath9k/main.c
parentaa68aeaaff8bbf58e355eb83b7d0c14ce82b2f12 (diff)
ath9k: Set PM field in frame control when in PS mode
mac80211 does not set PM field for normal data frames, so we need to update that based on the current PS mode when using PS-Poll (timeout=0) power save mode. This allows the AP to remain in sync with our PS state. However, there is still a potential race condition between PS state changes when multiple TX queues are used and nullfunc and PS-Poll frames use different queue. That corner case may need to be handled separately by changing which queue is used either in ath9k or mac80211. Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/main.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index d6545b3538b1..77fbc46624b7 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -2088,6 +2088,21 @@ static int ath9k_tx(struct ieee80211_hw *hw,
2088 goto exit; 2088 goto exit;
2089 } 2089 }
2090 2090
2091 if (sc->hw->conf.flags & IEEE80211_CONF_PS) {
2092 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
2093 /*
2094 * mac80211 does not set PM field for normal data frames, so we
2095 * need to update that based on the current PS mode.
2096 */
2097 if (ieee80211_is_data(hdr->frame_control) &&
2098 !ieee80211_is_nullfunc(hdr->frame_control) &&
2099 !ieee80211_has_pm(hdr->frame_control)) {
2100 DPRINTF(sc, ATH_DBG_PS, "Add PM=1 for a TX frame "
2101 "while in PS mode\n");
2102 hdr->frame_control |= cpu_to_le16(IEEE80211_FCTL_PM);
2103 }
2104 }
2105
2091 if (unlikely(sc->sc_ah->power_mode != ATH9K_PM_AWAKE)) { 2106 if (unlikely(sc->sc_ah->power_mode != ATH9K_PM_AWAKE)) {
2092 /* 2107 /*
2093 * We are using PS-Poll and mac80211 can request TX while in 2108 * We are using PS-Poll and mac80211 can request TX while in