Lines Matching refs:local

12 static int ieee80211_chanctx_num_assigned(struct ieee80211_local *local,  in ieee80211_chanctx_num_assigned()  argument
18 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chanctx_num_assigned()
26 static int ieee80211_chanctx_num_reserved(struct ieee80211_local *local, in ieee80211_chanctx_num_reserved() argument
32 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chanctx_num_reserved()
40 int ieee80211_chanctx_refcount(struct ieee80211_local *local, in ieee80211_chanctx_refcount() argument
43 return ieee80211_chanctx_num_assigned(local, ctx) + in ieee80211_chanctx_refcount()
44 ieee80211_chanctx_num_reserved(local, ctx); in ieee80211_chanctx_refcount()
47 static int ieee80211_num_chanctx(struct ieee80211_local *local) in ieee80211_num_chanctx() argument
52 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_num_chanctx()
54 list_for_each_entry(ctx, &local->chanctx_list, list) in ieee80211_num_chanctx()
60 static bool ieee80211_can_create_new_chanctx(struct ieee80211_local *local) in ieee80211_can_create_new_chanctx() argument
62 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_can_create_new_chanctx()
63 return ieee80211_num_chanctx(local) < ieee80211_max_num_channels(local); in ieee80211_can_create_new_chanctx()
69 struct ieee80211_local *local __maybe_unused = sdata->local; in ieee80211_vif_get_chanctx()
73 lockdep_is_held(&local->chanctx_mtx)); in ieee80211_vif_get_chanctx()
81 ieee80211_chanctx_reserved_chandef(struct ieee80211_local *local, in ieee80211_chanctx_reserved_chandef() argument
87 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chanctx_reserved_chandef()
104 ieee80211_chanctx_non_reserved_chandef(struct ieee80211_local *local, in ieee80211_chanctx_non_reserved_chandef() argument
110 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chanctx_non_reserved_chandef()
130 ieee80211_chanctx_combined_chandef(struct ieee80211_local *local, in ieee80211_chanctx_combined_chandef() argument
134 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chanctx_combined_chandef()
136 compat = ieee80211_chanctx_reserved_chandef(local, ctx, compat); in ieee80211_chanctx_combined_chandef()
140 compat = ieee80211_chanctx_non_reserved_chandef(local, ctx, compat); in ieee80211_chanctx_combined_chandef()
148 ieee80211_chanctx_can_reserve_chandef(struct ieee80211_local *local, in ieee80211_chanctx_can_reserve_chandef() argument
152 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chanctx_can_reserve_chandef()
154 if (ieee80211_chanctx_combined_chandef(local, ctx, def)) in ieee80211_chanctx_can_reserve_chandef()
158 ieee80211_chanctx_reserved_chandef(local, ctx, def)) in ieee80211_chanctx_can_reserve_chandef()
165 ieee80211_find_reservation_chanctx(struct ieee80211_local *local, in ieee80211_find_reservation_chanctx() argument
171 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_find_reservation_chanctx()
176 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_find_reservation_chanctx()
183 if (!ieee80211_chanctx_can_reserve_chandef(local, ctx, in ieee80211_find_reservation_chanctx()
229 list_for_each_entry_rcu(sta, &sdata->local->sta_list, list) { in ieee80211_get_max_required_bw()
245 ieee80211_get_chanctx_max_required_bw(struct ieee80211_local *local, in ieee80211_get_chanctx_max_required_bw() argument
252 list_for_each_entry_rcu(sdata, &local->interfaces, list) { in ieee80211_get_chanctx_max_required_bw()
295 sdata = rcu_dereference(local->monitor_sdata); in ieee80211_get_chanctx_max_required_bw()
309 void ieee80211_recalc_chanctx_min_def(struct ieee80211_local *local, in ieee80211_recalc_chanctx_min_def() argument
315 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_recalc_chanctx_min_def()
325 max_bw = ieee80211_get_chanctx_max_required_bw(local, &ctx->conf); in ieee80211_recalc_chanctx_min_def()
339 drv_change_chanctx(local, ctx, IEEE80211_CHANCTX_CHANGE_MIN_WIDTH); in ieee80211_recalc_chanctx_min_def()
342 static void ieee80211_change_chanctx(struct ieee80211_local *local, in ieee80211_change_chanctx() argument
352 drv_change_chanctx(local, ctx, IEEE80211_CHANCTX_CHANGE_WIDTH); in ieee80211_change_chanctx()
353 ieee80211_recalc_chanctx_min_def(local, ctx); in ieee80211_change_chanctx()
355 if (!local->use_chanctx) { in ieee80211_change_chanctx()
356 local->_oper_chandef = *chandef; in ieee80211_change_chanctx()
357 ieee80211_hw_config(local, 0); in ieee80211_change_chanctx()
362 ieee80211_find_chanctx(struct ieee80211_local *local, in ieee80211_find_chanctx() argument
368 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_find_chanctx()
373 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_find_chanctx()
386 compat = ieee80211_chanctx_reserved_chandef(local, ctx, in ieee80211_find_chanctx()
391 ieee80211_change_chanctx(local, ctx, compat); in ieee80211_find_chanctx()
399 bool ieee80211_is_radar_required(struct ieee80211_local *local) in ieee80211_is_radar_required() argument
403 lockdep_assert_held(&local->mtx); in ieee80211_is_radar_required()
406 list_for_each_entry_rcu(sdata, &local->interfaces, list) { in ieee80211_is_radar_required()
418 ieee80211_chanctx_radar_required(struct ieee80211_local *local, in ieee80211_chanctx_radar_required() argument
425 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chanctx_radar_required()
426 lockdep_assert_held(&local->mtx); in ieee80211_chanctx_radar_required()
429 list_for_each_entry_rcu(sdata, &local->interfaces, list) { in ieee80211_chanctx_radar_required()
446 ieee80211_alloc_chanctx(struct ieee80211_local *local, in ieee80211_alloc_chanctx() argument
452 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_alloc_chanctx()
454 ctx = kzalloc(sizeof(*ctx) + local->hw.chanctx_data_size, GFP_KERNEL); in ieee80211_alloc_chanctx()
465 ieee80211_recalc_chanctx_min_def(local, ctx); in ieee80211_alloc_chanctx()
470 static int ieee80211_add_chanctx(struct ieee80211_local *local, in ieee80211_add_chanctx() argument
476 lockdep_assert_held(&local->mtx); in ieee80211_add_chanctx()
477 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_add_chanctx()
479 if (!local->use_chanctx) in ieee80211_add_chanctx()
480 local->hw.conf.radar_enabled = ctx->conf.radar_enabled; in ieee80211_add_chanctx()
483 changed = ieee80211_idle_off(local); in ieee80211_add_chanctx()
485 ieee80211_hw_config(local, changed); in ieee80211_add_chanctx()
487 if (!local->use_chanctx) { in ieee80211_add_chanctx()
488 local->_oper_chandef = ctx->conf.def; in ieee80211_add_chanctx()
489 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL); in ieee80211_add_chanctx()
491 err = drv_add_chanctx(local, ctx); in ieee80211_add_chanctx()
493 ieee80211_recalc_idle(local); in ieee80211_add_chanctx()
502 ieee80211_new_chanctx(struct ieee80211_local *local, in ieee80211_new_chanctx() argument
509 lockdep_assert_held(&local->mtx); in ieee80211_new_chanctx()
510 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_new_chanctx()
512 ctx = ieee80211_alloc_chanctx(local, chandef, mode); in ieee80211_new_chanctx()
516 err = ieee80211_add_chanctx(local, ctx); in ieee80211_new_chanctx()
522 list_add_rcu(&ctx->list, &local->chanctx_list); in ieee80211_new_chanctx()
526 static void ieee80211_del_chanctx(struct ieee80211_local *local, in ieee80211_del_chanctx() argument
529 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_del_chanctx()
531 if (!local->use_chanctx) { in ieee80211_del_chanctx()
532 struct cfg80211_chan_def *chandef = &local->_oper_chandef; in ieee80211_del_chanctx()
540 WARN_ON(local->hw.conf.radar_enabled && in ieee80211_del_chanctx()
541 !list_empty(&local->chanctx_list)); in ieee80211_del_chanctx()
543 local->hw.conf.radar_enabled = false; in ieee80211_del_chanctx()
545 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL); in ieee80211_del_chanctx()
547 drv_remove_chanctx(local, ctx); in ieee80211_del_chanctx()
550 ieee80211_recalc_idle(local); in ieee80211_del_chanctx()
553 static void ieee80211_free_chanctx(struct ieee80211_local *local, in ieee80211_free_chanctx() argument
556 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_free_chanctx()
558 WARN_ON_ONCE(ieee80211_chanctx_refcount(local, ctx) != 0); in ieee80211_free_chanctx()
561 ieee80211_del_chanctx(local, ctx); in ieee80211_free_chanctx()
565 void ieee80211_recalc_chanctx_chantype(struct ieee80211_local *local, in ieee80211_recalc_chanctx_chantype() argument
573 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_recalc_chanctx_chantype()
576 list_for_each_entry_rcu(sdata, &local->interfaces, list) { in ieee80211_recalc_chanctx_chantype()
595 list_for_each_entry_rcu(sta, &local->sta_list, list) { in ieee80211_recalc_chanctx_chantype()
612 ieee80211_change_chanctx(local, ctx, compat); in ieee80211_recalc_chanctx_chantype()
615 static void ieee80211_recalc_radar_chanctx(struct ieee80211_local *local, in ieee80211_recalc_radar_chanctx() argument
620 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_recalc_radar_chanctx()
622 lockdep_assert_held(&local->mtx); in ieee80211_recalc_radar_chanctx()
624 radar_enabled = ieee80211_chanctx_radar_required(local, chanctx); in ieee80211_recalc_radar_chanctx()
631 if (!local->use_chanctx) { in ieee80211_recalc_radar_chanctx()
632 local->hw.conf.radar_enabled = chanctx->conf.radar_enabled; in ieee80211_recalc_radar_chanctx()
633 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL); in ieee80211_recalc_radar_chanctx()
636 drv_change_chanctx(local, chanctx, IEEE80211_CHANCTX_CHANGE_RADAR); in ieee80211_recalc_radar_chanctx()
642 struct ieee80211_local *local = sdata->local; in ieee80211_assign_vif_chanctx() local
648 lockdep_is_held(&local->chanctx_mtx)); in ieee80211_assign_vif_chanctx()
653 drv_unassign_vif_chanctx(local, sdata, curr_ctx); in ieee80211_assign_vif_chanctx()
659 ret = drv_assign_vif_chanctx(local, sdata, new_ctx); in ieee80211_assign_vif_chanctx()
673 if (curr_ctx && ieee80211_chanctx_num_assigned(local, curr_ctx) > 0) { in ieee80211_assign_vif_chanctx()
674 ieee80211_recalc_chanctx_chantype(local, curr_ctx); in ieee80211_assign_vif_chanctx()
675 ieee80211_recalc_smps_chanctx(local, curr_ctx); in ieee80211_assign_vif_chanctx()
676 ieee80211_recalc_radar_chanctx(local, curr_ctx); in ieee80211_assign_vif_chanctx()
677 ieee80211_recalc_chanctx_min_def(local, curr_ctx); in ieee80211_assign_vif_chanctx()
680 if (new_ctx && ieee80211_chanctx_num_assigned(local, new_ctx) > 0) { in ieee80211_assign_vif_chanctx()
682 ieee80211_recalc_chanctx_min_def(local, new_ctx); in ieee80211_assign_vif_chanctx()
695 void ieee80211_recalc_smps_chanctx(struct ieee80211_local *local, in ieee80211_recalc_smps_chanctx() argument
701 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_recalc_smps_chanctx()
707 list_for_each_entry_rcu(sdata, &local->interfaces, list) { in ieee80211_recalc_smps_chanctx()
760 sdata = rcu_dereference(local->monitor_sdata); in ieee80211_recalc_smps_chanctx()
763 rx_chains_dynamic = rx_chains_static = local->rx_chains; in ieee80211_recalc_smps_chanctx()
767 if (!local->use_chanctx) { in ieee80211_recalc_smps_chanctx()
769 local->smps_mode = IEEE80211_SMPS_OFF; in ieee80211_recalc_smps_chanctx()
771 local->smps_mode = IEEE80211_SMPS_DYNAMIC; in ieee80211_recalc_smps_chanctx()
773 local->smps_mode = IEEE80211_SMPS_STATIC; in ieee80211_recalc_smps_chanctx()
774 ieee80211_hw_config(local, 0); in ieee80211_recalc_smps_chanctx()
783 drv_change_chanctx(local, chanctx, IEEE80211_CHANCTX_CHANGE_RX_CHAINS); in ieee80211_recalc_smps_chanctx()
790 struct ieee80211_local *local __maybe_unused = sdata->local; in __ieee80211_vif_copy_chanctx_to_vlans()
797 lockdep_assert_held(&local->mtx); in __ieee80211_vif_copy_chanctx_to_vlans()
806 lockdep_is_held(&local->chanctx_mtx)); in __ieee80211_vif_copy_chanctx_to_vlans()
819 struct ieee80211_local *local = sdata->local; in ieee80211_vif_copy_chanctx_to_vlans() local
821 mutex_lock(&local->chanctx_mtx); in ieee80211_vif_copy_chanctx_to_vlans()
825 mutex_unlock(&local->chanctx_mtx); in ieee80211_vif_copy_chanctx_to_vlans()
832 lockdep_assert_held(&sdata->local->chanctx_mtx); in ieee80211_vif_unreserve_chanctx()
840 if (ieee80211_chanctx_refcount(sdata->local, ctx) == 0) { in ieee80211_vif_unreserve_chanctx()
856 ieee80211_free_chanctx(sdata->local, ctx); in ieee80211_vif_unreserve_chanctx()
868 struct ieee80211_local *local = sdata->local; in ieee80211_vif_reserve_chanctx() local
871 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_vif_reserve_chanctx()
874 if (curr_ctx && local->use_chanctx && !local->ops->switch_vif_chanctx) in ieee80211_vif_reserve_chanctx()
877 new_ctx = ieee80211_find_reservation_chanctx(local, chandef, mode); in ieee80211_vif_reserve_chanctx()
879 if (ieee80211_can_create_new_chanctx(local)) { in ieee80211_vif_reserve_chanctx()
880 new_ctx = ieee80211_new_chanctx(local, chandef, mode); in ieee80211_vif_reserve_chanctx()
910 list_for_each_entry(ctx, &local->chanctx_list, in ieee80211_vif_reserve_chanctx()
934 new_ctx = ieee80211_alloc_chanctx(local, chandef, mode); in ieee80211_vif_reserve_chanctx()
946 list_add_rcu(&new_ctx->list, &local->chanctx_list); in ieee80211_vif_reserve_chanctx()
967 ieee80211_queue_work(&sdata->local->hw, in ieee80211_vif_chanctx_reservation_complete()
971 ieee80211_queue_work(&sdata->local->hw, in ieee80211_vif_chanctx_reservation_complete()
1005 struct ieee80211_local *local = sdata->local; in ieee80211_vif_use_reserved_reassign() local
1012 lockdep_assert_held(&local->mtx); in ieee80211_vif_use_reserved_reassign()
1013 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_vif_use_reserved_reassign()
1031 chandef = ieee80211_chanctx_non_reserved_chandef(local, new_ctx, in ieee80211_vif_use_reserved_reassign()
1036 ieee80211_change_chanctx(local, new_ctx, chandef); in ieee80211_vif_use_reserved_reassign()
1045 err = drv_switch_vif_chanctx(local, vif_chsw, 1, in ieee80211_vif_use_reserved_reassign()
1048 if (ieee80211_chanctx_refcount(local, new_ctx) == 0) in ieee80211_vif_use_reserved_reassign()
1049 ieee80211_free_chanctx(local, new_ctx); in ieee80211_vif_use_reserved_reassign()
1062 if (ieee80211_chanctx_refcount(local, old_ctx) == 0) in ieee80211_vif_use_reserved_reassign()
1063 ieee80211_free_chanctx(local, old_ctx); in ieee80211_vif_use_reserved_reassign()
1070 ieee80211_recalc_smps_chanctx(local, new_ctx); in ieee80211_vif_use_reserved_reassign()
1071 ieee80211_recalc_radar_chanctx(local, new_ctx); in ieee80211_vif_use_reserved_reassign()
1072 ieee80211_recalc_chanctx_min_def(local, new_ctx); in ieee80211_vif_use_reserved_reassign()
1085 struct ieee80211_local *local = sdata->local; in ieee80211_vif_use_reserved_assign() local
1106 chandef = ieee80211_chanctx_non_reserved_chandef(local, new_ctx, in ieee80211_vif_use_reserved_assign()
1111 ieee80211_change_chanctx(local, new_ctx, chandef); in ieee80211_vif_use_reserved_assign()
1118 if (ieee80211_chanctx_refcount(local, new_ctx) == 0) in ieee80211_vif_use_reserved_assign()
1119 ieee80211_free_chanctx(local, new_ctx); in ieee80211_vif_use_reserved_assign()
1134 lockdep_assert_held(&sdata->local->chanctx_mtx); in ieee80211_vif_has_in_place_reservation()
1154 static int ieee80211_chsw_switch_hwconf(struct ieee80211_local *local, in ieee80211_chsw_switch_hwconf() argument
1159 lockdep_assert_held(&local->mtx); in ieee80211_chsw_switch_hwconf()
1160 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chsw_switch_hwconf()
1162 chandef = ieee80211_chanctx_reserved_chandef(local, new_ctx, NULL); in ieee80211_chsw_switch_hwconf()
1166 local->hw.conf.radar_enabled = new_ctx->conf.radar_enabled; in ieee80211_chsw_switch_hwconf()
1167 local->_oper_chandef = *chandef; in ieee80211_chsw_switch_hwconf()
1168 ieee80211_hw_config(local, 0); in ieee80211_chsw_switch_hwconf()
1173 static int ieee80211_chsw_switch_vifs(struct ieee80211_local *local, in ieee80211_chsw_switch_vifs() argument
1181 lockdep_assert_held(&local->mtx); in ieee80211_chsw_switch_vifs()
1182 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chsw_switch_vifs()
1189 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_chsw_switch_vifs()
1213 err = drv_switch_vif_chanctx(local, vif_chsw, n_vifs, in ieee80211_chsw_switch_vifs()
1221 static int ieee80211_chsw_switch_ctxs(struct ieee80211_local *local) in ieee80211_chsw_switch_ctxs() argument
1226 lockdep_assert_held(&local->mtx); in ieee80211_chsw_switch_ctxs()
1227 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chsw_switch_ctxs()
1229 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_chsw_switch_ctxs()
1236 ieee80211_del_chanctx(local, ctx->replace_ctx); in ieee80211_chsw_switch_ctxs()
1237 err = ieee80211_add_chanctx(local, ctx); in ieee80211_chsw_switch_ctxs()
1245 WARN_ON(ieee80211_add_chanctx(local, ctx)); in ieee80211_chsw_switch_ctxs()
1246 list_for_each_entry_continue_reverse(ctx, &local->chanctx_list, list) { in ieee80211_chsw_switch_ctxs()
1253 ieee80211_del_chanctx(local, ctx); in ieee80211_chsw_switch_ctxs()
1254 WARN_ON(ieee80211_add_chanctx(local, ctx->replace_ctx)); in ieee80211_chsw_switch_ctxs()
1260 static int ieee80211_vif_use_reserved_switch(struct ieee80211_local *local) in ieee80211_vif_use_reserved_switch() argument
1268 lockdep_assert_held(&local->mtx); in ieee80211_vif_use_reserved_switch()
1269 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_vif_use_reserved_switch()
1287 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_vif_use_reserved_switch()
1296 if (!local->use_chanctx) in ieee80211_vif_use_reserved_switch()
1317 wiphy_info(local->hw.wiphy, in ieee80211_vif_use_reserved_switch()
1353 WARN_ON(n_ctx > 1 && !local->use_chanctx) || in ieee80211_vif_use_reserved_switch()
1354 WARN_ON(!new_ctx && !local->use_chanctx)) { in ieee80211_vif_use_reserved_switch()
1364 if (local->use_chanctx) { in ieee80211_vif_use_reserved_switch()
1366 err = ieee80211_chsw_switch_vifs(local, n_vifs_switch); in ieee80211_vif_use_reserved_switch()
1372 err = ieee80211_chsw_switch_ctxs(local); in ieee80211_vif_use_reserved_switch()
1377 err = ieee80211_chsw_switch_hwconf(local, new_ctx); in ieee80211_vif_use_reserved_switch()
1388 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_vif_use_reserved_switch()
1426 ieee80211_recalc_chanctx_chantype(local, ctx); in ieee80211_vif_use_reserved_switch()
1427 ieee80211_recalc_smps_chanctx(local, ctx); in ieee80211_vif_use_reserved_switch()
1428 ieee80211_recalc_radar_chanctx(local, ctx); in ieee80211_vif_use_reserved_switch()
1429 ieee80211_recalc_chanctx_min_def(local, ctx); in ieee80211_vif_use_reserved_switch()
1474 cfg80211_stop_iface(local->hw.wiphy, in ieee80211_vif_use_reserved_switch()
1485 list_for_each_entry_safe(ctx, ctx_tmp, &local->chanctx_list, list) { in ieee80211_vif_use_reserved_switch()
1500 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_vif_use_reserved_switch()
1516 struct ieee80211_local *local = sdata->local; in __ieee80211_vif_release_channel() local
1521 lockdep_assert_held(&local->chanctx_mtx); in __ieee80211_vif_release_channel()
1524 lockdep_is_held(&local->chanctx_mtx)); in __ieee80211_vif_release_channel()
1533 ieee80211_chanctx_num_reserved(local, in __ieee80211_vif_release_channel()
1541 if (ieee80211_chanctx_refcount(local, ctx) == 0) in __ieee80211_vif_release_channel()
1542 ieee80211_free_chanctx(local, ctx); in __ieee80211_vif_release_channel()
1548 ieee80211_vif_use_reserved_switch(local); in __ieee80211_vif_release_channel()
1555 struct ieee80211_local *local = sdata->local; in ieee80211_vif_use_channel() local
1560 lockdep_assert_held(&local->mtx); in ieee80211_vif_use_channel()
1564 mutex_lock(&local->chanctx_mtx); in ieee80211_vif_use_channel()
1566 ret = cfg80211_chandef_dfs_required(local->hw.wiphy, in ieee80211_vif_use_channel()
1583 ctx = ieee80211_find_chanctx(local, chandef, mode); in ieee80211_vif_use_channel()
1585 ctx = ieee80211_new_chanctx(local, chandef, mode); in ieee80211_vif_use_channel()
1596 if (ieee80211_chanctx_refcount(local, ctx) == 0) in ieee80211_vif_use_channel()
1597 ieee80211_free_chanctx(local, ctx); in ieee80211_vif_use_channel()
1601 ieee80211_recalc_smps_chanctx(local, ctx); in ieee80211_vif_use_channel()
1602 ieee80211_recalc_radar_chanctx(local, ctx); in ieee80211_vif_use_channel()
1607 mutex_unlock(&local->chanctx_mtx); in ieee80211_vif_use_channel()
1613 struct ieee80211_local *local = sdata->local; in ieee80211_vif_use_reserved_context() local
1618 lockdep_assert_held(&local->mtx); in ieee80211_vif_use_reserved_context()
1619 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_vif_use_reserved_context()
1660 err = ieee80211_vif_use_reserved_switch(local); in ieee80211_vif_use_reserved_context()
1666 wiphy_info(local->hw.wiphy, in ieee80211_vif_use_reserved_context()
1679 struct ieee80211_local *local = sdata->local; in ieee80211_vif_change_bandwidth() local
1685 if (!cfg80211_chandef_usable(sdata->local->hw.wiphy, chandef, in ieee80211_vif_change_bandwidth()
1689 mutex_lock(&local->chanctx_mtx); in ieee80211_vif_change_bandwidth()
1702 lockdep_is_held(&local->chanctx_mtx)); in ieee80211_vif_change_bandwidth()
1718 if (!ieee80211_chanctx_reserved_chandef(local, ctx, compat)) { in ieee80211_vif_change_bandwidth()
1738 ieee80211_recalc_chanctx_chantype(local, ctx); in ieee80211_vif_change_bandwidth()
1743 mutex_unlock(&local->chanctx_mtx); in ieee80211_vif_change_bandwidth()
1751 lockdep_assert_held(&sdata->local->mtx); in ieee80211_vif_release_channel()
1753 mutex_lock(&sdata->local->chanctx_mtx); in ieee80211_vif_release_channel()
1755 mutex_unlock(&sdata->local->chanctx_mtx); in ieee80211_vif_release_channel()
1760 struct ieee80211_local *local = sdata->local; in ieee80211_vif_vlan_copy_chanctx() local
1769 mutex_lock(&local->chanctx_mtx); in ieee80211_vif_vlan_copy_chanctx()
1772 lockdep_is_held(&local->chanctx_mtx)); in ieee80211_vif_vlan_copy_chanctx()
1774 mutex_unlock(&local->chanctx_mtx); in ieee80211_vif_vlan_copy_chanctx()
1784 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_iter_chan_contexts_atomic() local
1788 list_for_each_entry_rcu(ctx, &local->chanctx_list, list) in ieee80211_iter_chan_contexts_atomic()