diff options
author | Sujith Manoharan <c_manoha@qca.qualcomm.com> | 2014-08-23 03:59:20 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-08-28 14:49:37 -0400 |
commit | e90e302a15b85ed27bdc148be2eed50c8aaaee06 (patch) | |
tree | d1bc206388ca18341fae536201098d5748a78f2a /drivers/net/wireless/ath/ath9k/channel.c | |
parent | 0e08b5fb81111662bf9fa5f67f8a412791923b6f (diff) |
ath9k: Add ath9k_offchannel_init
This patch adds a routine to setup the offchannel
instance in ath_softc.
Signed-off-by: Sujith Manoharan <c_manoha@qca.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.c | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/ath9k/channel.c b/drivers/net/wireless/ath/ath9k/channel.c index f719c36fe47d..d1ad5a2db2be 100644 --- a/drivers/net/wireless/ath/ath9k/channel.c +++ b/drivers/net/wireless/ath/ath9k/channel.c | |||
@@ -167,14 +167,6 @@ void ath_chanctx_init(struct ath_softc *sc) | |||
167 | for (j = 0; j < ARRAY_SIZE(ctx->acq); j++) | 167 | for (j = 0; j < ARRAY_SIZE(ctx->acq); j++) |
168 | INIT_LIST_HEAD(&ctx->acq[j]); | 168 | INIT_LIST_HEAD(&ctx->acq[j]); |
169 | } | 169 | } |
170 | ctx = &sc->offchannel.chan; | ||
171 | cfg80211_chandef_create(&ctx->chandef, chan, NL80211_CHAN_HT20); | ||
172 | INIT_LIST_HEAD(&ctx->vifs); | ||
173 | ctx->txpower = ATH_TXPOWER_MAX; | ||
174 | for (j = 0; j < ARRAY_SIZE(ctx->acq); j++) | ||
175 | INIT_LIST_HEAD(&ctx->acq[j]); | ||
176 | sc->offchannel.chan.offchannel = true; | ||
177 | |||
178 | } | 170 | } |
179 | 171 | ||
180 | void ath_chanctx_set_channel(struct ath_softc *sc, struct ath_chanctx *ctx, | 172 | void ath_chanctx_set_channel(struct ath_softc *sc, struct ath_chanctx *ctx, |
@@ -942,6 +934,31 @@ static void ath_chanctx_work(struct work_struct *work) | |||
942 | mutex_unlock(&sc->mutex); | 934 | mutex_unlock(&sc->mutex); |
943 | } | 935 | } |
944 | 936 | ||
937 | void ath9k_offchannel_init(struct ath_softc *sc) | ||
938 | { | ||
939 | struct ath_chanctx *ctx; | ||
940 | struct ath_common *common = ath9k_hw_common(sc->sc_ah); | ||
941 | struct ieee80211_supported_band *sband; | ||
942 | struct ieee80211_channel *chan; | ||
943 | int i; | ||
944 | |||
945 | sband = &common->sbands[IEEE80211_BAND_2GHZ]; | ||
946 | if (!sband->n_channels) | ||
947 | sband = &common->sbands[IEEE80211_BAND_5GHZ]; | ||
948 | |||
949 | chan = &sband->channels[0]; | ||
950 | |||
951 | ctx = &sc->offchannel.chan; | ||
952 | INIT_LIST_HEAD(&ctx->vifs); | ||
953 | ctx->txpower = ATH_TXPOWER_MAX; | ||
954 | cfg80211_chandef_create(&ctx->chandef, chan, NL80211_CHAN_HT20); | ||
955 | |||
956 | for (i = 0; i < ARRAY_SIZE(ctx->acq); i++) | ||
957 | INIT_LIST_HEAD(&ctx->acq[i]); | ||
958 | |||
959 | sc->offchannel.chan.offchannel = true; | ||
960 | } | ||
961 | |||
945 | void ath9k_init_channel_context(struct ath_softc *sc) | 962 | void ath9k_init_channel_context(struct ath_softc *sc) |
946 | { | 963 | { |
947 | INIT_WORK(&sc->chanctx_work, ath_chanctx_work); | 964 | INIT_WORK(&sc->chanctx_work, ath_chanctx_work); |