From: Felix Fietkau <nbd@xxxxxxxxxxx> Signed-off-by: Felix Fietkau <nbd@xxxxxxxxxxx> Signed-off-by: Rajkumar Manoharan <rmanohar@xxxxxxxxxxxxxxxx> --- drivers/net/wireless/ath/ath.h | 1 + drivers/net/wireless/ath/ath9k/channel.c | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/drivers/net/wireless/ath/ath.h b/drivers/net/wireless/ath/ath.h index a889fd6..fd9e530 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 f7842ee..3cb86f4 100644 --- a/drivers/net/wireless/ath/ath9k/channel.c +++ b/drivers/net/wireless/ath/ath9k/channel.c @@ -186,8 +186,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 i, n_active = 0; if (!ctx) return; @@ -207,6 +209,16 @@ void ath_chanctx_check_active(struct ath_softc *sc, struct ath_chanctx *ctx) } } ctx->active = active; + + for (i = 0; i < ATH9K_NUM_CHANCTX; i++) { + ctx = &sc->chanctx[i]; + if (ctx->assigned && !list_empty(&ctx->vifs)) + 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 -- 2.0.0 -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html