diff options
author | Felix Fietkau <nbd@openwrt.org> | 2014-06-11 12:48:00 +0200 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-06-19 21:49:18 +0200 |
commit | 26f16c246cea41f30ab2f63214a5529678677d0d (patch) | |
tree | 6956ba03c110a9804c8a0909e7b178402158a5c5 /drivers/net/wireless/ath | |
parent | ath9k: Move caldata into channel context (diff) | |
download | linux-26f16c246cea41f30ab2f63214a5529678677d0d.tar.xz linux-26f16c246cea41f30ab2f63214a5529678677d0d.zip |
ath9k: Add ATH_OP_MULTI_CHANNEL
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Rajkumar Manoharan <rmanohar@qti.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath')
-rw-r--r-- | drivers/net/wireless/ath/ath.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/channel.c | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath.h b/drivers/net/wireless/ath/ath.h index a889fd66fc63..fd9e5305e77f 100644 --- a/drivers/net/wireless/ath/ath.h +++ b/drivers/net/wireless/ath/ath.h @@ -63,6 +63,7 @@ enum ath_op_flags { ATH_OP_PRIM_STA_VIF, ATH_OP_HW_RESET, ATH_OP_SCANNING, + ATH_OP_MULTI_CHANNEL, }; enum ath_bus_type { diff --git a/drivers/net/wireless/ath/ath9k/channel.c b/drivers/net/wireless/ath/ath9k/channel.c index 097207073cd4..e3127b52e1ee 100644 --- a/drivers/net/wireless/ath/ath9k/channel.c +++ b/drivers/net/wireless/ath/ath9k/channel.c @@ -150,8 +150,10 @@ ath_chanctx_send_vif_ps_frame(struct ath_softc *sc, struct ath_vif *avp, void ath_chanctx_check_active(struct ath_softc *sc, struct ath_chanctx *ctx) { + struct ath_common *common = ath9k_hw_common(sc->sc_ah); struct ath_vif *avp; bool active = false; + u8 n_active = 0; if (!ctx) return; @@ -171,6 +173,17 @@ void ath_chanctx_check_active(struct ath_softc *sc, struct ath_chanctx *ctx) } } ctx->active = active; + + ath_for_each_chanctx(sc, ctx) { + if (!ctx->assigned || list_empty(&ctx->vifs)) + continue; + n_active++; + } + + if (n_active > 1) + set_bit(ATH_OP_MULTI_CHANNEL, &common->op_flags); + else + clear_bit(ATH_OP_MULTI_CHANNEL, &common->op_flags); } static bool |