Commit 48a6a468 authored by Luis R. Rodriguez's avatar Luis R. Rodriguez Committed by John W. Linville

ath9k: fix enabling ANI / tx monitor after bg scan

ath9k's entire logic with SC_OP_SCANNING is incorrect due to the
way mac80211 currently implements the scan complete callback and
we handle it in ath9k. This patch removes the flag completely in
preference for the SC_OP_OFFCHANNEL which is really what we wanted.

The scanning flag was used to ensure we reset ANI to the old values
when we go back to the home channel, but if we are offchannel we
use some defaults. The flag was also used to re-enable the TX monitor.

Without this patch we simply never re-enabled ANI and the TX monitor
after going offchannel. This means that after one background
scan we are prone to noise issues and if we had a TX hang we would
not recover. To get this to work properly we must enable ANI after
we have configured the beacon timers, otherwise hardware acts really
oddly.

This patch has stable fixes which apply down to [2.6.36+], there
*may* be a to fix this on older kernels but requires a bit of
work since this patch relies on the new mac80211 flag
IEEE80211_CONF_OFFCHANNEL which was introduced as of 2.6.36.

Cc: stable@kernel.org
Cc: Paul Stewart <pstew@google.com>
Cc: Amod Bodas <amod.bodas@atheros.com>
Signed-off-by: default avatarLuis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 52b8ac92
...@@ -563,7 +563,6 @@ struct ath_ant_comb { ...@@ -563,7 +563,6 @@ struct ath_ant_comb {
#define SC_OP_RXFLUSH BIT(7) #define SC_OP_RXFLUSH BIT(7)
#define SC_OP_LED_ASSOCIATED BIT(8) #define SC_OP_LED_ASSOCIATED BIT(8)
#define SC_OP_LED_ON BIT(9) #define SC_OP_LED_ON BIT(9)
#define SC_OP_SCANNING BIT(10)
#define SC_OP_TSF_RESET BIT(11) #define SC_OP_TSF_RESET BIT(11)
#define SC_OP_BT_PRIORITY_DETECTED BIT(12) #define SC_OP_BT_PRIORITY_DETECTED BIT(12)
#define SC_OP_BT_SCAN BIT(13) #define SC_OP_BT_SCAN BIT(13)
......
...@@ -255,14 +255,12 @@ int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw, ...@@ -255,14 +255,12 @@ int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw,
ath_update_txpow(sc); ath_update_txpow(sc);
ath9k_hw_set_interrupts(ah, ah->imask); ath9k_hw_set_interrupts(ah, ah->imask);
if (!(sc->sc_flags & (SC_OP_OFFCHANNEL | SC_OP_SCANNING))) { if (!(sc->sc_flags & (SC_OP_OFFCHANNEL))) {
ath_start_ani(common); ath_beacon_config(sc, NULL);
ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, 0); ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work, 0);
ath_start_ani(common);
} }
if (!(sc->sc_flags & (SC_OP_OFFCHANNEL)))
ath_beacon_config(sc, NULL);
ps_restore: ps_restore:
ath9k_ps_restore(sc); ath9k_ps_restore(sc);
return r; return r;
...@@ -2036,7 +2034,6 @@ static void ath9k_sw_scan_start(struct ieee80211_hw *hw) ...@@ -2036,7 +2034,6 @@ static void ath9k_sw_scan_start(struct ieee80211_hw *hw)
aphy->state = ATH_WIPHY_SCAN; aphy->state = ATH_WIPHY_SCAN;
ath9k_wiphy_pause_all_forced(sc, aphy); ath9k_wiphy_pause_all_forced(sc, aphy);
sc->sc_flags |= SC_OP_SCANNING;
mutex_unlock(&sc->mutex); mutex_unlock(&sc->mutex);
} }
...@@ -2051,7 +2048,6 @@ static void ath9k_sw_scan_complete(struct ieee80211_hw *hw) ...@@ -2051,7 +2048,6 @@ static void ath9k_sw_scan_complete(struct ieee80211_hw *hw)
mutex_lock(&sc->mutex); mutex_lock(&sc->mutex);
aphy->state = ATH_WIPHY_ACTIVE; aphy->state = ATH_WIPHY_ACTIVE;
sc->sc_flags &= ~SC_OP_SCANNING;
mutex_unlock(&sc->mutex); mutex_unlock(&sc->mutex);
} }
......
...@@ -300,7 +300,7 @@ static void ath_edma_start_recv(struct ath_softc *sc) ...@@ -300,7 +300,7 @@ static void ath_edma_start_recv(struct ath_softc *sc)
ath_opmode_init(sc); ath_opmode_init(sc);
ath9k_hw_startpcureceive(sc->sc_ah, (sc->sc_flags & SC_OP_SCANNING)); ath9k_hw_startpcureceive(sc->sc_ah, (sc->sc_flags & SC_OP_OFFCHANNEL));
} }
static void ath_edma_stop_recv(struct ath_softc *sc) static void ath_edma_stop_recv(struct ath_softc *sc)
...@@ -506,7 +506,7 @@ int ath_startrecv(struct ath_softc *sc) ...@@ -506,7 +506,7 @@ int ath_startrecv(struct ath_softc *sc)
start_recv: start_recv:
spin_unlock_bh(&sc->rx.rxbuflock); spin_unlock_bh(&sc->rx.rxbuflock);
ath_opmode_init(sc); ath_opmode_init(sc);
ath9k_hw_startpcureceive(ah, (sc->sc_flags & SC_OP_SCANNING)); ath9k_hw_startpcureceive(ah, (sc->sc_flags & SC_OP_OFFCHANNEL));
return 0; return 0;
} }
......
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