aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSujith Manoharan <c_manoha@qca.qualcomm.com>2014-11-15 19:41:09 -0500
committerJohn W. Linville <linville@tuxdriver.com>2014-11-17 15:32:17 -0500
commitd9092c9873739429c9e97c4bc21ead9af2fb6aa1 (patch)
tree892ed9aef936090da516a01ca6a8703821e82301
parent2c3634a8d4c66f743d11dab03d0e66d77b6aac05 (diff)
ath9k: Adjust tbtt delta properly
In a GO/STA setup, when we switch to the STA context, the channel context timer is scheduled with a period of half the beacon interval. If a beacon is received in this duration, the timer is adjusted to accommodate TSF sync done by the HW. But, if the actual channel switch is delayed for some reason, we end up rearming the timer every time a new beacon is received. Avoid this by doing the adjustment only once. 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/ath9k.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/channel.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 0f6db12967d9..abe8bd6b972d 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -381,6 +381,7 @@ enum ath_chanctx_state {
381 381
382struct ath_chanctx_sched { 382struct ath_chanctx_sched {
383 bool beacon_pending; 383 bool beacon_pending;
384 bool beacon_adjust;
384 bool offchannel_pending; 385 bool offchannel_pending;
385 bool wait_switch; 386 bool wait_switch;
386 bool force_noa_update; 387 bool force_noa_update;
diff --git a/drivers/net/wireless/ath/ath9k/channel.c b/drivers/net/wireless/ath/ath9k/channel.c
index ee76682cc058..99425fe13055 100644
--- a/drivers/net/wireless/ath/ath9k/channel.c
+++ b/drivers/net/wireless/ath/ath9k/channel.c
@@ -659,6 +659,7 @@ void ath_chanctx_event(struct ath_softc *sc, struct ieee80211_vif *vif,
659 sc->sched.beacon_miss = 0; 659 sc->sched.beacon_miss = 0;
660 660
661 if (sc->sched.state == ATH_CHANCTX_STATE_FORCE_ACTIVE || 661 if (sc->sched.state == ATH_CHANCTX_STATE_FORCE_ACTIVE ||
662 !sc->sched.beacon_adjust ||
662 !sc->cur_chan->tsf_val) 663 !sc->cur_chan->tsf_val)
663 break; 664 break;
664 665
@@ -672,7 +673,7 @@ void ath_chanctx_event(struct ath_softc *sc, struct ieee80211_vif *vif,
672 ath9k_hw_get_tsf_offset(&sc->cur_chan->tsf_ts, NULL); 673 ath9k_hw_get_tsf_offset(&sc->cur_chan->tsf_ts, NULL);
673 tsf_time += ath9k_hw_gettsf32(ah); 674 tsf_time += ath9k_hw_gettsf32(ah);
674 675
675 676 sc->sched.beacon_adjust = false;
676 ath_chanctx_setup_timer(sc, tsf_time); 677 ath_chanctx_setup_timer(sc, tsf_time);
677 break; 678 break;
678 case ATH_CHANCTX_EVENT_AUTHORIZED: 679 case ATH_CHANCTX_EVENT_AUTHORIZED:
@@ -717,6 +718,7 @@ void ath_chanctx_event(struct ath_softc *sc, struct ieee80211_vif *vif,
717 718
718 ath_chanctx_setup_timer(sc, tsf_time); 719 ath_chanctx_setup_timer(sc, tsf_time);
719 sc->sched.beacon_pending = true; 720 sc->sched.beacon_pending = true;
721 sc->sched.beacon_adjust = true;
720 break; 722 break;
721 case ATH_CHANCTX_EVENT_ENABLE_MULTICHANNEL: 723 case ATH_CHANCTX_EVENT_ENABLE_MULTICHANNEL:
722 if (sc->cur_chan == &sc->offchannel.chan || 724 if (sc->cur_chan == &sc->offchannel.chan ||