]> rtime.felk.cvut.cz Git - lisovros/linux_canprio.git/commitdiff
ath9k: fix regression on beacon loss after bgscan
authorLuis R. Rodriguez <lrodriguez@atheros.com>
Thu, 16 Sep 2010 19:12:27 +0000 (15:12 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 9 Dec 2010 21:32:00 +0000 (13:32 -0800)
commit 52b8ac92496e03d6b5619204d7f3bae6ce6eae45 upstream.

When we return to the home channel we were never reseting our beacon
timers, this was casued by the fact that the scanning flag was still
on even after we returned to our home channel. There are also other
reasons why we would get a reset and if we are not off channel
we always need to resynch our beacon timers, because a reset will
clear them.

This bug is a regression introduced on 2.6.36. The order of the
changes are as follows:

5ee08656 - Sat Jul 31 - ath9k: prevent calibration during off-channel activity
a0daa0e7 - Tue Jul 27 - Revert "mac80211: fix sw scan bracketing"
543708be - Fri Jun 18 - mac80211: fix sw scan bracketing

mcgrof@tux ~/linux-2.6-allstable (git::master)$ git describe \
        --contains 5ee0865615f65f84e6ee9174771a6716c29e08e1
v2.6.36-rc1~43^2~34^2~22

mcgrof@tux ~/linux-2.6-allstable (git::master)$ git describe \
        --contains a0daa0e7592ada797d6835f11529097aabc27ad2
v2.6.36-rc1~571^2~64^2~13

mcgrof@tux ~/linux-2.6-allstable (git::master)$ git describe \
        --contains 543708be320d7df692d24b349ca01a947b340764
v2.6.36-rc1~571^2~107^2~187

So 5ee08656 would have worked if a0daa0e7 was not committed but
it was so this means 5ee08656 was broken since it assumed that
when we were in the channel change routine the scan flag would
be lifted. As it turns out the scan flag will be set when we
are already on the home channel.

For more details refer to:

http://code.google.com/p/chromium-os/issues/detail?id=5715

These issues will need to be considered for our solution on
reshifting the scan complete callback location on mac80211 on
current development kernel work.

This patch has stable fixes which apply down to [2.6.36+]

Cc: Paul Stewart <pstew@google.com>
Cc: Amod Bodas <amod.bodas@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/wireless/ath/ath9k/main.c

index feea5fe1da95f0c22578075e3d0f5dd6bc223089..3e9277606989e7eba71f3ee28eafe1146d9fa5b0 100644 (file)
@@ -257,9 +257,11 @@ int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw,
        if (!(sc->sc_flags & (SC_OP_OFFCHANNEL | SC_OP_SCANNING))) {
                ath_start_ani(common);
                ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, 0);
-               ath_beacon_config(sc, NULL);
        }
 
+       if (!(sc->sc_flags & (SC_OP_OFFCHANNEL)))
+               ath_beacon_config(sc, NULL);
+
  ps_restore:
        ath9k_ps_restore(sc);
        return r;
@@ -953,7 +955,7 @@ int ath_reset(struct ath_softc *sc, bool retry_tx)
 
        ath_update_txpow(sc);
 
-       if (sc->sc_flags & SC_OP_BEACONS)
+       if ((sc->sc_flags & SC_OP_BEACONS) || !(sc->sc_flags & (SC_OP_OFFCHANNEL)))
                ath_beacon_config(sc, NULL);    /* restart beacons */
 
        ath9k_hw_set_interrupts(ah, ah->imask);