• Home
  • Raw
  • Download

Lines Matching refs:ctx

14 					  struct ieee80211_chanctx *ctx)  in ieee80211_chanctx_num_assigned()  argument
21 list_for_each_entry(sdata, &ctx->assigned_vifs, assigned_chanctx_list) in ieee80211_chanctx_num_assigned()
28 struct ieee80211_chanctx *ctx) in ieee80211_chanctx_num_reserved() argument
35 list_for_each_entry(sdata, &ctx->reserved_vifs, reserved_chanctx_list) in ieee80211_chanctx_num_reserved()
42 struct ieee80211_chanctx *ctx) in ieee80211_chanctx_refcount() argument
44 return ieee80211_chanctx_num_assigned(local, ctx) + in ieee80211_chanctx_refcount()
45 ieee80211_chanctx_num_reserved(local, ctx); in ieee80211_chanctx_refcount()
50 struct ieee80211_chanctx *ctx; in ieee80211_num_chanctx() local
55 list_for_each_entry(ctx, &local->chanctx_list, list) in ieee80211_num_chanctx()
83 struct ieee80211_chanctx *ctx, in ieee80211_chanctx_reserved_chandef() argument
90 list_for_each_entry(sdata, &ctx->reserved_vifs, in ieee80211_chanctx_reserved_chandef()
106 struct ieee80211_chanctx *ctx, in ieee80211_chanctx_non_reserved_chandef() argument
113 list_for_each_entry(sdata, &ctx->assigned_vifs, in ieee80211_chanctx_non_reserved_chandef()
132 struct ieee80211_chanctx *ctx, in ieee80211_chanctx_combined_chandef() argument
137 compat = ieee80211_chanctx_reserved_chandef(local, ctx, compat); in ieee80211_chanctx_combined_chandef()
141 compat = ieee80211_chanctx_non_reserved_chandef(local, ctx, compat); in ieee80211_chanctx_combined_chandef()
150 struct ieee80211_chanctx *ctx, in ieee80211_chanctx_can_reserve_chandef() argument
155 if (ieee80211_chanctx_combined_chandef(local, ctx, def)) in ieee80211_chanctx_can_reserve_chandef()
158 if (!list_empty(&ctx->reserved_vifs) && in ieee80211_chanctx_can_reserve_chandef()
159 ieee80211_chanctx_reserved_chandef(local, ctx, def)) in ieee80211_chanctx_can_reserve_chandef()
170 struct ieee80211_chanctx *ctx; in ieee80211_find_reservation_chanctx() local
177 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_find_reservation_chanctx()
178 if (ctx->replace_state == IEEE80211_CHANCTX_WILL_BE_REPLACED) in ieee80211_find_reservation_chanctx()
181 if (ctx->mode == IEEE80211_CHANCTX_EXCLUSIVE) in ieee80211_find_reservation_chanctx()
184 if (!ieee80211_chanctx_can_reserve_chandef(local, ctx, in ieee80211_find_reservation_chanctx()
188 return ctx; in ieee80211_find_reservation_chanctx()
309 struct ieee80211_chanctx *ctx) in ieee80211_recalc_chanctx_min_def() argument
317 if (ctx->conf.def.width == NL80211_CHAN_WIDTH_5 || in ieee80211_recalc_chanctx_min_def()
318 ctx->conf.def.width == NL80211_CHAN_WIDTH_10 || in ieee80211_recalc_chanctx_min_def()
319 ctx->conf.radar_enabled) { in ieee80211_recalc_chanctx_min_def()
320 ctx->conf.min_def = ctx->conf.def; in ieee80211_recalc_chanctx_min_def()
324 max_bw = ieee80211_get_chanctx_max_required_bw(local, &ctx->conf); in ieee80211_recalc_chanctx_min_def()
327 min_def = ctx->conf.def; in ieee80211_recalc_chanctx_min_def()
331 if (cfg80211_chandef_identical(&ctx->conf.min_def, &min_def)) in ieee80211_recalc_chanctx_min_def()
334 ctx->conf.min_def = min_def; in ieee80211_recalc_chanctx_min_def()
335 if (!ctx->driver_present) in ieee80211_recalc_chanctx_min_def()
338 drv_change_chanctx(local, ctx, IEEE80211_CHANCTX_CHANGE_MIN_WIDTH); in ieee80211_recalc_chanctx_min_def()
342 struct ieee80211_chanctx *ctx, in ieee80211_change_chanctx() argument
345 if (cfg80211_chandef_identical(&ctx->conf.def, chandef)) { in ieee80211_change_chanctx()
346 ieee80211_recalc_chanctx_min_def(local, ctx); in ieee80211_change_chanctx()
350 WARN_ON(!cfg80211_chandef_compatible(&ctx->conf.def, chandef)); in ieee80211_change_chanctx()
352 ctx->conf.def = *chandef; in ieee80211_change_chanctx()
353 drv_change_chanctx(local, ctx, IEEE80211_CHANCTX_CHANGE_WIDTH); in ieee80211_change_chanctx()
354 ieee80211_recalc_chanctx_min_def(local, ctx); in ieee80211_change_chanctx()
367 struct ieee80211_chanctx *ctx; in ieee80211_find_chanctx() local
374 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_find_chanctx()
377 if (ctx->replace_state != IEEE80211_CHANCTX_REPLACE_NONE) in ieee80211_find_chanctx()
380 if (ctx->mode == IEEE80211_CHANCTX_EXCLUSIVE) in ieee80211_find_chanctx()
383 compat = cfg80211_chandef_compatible(&ctx->conf.def, chandef); in ieee80211_find_chanctx()
387 compat = ieee80211_chanctx_reserved_chandef(local, ctx, in ieee80211_find_chanctx()
392 ieee80211_change_chanctx(local, ctx, compat); in ieee80211_find_chanctx()
394 return ctx; in ieee80211_find_chanctx()
420 struct ieee80211_chanctx *ctx) in ieee80211_chanctx_radar_required() argument
422 struct ieee80211_chanctx_conf *conf = &ctx->conf; in ieee80211_chanctx_radar_required()
451 struct ieee80211_chanctx *ctx; in ieee80211_alloc_chanctx() local
455 ctx = kzalloc(sizeof(*ctx) + local->hw.chanctx_data_size, GFP_KERNEL); in ieee80211_alloc_chanctx()
456 if (!ctx) in ieee80211_alloc_chanctx()
459 INIT_LIST_HEAD(&ctx->assigned_vifs); in ieee80211_alloc_chanctx()
460 INIT_LIST_HEAD(&ctx->reserved_vifs); in ieee80211_alloc_chanctx()
461 ctx->conf.def = *chandef; in ieee80211_alloc_chanctx()
462 ctx->conf.rx_chains_static = 1; in ieee80211_alloc_chanctx()
463 ctx->conf.rx_chains_dynamic = 1; in ieee80211_alloc_chanctx()
464 ctx->mode = mode; in ieee80211_alloc_chanctx()
465 ctx->conf.radar_enabled = false; in ieee80211_alloc_chanctx()
466 ieee80211_recalc_chanctx_min_def(local, ctx); in ieee80211_alloc_chanctx()
468 return ctx; in ieee80211_alloc_chanctx()
472 struct ieee80211_chanctx *ctx) in ieee80211_add_chanctx() argument
481 local->hw.conf.radar_enabled = ctx->conf.radar_enabled; in ieee80211_add_chanctx()
489 local->_oper_chandef = ctx->conf.def; in ieee80211_add_chanctx()
492 err = drv_add_chanctx(local, ctx); in ieee80211_add_chanctx()
507 struct ieee80211_chanctx *ctx; in ieee80211_new_chanctx() local
513 ctx = ieee80211_alloc_chanctx(local, chandef, mode); in ieee80211_new_chanctx()
514 if (!ctx) in ieee80211_new_chanctx()
517 err = ieee80211_add_chanctx(local, ctx); in ieee80211_new_chanctx()
519 kfree(ctx); in ieee80211_new_chanctx()
523 list_add_rcu(&ctx->list, &local->chanctx_list); in ieee80211_new_chanctx()
524 return ctx; in ieee80211_new_chanctx()
528 struct ieee80211_chanctx *ctx) in ieee80211_del_chanctx() argument
548 drv_remove_chanctx(local, ctx); in ieee80211_del_chanctx()
555 struct ieee80211_chanctx *ctx) in ieee80211_free_chanctx() argument
559 WARN_ON_ONCE(ieee80211_chanctx_refcount(local, ctx) != 0); in ieee80211_free_chanctx()
561 list_del_rcu(&ctx->list); in ieee80211_free_chanctx()
562 ieee80211_del_chanctx(local, ctx); in ieee80211_free_chanctx()
563 kfree_rcu(ctx, rcu_head); in ieee80211_free_chanctx()
567 struct ieee80211_chanctx *ctx) in ieee80211_recalc_chanctx_chantype() argument
569 struct ieee80211_chanctx_conf *conf = &ctx->conf; in ieee80211_recalc_chanctx_chantype()
613 ieee80211_change_chanctx(local, ctx, compat); in ieee80211_recalc_chanctx_chantype()
835 struct ieee80211_chanctx *ctx = sdata->reserved_chanctx; in ieee80211_vif_unreserve_chanctx() local
839 if (WARN_ON(!ctx)) in ieee80211_vif_unreserve_chanctx()
845 if (ieee80211_chanctx_refcount(sdata->local, ctx) == 0) { in ieee80211_vif_unreserve_chanctx()
846 if (ctx->replace_state == IEEE80211_CHANCTX_REPLACES_OTHER) { in ieee80211_vif_unreserve_chanctx()
847 if (WARN_ON(!ctx->replace_ctx)) in ieee80211_vif_unreserve_chanctx()
850 WARN_ON(ctx->replace_ctx->replace_state != in ieee80211_vif_unreserve_chanctx()
852 WARN_ON(ctx->replace_ctx->replace_ctx != ctx); in ieee80211_vif_unreserve_chanctx()
854 ctx->replace_ctx->replace_ctx = NULL; in ieee80211_vif_unreserve_chanctx()
855 ctx->replace_ctx->replace_state = in ieee80211_vif_unreserve_chanctx()
858 list_del_rcu(&ctx->list); in ieee80211_vif_unreserve_chanctx()
859 kfree_rcu(ctx, rcu_head); in ieee80211_vif_unreserve_chanctx()
861 ieee80211_free_chanctx(sdata->local, ctx); in ieee80211_vif_unreserve_chanctx()
874 struct ieee80211_chanctx *new_ctx, *curr_ctx, *ctx; in ieee80211_vif_reserve_chanctx() local
915 list_for_each_entry(ctx, &local->chanctx_list, in ieee80211_vif_reserve_chanctx()
917 if (ctx->replace_state != in ieee80211_vif_reserve_chanctx()
921 if (!list_empty(&ctx->reserved_vifs)) in ieee80211_vif_reserve_chanctx()
924 curr_ctx = ctx; in ieee80211_vif_reserve_chanctx()
1184 struct ieee80211_chanctx *ctx, *old_ctx; in ieee80211_chsw_switch_vifs() local
1195 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_chsw_switch_vifs()
1196 if (ctx->replace_state != IEEE80211_CHANCTX_REPLACES_OTHER) in ieee80211_chsw_switch_vifs()
1199 if (WARN_ON(!ctx->replace_ctx)) { in ieee80211_chsw_switch_vifs()
1204 list_for_each_entry(sdata, &ctx->reserved_vifs, in ieee80211_chsw_switch_vifs()
1213 vif_chsw[i].new_ctx = &ctx->conf; in ieee80211_chsw_switch_vifs()
1229 struct ieee80211_chanctx *ctx; in ieee80211_chsw_switch_ctxs() local
1235 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_chsw_switch_ctxs()
1236 if (ctx->replace_state != IEEE80211_CHANCTX_REPLACES_OTHER) in ieee80211_chsw_switch_ctxs()
1239 if (!list_empty(&ctx->replace_ctx->assigned_vifs)) in ieee80211_chsw_switch_ctxs()
1242 ieee80211_del_chanctx(local, ctx->replace_ctx); in ieee80211_chsw_switch_ctxs()
1243 err = ieee80211_add_chanctx(local, ctx); in ieee80211_chsw_switch_ctxs()
1251 WARN_ON(ieee80211_add_chanctx(local, ctx)); in ieee80211_chsw_switch_ctxs()
1252 list_for_each_entry_continue_reverse(ctx, &local->chanctx_list, list) { in ieee80211_chsw_switch_ctxs()
1253 if (ctx->replace_state != IEEE80211_CHANCTX_REPLACES_OTHER) in ieee80211_chsw_switch_ctxs()
1256 if (!list_empty(&ctx->replace_ctx->assigned_vifs)) in ieee80211_chsw_switch_ctxs()
1259 ieee80211_del_chanctx(local, ctx); in ieee80211_chsw_switch_ctxs()
1260 WARN_ON(ieee80211_add_chanctx(local, ctx->replace_ctx)); in ieee80211_chsw_switch_ctxs()
1269 struct ieee80211_chanctx *ctx, *ctx_tmp, *old_ctx; in ieee80211_vif_use_reserved_switch() local
1293 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_vif_use_reserved_switch()
1294 if (ctx->replace_state != IEEE80211_CHANCTX_REPLACES_OTHER) in ieee80211_vif_use_reserved_switch()
1297 if (WARN_ON(!ctx->replace_ctx)) { in ieee80211_vif_use_reserved_switch()
1303 new_ctx = ctx; in ieee80211_vif_use_reserved_switch()
1311 list_for_each_entry(sdata, &ctx->replace_ctx->assigned_vifs, in ieee80211_vif_use_reserved_switch()
1332 ctx->conf.radar_enabled = false; in ieee80211_vif_use_reserved_switch()
1333 list_for_each_entry(sdata, &ctx->reserved_vifs, in ieee80211_vif_use_reserved_switch()
1351 ctx->conf.radar_enabled = true; in ieee80211_vif_use_reserved_switch()
1392 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_vif_use_reserved_switch()
1393 if (ctx->replace_state != IEEE80211_CHANCTX_REPLACES_OTHER) in ieee80211_vif_use_reserved_switch()
1396 if (WARN_ON(!ctx->replace_ctx)) { in ieee80211_vif_use_reserved_switch()
1401 list_for_each_entry(sdata, &ctx->reserved_vifs, in ieee80211_vif_use_reserved_switch()
1408 rcu_assign_pointer(sdata->vif.chanctx_conf, &ctx->conf); in ieee80211_vif_use_reserved_switch()
1430 ieee80211_recalc_chanctx_chantype(local, ctx); in ieee80211_vif_use_reserved_switch()
1431 ieee80211_recalc_smps_chanctx(local, ctx); in ieee80211_vif_use_reserved_switch()
1432 ieee80211_recalc_radar_chanctx(local, ctx); in ieee80211_vif_use_reserved_switch()
1433 ieee80211_recalc_chanctx_min_def(local, ctx); in ieee80211_vif_use_reserved_switch()
1435 list_for_each_entry_safe(sdata, sdata_tmp, &ctx->reserved_vifs, in ieee80211_vif_use_reserved_switch()
1437 if (ieee80211_vif_get_chanctx(sdata) != ctx) in ieee80211_vif_use_reserved_switch()
1442 &ctx->assigned_vifs); in ieee80211_vif_use_reserved_switch()
1455 list_for_each_entry_safe(sdata, sdata_tmp, &ctx->reserved_vifs, in ieee80211_vif_use_reserved_switch()
1461 if (WARN_ON(sdata->reserved_chanctx != ctx)) in ieee80211_vif_use_reserved_switch()
1489 list_for_each_entry_safe(ctx, ctx_tmp, &local->chanctx_list, list) { in ieee80211_vif_use_reserved_switch()
1490 if (ctx->replace_state != IEEE80211_CHANCTX_WILL_BE_REPLACED) in ieee80211_vif_use_reserved_switch()
1493 ctx->replace_ctx->replace_ctx = NULL; in ieee80211_vif_use_reserved_switch()
1494 ctx->replace_ctx->replace_state = in ieee80211_vif_use_reserved_switch()
1497 list_del_rcu(&ctx->list); in ieee80211_vif_use_reserved_switch()
1498 kfree_rcu(ctx, rcu_head); in ieee80211_vif_use_reserved_switch()
1504 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_vif_use_reserved_switch()
1505 if (ctx->replace_state != IEEE80211_CHANCTX_REPLACES_OTHER) in ieee80211_vif_use_reserved_switch()
1508 list_for_each_entry_safe(sdata, sdata_tmp, &ctx->reserved_vifs, in ieee80211_vif_use_reserved_switch()
1522 struct ieee80211_chanctx *ctx; in __ieee80211_vif_release_channel() local
1532 ctx = container_of(conf, struct ieee80211_chanctx, conf); in __ieee80211_vif_release_channel()
1545 if (ieee80211_chanctx_refcount(local, ctx) == 0) in __ieee80211_vif_release_channel()
1546 ieee80211_free_chanctx(local, ctx); in __ieee80211_vif_release_channel()
1560 struct ieee80211_chanctx *ctx; in ieee80211_vif_use_channel() local
1587 ctx = ieee80211_find_chanctx(local, chandef, mode); in ieee80211_vif_use_channel()
1588 if (!ctx) in ieee80211_vif_use_channel()
1589 ctx = ieee80211_new_chanctx(local, chandef, mode); in ieee80211_vif_use_channel()
1590 if (IS_ERR(ctx)) { in ieee80211_vif_use_channel()
1591 ret = PTR_ERR(ctx); in ieee80211_vif_use_channel()
1597 ret = ieee80211_assign_vif_chanctx(sdata, ctx); in ieee80211_vif_use_channel()
1600 if (ieee80211_chanctx_refcount(local, ctx) == 0) in ieee80211_vif_use_channel()
1601 ieee80211_free_chanctx(local, ctx); in ieee80211_vif_use_channel()
1605 ieee80211_recalc_smps_chanctx(local, ctx); in ieee80211_vif_use_channel()
1606 ieee80211_recalc_radar_chanctx(local, ctx); in ieee80211_vif_use_channel()
1685 struct ieee80211_chanctx *ctx; in ieee80211_vif_change_bandwidth() local
1712 ctx = container_of(conf, struct ieee80211_chanctx, conf); in ieee80211_vif_change_bandwidth()
1720 switch (ctx->replace_state) { in ieee80211_vif_change_bandwidth()
1722 if (!ieee80211_chanctx_reserved_chandef(local, ctx, compat)) { in ieee80211_vif_change_bandwidth()
1742 ieee80211_recalc_chanctx_chantype(local, ctx); in ieee80211_vif_change_bandwidth()
1789 struct ieee80211_chanctx *ctx; in ieee80211_iter_chan_contexts_atomic() local
1792 list_for_each_entry_rcu(ctx, &local->chanctx_list, list) in ieee80211_iter_chan_contexts_atomic()
1793 if (ctx->driver_present) in ieee80211_iter_chan_contexts_atomic()
1794 iter(hw, &ctx->conf, iter_data); in ieee80211_iter_chan_contexts_atomic()