1 From: Sujith Manoharan <c_manoha@qca.qualcomm.com>
2 Date: Fri, 17 Oct 2014 07:40:28 +0530
3 Subject: [PATCH] ath9k: Fix HW scan abort
5 Instead of using ATH_CHANCTX_EVENT_ASSIGN to abort
6 a HW scan when a new interface becomes active, use the
7 mgd_prepare_tx() callback. This allows us to make
8 sure that the GO's channel becomes operational by
11 Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
14 --- a/drivers/net/wireless/ath/ath9k/channel.c
15 +++ b/drivers/net/wireless/ath/ath9k/channel.c
16 @@ -743,22 +743,6 @@ void ath_chanctx_event(struct ath_softc
17 ieee80211_queue_work(sc->hw, &sc->chanctx_work);
19 case ATH_CHANCTX_EVENT_ASSIGN:
21 - * When adding a new channel context, check if a scan
22 - * is in progress and abort it since the addition of
23 - * a new channel context is usually followed by VIF
24 - * assignment, in which case we have to start multi-channel
27 - if (test_bit(ATH_OP_SCANNING, &common->op_flags)) {
28 - ath_dbg(common, CHAN_CTX,
29 - "Aborting HW scan to add new context\n");
31 - spin_unlock_bh(&sc->chan_lock);
32 - del_timer_sync(&sc->offchannel.timer);
33 - ath_scan_complete(sc, true);
34 - spin_lock_bh(&sc->chan_lock);
37 case ATH_CHANCTX_EVENT_CHANGE:
39 --- a/drivers/net/wireless/ath/ath9k/main.c
40 +++ b/drivers/net/wireless/ath/ath9k/main.c
41 @@ -2365,7 +2365,6 @@ static int ath9k_add_chanctx(struct ieee
42 conf->def.chan->center_freq);
44 ath_chanctx_set_channel(sc, ctx, &conf->def);
45 - ath_chanctx_event(sc, NULL, ATH_CHANCTX_EVENT_ASSIGN);
47 mutex_unlock(&sc->mutex);
49 @@ -2496,6 +2495,19 @@ static void ath9k_mgd_prepare_tx(struct
53 + if (test_bit(ATH_OP_SCANNING, &common->op_flags)) {
54 + ath_dbg(common, CHAN_CTX,
55 + "%s: Aborting HW scan\n", __func__);
57 + mutex_unlock(&sc->mutex);
59 + del_timer_sync(&sc->offchannel.timer);
60 + ath_scan_complete(sc, true);
61 + flush_work(&sc->chanctx_work);
63 + mutex_lock(&sc->mutex);
66 go_ctx = ath_is_go_chanctx_present(sc);