Lines Matching refs:local

13 static int ieee80211_chanctx_num_assigned(struct ieee80211_local *local,  in ieee80211_chanctx_num_assigned()  argument
19 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chanctx_num_assigned()
27 static int ieee80211_chanctx_num_reserved(struct ieee80211_local *local, in ieee80211_chanctx_num_reserved() argument
33 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chanctx_num_reserved()
41 int ieee80211_chanctx_refcount(struct ieee80211_local *local, 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()
48 static int ieee80211_num_chanctx(struct ieee80211_local *local) in ieee80211_num_chanctx() argument
53 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_num_chanctx()
55 list_for_each_entry(ctx, &local->chanctx_list, list) in ieee80211_num_chanctx()
61 static bool ieee80211_can_create_new_chanctx(struct ieee80211_local *local) in ieee80211_can_create_new_chanctx() argument
63 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_can_create_new_chanctx()
64 return ieee80211_num_chanctx(local) < ieee80211_max_num_channels(local); in ieee80211_can_create_new_chanctx()
70 struct ieee80211_local *local __maybe_unused = sdata->local; in ieee80211_vif_get_chanctx()
74 lockdep_is_held(&local->chanctx_mtx)); in ieee80211_vif_get_chanctx()
82 ieee80211_chanctx_reserved_chandef(struct ieee80211_local *local, in ieee80211_chanctx_reserved_chandef() argument
88 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chanctx_reserved_chandef()
105 ieee80211_chanctx_non_reserved_chandef(struct ieee80211_local *local, in ieee80211_chanctx_non_reserved_chandef() argument
111 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chanctx_non_reserved_chandef()
131 ieee80211_chanctx_combined_chandef(struct ieee80211_local *local, in ieee80211_chanctx_combined_chandef() argument
135 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chanctx_combined_chandef()
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()
149 ieee80211_chanctx_can_reserve_chandef(struct ieee80211_local *local, in ieee80211_chanctx_can_reserve_chandef() argument
153 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chanctx_can_reserve_chandef()
155 if (ieee80211_chanctx_combined_chandef(local, ctx, def)) in ieee80211_chanctx_can_reserve_chandef()
159 ieee80211_chanctx_reserved_chandef(local, ctx, def)) in ieee80211_chanctx_can_reserve_chandef()
166 ieee80211_find_reservation_chanctx(struct ieee80211_local *local, in ieee80211_find_reservation_chanctx() argument
172 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_find_reservation_chanctx()
177 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_find_reservation_chanctx()
184 if (!ieee80211_chanctx_can_reserve_chandef(local, ctx, in ieee80211_find_reservation_chanctx()
230 list_for_each_entry_rcu(sta, &sdata->local->sta_list, list) { in ieee80211_get_max_required_bw()
243 ieee80211_get_chanctx_max_required_bw(struct ieee80211_local *local, in ieee80211_get_chanctx_max_required_bw() argument
250 list_for_each_entry_rcu(sdata, &local->interfaces, list) { in ieee80211_get_chanctx_max_required_bw()
294 sdata = rcu_dereference(local->monitor_sdata); in ieee80211_get_chanctx_max_required_bw()
308 void ieee80211_recalc_chanctx_min_def(struct ieee80211_local *local, in ieee80211_recalc_chanctx_min_def() argument
314 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_recalc_chanctx_min_def()
324 max_bw = ieee80211_get_chanctx_max_required_bw(local, &ctx->conf); in ieee80211_recalc_chanctx_min_def()
338 drv_change_chanctx(local, ctx, IEEE80211_CHANCTX_CHANGE_MIN_WIDTH); in ieee80211_recalc_chanctx_min_def()
341 static void ieee80211_change_chanctx(struct ieee80211_local *local, in ieee80211_change_chanctx() argument
346 ieee80211_recalc_chanctx_min_def(local, ctx); 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()
356 if (!local->use_chanctx) { in ieee80211_change_chanctx()
357 local->_oper_chandef = *chandef; in ieee80211_change_chanctx()
358 ieee80211_hw_config(local, 0); in ieee80211_change_chanctx()
363 ieee80211_find_chanctx(struct ieee80211_local *local, in ieee80211_find_chanctx() argument
369 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_find_chanctx()
374 list_for_each_entry(ctx, &local->chanctx_list, list) { 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()
400 bool ieee80211_is_radar_required(struct ieee80211_local *local) in ieee80211_is_radar_required() argument
404 lockdep_assert_held(&local->mtx); in ieee80211_is_radar_required()
407 list_for_each_entry_rcu(sdata, &local->interfaces, list) { in ieee80211_is_radar_required()
419 ieee80211_chanctx_radar_required(struct ieee80211_local *local, in ieee80211_chanctx_radar_required() argument
426 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chanctx_radar_required()
427 lockdep_assert_held(&local->mtx); in ieee80211_chanctx_radar_required()
430 list_for_each_entry_rcu(sdata, &local->interfaces, list) { in ieee80211_chanctx_radar_required()
447 ieee80211_alloc_chanctx(struct ieee80211_local *local, in ieee80211_alloc_chanctx() argument
453 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_alloc_chanctx()
455 ctx = kzalloc(sizeof(*ctx) + local->hw.chanctx_data_size, GFP_KERNEL); in ieee80211_alloc_chanctx()
466 ieee80211_recalc_chanctx_min_def(local, ctx); in ieee80211_alloc_chanctx()
471 static int ieee80211_add_chanctx(struct ieee80211_local *local, in ieee80211_add_chanctx() argument
477 lockdep_assert_held(&local->mtx); in ieee80211_add_chanctx()
478 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_add_chanctx()
480 if (!local->use_chanctx) in ieee80211_add_chanctx()
481 local->hw.conf.radar_enabled = ctx->conf.radar_enabled; in ieee80211_add_chanctx()
484 changed = ieee80211_idle_off(local); in ieee80211_add_chanctx()
486 ieee80211_hw_config(local, changed); in ieee80211_add_chanctx()
488 if (!local->use_chanctx) { in ieee80211_add_chanctx()
489 local->_oper_chandef = ctx->conf.def; in ieee80211_add_chanctx()
490 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL); in ieee80211_add_chanctx()
492 err = drv_add_chanctx(local, ctx); in ieee80211_add_chanctx()
494 ieee80211_recalc_idle(local); in ieee80211_add_chanctx()
503 ieee80211_new_chanctx(struct ieee80211_local *local, in ieee80211_new_chanctx() argument
510 lockdep_assert_held(&local->mtx); in ieee80211_new_chanctx()
511 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_new_chanctx()
513 ctx = ieee80211_alloc_chanctx(local, chandef, mode); in ieee80211_new_chanctx()
517 err = ieee80211_add_chanctx(local, ctx); in ieee80211_new_chanctx()
523 list_add_rcu(&ctx->list, &local->chanctx_list); in ieee80211_new_chanctx()
527 static void ieee80211_del_chanctx(struct ieee80211_local *local, in ieee80211_del_chanctx() argument
530 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_del_chanctx()
532 if (!local->use_chanctx) { in ieee80211_del_chanctx()
533 struct cfg80211_chan_def *chandef = &local->_oper_chandef; in ieee80211_del_chanctx()
541 WARN_ON(local->hw.conf.radar_enabled && in ieee80211_del_chanctx()
542 !list_empty(&local->chanctx_list)); in ieee80211_del_chanctx()
544 local->hw.conf.radar_enabled = false; in ieee80211_del_chanctx()
546 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL); in ieee80211_del_chanctx()
548 drv_remove_chanctx(local, ctx); in ieee80211_del_chanctx()
551 ieee80211_recalc_idle(local); in ieee80211_del_chanctx()
554 static void ieee80211_free_chanctx(struct ieee80211_local *local, in ieee80211_free_chanctx() argument
557 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_free_chanctx()
559 WARN_ON_ONCE(ieee80211_chanctx_refcount(local, ctx) != 0); in ieee80211_free_chanctx()
562 ieee80211_del_chanctx(local, ctx); in ieee80211_free_chanctx()
566 void ieee80211_recalc_chanctx_chantype(struct ieee80211_local *local, in ieee80211_recalc_chanctx_chantype() argument
574 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_recalc_chanctx_chantype()
577 list_for_each_entry_rcu(sdata, &local->interfaces, list) { in ieee80211_recalc_chanctx_chantype()
596 list_for_each_entry_rcu(sta, &local->sta_list, list) { in ieee80211_recalc_chanctx_chantype()
613 ieee80211_change_chanctx(local, ctx, compat); in ieee80211_recalc_chanctx_chantype()
616 static void ieee80211_recalc_radar_chanctx(struct ieee80211_local *local, in ieee80211_recalc_radar_chanctx() argument
621 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_recalc_radar_chanctx()
623 lockdep_assert_held(&local->mtx); in ieee80211_recalc_radar_chanctx()
625 radar_enabled = ieee80211_chanctx_radar_required(local, chanctx); in ieee80211_recalc_radar_chanctx()
632 if (!local->use_chanctx) { in ieee80211_recalc_radar_chanctx()
633 local->hw.conf.radar_enabled = chanctx->conf.radar_enabled; in ieee80211_recalc_radar_chanctx()
634 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL); in ieee80211_recalc_radar_chanctx()
637 drv_change_chanctx(local, chanctx, IEEE80211_CHANCTX_CHANGE_RADAR); in ieee80211_recalc_radar_chanctx()
643 struct ieee80211_local *local = sdata->local; in ieee80211_assign_vif_chanctx() local
652 lockdep_is_held(&local->chanctx_mtx)); in ieee80211_assign_vif_chanctx()
657 drv_unassign_vif_chanctx(local, sdata, curr_ctx); in ieee80211_assign_vif_chanctx()
663 ret = drv_assign_vif_chanctx(local, sdata, new_ctx); in ieee80211_assign_vif_chanctx()
677 if (curr_ctx && ieee80211_chanctx_num_assigned(local, curr_ctx) > 0) { in ieee80211_assign_vif_chanctx()
678 ieee80211_recalc_chanctx_chantype(local, curr_ctx); in ieee80211_assign_vif_chanctx()
679 ieee80211_recalc_smps_chanctx(local, curr_ctx); in ieee80211_assign_vif_chanctx()
680 ieee80211_recalc_radar_chanctx(local, curr_ctx); in ieee80211_assign_vif_chanctx()
681 ieee80211_recalc_chanctx_min_def(local, curr_ctx); in ieee80211_assign_vif_chanctx()
684 if (new_ctx && ieee80211_chanctx_num_assigned(local, new_ctx) > 0) { in ieee80211_assign_vif_chanctx()
686 ieee80211_recalc_chanctx_min_def(local, new_ctx); in ieee80211_assign_vif_chanctx()
699 void ieee80211_recalc_smps_chanctx(struct ieee80211_local *local, in ieee80211_recalc_smps_chanctx() argument
705 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_recalc_smps_chanctx()
711 list_for_each_entry_rcu(sdata, &local->interfaces, list) { in ieee80211_recalc_smps_chanctx()
765 sdata = rcu_dereference(local->monitor_sdata); in ieee80211_recalc_smps_chanctx()
768 rx_chains_dynamic = rx_chains_static = local->rx_chains; in ieee80211_recalc_smps_chanctx()
772 if (!local->use_chanctx) { in ieee80211_recalc_smps_chanctx()
774 local->smps_mode = IEEE80211_SMPS_OFF; in ieee80211_recalc_smps_chanctx()
776 local->smps_mode = IEEE80211_SMPS_DYNAMIC; in ieee80211_recalc_smps_chanctx()
778 local->smps_mode = IEEE80211_SMPS_STATIC; in ieee80211_recalc_smps_chanctx()
779 ieee80211_hw_config(local, 0); in ieee80211_recalc_smps_chanctx()
788 drv_change_chanctx(local, chanctx, IEEE80211_CHANCTX_CHANGE_RX_CHAINS); in ieee80211_recalc_smps_chanctx()
795 struct ieee80211_local *local __maybe_unused = sdata->local; in __ieee80211_vif_copy_chanctx_to_vlans()
802 lockdep_assert_held(&local->mtx); in __ieee80211_vif_copy_chanctx_to_vlans()
811 lockdep_is_held(&local->chanctx_mtx)); in __ieee80211_vif_copy_chanctx_to_vlans()
824 struct ieee80211_local *local = sdata->local; in ieee80211_vif_copy_chanctx_to_vlans() local
826 mutex_lock(&local->chanctx_mtx); in ieee80211_vif_copy_chanctx_to_vlans()
830 mutex_unlock(&local->chanctx_mtx); in ieee80211_vif_copy_chanctx_to_vlans()
837 lockdep_assert_held(&sdata->local->chanctx_mtx); in ieee80211_vif_unreserve_chanctx()
845 if (ieee80211_chanctx_refcount(sdata->local, ctx) == 0) { in ieee80211_vif_unreserve_chanctx()
861 ieee80211_free_chanctx(sdata->local, ctx); in ieee80211_vif_unreserve_chanctx()
873 struct ieee80211_local *local = sdata->local; in ieee80211_vif_reserve_chanctx() local
876 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_vif_reserve_chanctx()
879 if (curr_ctx && local->use_chanctx && !local->ops->switch_vif_chanctx) in ieee80211_vif_reserve_chanctx()
882 new_ctx = ieee80211_find_reservation_chanctx(local, chandef, mode); in ieee80211_vif_reserve_chanctx()
884 if (ieee80211_can_create_new_chanctx(local)) { in ieee80211_vif_reserve_chanctx()
885 new_ctx = ieee80211_new_chanctx(local, chandef, mode); in ieee80211_vif_reserve_chanctx()
915 list_for_each_entry(ctx, &local->chanctx_list, in ieee80211_vif_reserve_chanctx()
939 new_ctx = ieee80211_alloc_chanctx(local, chandef, mode); in ieee80211_vif_reserve_chanctx()
951 list_add_rcu(&new_ctx->list, &local->chanctx_list); in ieee80211_vif_reserve_chanctx()
972 ieee80211_queue_work(&sdata->local->hw, in ieee80211_vif_chanctx_reservation_complete()
976 ieee80211_queue_work(&sdata->local->hw, in ieee80211_vif_chanctx_reservation_complete()
1011 struct ieee80211_local *local = sdata->local; in ieee80211_vif_use_reserved_reassign() local
1018 lockdep_assert_held(&local->mtx); in ieee80211_vif_use_reserved_reassign()
1019 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_vif_use_reserved_reassign()
1037 chandef = ieee80211_chanctx_non_reserved_chandef(local, new_ctx, in ieee80211_vif_use_reserved_reassign()
1042 ieee80211_change_chanctx(local, new_ctx, chandef); in ieee80211_vif_use_reserved_reassign()
1051 err = drv_switch_vif_chanctx(local, vif_chsw, 1, in ieee80211_vif_use_reserved_reassign()
1054 if (ieee80211_chanctx_refcount(local, new_ctx) == 0) in ieee80211_vif_use_reserved_reassign()
1055 ieee80211_free_chanctx(local, new_ctx); in ieee80211_vif_use_reserved_reassign()
1068 if (ieee80211_chanctx_refcount(local, old_ctx) == 0) in ieee80211_vif_use_reserved_reassign()
1069 ieee80211_free_chanctx(local, old_ctx); in ieee80211_vif_use_reserved_reassign()
1076 ieee80211_recalc_smps_chanctx(local, new_ctx); in ieee80211_vif_use_reserved_reassign()
1077 ieee80211_recalc_radar_chanctx(local, new_ctx); in ieee80211_vif_use_reserved_reassign()
1078 ieee80211_recalc_chanctx_min_def(local, new_ctx); in ieee80211_vif_use_reserved_reassign()
1091 struct ieee80211_local *local = sdata->local; in ieee80211_vif_use_reserved_assign() local
1112 chandef = ieee80211_chanctx_non_reserved_chandef(local, new_ctx, in ieee80211_vif_use_reserved_assign()
1117 ieee80211_change_chanctx(local, new_ctx, chandef); in ieee80211_vif_use_reserved_assign()
1124 if (ieee80211_chanctx_refcount(local, new_ctx) == 0) in ieee80211_vif_use_reserved_assign()
1125 ieee80211_free_chanctx(local, new_ctx); in ieee80211_vif_use_reserved_assign()
1140 lockdep_assert_held(&sdata->local->chanctx_mtx); in ieee80211_vif_has_in_place_reservation()
1160 static int ieee80211_chsw_switch_hwconf(struct ieee80211_local *local, in ieee80211_chsw_switch_hwconf() argument
1165 lockdep_assert_held(&local->mtx); in ieee80211_chsw_switch_hwconf()
1166 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chsw_switch_hwconf()
1168 chandef = ieee80211_chanctx_reserved_chandef(local, new_ctx, NULL); in ieee80211_chsw_switch_hwconf()
1172 local->hw.conf.radar_enabled = new_ctx->conf.radar_enabled; in ieee80211_chsw_switch_hwconf()
1173 local->_oper_chandef = *chandef; in ieee80211_chsw_switch_hwconf()
1174 ieee80211_hw_config(local, 0); in ieee80211_chsw_switch_hwconf()
1179 static int ieee80211_chsw_switch_vifs(struct ieee80211_local *local, in ieee80211_chsw_switch_vifs() argument
1187 lockdep_assert_held(&local->mtx); in ieee80211_chsw_switch_vifs()
1188 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chsw_switch_vifs()
1195 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_chsw_switch_vifs()
1219 err = drv_switch_vif_chanctx(local, vif_chsw, n_vifs, in ieee80211_chsw_switch_vifs()
1227 static int ieee80211_chsw_switch_ctxs(struct ieee80211_local *local) in ieee80211_chsw_switch_ctxs() argument
1232 lockdep_assert_held(&local->mtx); in ieee80211_chsw_switch_ctxs()
1233 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chsw_switch_ctxs()
1235 list_for_each_entry(ctx, &local->chanctx_list, list) { 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()
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()
1266 static int ieee80211_vif_use_reserved_switch(struct ieee80211_local *local) in ieee80211_vif_use_reserved_switch() argument
1274 lockdep_assert_held(&local->mtx); in ieee80211_vif_use_reserved_switch()
1275 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_vif_use_reserved_switch()
1293 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_vif_use_reserved_switch()
1302 if (!local->use_chanctx) in ieee80211_vif_use_reserved_switch()
1323 wiphy_info(local->hw.wiphy, in ieee80211_vif_use_reserved_switch()
1359 WARN_ON(n_ctx > 1 && !local->use_chanctx) || in ieee80211_vif_use_reserved_switch()
1360 WARN_ON(!new_ctx && !local->use_chanctx)) { in ieee80211_vif_use_reserved_switch()
1370 if (local->use_chanctx) { in ieee80211_vif_use_reserved_switch()
1372 err = ieee80211_chsw_switch_vifs(local, n_vifs_switch); in ieee80211_vif_use_reserved_switch()
1378 err = ieee80211_chsw_switch_ctxs(local); in ieee80211_vif_use_reserved_switch()
1383 err = ieee80211_chsw_switch_hwconf(local, new_ctx); in ieee80211_vif_use_reserved_switch()
1392 list_for_each_entry(ctx, &local->chanctx_list, list) { 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()
1478 cfg80211_stop_iface(local->hw.wiphy, 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()
1504 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_vif_use_reserved_switch()
1520 struct ieee80211_local *local = sdata->local; in __ieee80211_vif_release_channel() local
1525 lockdep_assert_held(&local->chanctx_mtx); in __ieee80211_vif_release_channel()
1528 lockdep_is_held(&local->chanctx_mtx)); in __ieee80211_vif_release_channel()
1537 ieee80211_chanctx_num_reserved(local, 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()
1552 ieee80211_vif_use_reserved_switch(local); in __ieee80211_vif_release_channel()
1559 struct ieee80211_local *local = sdata->local; in ieee80211_vif_use_channel() local
1564 lockdep_assert_held(&local->mtx); in ieee80211_vif_use_channel()
1568 mutex_lock(&local->chanctx_mtx); in ieee80211_vif_use_channel()
1570 ret = cfg80211_chandef_dfs_required(local->hw.wiphy, in ieee80211_vif_use_channel()
1587 ctx = ieee80211_find_chanctx(local, chandef, mode); in ieee80211_vif_use_channel()
1589 ctx = ieee80211_new_chanctx(local, chandef, mode); 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()
1611 mutex_unlock(&local->chanctx_mtx); in ieee80211_vif_use_channel()
1617 struct ieee80211_local *local = sdata->local; in ieee80211_vif_use_reserved_context() local
1622 lockdep_assert_held(&local->mtx); in ieee80211_vif_use_reserved_context()
1623 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_vif_use_reserved_context()
1664 err = ieee80211_vif_use_reserved_switch(local); in ieee80211_vif_use_reserved_context()
1670 wiphy_info(local->hw.wiphy, in ieee80211_vif_use_reserved_context()
1683 struct ieee80211_local *local = sdata->local; in ieee80211_vif_change_bandwidth() local
1689 if (!cfg80211_chandef_usable(sdata->local->hw.wiphy, chandef, in ieee80211_vif_change_bandwidth()
1693 mutex_lock(&local->chanctx_mtx); in ieee80211_vif_change_bandwidth()
1706 lockdep_is_held(&local->chanctx_mtx)); 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()
1747 mutex_unlock(&local->chanctx_mtx); in ieee80211_vif_change_bandwidth()
1755 lockdep_assert_held(&sdata->local->mtx); in ieee80211_vif_release_channel()
1757 mutex_lock(&sdata->local->chanctx_mtx); in ieee80211_vif_release_channel()
1759 mutex_unlock(&sdata->local->chanctx_mtx); in ieee80211_vif_release_channel()
1764 struct ieee80211_local *local = sdata->local; in ieee80211_vif_vlan_copy_chanctx() local
1773 mutex_lock(&local->chanctx_mtx); in ieee80211_vif_vlan_copy_chanctx()
1776 lockdep_is_held(&local->chanctx_mtx)); in ieee80211_vif_vlan_copy_chanctx()
1778 mutex_unlock(&local->chanctx_mtx); in ieee80211_vif_vlan_copy_chanctx()
1788 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_iter_chan_contexts_atomic() local
1792 list_for_each_entry_rcu(ctx, &local->chanctx_list, list) in ieee80211_iter_chan_contexts_atomic()