Lines Matching refs:ctx

105 	struct ath_chanctx *ctx;
117 ctx = &sc->chanctx[i];
118 cfg80211_chandef_create(&ctx->chandef, chan, NL80211_CHAN_HT20);
119 INIT_LIST_HEAD(&ctx->vifs);
120 ctx->txpower = ATH_TXPOWER_MAX;
121 ctx->flush_timeout = HZ / 5; /* 200ms */
122 for (j = 0; j < ARRAY_SIZE(ctx->acq); j++) {
123 INIT_LIST_HEAD(&ctx->acq[j].acq_new);
124 INIT_LIST_HEAD(&ctx->acq[j].acq_old);
125 spin_lock_init(&ctx->acq[j].lock);
130 void ath_chanctx_set_channel(struct ath_softc *sc, struct ath_chanctx *ctx,
138 memcpy(&ctx->chandef, chandef, sizeof(*chandef));
139 cur_chan = sc->cur_chan == ctx;
159 struct ath_chanctx *ctx;
165 ath_for_each_chanctx(sc, ctx) {
166 if (!ctx->active)
169 list_for_each_entry(avp, &ctx->vifs, list) {
174 return ctx;
247 void ath_chanctx_check_active(struct ath_softc *sc, struct ath_chanctx *ctx)
255 if (!ctx)
258 if (ctx == &sc->offchannel.chan) {
262 ctx->flush_timeout =
265 ctx->flush_timeout =
278 ictx = ctx;
280 list_for_each_entry(avp, &ctx->vifs, list) {
294 ctx->active = active;
296 ath_for_each_chanctx(sc, ctx) {
297 if (!ctx->assigned || list_empty(&ctx->vifs))
327 ath_chanctx_get_next(struct ath_softc *sc, struct ath_chanctx *ctx)
329 int idx = ctx - &sc->chanctx[0];
390 struct ath_chanctx *ctx,
399 if (ctx->active && sc->sched.extend_absence) {
408 if (ctx->active && sc->sched.beacon_miss >= 2) {
415 struct ath_chanctx *ctx,
436 if (ctx->active && avp->noa_duration)
501 struct ath_chanctx *ctx;
543 ctx = ath_chanctx_get_next(sc, sc->cur_chan);
544 if (ctx->active && sc->sched.state == ATH_CHANCTX_STATE_IDLE) {
545 sc->next_chan = ctx;
567 if (!ctx->active && avp->noa_duration &&
598 ath_chanctx_offchannel_noa(sc, ctx, avp, tsf_time);
602 ath_chanctx_handle_bmiss(sc, ctx, avp);
625 if (ctx->active &&
630 if (ctx->active && sc->sched.force_noa_update)
760 ctx = ath_chanctx_get_next(sc, sc->cur_chan);
762 if (!ctx->assigned)
765 sc->next_chan = ctx;
801 static void ath_chanctx_switch(struct ath_softc *sc, struct ath_chanctx *ctx,
809 (sc->cur_chan != ctx) && (ctx == &sc->offchannel.chan)) {
811 ctx->chandef = *chandef;
825 sc->next_chan = ctx;
827 ctx->chandef = *chandef;
864 struct ath_chanctx *ctx;
866 ath_for_each_chanctx(sc, ctx) {
867 if (!ctx->assigned || list_empty(&ctx->vifs))
869 if (active && !ctx->active)
872 if (ctx->switch_after_beacon)
873 return ctx;
1060 struct ath_chanctx *ctx;
1072 ctx = ath_chanctx_get_oper_chan(sc, true);
1073 if (ctx->active) {
1079 ath_chanctx_switch(sc, ctx, NULL);
1335 struct ath_chanctx *ctx;
1347 ctx = &sc->offchannel.chan;
1348 INIT_LIST_HEAD(&ctx->vifs);
1349 ctx->txpower = ATH_TXPOWER_MAX;
1350 cfg80211_chandef_create(&ctx->chandef, chan, NL80211_CHAN_HT20);
1352 for (i = 0; i < ARRAY_SIZE(ctx->acq); i++) {
1353 INIT_LIST_HEAD(&ctx->acq[i].acq_new);
1354 INIT_LIST_HEAD(&ctx->acq[i].acq_old);
1355 spin_lock_init(&ctx->acq[i].lock);
1385 void ath9k_chanctx_stop_queues(struct ath_softc *sc, struct ath_chanctx *ctx)
1390 if (ctx == &sc->offchannel.chan) {
1396 ctx->hw_queue_base + i);
1404 void ath9k_chanctx_wake_queues(struct ath_softc *sc, struct ath_chanctx *ctx)
1409 if (ctx == &sc->offchannel.chan) {
1415 ctx->hw_queue_base + i);