Lines Matching full: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()
329 max_bw = ieee80211_get_chanctx_max_required_bw(local, &ctx->conf); in ieee80211_recalc_chanctx_min_def()
343 drv_change_chanctx(local, ctx, IEEE80211_CHANCTX_CHANGE_MIN_WIDTH); in ieee80211_recalc_chanctx_min_def()
346 static void ieee80211_change_chanctx(struct ieee80211_local *local, in ieee80211_change_chanctx() argument
351 ieee80211_recalc_chanctx_min_def(local, ctx); in ieee80211_change_chanctx()
358 drv_change_chanctx(local, ctx, IEEE80211_CHANCTX_CHANGE_WIDTH); in ieee80211_change_chanctx()
359 ieee80211_recalc_chanctx_min_def(local, ctx); in ieee80211_change_chanctx()
361 if (!local->use_chanctx) { in ieee80211_change_chanctx()
362 local->_oper_chandef = *chandef; in ieee80211_change_chanctx()
363 ieee80211_hw_config(local, 0); in ieee80211_change_chanctx()
368 ieee80211_find_chanctx(struct ieee80211_local *local, in ieee80211_find_chanctx() argument
374 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_find_chanctx()
379 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_find_chanctx()
392 compat = ieee80211_chanctx_reserved_chandef(local, ctx, in ieee80211_find_chanctx()
397 ieee80211_change_chanctx(local, ctx, compat); in ieee80211_find_chanctx()
405 bool ieee80211_is_radar_required(struct ieee80211_local *local) in ieee80211_is_radar_required() argument
409 lockdep_assert_held(&local->mtx); in ieee80211_is_radar_required()
412 list_for_each_entry_rcu(sdata, &local->interfaces, list) { in ieee80211_is_radar_required()
424 ieee80211_chanctx_radar_required(struct ieee80211_local *local, in ieee80211_chanctx_radar_required() argument
431 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chanctx_radar_required()
432 lockdep_assert_held(&local->mtx); in ieee80211_chanctx_radar_required()
435 list_for_each_entry_rcu(sdata, &local->interfaces, list) { in ieee80211_chanctx_radar_required()
452 ieee80211_alloc_chanctx(struct ieee80211_local *local, in ieee80211_alloc_chanctx() argument
458 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_alloc_chanctx()
460 ctx = kzalloc(sizeof(*ctx) + local->hw.chanctx_data_size, GFP_KERNEL); in ieee80211_alloc_chanctx()
471 ieee80211_recalc_chanctx_min_def(local, ctx); in ieee80211_alloc_chanctx()
476 static int ieee80211_add_chanctx(struct ieee80211_local *local, in ieee80211_add_chanctx() argument
482 lockdep_assert_held(&local->mtx); in ieee80211_add_chanctx()
483 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_add_chanctx()
485 if (!local->use_chanctx) in ieee80211_add_chanctx()
486 local->hw.conf.radar_enabled = ctx->conf.radar_enabled; in ieee80211_add_chanctx()
489 changed = ieee80211_idle_off(local); in ieee80211_add_chanctx()
491 ieee80211_hw_config(local, changed); in ieee80211_add_chanctx()
493 if (!local->use_chanctx) { in ieee80211_add_chanctx()
494 local->_oper_chandef = ctx->conf.def; in ieee80211_add_chanctx()
495 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL); in ieee80211_add_chanctx()
497 err = drv_add_chanctx(local, ctx); in ieee80211_add_chanctx()
499 ieee80211_recalc_idle(local); in ieee80211_add_chanctx()
508 ieee80211_new_chanctx(struct ieee80211_local *local, in ieee80211_new_chanctx() argument
515 lockdep_assert_held(&local->mtx); in ieee80211_new_chanctx()
516 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_new_chanctx()
518 ctx = ieee80211_alloc_chanctx(local, chandef, mode); in ieee80211_new_chanctx()
522 err = ieee80211_add_chanctx(local, ctx); in ieee80211_new_chanctx()
528 list_add_rcu(&ctx->list, &local->chanctx_list); in ieee80211_new_chanctx()
532 static void ieee80211_del_chanctx(struct ieee80211_local *local, in ieee80211_del_chanctx() argument
535 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_del_chanctx()
537 if (!local->use_chanctx) { in ieee80211_del_chanctx()
538 struct cfg80211_chan_def *chandef = &local->_oper_chandef; in ieee80211_del_chanctx()
554 WARN_ON(local->hw.conf.radar_enabled && in ieee80211_del_chanctx()
555 !list_empty(&local->chanctx_list)); in ieee80211_del_chanctx()
557 local->hw.conf.radar_enabled = false; in ieee80211_del_chanctx()
559 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL); in ieee80211_del_chanctx()
561 drv_remove_chanctx(local, ctx); in ieee80211_del_chanctx()
564 ieee80211_recalc_idle(local); in ieee80211_del_chanctx()
567 static void ieee80211_free_chanctx(struct ieee80211_local *local, in ieee80211_free_chanctx() argument
570 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_free_chanctx()
572 WARN_ON_ONCE(ieee80211_chanctx_refcount(local, ctx) != 0); in ieee80211_free_chanctx()
575 ieee80211_del_chanctx(local, ctx); in ieee80211_free_chanctx()
579 void ieee80211_recalc_chanctx_chantype(struct ieee80211_local *local, in ieee80211_recalc_chanctx_chantype() argument
587 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_recalc_chanctx_chantype()
590 list_for_each_entry_rcu(sdata, &local->interfaces, list) { in ieee80211_recalc_chanctx_chantype()
609 list_for_each_entry_rcu(sta, &local->sta_list, list) { in ieee80211_recalc_chanctx_chantype()
626 ieee80211_change_chanctx(local, ctx, compat); in ieee80211_recalc_chanctx_chantype()
629 static void ieee80211_recalc_radar_chanctx(struct ieee80211_local *local, in ieee80211_recalc_radar_chanctx() argument
634 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_recalc_radar_chanctx()
636 lockdep_assert_held(&local->mtx); in ieee80211_recalc_radar_chanctx()
638 radar_enabled = ieee80211_chanctx_radar_required(local, chanctx); in ieee80211_recalc_radar_chanctx()
645 if (!local->use_chanctx) { in ieee80211_recalc_radar_chanctx()
646 local->hw.conf.radar_enabled = chanctx->conf.radar_enabled; in ieee80211_recalc_radar_chanctx()
647 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL); in ieee80211_recalc_radar_chanctx()
650 drv_change_chanctx(local, chanctx, IEEE80211_CHANCTX_CHANGE_RADAR); in ieee80211_recalc_radar_chanctx()
656 struct ieee80211_local *local = sdata->local; in ieee80211_assign_vif_chanctx() local
665 lockdep_is_held(&local->chanctx_mtx)); in ieee80211_assign_vif_chanctx()
670 drv_unassign_vif_chanctx(local, sdata, curr_ctx); in ieee80211_assign_vif_chanctx()
676 ret = drv_assign_vif_chanctx(local, sdata, new_ctx); in ieee80211_assign_vif_chanctx()
690 if (curr_ctx && ieee80211_chanctx_num_assigned(local, curr_ctx) > 0) { in ieee80211_assign_vif_chanctx()
691 ieee80211_recalc_chanctx_chantype(local, curr_ctx); in ieee80211_assign_vif_chanctx()
692 ieee80211_recalc_smps_chanctx(local, curr_ctx); in ieee80211_assign_vif_chanctx()
693 ieee80211_recalc_radar_chanctx(local, curr_ctx); in ieee80211_assign_vif_chanctx()
694 ieee80211_recalc_chanctx_min_def(local, curr_ctx); in ieee80211_assign_vif_chanctx()
697 if (new_ctx && ieee80211_chanctx_num_assigned(local, new_ctx) > 0) { in ieee80211_assign_vif_chanctx()
699 ieee80211_recalc_chanctx_min_def(local, new_ctx); in ieee80211_assign_vif_chanctx()
712 void ieee80211_recalc_smps_chanctx(struct ieee80211_local *local, in ieee80211_recalc_smps_chanctx() argument
718 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_recalc_smps_chanctx()
724 list_for_each_entry_rcu(sdata, &local->interfaces, list) { in ieee80211_recalc_smps_chanctx()
778 sdata = rcu_dereference(local->monitor_sdata); in ieee80211_recalc_smps_chanctx()
781 rx_chains_dynamic = rx_chains_static = local->rx_chains; in ieee80211_recalc_smps_chanctx()
785 if (!local->use_chanctx) { in ieee80211_recalc_smps_chanctx()
787 local->smps_mode = IEEE80211_SMPS_OFF; in ieee80211_recalc_smps_chanctx()
789 local->smps_mode = IEEE80211_SMPS_DYNAMIC; in ieee80211_recalc_smps_chanctx()
791 local->smps_mode = IEEE80211_SMPS_STATIC; in ieee80211_recalc_smps_chanctx()
792 ieee80211_hw_config(local, 0); in ieee80211_recalc_smps_chanctx()
801 drv_change_chanctx(local, chanctx, IEEE80211_CHANCTX_CHANGE_RX_CHAINS); in ieee80211_recalc_smps_chanctx()
808 struct ieee80211_local *local __maybe_unused = sdata->local; in __ieee80211_vif_copy_chanctx_to_vlans()
815 lockdep_assert_held(&local->mtx); in __ieee80211_vif_copy_chanctx_to_vlans()
824 lockdep_is_held(&local->chanctx_mtx)); in __ieee80211_vif_copy_chanctx_to_vlans()
837 struct ieee80211_local *local = sdata->local; in ieee80211_vif_copy_chanctx_to_vlans() local
839 mutex_lock(&local->chanctx_mtx); in ieee80211_vif_copy_chanctx_to_vlans()
843 mutex_unlock(&local->chanctx_mtx); in ieee80211_vif_copy_chanctx_to_vlans()
850 lockdep_assert_held(&sdata->local->chanctx_mtx); in ieee80211_vif_unreserve_chanctx()
858 if (ieee80211_chanctx_refcount(sdata->local, ctx) == 0) { in ieee80211_vif_unreserve_chanctx()
874 ieee80211_free_chanctx(sdata->local, ctx); in ieee80211_vif_unreserve_chanctx()
886 struct ieee80211_local *local = sdata->local; in ieee80211_vif_reserve_chanctx() local
889 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_vif_reserve_chanctx()
892 if (curr_ctx && local->use_chanctx && !local->ops->switch_vif_chanctx) in ieee80211_vif_reserve_chanctx()
895 new_ctx = ieee80211_find_reservation_chanctx(local, chandef, mode); in ieee80211_vif_reserve_chanctx()
897 if (ieee80211_can_create_new_chanctx(local)) { in ieee80211_vif_reserve_chanctx()
898 new_ctx = ieee80211_new_chanctx(local, chandef, mode); in ieee80211_vif_reserve_chanctx()
928 list_for_each_entry(ctx, &local->chanctx_list, in ieee80211_vif_reserve_chanctx()
952 new_ctx = ieee80211_alloc_chanctx(local, chandef, mode); in ieee80211_vif_reserve_chanctx()
964 list_add_rcu(&new_ctx->list, &local->chanctx_list); in ieee80211_vif_reserve_chanctx()
985 ieee80211_queue_work(&sdata->local->hw, in ieee80211_vif_chanctx_reservation_complete()
989 ieee80211_queue_work(&sdata->local->hw, in ieee80211_vif_chanctx_reservation_complete()
1024 struct ieee80211_local *local = sdata->local; in ieee80211_vif_use_reserved_reassign() local
1031 lockdep_assert_held(&local->mtx); in ieee80211_vif_use_reserved_reassign()
1032 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_vif_use_reserved_reassign()
1050 chandef = ieee80211_chanctx_non_reserved_chandef(local, new_ctx, in ieee80211_vif_use_reserved_reassign()
1055 ieee80211_change_chanctx(local, new_ctx, chandef); in ieee80211_vif_use_reserved_reassign()
1064 err = drv_switch_vif_chanctx(local, vif_chsw, 1, in ieee80211_vif_use_reserved_reassign()
1067 if (ieee80211_chanctx_refcount(local, new_ctx) == 0) in ieee80211_vif_use_reserved_reassign()
1068 ieee80211_free_chanctx(local, new_ctx); in ieee80211_vif_use_reserved_reassign()
1081 if (ieee80211_chanctx_refcount(local, old_ctx) == 0) in ieee80211_vif_use_reserved_reassign()
1082 ieee80211_free_chanctx(local, old_ctx); in ieee80211_vif_use_reserved_reassign()
1089 ieee80211_recalc_smps_chanctx(local, new_ctx); in ieee80211_vif_use_reserved_reassign()
1090 ieee80211_recalc_radar_chanctx(local, new_ctx); in ieee80211_vif_use_reserved_reassign()
1091 ieee80211_recalc_chanctx_min_def(local, new_ctx); in ieee80211_vif_use_reserved_reassign()
1104 struct ieee80211_local *local = sdata->local; in ieee80211_vif_use_reserved_assign() local
1125 chandef = ieee80211_chanctx_non_reserved_chandef(local, new_ctx, in ieee80211_vif_use_reserved_assign()
1130 ieee80211_change_chanctx(local, new_ctx, chandef); in ieee80211_vif_use_reserved_assign()
1137 if (ieee80211_chanctx_refcount(local, new_ctx) == 0) in ieee80211_vif_use_reserved_assign()
1138 ieee80211_free_chanctx(local, new_ctx); in ieee80211_vif_use_reserved_assign()
1153 lockdep_assert_held(&sdata->local->chanctx_mtx); in ieee80211_vif_has_in_place_reservation()
1173 static int ieee80211_chsw_switch_hwconf(struct ieee80211_local *local, in ieee80211_chsw_switch_hwconf() argument
1178 lockdep_assert_held(&local->mtx); in ieee80211_chsw_switch_hwconf()
1179 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chsw_switch_hwconf()
1181 chandef = ieee80211_chanctx_reserved_chandef(local, new_ctx, NULL); in ieee80211_chsw_switch_hwconf()
1185 local->hw.conf.radar_enabled = new_ctx->conf.radar_enabled; in ieee80211_chsw_switch_hwconf()
1186 local->_oper_chandef = *chandef; in ieee80211_chsw_switch_hwconf()
1187 ieee80211_hw_config(local, 0); in ieee80211_chsw_switch_hwconf()
1192 static int ieee80211_chsw_switch_vifs(struct ieee80211_local *local, in ieee80211_chsw_switch_vifs() argument
1200 lockdep_assert_held(&local->mtx); in ieee80211_chsw_switch_vifs()
1201 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chsw_switch_vifs()
1208 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_chsw_switch_vifs()
1232 err = drv_switch_vif_chanctx(local, vif_chsw, n_vifs, in ieee80211_chsw_switch_vifs()
1240 static int ieee80211_chsw_switch_ctxs(struct ieee80211_local *local) in ieee80211_chsw_switch_ctxs() argument
1245 lockdep_assert_held(&local->mtx); in ieee80211_chsw_switch_ctxs()
1246 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chsw_switch_ctxs()
1248 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_chsw_switch_ctxs()
1255 ieee80211_del_chanctx(local, ctx->replace_ctx); in ieee80211_chsw_switch_ctxs()
1256 err = ieee80211_add_chanctx(local, ctx); in ieee80211_chsw_switch_ctxs()
1264 WARN_ON(ieee80211_add_chanctx(local, ctx)); in ieee80211_chsw_switch_ctxs()
1265 list_for_each_entry_continue_reverse(ctx, &local->chanctx_list, list) { in ieee80211_chsw_switch_ctxs()
1272 ieee80211_del_chanctx(local, ctx); in ieee80211_chsw_switch_ctxs()
1273 WARN_ON(ieee80211_add_chanctx(local, ctx->replace_ctx)); in ieee80211_chsw_switch_ctxs()
1279 static int ieee80211_vif_use_reserved_switch(struct ieee80211_local *local) in ieee80211_vif_use_reserved_switch() argument
1287 lockdep_assert_held(&local->mtx); in ieee80211_vif_use_reserved_switch()
1288 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_vif_use_reserved_switch()
1306 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_vif_use_reserved_switch()
1315 if (!local->use_chanctx) in ieee80211_vif_use_reserved_switch()
1336 wiphy_info(local->hw.wiphy, in ieee80211_vif_use_reserved_switch()
1372 WARN_ON(n_ctx > 1 && !local->use_chanctx) || in ieee80211_vif_use_reserved_switch()
1373 WARN_ON(!new_ctx && !local->use_chanctx)) { in ieee80211_vif_use_reserved_switch()
1383 if (local->use_chanctx) { in ieee80211_vif_use_reserved_switch()
1385 err = ieee80211_chsw_switch_vifs(local, n_vifs_switch); in ieee80211_vif_use_reserved_switch()
1391 err = ieee80211_chsw_switch_ctxs(local); in ieee80211_vif_use_reserved_switch()
1396 err = ieee80211_chsw_switch_hwconf(local, new_ctx); in ieee80211_vif_use_reserved_switch()
1405 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_vif_use_reserved_switch()
1443 ieee80211_recalc_chanctx_chantype(local, ctx); in ieee80211_vif_use_reserved_switch()
1444 ieee80211_recalc_smps_chanctx(local, ctx); in ieee80211_vif_use_reserved_switch()
1445 ieee80211_recalc_radar_chanctx(local, ctx); in ieee80211_vif_use_reserved_switch()
1446 ieee80211_recalc_chanctx_min_def(local, ctx); in ieee80211_vif_use_reserved_switch()
1491 cfg80211_stop_iface(local->hw.wiphy, in ieee80211_vif_use_reserved_switch()
1502 list_for_each_entry_safe(ctx, ctx_tmp, &local->chanctx_list, list) { in ieee80211_vif_use_reserved_switch()
1517 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_vif_use_reserved_switch()
1533 struct ieee80211_local *local = sdata->local; in __ieee80211_vif_release_channel() local
1538 lockdep_assert_held(&local->chanctx_mtx); in __ieee80211_vif_release_channel()
1541 lockdep_is_held(&local->chanctx_mtx)); in __ieee80211_vif_release_channel()
1550 ieee80211_chanctx_num_reserved(local, in __ieee80211_vif_release_channel()
1558 if (ieee80211_chanctx_refcount(local, ctx) == 0) in __ieee80211_vif_release_channel()
1559 ieee80211_free_chanctx(local, ctx); in __ieee80211_vif_release_channel()
1565 ieee80211_vif_use_reserved_switch(local); in __ieee80211_vif_release_channel()
1572 struct ieee80211_local *local = sdata->local; in ieee80211_vif_use_channel() local
1577 lockdep_assert_held(&local->mtx); in ieee80211_vif_use_channel()
1581 mutex_lock(&local->chanctx_mtx); in ieee80211_vif_use_channel()
1583 ret = cfg80211_chandef_dfs_required(local->hw.wiphy, in ieee80211_vif_use_channel()
1600 ctx = ieee80211_find_chanctx(local, chandef, mode); in ieee80211_vif_use_channel()
1602 ctx = ieee80211_new_chanctx(local, chandef, mode); in ieee80211_vif_use_channel()
1613 if (ieee80211_chanctx_refcount(local, ctx) == 0) in ieee80211_vif_use_channel()
1614 ieee80211_free_chanctx(local, ctx); in ieee80211_vif_use_channel()
1618 ieee80211_recalc_smps_chanctx(local, ctx); in ieee80211_vif_use_channel()
1619 ieee80211_recalc_radar_chanctx(local, ctx); in ieee80211_vif_use_channel()
1624 mutex_unlock(&local->chanctx_mtx); in ieee80211_vif_use_channel()
1630 struct ieee80211_local *local = sdata->local; in ieee80211_vif_use_reserved_context() local
1635 lockdep_assert_held(&local->mtx); in ieee80211_vif_use_reserved_context()
1636 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_vif_use_reserved_context()
1677 err = ieee80211_vif_use_reserved_switch(local); in ieee80211_vif_use_reserved_context()
1683 wiphy_info(local->hw.wiphy, in ieee80211_vif_use_reserved_context()
1696 struct ieee80211_local *local = sdata->local; in ieee80211_vif_change_bandwidth() local
1702 if (!cfg80211_chandef_usable(sdata->local->hw.wiphy, chandef, in ieee80211_vif_change_bandwidth()
1706 mutex_lock(&local->chanctx_mtx); in ieee80211_vif_change_bandwidth()
1719 lockdep_is_held(&local->chanctx_mtx)); in ieee80211_vif_change_bandwidth()
1735 if (!ieee80211_chanctx_reserved_chandef(local, ctx, compat)) { in ieee80211_vif_change_bandwidth()
1755 ieee80211_recalc_chanctx_chantype(local, ctx); in ieee80211_vif_change_bandwidth()
1760 mutex_unlock(&local->chanctx_mtx); in ieee80211_vif_change_bandwidth()
1768 lockdep_assert_held(&sdata->local->mtx); in ieee80211_vif_release_channel()
1770 mutex_lock(&sdata->local->chanctx_mtx); in ieee80211_vif_release_channel()
1772 mutex_unlock(&sdata->local->chanctx_mtx); in ieee80211_vif_release_channel()
1777 struct ieee80211_local *local = sdata->local; in ieee80211_vif_vlan_copy_chanctx() local
1786 mutex_lock(&local->chanctx_mtx); in ieee80211_vif_vlan_copy_chanctx()
1789 lockdep_is_held(&local->chanctx_mtx)); in ieee80211_vif_vlan_copy_chanctx()
1791 mutex_unlock(&local->chanctx_mtx); in ieee80211_vif_vlan_copy_chanctx()
1801 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_iter_chan_contexts_atomic() local
1805 list_for_each_entry_rcu(ctx, &local->chanctx_list, list) in ieee80211_iter_chan_contexts_atomic()