Commit 196fb860 authored by Sujith Manoharan's avatar Sujith Manoharan Committed by John W. Linville

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: default avatarSujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 07c15a3f
...@@ -210,6 +210,7 @@ static bool ath_complete_reset(struct ath_softc *sc, bool start) ...@@ -210,6 +210,7 @@ static bool ath_complete_reset(struct ath_softc *sc, bool start)
{ {
struct ath_hw *ah = sc->sc_ah; struct ath_hw *ah = sc->sc_ah;
struct ath_common *common = ath9k_hw_common(ah); struct ath_common *common = ath9k_hw_common(ah);
unsigned long flags;
if (ath_startrecv(sc) != 0) { if (ath_startrecv(sc) != 0) {
ath_err(common, "Unable to restart recv logic\n"); 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,9 +225,18 @@ static bool ath_complete_reset(struct ath_softc *sc, bool start)
ath9k_hw_enable_interrupts(ah); ath9k_hw_enable_interrupts(ah);
if (!(sc->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL) && start) { if (!(sc->hw->conf.flags & IEEE80211_CONF_OFFCHANNEL) && start) {
if (test_bit(SC_OP_BEACONS, &sc->sc_flags)) if (!test_bit(SC_OP_BEACONS, &sc->sc_flags))
goto work;
ath_set_beacon(sc); ath_set_beacon(sc);
if (ah->opmode == NL80211_IFTYPE_STATION &&
test_bit(SC_OP_PRIM_STA_VIF, &sc->sc_flags)) {
spin_lock_irqsave(&sc->sc_pm_lock, flags);
sc->ps_flags |= PS_BEACON_SYNC | PS_WAIT_FOR_BEACON;
spin_unlock_irqrestore(&sc->sc_pm_lock, flags);
}
work:
ath_restart_work(sc); ath_restart_work(sc);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment