diff options
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/channel.c')
-rw-r--r-- | drivers/net/wireless/ath/ath9k/channel.c | 31 |
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 26fc98b3495b..c679a26045ac 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) | |||
228 | if (send_ps) | 228 | if (send_ps) |
229 | ath_chanctx_send_ps_frame(sc, false); | 229 | ath_chanctx_send_ps_frame(sc, false); |
230 | 230 | ||
231 | ath_offchannel_channel_change(sc); | ||
231 | mutex_unlock(&sc->mutex); | 232 | mutex_unlock(&sc->mutex); |
232 | } | 233 | } |
233 | 234 | ||
@@ -253,6 +254,14 @@ void ath_chanctx_init(struct ath_softc *sc) | |||
253 | INIT_LIST_HEAD(&ctx->acq[j]); | 254 | INIT_LIST_HEAD(&ctx->acq[j]); |
254 | } | 255 | } |
255 | sc->cur_chan = &sc->chanctx[0]; | 256 | sc->cur_chan = &sc->chanctx[0]; |
257 | ctx = &sc->offchannel.chan; | ||
258 | cfg80211_chandef_create(&ctx->chandef, chan, NL80211_CHAN_HT20); | ||
259 | INIT_LIST_HEAD(&ctx->vifs); | ||
260 | ctx->txpower = ATH_TXPOWER_MAX; | ||
261 | for (j = 0; j < ARRAY_SIZE(ctx->acq); j++) | ||
262 | INIT_LIST_HEAD(&ctx->acq[j]); | ||
263 | sc->offchannel.chan.offchannel = true; | ||
264 | |||
256 | } | 265 | } |
257 | 266 | ||
258 | void ath_chanctx_switch(struct ath_softc *sc, struct ath_chanctx *ctx, | 267 | 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, | |||
283 | 292 | ||
284 | ath_set_channel(sc); | 293 | ath_set_channel(sc); |
285 | } | 294 | } |
295 | |||
296 | struct ath_chanctx *ath_chanctx_get_oper_chan(struct ath_softc *sc) | ||
297 | { | ||
298 | u8 i; | ||
299 | |||
300 | for (i = 0; i < ARRAY_SIZE(sc->chanctx); i++) { | ||
301 | if (!list_empty(&sc->chanctx[i].vifs)) | ||
302 | return &sc->chanctx[i]; | ||
303 | } | ||
304 | |||
305 | return &sc->chanctx[0]; | ||
306 | } | ||
307 | |||
308 | void ath_chanctx_offchan_switch(struct ath_softc *sc, | ||
309 | struct ieee80211_channel *chan) | ||
310 | { | ||
311 | struct cfg80211_chan_def chandef; | ||
312 | |||
313 | cfg80211_chandef_create(&chandef, chan, NL80211_CHAN_NO_HT); | ||
314 | |||
315 | ath_chanctx_switch(sc, &sc->offchannel.chan, &chandef); | ||
316 | } | ||