Lines Matching full:local
15 static int ieee80211_chanctx_num_assigned(struct ieee80211_local *local, in ieee80211_chanctx_num_assigned() argument
21 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chanctx_num_assigned()
29 static int ieee80211_chanctx_num_reserved(struct ieee80211_local *local, in ieee80211_chanctx_num_reserved() argument
35 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chanctx_num_reserved()
43 int ieee80211_chanctx_refcount(struct ieee80211_local *local, in ieee80211_chanctx_refcount() argument
46 return ieee80211_chanctx_num_assigned(local, ctx) + in ieee80211_chanctx_refcount()
47 ieee80211_chanctx_num_reserved(local, ctx); in ieee80211_chanctx_refcount()
50 static int ieee80211_num_chanctx(struct ieee80211_local *local) in ieee80211_num_chanctx() argument
55 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_num_chanctx()
57 list_for_each_entry(ctx, &local->chanctx_list, list) in ieee80211_num_chanctx()
63 static bool ieee80211_can_create_new_chanctx(struct ieee80211_local *local) in ieee80211_can_create_new_chanctx() argument
65 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_can_create_new_chanctx()
66 return ieee80211_num_chanctx(local) < ieee80211_max_num_channels(local); in ieee80211_can_create_new_chanctx()
72 struct ieee80211_local *local __maybe_unused = sdata->local; in ieee80211_vif_get_chanctx()
76 lockdep_is_held(&local->chanctx_mtx)); in ieee80211_vif_get_chanctx()
84 ieee80211_chanctx_reserved_chandef(struct ieee80211_local *local, in ieee80211_chanctx_reserved_chandef() argument
90 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chanctx_reserved_chandef()
107 ieee80211_chanctx_non_reserved_chandef(struct ieee80211_local *local, in ieee80211_chanctx_non_reserved_chandef() argument
113 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chanctx_non_reserved_chandef()
133 ieee80211_chanctx_combined_chandef(struct ieee80211_local *local, in ieee80211_chanctx_combined_chandef() argument
137 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chanctx_combined_chandef()
139 compat = ieee80211_chanctx_reserved_chandef(local, ctx, compat); in ieee80211_chanctx_combined_chandef()
143 compat = ieee80211_chanctx_non_reserved_chandef(local, ctx, compat); in ieee80211_chanctx_combined_chandef()
151 ieee80211_chanctx_can_reserve_chandef(struct ieee80211_local *local, in ieee80211_chanctx_can_reserve_chandef() argument
155 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chanctx_can_reserve_chandef()
157 if (ieee80211_chanctx_combined_chandef(local, ctx, def)) in ieee80211_chanctx_can_reserve_chandef()
161 ieee80211_chanctx_reserved_chandef(local, ctx, def)) in ieee80211_chanctx_can_reserve_chandef()
168 ieee80211_find_reservation_chanctx(struct ieee80211_local *local, in ieee80211_find_reservation_chanctx() argument
174 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_find_reservation_chanctx()
179 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_find_reservation_chanctx()
186 if (!ieee80211_chanctx_can_reserve_chandef(local, ctx, in ieee80211_find_reservation_chanctx()
234 list_for_each_entry_rcu(sta, &sdata->local->sta_list, list) { in ieee80211_get_max_required_bw()
247 ieee80211_get_chanctx_max_required_bw(struct ieee80211_local *local, in ieee80211_get_chanctx_max_required_bw() argument
254 list_for_each_entry_rcu(sdata, &local->interfaces, list) { in ieee80211_get_chanctx_max_required_bw()
298 sdata = rcu_dereference(local->monitor_sdata); in ieee80211_get_chanctx_max_required_bw()
312 static u32 _ieee80211_recalc_chanctx_min_def(struct ieee80211_local *local, in _ieee80211_recalc_chanctx_min_def() argument
318 lockdep_assert_held(&local->chanctx_mtx); in _ieee80211_recalc_chanctx_min_def()
333 max_bw = ieee80211_get_chanctx_max_required_bw(local, &ctx->conf); in _ieee80211_recalc_chanctx_min_def()
353 static void ieee80211_chan_bw_change(struct ieee80211_local *local, in ieee80211_chan_bw_change() argument
359 local->hw.wiphy->bands[ctx->conf.def.chan->band]; in ieee80211_chan_bw_change()
362 list_for_each_entry_rcu(sta, &local->sta_list, in ieee80211_chan_bw_change()
385 rate_control_rate_update(local, sband, sta, in ieee80211_chan_bw_change()
396 void ieee80211_recalc_chanctx_min_def(struct ieee80211_local *local, in ieee80211_recalc_chanctx_min_def() argument
399 u32 changed = _ieee80211_recalc_chanctx_min_def(local, ctx); in ieee80211_recalc_chanctx_min_def()
405 ieee80211_chan_bw_change(local, ctx, true); in ieee80211_recalc_chanctx_min_def()
407 drv_change_chanctx(local, ctx, changed); in ieee80211_recalc_chanctx_min_def()
410 ieee80211_chan_bw_change(local, ctx, false); in ieee80211_recalc_chanctx_min_def()
413 static void ieee80211_change_chanctx(struct ieee80211_local *local, in ieee80211_change_chanctx() argument
437 ieee80211_chan_bw_change(local, old_ctx, true); in ieee80211_change_chanctx()
440 ieee80211_recalc_chanctx_min_def(local, ctx); in ieee80211_change_chanctx()
450 _ieee80211_recalc_chanctx_min_def(local, ctx); in ieee80211_change_chanctx()
451 drv_change_chanctx(local, ctx, changed); in ieee80211_change_chanctx()
453 if (!local->use_chanctx) { in ieee80211_change_chanctx()
454 local->_oper_chandef = *chandef; in ieee80211_change_chanctx()
455 ieee80211_hw_config(local, 0); in ieee80211_change_chanctx()
459 ieee80211_chan_bw_change(local, old_ctx, false); in ieee80211_change_chanctx()
463 ieee80211_find_chanctx(struct ieee80211_local *local, in ieee80211_find_chanctx() argument
469 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_find_chanctx()
474 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_find_chanctx()
487 compat = ieee80211_chanctx_reserved_chandef(local, ctx, in ieee80211_find_chanctx()
492 ieee80211_change_chanctx(local, ctx, ctx, compat); in ieee80211_find_chanctx()
500 bool ieee80211_is_radar_required(struct ieee80211_local *local) in ieee80211_is_radar_required() argument
504 lockdep_assert_held(&local->mtx); in ieee80211_is_radar_required()
507 list_for_each_entry_rcu(sdata, &local->interfaces, list) { in ieee80211_is_radar_required()
519 ieee80211_chanctx_radar_required(struct ieee80211_local *local, in ieee80211_chanctx_radar_required() argument
526 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chanctx_radar_required()
527 lockdep_assert_held(&local->mtx); in ieee80211_chanctx_radar_required()
530 list_for_each_entry_rcu(sdata, &local->interfaces, list) { in ieee80211_chanctx_radar_required()
547 ieee80211_alloc_chanctx(struct ieee80211_local *local, in ieee80211_alloc_chanctx() argument
553 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_alloc_chanctx()
555 ctx = kzalloc(sizeof(*ctx) + local->hw.chanctx_data_size, GFP_KERNEL); in ieee80211_alloc_chanctx()
566 ieee80211_recalc_chanctx_min_def(local, ctx); in ieee80211_alloc_chanctx()
571 static int ieee80211_add_chanctx(struct ieee80211_local *local, in ieee80211_add_chanctx() argument
577 lockdep_assert_held(&local->mtx); in ieee80211_add_chanctx()
578 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_add_chanctx()
580 if (!local->use_chanctx) in ieee80211_add_chanctx()
581 local->hw.conf.radar_enabled = ctx->conf.radar_enabled; in ieee80211_add_chanctx()
584 changed = ieee80211_idle_off(local); in ieee80211_add_chanctx()
586 ieee80211_hw_config(local, changed); in ieee80211_add_chanctx()
588 if (!local->use_chanctx) { in ieee80211_add_chanctx()
589 local->_oper_chandef = ctx->conf.def; in ieee80211_add_chanctx()
590 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL); in ieee80211_add_chanctx()
592 err = drv_add_chanctx(local, ctx); in ieee80211_add_chanctx()
594 ieee80211_recalc_idle(local); in ieee80211_add_chanctx()
603 ieee80211_new_chanctx(struct ieee80211_local *local, in ieee80211_new_chanctx() argument
610 lockdep_assert_held(&local->mtx); in ieee80211_new_chanctx()
611 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_new_chanctx()
613 ctx = ieee80211_alloc_chanctx(local, chandef, mode); in ieee80211_new_chanctx()
617 err = ieee80211_add_chanctx(local, ctx); in ieee80211_new_chanctx()
623 list_add_rcu(&ctx->list, &local->chanctx_list); in ieee80211_new_chanctx()
627 static void ieee80211_del_chanctx(struct ieee80211_local *local, in ieee80211_del_chanctx() argument
630 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_del_chanctx()
632 if (!local->use_chanctx) { in ieee80211_del_chanctx()
633 struct cfg80211_chan_def *chandef = &local->_oper_chandef; in ieee80211_del_chanctx()
649 WARN_ON(local->hw.conf.radar_enabled && in ieee80211_del_chanctx()
650 !list_empty(&local->chanctx_list)); in ieee80211_del_chanctx()
652 local->hw.conf.radar_enabled = false; in ieee80211_del_chanctx()
654 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL); in ieee80211_del_chanctx()
656 drv_remove_chanctx(local, ctx); in ieee80211_del_chanctx()
659 ieee80211_recalc_idle(local); in ieee80211_del_chanctx()
662 static void ieee80211_free_chanctx(struct ieee80211_local *local, in ieee80211_free_chanctx() argument
665 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_free_chanctx()
667 WARN_ON_ONCE(ieee80211_chanctx_refcount(local, ctx) != 0); in ieee80211_free_chanctx()
670 ieee80211_del_chanctx(local, ctx); in ieee80211_free_chanctx()
674 void ieee80211_recalc_chanctx_chantype(struct ieee80211_local *local, in ieee80211_recalc_chanctx_chantype() argument
682 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_recalc_chanctx_chantype()
685 list_for_each_entry_rcu(sdata, &local->interfaces, list) { in ieee80211_recalc_chanctx_chantype()
704 list_for_each_entry_rcu(sta, &local->sta_list, list) { in ieee80211_recalc_chanctx_chantype()
721 ieee80211_change_chanctx(local, ctx, ctx, compat); in ieee80211_recalc_chanctx_chantype()
724 static void ieee80211_recalc_radar_chanctx(struct ieee80211_local *local, in ieee80211_recalc_radar_chanctx() argument
729 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_recalc_radar_chanctx()
731 lockdep_assert_held(&local->mtx); in ieee80211_recalc_radar_chanctx()
733 radar_enabled = ieee80211_chanctx_radar_required(local, chanctx); in ieee80211_recalc_radar_chanctx()
740 if (!local->use_chanctx) { in ieee80211_recalc_radar_chanctx()
741 local->hw.conf.radar_enabled = chanctx->conf.radar_enabled; in ieee80211_recalc_radar_chanctx()
742 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL); in ieee80211_recalc_radar_chanctx()
745 drv_change_chanctx(local, chanctx, IEEE80211_CHANCTX_CHANGE_RADAR); in ieee80211_recalc_radar_chanctx()
751 struct ieee80211_local *local = sdata->local; in ieee80211_assign_vif_chanctx() local
760 lockdep_is_held(&local->chanctx_mtx)); in ieee80211_assign_vif_chanctx()
765 drv_unassign_vif_chanctx(local, sdata, curr_ctx); in ieee80211_assign_vif_chanctx()
771 ret = drv_assign_vif_chanctx(local, sdata, new_ctx); in ieee80211_assign_vif_chanctx()
785 if (curr_ctx && ieee80211_chanctx_num_assigned(local, curr_ctx) > 0) { in ieee80211_assign_vif_chanctx()
786 ieee80211_recalc_chanctx_chantype(local, curr_ctx); in ieee80211_assign_vif_chanctx()
787 ieee80211_recalc_smps_chanctx(local, curr_ctx); in ieee80211_assign_vif_chanctx()
788 ieee80211_recalc_radar_chanctx(local, curr_ctx); in ieee80211_assign_vif_chanctx()
789 ieee80211_recalc_chanctx_min_def(local, curr_ctx); in ieee80211_assign_vif_chanctx()
792 if (new_ctx && ieee80211_chanctx_num_assigned(local, new_ctx) > 0) { in ieee80211_assign_vif_chanctx()
794 ieee80211_recalc_chanctx_min_def(local, new_ctx); in ieee80211_assign_vif_chanctx()
807 void ieee80211_recalc_smps_chanctx(struct ieee80211_local *local, in ieee80211_recalc_smps_chanctx() argument
813 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_recalc_smps_chanctx()
819 list_for_each_entry_rcu(sdata, &local->interfaces, list) { in ieee80211_recalc_smps_chanctx()
872 sdata = rcu_dereference(local->monitor_sdata); in ieee80211_recalc_smps_chanctx()
875 rx_chains_dynamic = rx_chains_static = local->rx_chains; in ieee80211_recalc_smps_chanctx()
879 if (!local->use_chanctx) { in ieee80211_recalc_smps_chanctx()
881 local->smps_mode = IEEE80211_SMPS_OFF; in ieee80211_recalc_smps_chanctx()
883 local->smps_mode = IEEE80211_SMPS_DYNAMIC; in ieee80211_recalc_smps_chanctx()
885 local->smps_mode = IEEE80211_SMPS_STATIC; in ieee80211_recalc_smps_chanctx()
886 ieee80211_hw_config(local, 0); in ieee80211_recalc_smps_chanctx()
895 drv_change_chanctx(local, chanctx, IEEE80211_CHANCTX_CHANGE_RX_CHAINS); in ieee80211_recalc_smps_chanctx()
902 struct ieee80211_local *local __maybe_unused = sdata->local; in __ieee80211_vif_copy_chanctx_to_vlans()
909 lockdep_assert_held(&local->mtx); in __ieee80211_vif_copy_chanctx_to_vlans()
918 lockdep_is_held(&local->chanctx_mtx)); in __ieee80211_vif_copy_chanctx_to_vlans()
931 struct ieee80211_local *local = sdata->local; in ieee80211_vif_copy_chanctx_to_vlans() local
933 mutex_lock(&local->chanctx_mtx); in ieee80211_vif_copy_chanctx_to_vlans()
937 mutex_unlock(&local->chanctx_mtx); in ieee80211_vif_copy_chanctx_to_vlans()
944 lockdep_assert_held(&sdata->local->chanctx_mtx); in ieee80211_vif_unreserve_chanctx()
952 if (ieee80211_chanctx_refcount(sdata->local, ctx) == 0) { in ieee80211_vif_unreserve_chanctx()
968 ieee80211_free_chanctx(sdata->local, ctx); in ieee80211_vif_unreserve_chanctx()
980 struct ieee80211_local *local = sdata->local; in ieee80211_vif_reserve_chanctx() local
983 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_vif_reserve_chanctx()
986 if (curr_ctx && local->use_chanctx && !local->ops->switch_vif_chanctx) in ieee80211_vif_reserve_chanctx()
989 new_ctx = ieee80211_find_reservation_chanctx(local, chandef, mode); in ieee80211_vif_reserve_chanctx()
991 if (ieee80211_can_create_new_chanctx(local)) { in ieee80211_vif_reserve_chanctx()
992 new_ctx = ieee80211_new_chanctx(local, chandef, mode); in ieee80211_vif_reserve_chanctx()
1022 list_for_each_entry(ctx, &local->chanctx_list, in ieee80211_vif_reserve_chanctx()
1046 new_ctx = ieee80211_alloc_chanctx(local, chandef, mode); in ieee80211_vif_reserve_chanctx()
1058 list_add_rcu(&new_ctx->list, &local->chanctx_list); in ieee80211_vif_reserve_chanctx()
1079 ieee80211_queue_work(&sdata->local->hw, in ieee80211_vif_chanctx_reservation_complete()
1083 ieee80211_queue_work(&sdata->local->hw, in ieee80211_vif_chanctx_reservation_complete()
1118 struct ieee80211_local *local = sdata->local; in ieee80211_vif_use_reserved_reassign() local
1125 lockdep_assert_held(&local->mtx); in ieee80211_vif_use_reserved_reassign()
1126 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_vif_use_reserved_reassign()
1144 chandef = ieee80211_chanctx_non_reserved_chandef(local, new_ctx, in ieee80211_vif_use_reserved_reassign()
1154 ieee80211_change_chanctx(local, new_ctx, old_ctx, chandef); in ieee80211_vif_use_reserved_reassign()
1163 err = drv_switch_vif_chanctx(local, vif_chsw, 1, in ieee80211_vif_use_reserved_reassign()
1166 if (ieee80211_chanctx_refcount(local, new_ctx) == 0) in ieee80211_vif_use_reserved_reassign()
1167 ieee80211_free_chanctx(local, new_ctx); in ieee80211_vif_use_reserved_reassign()
1180 if (ieee80211_chanctx_refcount(local, old_ctx) == 0) in ieee80211_vif_use_reserved_reassign()
1181 ieee80211_free_chanctx(local, old_ctx); in ieee80211_vif_use_reserved_reassign()
1183 ieee80211_recalc_chanctx_min_def(local, new_ctx); in ieee80211_vif_use_reserved_reassign()
1184 ieee80211_recalc_smps_chanctx(local, new_ctx); in ieee80211_vif_use_reserved_reassign()
1185 ieee80211_recalc_radar_chanctx(local, new_ctx); in ieee80211_vif_use_reserved_reassign()
1198 struct ieee80211_local *local = sdata->local; in ieee80211_vif_use_reserved_assign() local
1219 chandef = ieee80211_chanctx_non_reserved_chandef(local, new_ctx, in ieee80211_vif_use_reserved_assign()
1224 ieee80211_change_chanctx(local, new_ctx, new_ctx, chandef); in ieee80211_vif_use_reserved_assign()
1231 if (ieee80211_chanctx_refcount(local, new_ctx) == 0) in ieee80211_vif_use_reserved_assign()
1232 ieee80211_free_chanctx(local, new_ctx); in ieee80211_vif_use_reserved_assign()
1247 lockdep_assert_held(&sdata->local->chanctx_mtx); in ieee80211_vif_has_in_place_reservation()
1267 static int ieee80211_chsw_switch_hwconf(struct ieee80211_local *local, in ieee80211_chsw_switch_hwconf() argument
1272 lockdep_assert_held(&local->mtx); in ieee80211_chsw_switch_hwconf()
1273 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chsw_switch_hwconf()
1275 chandef = ieee80211_chanctx_reserved_chandef(local, new_ctx, NULL); in ieee80211_chsw_switch_hwconf()
1279 local->hw.conf.radar_enabled = new_ctx->conf.radar_enabled; in ieee80211_chsw_switch_hwconf()
1280 local->_oper_chandef = *chandef; in ieee80211_chsw_switch_hwconf()
1281 ieee80211_hw_config(local, 0); in ieee80211_chsw_switch_hwconf()
1286 static int ieee80211_chsw_switch_vifs(struct ieee80211_local *local, in ieee80211_chsw_switch_vifs() argument
1294 lockdep_assert_held(&local->mtx); in ieee80211_chsw_switch_vifs()
1295 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chsw_switch_vifs()
1302 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_chsw_switch_vifs()
1326 err = drv_switch_vif_chanctx(local, vif_chsw, n_vifs, in ieee80211_chsw_switch_vifs()
1334 static int ieee80211_chsw_switch_ctxs(struct ieee80211_local *local) in ieee80211_chsw_switch_ctxs() argument
1339 lockdep_assert_held(&local->mtx); in ieee80211_chsw_switch_ctxs()
1340 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chsw_switch_ctxs()
1342 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_chsw_switch_ctxs()
1349 ieee80211_del_chanctx(local, ctx->replace_ctx); in ieee80211_chsw_switch_ctxs()
1350 err = ieee80211_add_chanctx(local, ctx); in ieee80211_chsw_switch_ctxs()
1358 WARN_ON(ieee80211_add_chanctx(local, ctx)); in ieee80211_chsw_switch_ctxs()
1359 list_for_each_entry_continue_reverse(ctx, &local->chanctx_list, list) { in ieee80211_chsw_switch_ctxs()
1366 ieee80211_del_chanctx(local, ctx); in ieee80211_chsw_switch_ctxs()
1367 WARN_ON(ieee80211_add_chanctx(local, ctx->replace_ctx)); in ieee80211_chsw_switch_ctxs()
1373 static int ieee80211_vif_use_reserved_switch(struct ieee80211_local *local) in ieee80211_vif_use_reserved_switch() argument
1381 lockdep_assert_held(&local->mtx); in ieee80211_vif_use_reserved_switch()
1382 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_vif_use_reserved_switch()
1400 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_vif_use_reserved_switch()
1409 if (!local->use_chanctx) in ieee80211_vif_use_reserved_switch()
1430 wiphy_info(local->hw.wiphy, in ieee80211_vif_use_reserved_switch()
1466 WARN_ON(n_ctx > 1 && !local->use_chanctx) || in ieee80211_vif_use_reserved_switch()
1467 WARN_ON(!new_ctx && !local->use_chanctx)) { in ieee80211_vif_use_reserved_switch()
1477 if (local->use_chanctx) { in ieee80211_vif_use_reserved_switch()
1479 err = ieee80211_chsw_switch_vifs(local, n_vifs_switch); in ieee80211_vif_use_reserved_switch()
1485 err = ieee80211_chsw_switch_ctxs(local); in ieee80211_vif_use_reserved_switch()
1490 err = ieee80211_chsw_switch_hwconf(local, new_ctx); in ieee80211_vif_use_reserved_switch()
1499 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_vif_use_reserved_switch()
1537 ieee80211_recalc_chanctx_chantype(local, ctx); in ieee80211_vif_use_reserved_switch()
1538 ieee80211_recalc_smps_chanctx(local, ctx); in ieee80211_vif_use_reserved_switch()
1539 ieee80211_recalc_radar_chanctx(local, ctx); in ieee80211_vif_use_reserved_switch()
1540 ieee80211_recalc_chanctx_min_def(local, ctx); in ieee80211_vif_use_reserved_switch()
1585 cfg80211_stop_iface(local->hw.wiphy, in ieee80211_vif_use_reserved_switch()
1596 list_for_each_entry_safe(ctx, ctx_tmp, &local->chanctx_list, list) { in ieee80211_vif_use_reserved_switch()
1611 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_vif_use_reserved_switch()
1627 struct ieee80211_local *local = sdata->local; in __ieee80211_vif_release_channel() local
1632 lockdep_assert_held(&local->chanctx_mtx); in __ieee80211_vif_release_channel()
1635 lockdep_is_held(&local->chanctx_mtx)); in __ieee80211_vif_release_channel()
1644 ieee80211_chanctx_num_reserved(local, in __ieee80211_vif_release_channel()
1652 if (ieee80211_chanctx_refcount(local, ctx) == 0) in __ieee80211_vif_release_channel()
1653 ieee80211_free_chanctx(local, ctx); in __ieee80211_vif_release_channel()
1659 ieee80211_vif_use_reserved_switch(local); in __ieee80211_vif_release_channel()
1666 struct ieee80211_local *local = sdata->local; in ieee80211_vif_use_channel() local
1671 lockdep_assert_held(&local->mtx); in ieee80211_vif_use_channel()
1675 mutex_lock(&local->chanctx_mtx); in ieee80211_vif_use_channel()
1677 ret = cfg80211_chandef_dfs_required(local->hw.wiphy, in ieee80211_vif_use_channel()
1694 ctx = ieee80211_find_chanctx(local, chandef, mode); in ieee80211_vif_use_channel()
1696 ctx = ieee80211_new_chanctx(local, chandef, mode); in ieee80211_vif_use_channel()
1707 if (ieee80211_chanctx_refcount(local, ctx) == 0) in ieee80211_vif_use_channel()
1708 ieee80211_free_chanctx(local, ctx); in ieee80211_vif_use_channel()
1712 ieee80211_recalc_smps_chanctx(local, ctx); in ieee80211_vif_use_channel()
1713 ieee80211_recalc_radar_chanctx(local, ctx); in ieee80211_vif_use_channel()
1718 mutex_unlock(&local->chanctx_mtx); in ieee80211_vif_use_channel()
1724 struct ieee80211_local *local = sdata->local; in ieee80211_vif_use_reserved_context() local
1729 lockdep_assert_held(&local->mtx); in ieee80211_vif_use_reserved_context()
1730 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_vif_use_reserved_context()
1771 err = ieee80211_vif_use_reserved_switch(local); in ieee80211_vif_use_reserved_context()
1777 wiphy_info(local->hw.wiphy, in ieee80211_vif_use_reserved_context()
1790 struct ieee80211_local *local = sdata->local; in ieee80211_vif_change_bandwidth() local
1796 if (!cfg80211_chandef_usable(sdata->local->hw.wiphy, chandef, in ieee80211_vif_change_bandwidth()
1800 mutex_lock(&local->chanctx_mtx); in ieee80211_vif_change_bandwidth()
1813 lockdep_is_held(&local->chanctx_mtx)); in ieee80211_vif_change_bandwidth()
1829 if (!ieee80211_chanctx_reserved_chandef(local, ctx, compat)) { in ieee80211_vif_change_bandwidth()
1849 ieee80211_recalc_chanctx_chantype(local, ctx); in ieee80211_vif_change_bandwidth()
1854 mutex_unlock(&local->chanctx_mtx); in ieee80211_vif_change_bandwidth()
1862 lockdep_assert_held(&sdata->local->mtx); in ieee80211_vif_release_channel()
1864 mutex_lock(&sdata->local->chanctx_mtx); in ieee80211_vif_release_channel()
1866 mutex_unlock(&sdata->local->chanctx_mtx); in ieee80211_vif_release_channel()
1871 struct ieee80211_local *local = sdata->local; in ieee80211_vif_vlan_copy_chanctx() local
1880 mutex_lock(&local->chanctx_mtx); in ieee80211_vif_vlan_copy_chanctx()
1883 lockdep_is_held(&local->chanctx_mtx)); in ieee80211_vif_vlan_copy_chanctx()
1885 mutex_unlock(&local->chanctx_mtx); in ieee80211_vif_vlan_copy_chanctx()
1895 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_iter_chan_contexts_atomic() local
1899 list_for_each_entry_rcu(ctx, &local->chanctx_list, list) in ieee80211_iter_chan_contexts_atomic()