summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/channel.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-06-11 16:17:55 +0530
committerJohn W. Linville <linville@tuxdriver.com>2014-06-19 15:49:17 -0400
commit78b21949711ee3c877f1aab5b51abe1981e1161d (patch)
tree317ab473cd8a8ca5a96fdd000a5fc70a644868be /drivers/net/wireless/ath/ath9k/channel.c
parentc083ce9980109065297aa2171d18980a0ac92bb9 (diff)
ath9k: Implement hw_scan support
Implement hw_scan support for enabling multi-channel cuncurrency. 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/ath9k/channel.c')
-rw-r--r--drivers/net/wireless/ath/ath9k/channel.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/net/wireless/ath/ath9k/channel.c b/drivers/net/wireless/ath/ath9k/channel.c
index 26fc98b3495..c679a26045a 100644
--- a/drivers/net/wireless/ath/ath9k/channel.c
+++ b/drivers/net/wireless/ath/ath9k/channel.c
@@ -228,6 +228,7 @@ void ath_chanctx_work(struct work_struct *work)
if (send_ps)
ath_chanctx_send_ps_frame(sc, false);
+ ath_offchannel_channel_change(sc);
mutex_unlock(&sc->mutex);
}
@@ -253,6 +254,14 @@ void ath_chanctx_init(struct ath_softc *sc)
INIT_LIST_HEAD(&ctx->acq[j]);
}
sc->cur_chan = &sc->chanctx[0];
+ ctx = &sc->offchannel.chan;
+ cfg80211_chandef_create(&ctx->chandef, chan, NL80211_CHAN_HT20);
+ INIT_LIST_HEAD(&ctx->vifs);
+ ctx->txpower = ATH_TXPOWER_MAX;
+ for (j = 0; j < ARRAY_SIZE(ctx->acq); j++)
+ INIT_LIST_HEAD(&ctx->acq[j]);
+ sc->offchannel.chan.offchannel = true;
+
}
void ath_chanctx_switch(struct ath_softc *sc, struct ath_chanctx *ctx,
@@ -283,3 +292,25 @@ 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)
+{
+ u8 i;
+
+ for (i = 0; i < ARRAY_SIZE(sc->chanctx); i++) {
+ if (!list_empty(&sc->chanctx[i].vifs))
+ return &sc->chanctx[i];
+ }
+
+ return &sc->chanctx[0];
+}
+
+void ath_chanctx_offchan_switch(struct ath_softc *sc,
+ struct ieee80211_channel *chan)
+{
+ struct cfg80211_chan_def chandef;
+
+ cfg80211_chandef_create(&chandef, chan, NL80211_CHAN_NO_HT);
+
+ ath_chanctx_switch(sc, &sc->offchannel.chan, &chandef);
+}