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 = link->sdata->local; in ieee80211_link_get_chanctx()
76 lockdep_is_held(&local->chanctx_mtx)); in ieee80211_link_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()
135 ieee80211_chanctx_combined_chandef(struct ieee80211_local *local, in ieee80211_chanctx_combined_chandef() argument
139 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chanctx_combined_chandef()
141 compat = ieee80211_chanctx_reserved_chandef(local, ctx, compat); in ieee80211_chanctx_combined_chandef()
145 compat = ieee80211_chanctx_non_reserved_chandef(local, ctx, compat); in ieee80211_chanctx_combined_chandef()
153 ieee80211_chanctx_can_reserve_chandef(struct ieee80211_local *local, in ieee80211_chanctx_can_reserve_chandef() argument
157 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chanctx_can_reserve_chandef()
159 if (ieee80211_chanctx_combined_chandef(local, ctx, def)) in ieee80211_chanctx_can_reserve_chandef()
163 ieee80211_chanctx_reserved_chandef(local, ctx, def)) in ieee80211_chanctx_can_reserve_chandef()
170 ieee80211_find_reservation_chanctx(struct ieee80211_local *local, in ieee80211_find_reservation_chanctx() argument
176 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_find_reservation_chanctx()
181 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_find_reservation_chanctx()
188 if (!ieee80211_chanctx_can_reserve_chandef(local, ctx, in ieee80211_find_reservation_chanctx()
248 list_for_each_entry_rcu(sta, &sdata->local->sta_list, list) { in ieee80211_get_max_required_bw()
318 ieee80211_get_chanctx_max_required_bw(struct ieee80211_local *local, in ieee80211_get_chanctx_max_required_bw() argument
325 list_for_each_entry_rcu(sdata, &local->interfaces, list) { in ieee80211_get_chanctx_max_required_bw()
337 sdata = rcu_dereference(local->monitor_sdata); in ieee80211_get_chanctx_max_required_bw()
352 static u32 _ieee80211_recalc_chanctx_min_def(struct ieee80211_local *local, in _ieee80211_recalc_chanctx_min_def() argument
358 lockdep_assert_held(&local->chanctx_mtx); in _ieee80211_recalc_chanctx_min_def()
373 max_bw = ieee80211_get_chanctx_max_required_bw(local, &ctx->conf); in _ieee80211_recalc_chanctx_min_def()
393 static void ieee80211_chan_bw_change(struct ieee80211_local *local, in ieee80211_chan_bw_change() argument
399 local->hw.wiphy->bands[ctx->conf.def.chan->band]; in ieee80211_chan_bw_change()
402 list_for_each_entry_rcu(sta, &local->sta_list, in ieee80211_chan_bw_change()
438 rate_control_rate_update(local, sband, sta, link_id, in ieee80211_chan_bw_change()
450 void ieee80211_recalc_chanctx_min_def(struct ieee80211_local *local, in ieee80211_recalc_chanctx_min_def() argument
453 u32 changed = _ieee80211_recalc_chanctx_min_def(local, ctx); in ieee80211_recalc_chanctx_min_def()
459 ieee80211_chan_bw_change(local, ctx, true); in ieee80211_recalc_chanctx_min_def()
461 drv_change_chanctx(local, ctx, changed); in ieee80211_recalc_chanctx_min_def()
464 ieee80211_chan_bw_change(local, ctx, false); in ieee80211_recalc_chanctx_min_def()
467 static void ieee80211_change_chanctx(struct ieee80211_local *local, in ieee80211_change_chanctx() argument
492 ieee80211_chan_bw_change(local, old_ctx, true); in ieee80211_change_chanctx()
495 ieee80211_recalc_chanctx_min_def(local, ctx); in ieee80211_change_chanctx()
505 _ieee80211_recalc_chanctx_min_def(local, ctx); in ieee80211_change_chanctx()
506 drv_change_chanctx(local, ctx, changed); in ieee80211_change_chanctx()
508 if (!local->use_chanctx) { in ieee80211_change_chanctx()
509 local->_oper_chandef = *chandef; in ieee80211_change_chanctx()
510 ieee80211_hw_config(local, 0); in ieee80211_change_chanctx()
514 ieee80211_chan_bw_change(local, old_ctx, false); in ieee80211_change_chanctx()
518 ieee80211_find_chanctx(struct ieee80211_local *local, in ieee80211_find_chanctx() argument
524 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_find_chanctx()
529 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_find_chanctx()
542 compat = ieee80211_chanctx_reserved_chandef(local, ctx, in ieee80211_find_chanctx()
547 ieee80211_change_chanctx(local, ctx, ctx, compat); in ieee80211_find_chanctx()
555 bool ieee80211_is_radar_required(struct ieee80211_local *local) in ieee80211_is_radar_required() argument
559 lockdep_assert_held(&local->mtx); in ieee80211_is_radar_required()
562 list_for_each_entry_rcu(sdata, &local->interfaces, list) { in ieee80211_is_radar_required()
582 ieee80211_chanctx_radar_required(struct ieee80211_local *local, in ieee80211_chanctx_radar_required() argument
589 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chanctx_radar_required()
590 lockdep_assert_held(&local->mtx); in ieee80211_chanctx_radar_required()
593 list_for_each_entry_rcu(sdata, &local->interfaces, list) { in ieee80211_chanctx_radar_required()
622 ieee80211_alloc_chanctx(struct ieee80211_local *local, in ieee80211_alloc_chanctx() argument
628 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_alloc_chanctx()
630 ctx = kzalloc(sizeof(*ctx) + local->hw.chanctx_data_size, GFP_KERNEL); in ieee80211_alloc_chanctx()
641 ieee80211_recalc_chanctx_min_def(local, ctx); in ieee80211_alloc_chanctx()
646 static int ieee80211_add_chanctx(struct ieee80211_local *local, in ieee80211_add_chanctx() argument
652 lockdep_assert_held(&local->mtx); in ieee80211_add_chanctx()
653 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_add_chanctx()
655 if (!local->use_chanctx) in ieee80211_add_chanctx()
656 local->hw.conf.radar_enabled = ctx->conf.radar_enabled; in ieee80211_add_chanctx()
659 changed = ieee80211_idle_off(local); in ieee80211_add_chanctx()
661 ieee80211_hw_config(local, changed); in ieee80211_add_chanctx()
663 if (!local->use_chanctx) { in ieee80211_add_chanctx()
664 local->_oper_chandef = ctx->conf.def; in ieee80211_add_chanctx()
665 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL); in ieee80211_add_chanctx()
667 err = drv_add_chanctx(local, ctx); in ieee80211_add_chanctx()
669 ieee80211_recalc_idle(local); in ieee80211_add_chanctx()
678 ieee80211_new_chanctx(struct ieee80211_local *local, in ieee80211_new_chanctx() argument
685 lockdep_assert_held(&local->mtx); in ieee80211_new_chanctx()
686 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_new_chanctx()
688 ctx = ieee80211_alloc_chanctx(local, chandef, mode); in ieee80211_new_chanctx()
692 err = ieee80211_add_chanctx(local, ctx); in ieee80211_new_chanctx()
698 list_add_rcu(&ctx->list, &local->chanctx_list); in ieee80211_new_chanctx()
702 static void ieee80211_del_chanctx(struct ieee80211_local *local, in ieee80211_del_chanctx() argument
705 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_del_chanctx()
707 if (!local->use_chanctx) { in ieee80211_del_chanctx()
708 struct cfg80211_chan_def *chandef = &local->_oper_chandef; in ieee80211_del_chanctx()
724 WARN_ON(local->hw.conf.radar_enabled && in ieee80211_del_chanctx()
725 !list_empty(&local->chanctx_list)); in ieee80211_del_chanctx()
727 local->hw.conf.radar_enabled = false; in ieee80211_del_chanctx()
729 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL); in ieee80211_del_chanctx()
731 drv_remove_chanctx(local, ctx); in ieee80211_del_chanctx()
734 ieee80211_recalc_idle(local); in ieee80211_del_chanctx()
737 static void ieee80211_free_chanctx(struct ieee80211_local *local, in ieee80211_free_chanctx() argument
740 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_free_chanctx()
742 WARN_ON_ONCE(ieee80211_chanctx_refcount(local, ctx) != 0); in ieee80211_free_chanctx()
745 ieee80211_del_chanctx(local, ctx); in ieee80211_free_chanctx()
749 void ieee80211_recalc_chanctx_chantype(struct ieee80211_local *local, in ieee80211_recalc_chanctx_chantype() argument
757 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_recalc_chanctx_chantype()
760 list_for_each_entry_rcu(sdata, &local->interfaces, list) { in ieee80211_recalc_chanctx_chantype()
790 list_for_each_entry_rcu(sta, &local->sta_list, list) { in ieee80211_recalc_chanctx_chantype()
807 ieee80211_change_chanctx(local, ctx, ctx, compat); in ieee80211_recalc_chanctx_chantype()
810 static void ieee80211_recalc_radar_chanctx(struct ieee80211_local *local, in ieee80211_recalc_radar_chanctx() argument
815 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_recalc_radar_chanctx()
817 lockdep_assert_held(&local->mtx); in ieee80211_recalc_radar_chanctx()
819 radar_enabled = ieee80211_chanctx_radar_required(local, chanctx); in ieee80211_recalc_radar_chanctx()
826 if (!local->use_chanctx) { in ieee80211_recalc_radar_chanctx()
827 local->hw.conf.radar_enabled = chanctx->conf.radar_enabled; in ieee80211_recalc_radar_chanctx()
828 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL); in ieee80211_recalc_radar_chanctx()
831 drv_change_chanctx(local, chanctx, IEEE80211_CHANCTX_CHANGE_RADAR); in ieee80211_recalc_radar_chanctx()
838 struct ieee80211_local *local = sdata->local; in ieee80211_assign_link_chanctx() local
847 lockdep_is_held(&local->chanctx_mtx)); in ieee80211_assign_link_chanctx()
852 drv_unassign_vif_chanctx(local, sdata, link->conf, curr_ctx); in ieee80211_assign_link_chanctx()
858 ret = drv_assign_vif_chanctx(local, sdata, link->conf, new_ctx); in ieee80211_assign_link_chanctx()
872 if (curr_ctx && ieee80211_chanctx_num_assigned(local, curr_ctx) > 0) { in ieee80211_assign_link_chanctx()
873 ieee80211_recalc_chanctx_chantype(local, curr_ctx); in ieee80211_assign_link_chanctx()
874 ieee80211_recalc_smps_chanctx(local, curr_ctx); in ieee80211_assign_link_chanctx()
875 ieee80211_recalc_radar_chanctx(local, curr_ctx); in ieee80211_assign_link_chanctx()
876 ieee80211_recalc_chanctx_min_def(local, curr_ctx); in ieee80211_assign_link_chanctx()
879 if (new_ctx && ieee80211_chanctx_num_assigned(local, new_ctx) > 0) { in ieee80211_assign_link_chanctx()
881 ieee80211_recalc_chanctx_min_def(local, new_ctx); in ieee80211_assign_link_chanctx()
893 void ieee80211_recalc_smps_chanctx(struct ieee80211_local *local, in ieee80211_recalc_smps_chanctx() argument
899 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_recalc_smps_chanctx()
905 list_for_each_entry_rcu(sdata, &local->interfaces, list) { in ieee80211_recalc_smps_chanctx()
962 sdata = rcu_dereference(local->monitor_sdata); in ieee80211_recalc_smps_chanctx()
965 rx_chains_dynamic = rx_chains_static = local->rx_chains; in ieee80211_recalc_smps_chanctx()
969 if (!local->use_chanctx) { in ieee80211_recalc_smps_chanctx()
971 local->smps_mode = IEEE80211_SMPS_OFF; in ieee80211_recalc_smps_chanctx()
973 local->smps_mode = IEEE80211_SMPS_DYNAMIC; in ieee80211_recalc_smps_chanctx()
975 local->smps_mode = IEEE80211_SMPS_STATIC; in ieee80211_recalc_smps_chanctx()
976 ieee80211_hw_config(local, 0); in ieee80211_recalc_smps_chanctx()
985 drv_change_chanctx(local, chanctx, IEEE80211_CHANCTX_CHANGE_RX_CHAINS); in ieee80211_recalc_smps_chanctx()
995 struct ieee80211_local *local __maybe_unused = sdata->local; in __ieee80211_link_copy_chanctx_to_vlans()
1002 lockdep_assert_held(&local->mtx); in __ieee80211_link_copy_chanctx_to_vlans()
1011 lockdep_is_held(&local->chanctx_mtx)); in __ieee80211_link_copy_chanctx_to_vlans()
1033 struct ieee80211_local *local = link->sdata->local; in ieee80211_link_copy_chanctx_to_vlans() local
1035 mutex_lock(&local->chanctx_mtx); in ieee80211_link_copy_chanctx_to_vlans()
1039 mutex_unlock(&local->chanctx_mtx); in ieee80211_link_copy_chanctx_to_vlans()
1047 lockdep_assert_held(&sdata->local->chanctx_mtx); in ieee80211_link_unreserve_chanctx()
1055 if (ieee80211_chanctx_refcount(sdata->local, ctx) == 0) { in ieee80211_link_unreserve_chanctx()
1071 ieee80211_free_chanctx(sdata->local, ctx); in ieee80211_link_unreserve_chanctx()
1084 struct ieee80211_local *local = sdata->local; in ieee80211_link_reserve_chanctx() local
1087 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_link_reserve_chanctx()
1090 if (curr_ctx && local->use_chanctx && !local->ops->switch_vif_chanctx) in ieee80211_link_reserve_chanctx()
1093 new_ctx = ieee80211_find_reservation_chanctx(local, chandef, mode); in ieee80211_link_reserve_chanctx()
1095 if (ieee80211_can_create_new_chanctx(local)) { in ieee80211_link_reserve_chanctx()
1096 new_ctx = ieee80211_new_chanctx(local, chandef, mode); in ieee80211_link_reserve_chanctx()
1126 list_for_each_entry(ctx, &local->chanctx_list, in ieee80211_link_reserve_chanctx()
1150 new_ctx = ieee80211_alloc_chanctx(local, chandef, mode); in ieee80211_link_reserve_chanctx()
1162 list_add_rcu(&new_ctx->list, &local->chanctx_list); in ieee80211_link_reserve_chanctx()
1185 ieee80211_queue_work(&sdata->local->hw, in ieee80211_link_chanctx_reservation_complete()
1189 ieee80211_queue_work(&sdata->local->hw, in ieee80211_link_chanctx_reservation_complete()
1237 struct ieee80211_local *local = sdata->local; in ieee80211_link_use_reserved_reassign() local
1244 lockdep_assert_held(&local->mtx); in ieee80211_link_use_reserved_reassign()
1245 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_link_use_reserved_reassign()
1263 chandef = ieee80211_chanctx_non_reserved_chandef(local, new_ctx, in ieee80211_link_use_reserved_reassign()
1273 ieee80211_change_chanctx(local, new_ctx, old_ctx, chandef); in ieee80211_link_use_reserved_reassign()
1283 err = drv_switch_vif_chanctx(local, vif_chsw, 1, in ieee80211_link_use_reserved_reassign()
1286 if (ieee80211_chanctx_refcount(local, new_ctx) == 0) in ieee80211_link_use_reserved_reassign()
1287 ieee80211_free_chanctx(local, new_ctx); in ieee80211_link_use_reserved_reassign()
1300 if (ieee80211_chanctx_refcount(local, old_ctx) == 0) in ieee80211_link_use_reserved_reassign()
1301 ieee80211_free_chanctx(local, old_ctx); in ieee80211_link_use_reserved_reassign()
1303 ieee80211_recalc_chanctx_min_def(local, new_ctx); in ieee80211_link_use_reserved_reassign()
1304 ieee80211_recalc_smps_chanctx(local, new_ctx); in ieee80211_link_use_reserved_reassign()
1305 ieee80211_recalc_radar_chanctx(local, new_ctx); in ieee80211_link_use_reserved_reassign()
1319 struct ieee80211_local *local = sdata->local; in ieee80211_link_use_reserved_assign() local
1340 chandef = ieee80211_chanctx_non_reserved_chandef(local, new_ctx, in ieee80211_link_use_reserved_assign()
1345 ieee80211_change_chanctx(local, new_ctx, new_ctx, chandef); in ieee80211_link_use_reserved_assign()
1352 if (ieee80211_chanctx_refcount(local, new_ctx) == 0) in ieee80211_link_use_reserved_assign()
1353 ieee80211_free_chanctx(local, new_ctx); in ieee80211_link_use_reserved_assign()
1369 lockdep_assert_held(&sdata->local->chanctx_mtx); in ieee80211_link_has_in_place_reservation()
1389 static int ieee80211_chsw_switch_hwconf(struct ieee80211_local *local, in ieee80211_chsw_switch_hwconf() argument
1394 lockdep_assert_held(&local->mtx); in ieee80211_chsw_switch_hwconf()
1395 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chsw_switch_hwconf()
1397 chandef = ieee80211_chanctx_reserved_chandef(local, new_ctx, NULL); in ieee80211_chsw_switch_hwconf()
1401 local->hw.conf.radar_enabled = new_ctx->conf.radar_enabled; in ieee80211_chsw_switch_hwconf()
1402 local->_oper_chandef = *chandef; in ieee80211_chsw_switch_hwconf()
1403 ieee80211_hw_config(local, 0); in ieee80211_chsw_switch_hwconf()
1408 static int ieee80211_chsw_switch_vifs(struct ieee80211_local *local, in ieee80211_chsw_switch_vifs() argument
1416 lockdep_assert_held(&local->mtx); in ieee80211_chsw_switch_vifs()
1417 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chsw_switch_vifs()
1424 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_chsw_switch_vifs()
1448 err = drv_switch_vif_chanctx(local, vif_chsw, n_vifs, in ieee80211_chsw_switch_vifs()
1456 static int ieee80211_chsw_switch_ctxs(struct ieee80211_local *local) in ieee80211_chsw_switch_ctxs() argument
1461 lockdep_assert_held(&local->mtx); in ieee80211_chsw_switch_ctxs()
1462 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_chsw_switch_ctxs()
1464 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_chsw_switch_ctxs()
1471 ieee80211_del_chanctx(local, ctx->replace_ctx); in ieee80211_chsw_switch_ctxs()
1472 err = ieee80211_add_chanctx(local, ctx); in ieee80211_chsw_switch_ctxs()
1480 WARN_ON(ieee80211_add_chanctx(local, ctx)); in ieee80211_chsw_switch_ctxs()
1481 list_for_each_entry_continue_reverse(ctx, &local->chanctx_list, list) { in ieee80211_chsw_switch_ctxs()
1488 ieee80211_del_chanctx(local, ctx); in ieee80211_chsw_switch_ctxs()
1489 WARN_ON(ieee80211_add_chanctx(local, ctx->replace_ctx)); in ieee80211_chsw_switch_ctxs()
1495 static int ieee80211_vif_use_reserved_switch(struct ieee80211_local *local) in ieee80211_vif_use_reserved_switch() argument
1502 lockdep_assert_held(&local->mtx); in ieee80211_vif_use_reserved_switch()
1503 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_vif_use_reserved_switch()
1521 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_vif_use_reserved_switch()
1532 if (!local->use_chanctx) in ieee80211_vif_use_reserved_switch()
1553 wiphy_info(local->hw.wiphy, in ieee80211_vif_use_reserved_switch()
1589 WARN_ON(n_ctx > 1 && !local->use_chanctx) || in ieee80211_vif_use_reserved_switch()
1590 WARN_ON(!new_ctx && !local->use_chanctx)) { in ieee80211_vif_use_reserved_switch()
1600 if (local->use_chanctx) { in ieee80211_vif_use_reserved_switch()
1602 err = ieee80211_chsw_switch_vifs(local, n_vifs_switch); in ieee80211_vif_use_reserved_switch()
1608 err = ieee80211_chsw_switch_ctxs(local); in ieee80211_vif_use_reserved_switch()
1613 err = ieee80211_chsw_switch_hwconf(local, new_ctx); in ieee80211_vif_use_reserved_switch()
1622 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_vif_use_reserved_switch()
1665 ieee80211_recalc_chanctx_chantype(local, ctx); in ieee80211_vif_use_reserved_switch()
1666 ieee80211_recalc_smps_chanctx(local, ctx); in ieee80211_vif_use_reserved_switch()
1667 ieee80211_recalc_radar_chanctx(local, ctx); in ieee80211_vif_use_reserved_switch()
1668 ieee80211_recalc_chanctx_min_def(local, ctx); in ieee80211_vif_use_reserved_switch()
1711 cfg80211_stop_iface(local->hw.wiphy, in ieee80211_vif_use_reserved_switch()
1722 list_for_each_entry_safe(ctx, ctx_tmp, &local->chanctx_list, list) { in ieee80211_vif_use_reserved_switch()
1737 list_for_each_entry(ctx, &local->chanctx_list, list) { in ieee80211_vif_use_reserved_switch()
1757 struct ieee80211_local *local = sdata->local; in __ieee80211_link_release_channel() local
1762 lockdep_assert_held(&local->chanctx_mtx); in __ieee80211_link_release_channel()
1765 lockdep_is_held(&local->chanctx_mtx)); in __ieee80211_link_release_channel()
1773 ieee80211_chanctx_num_reserved(local, link->reserved_chanctx) > 1) in __ieee80211_link_release_channel()
1780 if (ieee80211_chanctx_refcount(local, ctx) == 0) in __ieee80211_link_release_channel()
1781 ieee80211_free_chanctx(local, ctx); in __ieee80211_link_release_channel()
1787 ieee80211_vif_use_reserved_switch(local); in __ieee80211_link_release_channel()
1795 struct ieee80211_local *local = sdata->local; in ieee80211_link_use_channel() local
1800 lockdep_assert_held(&local->mtx); in ieee80211_link_use_channel()
1808 mutex_lock(&local->chanctx_mtx); in ieee80211_link_use_channel()
1810 ret = cfg80211_chandef_dfs_required(local->hw.wiphy, in ieee80211_link_use_channel()
1827 ctx = ieee80211_find_chanctx(local, chandef, mode); in ieee80211_link_use_channel()
1829 ctx = ieee80211_new_chanctx(local, chandef, mode); in ieee80211_link_use_channel()
1840 if (ieee80211_chanctx_refcount(local, ctx) == 0) in ieee80211_link_use_channel()
1841 ieee80211_free_chanctx(local, ctx); in ieee80211_link_use_channel()
1845 ieee80211_recalc_smps_chanctx(local, ctx); in ieee80211_link_use_channel()
1846 ieee80211_recalc_radar_chanctx(local, ctx); in ieee80211_link_use_channel()
1851 mutex_unlock(&local->chanctx_mtx); in ieee80211_link_use_channel()
1858 struct ieee80211_local *local = sdata->local; in ieee80211_link_use_reserved_context() local
1863 lockdep_assert_held(&local->mtx); in ieee80211_link_use_reserved_context()
1864 lockdep_assert_held(&local->chanctx_mtx); in ieee80211_link_use_reserved_context()
1902 err = ieee80211_vif_use_reserved_switch(local); in ieee80211_link_use_reserved_context()
1908 wiphy_info(local->hw.wiphy, in ieee80211_link_use_reserved_context()
1923 struct ieee80211_local *local = sdata->local; in ieee80211_link_change_bandwidth() local
1929 if (!cfg80211_chandef_usable(sdata->local->hw.wiphy, chandef, in ieee80211_link_change_bandwidth()
1933 mutex_lock(&local->chanctx_mtx); in ieee80211_link_change_bandwidth()
1946 lockdep_is_held(&local->chanctx_mtx)); in ieee80211_link_change_bandwidth()
1962 if (!ieee80211_chanctx_reserved_chandef(local, ctx, compat)) { in ieee80211_link_change_bandwidth()
1982 ieee80211_recalc_chanctx_chantype(local, ctx); in ieee80211_link_change_bandwidth()
1987 mutex_unlock(&local->chanctx_mtx); in ieee80211_link_change_bandwidth()
1995 mutex_lock(&sdata->local->chanctx_mtx); in ieee80211_link_release_channel()
1997 lockdep_assert_held(&sdata->local->mtx); in ieee80211_link_release_channel()
2000 mutex_unlock(&sdata->local->chanctx_mtx); in ieee80211_link_release_channel()
2009 struct ieee80211_local *local = sdata->local; in ieee80211_link_vlan_copy_chanctx() local
2018 mutex_lock(&local->chanctx_mtx); in ieee80211_link_vlan_copy_chanctx()
2023 lockdep_is_held(&local->chanctx_mtx)); in ieee80211_link_vlan_copy_chanctx()
2026 mutex_unlock(&local->chanctx_mtx); in ieee80211_link_vlan_copy_chanctx()
2036 struct ieee80211_local *local = hw_to_local(hw); in ieee80211_iter_chan_contexts_atomic() local
2040 list_for_each_entry_rcu(ctx, &local->chanctx_list, list) in ieee80211_iter_chan_contexts_atomic()