aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-06-11 06:48:00 -0400
committerJohn W. Linville <linville@tuxdriver.com>2014-06-19 15:49:18 -0400
commit26f16c246cea41f30ab2f63214a5529678677d0d (patch)
tree6956ba03c110a9804c8a0909e7b178402158a5c5
parentb01459e856cbe9ccf64dde251aec02eae60094ce (diff)
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>
-rw-r--r--drivers/net/wireless/ath/ath.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/channel.c13
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 {
63 ATH_OP_PRIM_STA_VIF, 63 ATH_OP_PRIM_STA_VIF,
64 ATH_OP_HW_RESET, 64 ATH_OP_HW_RESET,
65 ATH_OP_SCANNING, 65 ATH_OP_SCANNING,
66 ATH_OP_MULTI_CHANNEL,
66}; 67};
67 68
68enum ath_bus_type { 69enum 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,
150 150
151void ath_chanctx_check_active(struct ath_softc *sc, struct ath_chanctx *ctx) 151void ath_chanctx_check_active(struct ath_softc *sc, struct ath_chanctx *ctx)
152{ 152{
153 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
153 struct ath_vif *avp; 154 struct ath_vif *avp;
154 bool active = false; 155 bool active = false;
156 u8 n_active = 0;
155 157
156 if (!ctx) 158 if (!ctx)
157 return; 159 return;
@@ -171,6 +173,17 @@ void ath_chanctx_check_active(struct ath_softc *sc, struct ath_chanctx *ctx)
171 } 173 }
172 } 174 }
173 ctx->active = active; 175 ctx->active = active;
176
177 ath_for_each_chanctx(sc, ctx) {
178 if (!ctx->assigned || list_empty(&ctx->vifs))
179 continue;
180 n_active++;
181 }
182
183 if (n_active > 1)
184 set_bit(ATH_OP_MULTI_CHANNEL, &common->op_flags);
185 else
186 clear_bit(ATH_OP_MULTI_CHANNEL, &common->op_flags);
174} 187}
175 188
176static bool 189static bool