summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/ath9k/channel.c
diff options
context:
space:
mode:
authorRajkumar Manoharan <rmanohar@qti.qualcomm.com>2014-06-11 16:17:58 +0530
committerJohn W. Linville <linville@tuxdriver.com>2014-06-19 15:49:18 -0400
commitc4dc0d040e356efc0263e0b27181b05f9ef33e5f (patch)
treea2a694b3925d7d3a89993900c082172c7fc78d1c /drivers/net/wireless/ath/ath9k/channel.c
parent3930563570d3714420a2ebe0324a917ff64e0422 (diff)
ath9k: Fetch appropriate operating channel context
Retrieve appropriate operating channel context while switching between operating and off channels. 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/ath9k/channel.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/channel.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath/ath9k/channel.c b/drivers/net/wireless/ath/ath9k/channel.c
index c679a26045ac..097207073cd4 100644
--- a/drivers/net/wireless/ath/ath9k/channel.c
+++ b/drivers/net/wireless/ath/ath9k/channel.c
@@ -293,13 +293,17 @@ void ath_chanctx_set_channel(struct ath_softc *sc, struct ath_chanctx *ctx,
ath_set_channel(sc);
}
-struct ath_chanctx *ath_chanctx_get_oper_chan(struct ath_softc *sc)
+struct ath_chanctx *ath_chanctx_get_oper_chan(struct ath_softc *sc, bool active)
{
- u8 i;
+ struct ath_chanctx *ctx;
+
+ ath_for_each_chanctx(sc, ctx) {
+ if (!ctx->assigned || list_empty(&ctx->vifs))
+ continue;
+ if (active && !ctx->active)
+ continue;
- for (i = 0; i < ARRAY_SIZE(sc->chanctx); i++) {
- if (!list_empty(&sc->chanctx[i].vifs))
- return &sc->chanctx[i];
+ return ctx;
}
return &sc->chanctx[0];