diff options
author | Sujith Manoharan <c_manoha@qca.qualcomm.com> | 2014-08-23 13:29:16 +0530 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-08-28 14:49:37 -0400 |
commit | 27babf9f470b5e75763703626cae710a30bf703d (patch) | |
tree | c705577e90ab5394ede2db1d04caea92acbc1c21 /drivers/net/wireless/ath/ath9k/channel.c | |
parent | 922c943dcc48fc0085daeaa3e8038c5446f226c2 (diff) |
ath9k: Fix channel context events
Check if channel context usage is enabled before
calling ath_chanctx_event() from various parts of the
driver. Also, make sure that ath_chanctx_event() is
compiled only when CONFIG_ATH9K_CHANNEL_CONTEXT is
enabled.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/channel.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/channel.c | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/drivers/net/wireless/ath/ath9k/channel.c b/drivers/net/wireless/ath/ath9k/channel.c index ceb3ce8bb25..ae0b3f9530f 100644 --- a/drivers/net/wireless/ath/ath9k/channel.c +++ b/drivers/net/wireless/ath/ath9k/channel.c @@ -139,7 +139,11 @@ void ath_chanctx_check_active(struct ath_softc *sc, struct ath_chanctx *ctx) } if (test_and_set_bit(ATH_OP_MULTI_CHANNEL, &common->op_flags)) return; - ath_chanctx_event(sc, NULL, ATH_CHANCTX_EVENT_ENABLE_MULTICHANNEL); + + if (ath9k_is_chanctx_enabled()) { + ath_chanctx_event(sc, NULL, + ATH_CHANCTX_EVENT_ENABLE_MULTICHANNEL); + } } void ath_chanctx_init(struct ath_softc *sc) @@ -190,6 +194,25 @@ void ath_chanctx_set_channel(struct ath_softc *sc, struct ath_chanctx *ctx, ath_set_channel(sc); } +#ifdef CONFIG_ATH9K_CHANNEL_CONTEXT + +static const char *offchannel_state_string(enum ath_offchannel_state state) +{ +#define case_rtn_string(val) case val: return #val + + switch (state) { + case_rtn_string(ATH_OFFCHANNEL_IDLE); + case_rtn_string(ATH_OFFCHANNEL_PROBE_SEND); + case_rtn_string(ATH_OFFCHANNEL_PROBE_WAIT); + case_rtn_string(ATH_OFFCHANNEL_SUSPEND); + case_rtn_string(ATH_OFFCHANNEL_ROC_START); + case_rtn_string(ATH_OFFCHANNEL_ROC_WAIT); + case_rtn_string(ATH_OFFCHANNEL_ROC_DONE); + default: + return "unknown"; + } +} + static struct ath_chanctx * ath_chanctx_get_next(struct ath_softc *sc, struct ath_chanctx *ctx) { @@ -440,25 +463,6 @@ void ath_chanctx_event(struct ath_softc *sc, struct ieee80211_vif *vif, spin_unlock_bh(&sc->chan_lock); } -#ifdef CONFIG_ATH9K_CHANNEL_CONTEXT - -static const char *offchannel_state_string(enum ath_offchannel_state state) -{ -#define case_rtn_string(val) case val: return #val - - switch (state) { - case_rtn_string(ATH_OFFCHANNEL_IDLE); - case_rtn_string(ATH_OFFCHANNEL_PROBE_SEND); - case_rtn_string(ATH_OFFCHANNEL_PROBE_WAIT); - case_rtn_string(ATH_OFFCHANNEL_SUSPEND); - case_rtn_string(ATH_OFFCHANNEL_ROC_START); - case_rtn_string(ATH_OFFCHANNEL_ROC_WAIT); - case_rtn_string(ATH_OFFCHANNEL_ROC_DONE); - default: - return "unknown"; - } -} - static int ath_scan_channel_duration(struct ath_softc *sc, struct ieee80211_channel *chan) { |