aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSujith Manoharan <c_manoha@qca.qualcomm.com>2012-06-04 10:54:13 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-06-06 15:20:32 -0400
commit196fb860ceb6b937cbe608ea3ea0209bd4edf3b2 (patch)
tree5ba7df797b2c1084a03634b22763326a75848fd6
parent07c15a3ffd68ff1a3276daa26885b277f19e4abd (diff)
ath9k: Resync beacons properly
After a chip reset, the beacon timers have to re-programmed correctly for a station in associated state. Use the PS flags to ensure that this is done after a TSF sync happens, otherwise the driver ends up using incorrect values for TBTT/DTIM in powersave mode. Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/main.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 88f7ad106e05..c0f478b0a9a2 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -210,6 +210,7 @@ static bool ath_complete_reset(struct ath_softc *sc, bool start)
210{ 210{
211 struct ath_hw *ah = sc->sc_ah; 211 struct ath_hw *ah = sc->sc_ah;
212 struct ath_common *common = ath9k_hw_common(ah); 212 struct ath_common *common = ath9k_hw_common(ah);
213 unsigned long flags;
213 214
214 if (ath_startrecv(sc) != 0) { 215 if (ath_startrecv(sc) != 0) {
215 ath_err(common, "Unable to restart recv logic\n"); 216 ath_err(common, "Unable to restart recv logic\n");
@@ -224,9 +225,18 @@ static bool ath_complete_reset(struct ath_softc *sc, bool start)
224 ath9k_hw_enable_interrupts(ah); 225 ath9k_hw_enable_interrupts(ah);
225 226
226 if (!(sc->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL) && start) { 227 if (!(sc->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL) && start) {
227 if (test_bit(SC_OP_BEACONS, &sc->sc_flags)) 228 if (!test_bit(SC_OP_BEACONS, &sc->sc_flags))
228 ath_set_beacon(sc); 229 goto work;
230
231 ath_set_beacon(sc);
229 232
233 if (ah->opmode == NL80211_IFTYPE_STATION &&
234 test_bit(SC_OP_PRIM_STA_VIF, &sc->sc_flags)) {
235 spin_lock_irqsave(&sc->sc_pm_lock, flags);
236 sc->ps_flags |= PS_BEACON_SYNC | PS_WAIT_FOR_BEACON;
237 spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
238 }
239 work:
230 ath_restart_work(sc); 240 ath_restart_work(sc);
231 } 241 }
232 242