Lines Matching full:local

34 static void ieee80211_chanctx_user_iter_next(struct ieee80211_local *local,  in ieee80211_chanctx_user_iter_next()  argument
40 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_chanctx_user_iter_next()
91 iter->sdata = list_prepare_entry(iter->sdata, &local->interfaces, list); in ieee80211_chanctx_user_iter_next()
92 list_for_each_entry_continue(iter->sdata, &local->interfaces, list) { in ieee80211_chanctx_user_iter_next()
109 #define for_each_chanctx_user_assigned(local, ctx, iter) \ argument
110 for (ieee80211_chanctx_user_iter_next(local, ctx, iter, \
114 ieee80211_chanctx_user_iter_next(local, ctx, iter, \
118 #define for_each_chanctx_user_reserved(local, ctx, iter) \ argument
119 for (ieee80211_chanctx_user_iter_next(local, ctx, iter, \
123 ieee80211_chanctx_user_iter_next(local, ctx, iter, \
127 #define for_each_chanctx_user_all(local, ctx, iter) \ argument
128 for (ieee80211_chanctx_user_iter_next(local, ctx, iter, \
132 ieee80211_chanctx_user_iter_next(local, ctx, iter, \
136 static int ieee80211_chanctx_num_assigned(struct ieee80211_local *local, in ieee80211_chanctx_num_assigned() argument
142 for_each_chanctx_user_assigned(local, ctx, &iter) in ieee80211_chanctx_num_assigned()
148 static int ieee80211_chanctx_num_reserved(struct ieee80211_local *local, in ieee80211_chanctx_num_reserved() argument
154 for_each_chanctx_user_reserved(local, ctx, &iter) in ieee80211_chanctx_num_reserved()
160 int ieee80211_chanctx_refcount(struct ieee80211_local *local, in ieee80211_chanctx_refcount() argument
166 for_each_chanctx_user_all(local, ctx, &iter) in ieee80211_chanctx_refcount()
172 static int ieee80211_num_chanctx(struct ieee80211_local *local, int radio_idx) in ieee80211_num_chanctx() argument
177 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_num_chanctx()
179 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_num_chanctx()
188 static bool ieee80211_can_create_new_chanctx(struct ieee80211_local *local, in ieee80211_can_create_new_chanctx() argument
191 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_can_create_new_chanctx()
193 return ieee80211_num_chanctx(local, radio_idx) < in ieee80211_can_create_new_chanctx()
194 ieee80211_max_num_channels(local, radio_idx); in ieee80211_can_create_new_chanctx()
200 struct ieee80211_local *local __maybe_unused = link->sdata->local; in ieee80211_link_get_chanctx()
204 lockdep_is_held(&local->hw.wiphy->mtx)); in ieee80211_link_get_chanctx()
263 ieee80211_chanctx_reserved_chanreq(struct ieee80211_local *local, in ieee80211_chanctx_reserved_chanreq() argument
270 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_chanctx_reserved_chanreq()
275 for_each_chanctx_user_reserved(local, ctx, &iter) { in ieee80211_chanctx_reserved_chanreq()
285 ieee80211_chanctx_non_reserved_chandef(struct ieee80211_local *local, in ieee80211_chanctx_non_reserved_chandef() argument
293 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_chanctx_non_reserved_chandef()
295 for_each_chanctx_user_assigned(local, ctx, &iter) { in ieee80211_chanctx_non_reserved_chandef()
309 ieee80211_chanctx_can_reserve(struct ieee80211_local *local, in ieee80211_chanctx_can_reserve() argument
315 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_chanctx_can_reserve()
317 if (!ieee80211_chanctx_reserved_chanreq(local, ctx, req, &tmp)) in ieee80211_chanctx_can_reserve()
320 if (!ieee80211_chanctx_non_reserved_chandef(local, ctx, req, &tmp)) in ieee80211_chanctx_can_reserve()
323 if (ieee80211_chanctx_num_reserved(local, ctx) != 0 && in ieee80211_chanctx_can_reserve()
324 ieee80211_chanctx_reserved_chanreq(local, ctx, req, &tmp)) in ieee80211_chanctx_can_reserve()
331 ieee80211_find_reservation_chanctx(struct ieee80211_local *local, in ieee80211_find_reservation_chanctx() argument
337 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_find_reservation_chanctx()
342 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_find_reservation_chanctx()
349 if (!ieee80211_chanctx_can_reserve(local, ctx, chanreq)) in ieee80211_find_reservation_chanctx()
364 link_sta = wiphy_dereference(sta->local->hw.wiphy, sta->link[link_id]); in ieee80211_get_sta_bw()
416 lockdep_assert_wiphy(sdata->local->hw.wiphy); in ieee80211_get_max_required_bw()
418 list_for_each_entry(sta, &sdata->local->sta_list, list) { in ieee80211_get_max_required_bw()
430 ieee80211_get_chanctx_max_required_bw(struct ieee80211_local *local, in ieee80211_get_chanctx_max_required_bw() argument
442 for_each_sdata_link(local, link) { in ieee80211_get_chanctx_max_required_bw()
478 WARN_ON_ONCE(!ieee80211_hw_check(&local->hw, in ieee80211_get_chanctx_max_required_bw()
498 sdata = wiphy_dereference(local->hw.wiphy, local->monitor_sdata); in ieee80211_get_chanctx_max_required_bw()
512 __ieee80211_recalc_chanctx_min_def(struct ieee80211_local *local, in __ieee80211_recalc_chanctx_min_def() argument
520 lockdep_assert_wiphy(local->hw.wiphy); in __ieee80211_recalc_chanctx_min_def()
535 max_bw = ieee80211_get_chanctx_max_required_bw(local, ctx, rsvd_for, in __ieee80211_recalc_chanctx_min_def()
553 static void ieee80211_chan_bw_change(struct ieee80211_local *local, in ieee80211_chan_bw_change() argument
559 local->hw.wiphy->bands[ctx->conf.def.chan->band]; in ieee80211_chan_bw_change()
562 list_for_each_entry_rcu(sta, &local->sta_list, in ieee80211_chan_bw_change()
610 rate_control_rate_update(local, sband, link_sta, in ieee80211_chan_bw_change()
623 _ieee80211_recalc_chanctx_min_def(struct ieee80211_local *local, in _ieee80211_recalc_chanctx_min_def() argument
628 u32 changed = __ieee80211_recalc_chanctx_min_def(local, ctx, rsvd_for, in _ieee80211_recalc_chanctx_min_def()
635 ieee80211_chan_bw_change(local, ctx, false, true); in _ieee80211_recalc_chanctx_min_def()
637 drv_change_chanctx(local, ctx, changed); in _ieee80211_recalc_chanctx_min_def()
640 ieee80211_chan_bw_change(local, ctx, false, false); in _ieee80211_recalc_chanctx_min_def()
643 void ieee80211_recalc_chanctx_min_def(struct ieee80211_local *local, in ieee80211_recalc_chanctx_min_def() argument
646 _ieee80211_recalc_chanctx_min_def(local, ctx, NULL, false); in ieee80211_recalc_chanctx_min_def()
649 static void _ieee80211_change_chanctx(struct ieee80211_local *local, in _ieee80211_change_chanctx() argument
691 ieee80211_chan_bw_change(local, old_ctx, false, true); in _ieee80211_change_chanctx()
694 _ieee80211_recalc_chanctx_min_def(local, ctx, rsvd_for, false); in _ieee80211_change_chanctx()
698 WARN_ON(ieee80211_chanctx_refcount(local, ctx) > 1 && in _ieee80211_change_chanctx()
701 ieee80211_remove_wbrf(local, &ctx->conf.def); in _ieee80211_change_chanctx()
715 changed |= __ieee80211_recalc_chanctx_min_def(local, ctx, rsvd_for, in _ieee80211_change_chanctx()
718 ieee80211_add_wbrf(local, &ctx->conf.def); in _ieee80211_change_chanctx()
720 drv_change_chanctx(local, ctx, changed); in _ieee80211_change_chanctx()
723 ieee80211_chan_bw_change(local, old_ctx, false, false); in _ieee80211_change_chanctx()
726 static void ieee80211_change_chanctx(struct ieee80211_local *local, in ieee80211_change_chanctx() argument
731 _ieee80211_change_chanctx(local, ctx, old_ctx, chanreq, NULL); in ieee80211_change_chanctx()
736 ieee80211_find_chanctx(struct ieee80211_local *local, in ieee80211_find_chanctx() argument
744 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_find_chanctx()
752 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_find_chanctx()
765 compat = ieee80211_chanctx_reserved_chanreq(local, ctx, in ieee80211_find_chanctx()
778 ieee80211_change_chanctx(local, ctx, ctx, compat); in ieee80211_find_chanctx()
786 bool ieee80211_is_radar_required(struct ieee80211_local *local, in ieee80211_is_radar_required() argument
789 struct wiphy *wiphy = local->hw.wiphy; in ieee80211_is_radar_required()
794 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_is_radar_required()
799 for_each_sdata_link(local, link) { in ieee80211_is_radar_required()
814 ieee80211_chanctx_radar_required(struct ieee80211_local *local, in ieee80211_chanctx_radar_required() argument
819 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_chanctx_radar_required()
821 for_each_chanctx_user_assigned(local, ctx, &iter) { in ieee80211_chanctx_radar_required()
830 ieee80211_alloc_chanctx(struct ieee80211_local *local, in ieee80211_alloc_chanctx() argument
837 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_alloc_chanctx()
839 ctx = kzalloc(sizeof(*ctx) + local->hw.chanctx_data_size, GFP_KERNEL); in ieee80211_alloc_chanctx()
851 __ieee80211_recalc_chanctx_min_def(local, ctx, NULL, false); in ieee80211_alloc_chanctx()
856 static int ieee80211_add_chanctx(struct ieee80211_local *local, in ieee80211_add_chanctx() argument
862 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_add_chanctx()
864 ieee80211_add_wbrf(local, &ctx->conf.def); in ieee80211_add_chanctx()
867 changed = ieee80211_idle_off(local); in ieee80211_add_chanctx()
869 ieee80211_hw_config(local, -1, changed); in ieee80211_add_chanctx()
871 err = drv_add_chanctx(local, ctx); in ieee80211_add_chanctx()
873 ieee80211_recalc_idle(local); in ieee80211_add_chanctx()
881 ieee80211_new_chanctx(struct ieee80211_local *local, in ieee80211_new_chanctx() argument
890 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_new_chanctx()
892 ctx = ieee80211_alloc_chanctx(local, chanreq, mode, radio_idx); in ieee80211_new_chanctx()
896 err = ieee80211_add_chanctx(local, ctx); in ieee80211_new_chanctx()
902 WARN_ON_ONCE(err && !local->in_reconfig); in ieee80211_new_chanctx()
904 list_add_rcu(&ctx->list, &local->chanctx_list); in ieee80211_new_chanctx()
908 static void ieee80211_del_chanctx(struct ieee80211_local *local, in ieee80211_del_chanctx() argument
912 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_del_chanctx()
914 drv_remove_chanctx(local, ctx); in ieee80211_del_chanctx()
917 ieee80211_recalc_idle(local); in ieee80211_del_chanctx()
919 ieee80211_remove_wbrf(local, &ctx->conf.def); in ieee80211_del_chanctx()
922 static void ieee80211_free_chanctx(struct ieee80211_local *local, in ieee80211_free_chanctx() argument
926 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_free_chanctx()
928 WARN_ON_ONCE(ieee80211_chanctx_refcount(local, ctx) != 0); in ieee80211_free_chanctx()
931 ieee80211_del_chanctx(local, ctx, skip_idle_recalc); in ieee80211_free_chanctx()
935 void ieee80211_recalc_chanctx_chantype(struct ieee80211_local *local, in ieee80211_recalc_chanctx_chantype() argument
944 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_recalc_chanctx_chantype()
946 for_each_chanctx_user_assigned(local, ctx, &iter) { in ieee80211_recalc_chanctx_chantype()
960 list_for_each_entry(sta, &local->sta_list, list) { in ieee80211_recalc_chanctx_chantype()
989 ieee80211_change_chanctx(local, ctx, ctx, compat); in ieee80211_recalc_chanctx_chantype()
992 static void ieee80211_recalc_radar_chanctx(struct ieee80211_local *local, in ieee80211_recalc_radar_chanctx() argument
997 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_recalc_radar_chanctx()
999 radar_enabled = ieee80211_chanctx_radar_required(local, chanctx); in ieee80211_recalc_radar_chanctx()
1006 drv_change_chanctx(local, chanctx, IEEE80211_CHANCTX_CHANGE_RADAR); in ieee80211_recalc_radar_chanctx()
1014 struct ieee80211_local *local = sdata->local; in ieee80211_assign_link_chanctx() local
1024 lockdep_is_held(&local->hw.wiphy->mtx)); in ieee80211_assign_link_chanctx()
1026 if (conf && !local->in_reconfig) { in ieee80211_assign_link_chanctx()
1029 drv_unassign_vif_chanctx(local, sdata, link->conf, curr_ctx); in ieee80211_assign_link_chanctx()
1035 _ieee80211_recalc_chanctx_min_def(local, new_ctx, link, false); in ieee80211_assign_link_chanctx()
1037 ret = drv_assign_vif_chanctx(local, sdata, link->conf, new_ctx); in ieee80211_assign_link_chanctx()
1040 WARN_ON_ONCE(ret && !local->in_reconfig); in ieee80211_assign_link_chanctx()
1052 if (curr_ctx && ieee80211_chanctx_num_assigned(local, curr_ctx) > 0) { in ieee80211_assign_link_chanctx()
1053 ieee80211_recalc_chanctx_chantype(local, curr_ctx); in ieee80211_assign_link_chanctx()
1054 ieee80211_recalc_smps_chanctx(local, curr_ctx); in ieee80211_assign_link_chanctx()
1055 ieee80211_recalc_radar_chanctx(local, curr_ctx); in ieee80211_assign_link_chanctx()
1056 ieee80211_recalc_chanctx_min_def(local, curr_ctx); in ieee80211_assign_link_chanctx()
1059 if (new_ctx && ieee80211_chanctx_num_assigned(local, new_ctx) > 0) { in ieee80211_assign_link_chanctx()
1061 ieee80211_recalc_chanctx_min_def(local, new_ctx); in ieee80211_assign_link_chanctx()
1070 for_each_sdata_link(local, tmp) { in ieee80211_assign_link_chanctx()
1091 void ieee80211_recalc_smps_chanctx(struct ieee80211_local *local, in ieee80211_recalc_smps_chanctx() argument
1098 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_recalc_smps_chanctx()
1103 for_each_chanctx_user_assigned(local, chanctx, &iter) { in ieee80211_recalc_smps_chanctx()
1112 if (!ieee80211_hw_check(&local->hw, NO_VIRTUAL_MONITOR)) in ieee80211_recalc_smps_chanctx()
1125 rx_chains_dynamic = rx_chains_static = local->rx_chains; in ieee80211_recalc_smps_chanctx()
1153 sdata = wiphy_dereference(local->hw.wiphy, local->monitor_sdata); in ieee80211_recalc_smps_chanctx()
1156 rx_chains_dynamic = rx_chains_static = local->rx_chains; in ieee80211_recalc_smps_chanctx()
1164 drv_change_chanctx(local, chanctx, IEEE80211_CHANCTX_CHANGE_RX_CHAINS); in ieee80211_recalc_smps_chanctx()
1174 struct ieee80211_local *local __maybe_unused = sdata->local; in __ieee80211_link_copy_chanctx_to_vlans()
1181 lockdep_assert_wiphy(local->hw.wiphy); in __ieee80211_link_copy_chanctx_to_vlans()
1190 lockdep_is_held(&local->hw.wiphy->mtx)); in __ieee80211_link_copy_chanctx_to_vlans()
1199 vlan_conf = wiphy_dereference(local->hw.wiphy, in __ieee80211_link_copy_chanctx_to_vlans()
1211 struct ieee80211_local *local = link->sdata->local; in ieee80211_link_copy_chanctx_to_vlans() local
1213 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_link_copy_chanctx_to_vlans()
1223 lockdep_assert_wiphy(sdata->local->hw.wiphy); in ieee80211_link_unreserve_chanctx()
1230 if (ieee80211_chanctx_refcount(sdata->local, ctx) == 0) { in ieee80211_link_unreserve_chanctx()
1246 ieee80211_free_chanctx(sdata->local, ctx, false); in ieee80211_link_unreserve_chanctx()
1252 ieee80211_replace_chanctx(struct ieee80211_local *local, in ieee80211_replace_chanctx() argument
1258 struct wiphy *wiphy = local->hw.wiphy; in ieee80211_replace_chanctx()
1263 ieee80211_chanctx_num_reserved(local, curr_ctx) != 0) { in ieee80211_replace_chanctx()
1281 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_replace_chanctx()
1286 if (ieee80211_chanctx_num_reserved(local, ctx) != 0) in ieee80211_replace_chanctx()
1306 ieee80211_chanctx_num_reserved(local, curr_ctx) != 0) in ieee80211_replace_chanctx()
1309 new_ctx = ieee80211_alloc_chanctx(local, chanreq, mode, -1); in ieee80211_replace_chanctx()
1319 list_add_rcu(&new_ctx->list, &local->chanctx_list); in ieee80211_replace_chanctx()
1325 ieee80211_find_available_radio(struct ieee80211_local *local, in ieee80211_find_available_radio() argument
1329 struct wiphy *wiphy = local->hw.wiphy; in ieee80211_find_available_radio()
1345 if (!ieee80211_can_create_new_chanctx(local, i)) in ieee80211_find_available_radio()
1361 struct ieee80211_local *local = sdata->local; in ieee80211_link_reserve_chanctx() local
1365 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_link_reserve_chanctx()
1368 if (curr_ctx && !local->ops->switch_vif_chanctx) in ieee80211_link_reserve_chanctx()
1371 new_ctx = ieee80211_find_reservation_chanctx(local, chanreq, mode); in ieee80211_link_reserve_chanctx()
1373 if (ieee80211_can_create_new_chanctx(local, -1) && in ieee80211_link_reserve_chanctx()
1374 ieee80211_find_available_radio(local, chanreq, in ieee80211_link_reserve_chanctx()
1377 new_ctx = ieee80211_new_chanctx(local, chanreq, mode, in ieee80211_link_reserve_chanctx()
1380 new_ctx = ieee80211_replace_chanctx(local, chanreq, in ieee80211_link_reserve_chanctx()
1404 wiphy_work_queue(sdata->local->hw.wiphy, in ieee80211_link_chanctx_reservation_complete()
1408 wiphy_hrtimer_work_queue(sdata->local->hw.wiphy, in ieee80211_link_chanctx_reservation_complete()
1441 vlan_conf = wiphy_dereference(sdata->local->hw.wiphy, in ieee80211_link_update_chanreq()
1455 struct ieee80211_local *local = sdata->local; in ieee80211_link_use_reserved_reassign() local
1463 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_link_use_reserved_reassign()
1481 chanreq = ieee80211_chanctx_non_reserved_chandef(local, new_ctx, in ieee80211_link_use_reserved_reassign()
1492 _ieee80211_change_chanctx(local, new_ctx, old_ctx, chanreq, link); in ieee80211_link_use_reserved_reassign()
1501 err = drv_switch_vif_chanctx(local, vif_chsw, 1, in ieee80211_link_use_reserved_reassign()
1504 if (ieee80211_chanctx_refcount(local, new_ctx) == 0) in ieee80211_link_use_reserved_reassign()
1505 ieee80211_free_chanctx(local, new_ctx, false); in ieee80211_link_use_reserved_reassign()
1518 if (ieee80211_chanctx_refcount(local, old_ctx) == 0) in ieee80211_link_use_reserved_reassign()
1519 ieee80211_free_chanctx(local, old_ctx, false); in ieee80211_link_use_reserved_reassign()
1521 ieee80211_recalc_chanctx_min_def(local, new_ctx); in ieee80211_link_use_reserved_reassign()
1522 ieee80211_recalc_smps_chanctx(local, new_ctx); in ieee80211_link_use_reserved_reassign()
1523 ieee80211_recalc_radar_chanctx(local, new_ctx); in ieee80211_link_use_reserved_reassign()
1537 struct ieee80211_local *local = sdata->local; in ieee80211_link_use_reserved_assign() local
1559 chanreq = ieee80211_chanctx_non_reserved_chandef(local, new_ctx, in ieee80211_link_use_reserved_assign()
1565 ieee80211_change_chanctx(local, new_ctx, new_ctx, chanreq); in ieee80211_link_use_reserved_assign()
1571 if (ieee80211_chanctx_refcount(local, new_ctx) == 0) in ieee80211_link_use_reserved_assign()
1572 ieee80211_free_chanctx(local, new_ctx, false); in ieee80211_link_use_reserved_assign()
1588 lockdep_assert_wiphy(sdata->local->hw.wiphy); in ieee80211_link_has_in_place_reservation()
1608 static int ieee80211_chsw_switch_vifs(struct ieee80211_local *local, in ieee80211_chsw_switch_vifs() argument
1615 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_chsw_switch_vifs()
1622 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_chsw_switch_vifs()
1633 for_each_chanctx_user_reserved(local, ctx, &iter) { in ieee80211_chsw_switch_vifs()
1647 err = drv_switch_vif_chanctx(local, vif_chsw, n_vifs, in ieee80211_chsw_switch_vifs()
1655 static int ieee80211_chsw_switch_ctxs(struct ieee80211_local *local) in ieee80211_chsw_switch_ctxs() argument
1660 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_chsw_switch_ctxs()
1662 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_chsw_switch_ctxs()
1666 if (ieee80211_chanctx_num_assigned(local, ctx) != 0) in ieee80211_chsw_switch_ctxs()
1669 ieee80211_del_chanctx(local, ctx->replace_ctx, false); in ieee80211_chsw_switch_ctxs()
1670 err = ieee80211_add_chanctx(local, ctx); in ieee80211_chsw_switch_ctxs()
1678 WARN_ON(ieee80211_add_chanctx(local, ctx)); in ieee80211_chsw_switch_ctxs()
1679 list_for_each_entry_continue_reverse(ctx, &local->chanctx_list, list) { in ieee80211_chsw_switch_ctxs()
1683 if (ieee80211_chanctx_num_assigned(local, ctx) != 0) in ieee80211_chsw_switch_ctxs()
1686 ieee80211_del_chanctx(local, ctx, false); in ieee80211_chsw_switch_ctxs()
1687 WARN_ON(ieee80211_add_chanctx(local, ctx->replace_ctx)); in ieee80211_chsw_switch_ctxs()
1693 static int ieee80211_vif_use_reserved_switch(struct ieee80211_local *local) in ieee80211_vif_use_reserved_switch() argument
1699 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_vif_use_reserved_switch()
1717 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_vif_use_reserved_switch()
1734 for_each_chanctx_user_assigned(local, ctx->replace_ctx, &iter) { in ieee80211_vif_use_reserved_switch()
1745 wiphy_info(local->hw.wiphy, in ieee80211_vif_use_reserved_switch()
1755 for_each_chanctx_user_reserved(local, ctx, &iter) { in ieee80211_vif_use_reserved_switch()
1785 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_vif_use_reserved_switch()
1796 for_each_chanctx_user_reserved(local, ctx, &iter) { in ieee80211_vif_use_reserved_switch()
1800 ieee80211_chan_bw_change(local, in ieee80211_vif_use_reserved_switch()
1805 _ieee80211_recalc_chanctx_min_def(local, ctx, NULL, true); in ieee80211_vif_use_reserved_switch()
1814 err = ieee80211_chsw_switch_vifs(local, n_vifs_switch); in ieee80211_vif_use_reserved_switch()
1820 err = ieee80211_chsw_switch_ctxs(local); in ieee80211_vif_use_reserved_switch()
1829 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_vif_use_reserved_switch()
1840 for_each_chanctx_user_reserved(local, ctx, &iter) { in ieee80211_vif_use_reserved_switch()
1872 ieee80211_recalc_chanctx_chantype(local, ctx); in ieee80211_vif_use_reserved_switch()
1873 ieee80211_recalc_smps_chanctx(local, ctx); in ieee80211_vif_use_reserved_switch()
1874 ieee80211_recalc_radar_chanctx(local, ctx); in ieee80211_vif_use_reserved_switch()
1875 ieee80211_recalc_chanctx_min_def(local, ctx); in ieee80211_vif_use_reserved_switch()
1877 for_each_chanctx_user_reserved(local, ctx, &iter) { in ieee80211_vif_use_reserved_switch()
1884 ieee80211_chan_bw_change(local, ctx, false, false); in ieee80211_vif_use_reserved_switch()
1894 for_each_chanctx_user_reserved(local, ctx, &iter) { in ieee80211_vif_use_reserved_switch()
1913 cfg80211_stop_iface(local->hw.wiphy, in ieee80211_vif_use_reserved_switch()
1924 list_for_each_entry_safe(ctx, ctx_tmp, &local->chanctx_list, list) { in ieee80211_vif_use_reserved_switch()
1939 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_vif_use_reserved_switch()
1945 for_each_chanctx_user_reserved(local, ctx, &iter) { in ieee80211_vif_use_reserved_switch()
1959 struct ieee80211_local *local = sdata->local; in __ieee80211_link_release_channel() local
1964 lockdep_assert_wiphy(local->hw.wiphy); in __ieee80211_link_release_channel()
1967 lockdep_is_held(&local->hw.wiphy->mtx)); in __ieee80211_link_release_channel()
1975 ieee80211_chanctx_num_reserved(local, link->reserved_chanctx) > 1) in __ieee80211_link_release_channel()
1982 if (ieee80211_chanctx_refcount(local, ctx) == 0) in __ieee80211_link_release_channel()
1983 ieee80211_free_chanctx(local, ctx, skip_idle_recalc); in __ieee80211_link_release_channel()
1989 ieee80211_vif_use_reserved_switch(local); in __ieee80211_link_release_channel()
1998 struct ieee80211_local *local = sdata->local; in _ieee80211_link_use_channel() local
2005 lockdep_assert_wiphy(local->hw.wiphy); in _ieee80211_link_use_channel()
2012 ret = cfg80211_chandef_dfs_required(local->hw.wiphy, in _ieee80211_link_use_channel()
2027 if (!local->in_reconfig) in _ieee80211_link_use_channel()
2030 ctx = ieee80211_find_chanctx(local, link, chanreq, mode); in _ieee80211_link_use_channel()
2034 else if (!ieee80211_find_available_radio(local, chanreq, in _ieee80211_link_use_channel()
2039 ctx = ieee80211_new_chanctx(local, chanreq, mode, in _ieee80211_link_use_channel()
2058 if (ieee80211_chanctx_refcount(local, ctx) == 0) in _ieee80211_link_use_channel()
2059 ieee80211_free_chanctx(local, ctx, false); in _ieee80211_link_use_channel()
2063 ieee80211_recalc_smps_chanctx(local, ctx); in _ieee80211_link_use_channel()
2064 ieee80211_recalc_radar_chanctx(local, ctx); in _ieee80211_link_use_channel()
2075 struct ieee80211_local *local = sdata->local; in ieee80211_link_use_reserved_context() local
2080 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_link_use_reserved_context()
2118 err = ieee80211_vif_use_reserved_switch(local); in ieee80211_link_use_reserved_context()
2124 wiphy_info(local->hw.wiphy, in ieee80211_link_use_reserved_context()
2143 ieee80211_chanctx_recheck(struct ieee80211_local *local, in ieee80211_chanctx_recheck() argument
2152 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_chanctx_recheck()
2154 for_each_chanctx_user_all(local, ctx, &iter) { in ieee80211_chanctx_recheck()
2173 struct ieee80211_local *local = sdata->local; in ieee80211_link_change_chanreq() local
2179 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_link_change_chanreq()
2181 if (!cfg80211_chandef_usable(sdata->local->hw.wiphy, in ieee80211_link_change_chanreq()
2197 lockdep_is_held(&local->hw.wiphy->mtx)); in ieee80211_link_change_chanreq()
2203 compat = ieee80211_chanctx_recheck(local, link, ctx, chanreq, &tmp); in ieee80211_link_change_chanreq()
2209 if (!ieee80211_chanctx_reserved_chanreq(local, ctx, compat, in ieee80211_link_change_chanreq()
2227 ieee80211_recalc_chanctx_chantype(local, ctx); in ieee80211_link_change_chanreq()
2240 lockdep_assert_wiphy(sdata->local->hw.wiphy); in ieee80211_link_release_channel()
2252 struct ieee80211_local *local = sdata->local; in ieee80211_link_vlan_copy_chanctx() local
2256 lockdep_assert_wiphy(local->hw.wiphy); in ieee80211_link_vlan_copy_chanctx()
2263 ap_conf = wiphy_dereference(local->hw.wiphy, in ieee80211_link_vlan_copy_chanctx()
2265 conf = wiphy_dereference(local->hw.wiphy, in ieee80211_link_vlan_copy_chanctx()
2277 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_iter_chan_contexts_atomic() local
2281 list_for_each_entry_rcu(ctx, &local->chanctx_list, list) in ieee80211_iter_chan_contexts_atomic()
2295 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_iter_chan_contexts_mtx() local
2300 list_for_each_entry(ctx, &local->chanctx_list, list) in ieee80211_iter_chan_contexts_mtx()