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 | |
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>
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ath9k.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/channel.c | 33 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/init.c | 1 |
3 files changed, 30 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index 892ca4af75ef..5b8bc5dd007e 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h | |||
@@ -423,6 +423,7 @@ void ath_chanctx_check_active(struct ath_softc *sc, struct ath_chanctx *ctx); | |||
423 | bool ath9k_is_chanctx_enabled(void); | 423 | bool ath9k_is_chanctx_enabled(void); |
424 | void ath9k_fill_chanctx_ops(void); | 424 | void ath9k_fill_chanctx_ops(void); |
425 | void ath9k_init_channel_context(struct ath_softc *sc); | 425 | void ath9k_init_channel_context(struct ath_softc *sc); |
426 | void ath9k_offchannel_init(struct ath_softc *sc); | ||
426 | void ath9k_deinit_channel_context(struct ath_softc *sc); | 427 | void ath9k_deinit_channel_context(struct ath_softc *sc); |
427 | int ath9k_init_p2p(struct ath_softc *sc); | 428 | int ath9k_init_p2p(struct ath_softc *sc); |
428 | void ath9k_deinit_p2p(struct ath_softc *sc); | 429 | void ath9k_deinit_p2p(struct ath_softc *sc); |
@@ -455,6 +456,9 @@ static inline void ath9k_fill_chanctx_ops(void) | |||
455 | static inline void ath9k_init_channel_context(struct ath_softc *sc) | 456 | static inline void ath9k_init_channel_context(struct ath_softc *sc) |
456 | { | 457 | { |
457 | } | 458 | } |
459 | static inline void ath9k_offchannel_init(struct ath_softc *sc) | ||
460 | { | ||
461 | } | ||
458 | static inline void ath9k_deinit_channel_context(struct ath_softc *sc) | 462 | static inline void ath9k_deinit_channel_context(struct ath_softc *sc) |
459 | { | 463 | { |
460 | } | 464 | } |
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); |
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c index fe0311a0cd23..5887499a3838 100644 --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c | |||
@@ -610,6 +610,7 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc, | |||
610 | ath9k_init_misc(sc); | 610 | ath9k_init_misc(sc); |
611 | ath_fill_led_pin(sc); | 611 | ath_fill_led_pin(sc); |
612 | ath_chanctx_init(sc); | 612 | ath_chanctx_init(sc); |
613 | ath9k_offchannel_init(sc); | ||
613 | 614 | ||
614 | if (common->bus_ops->aspm_init) | 615 | if (common->bus_ops->aspm_init) |
615 | common->bus_ops->aspm_init(common); | 616 | common->bus_ops->aspm_init(common); |