Lines Matching defs:sdata

16 	struct ieee80211_sub_if_data *sdata;
21 list_for_each_entry(sdata, &ctx->assigned_vifs, assigned_chanctx_list)
30 struct ieee80211_sub_if_data *sdata;
35 list_for_each_entry(sdata, &ctx->reserved_vifs, reserved_chanctx_list)
68 ieee80211_vif_get_chanctx(struct ieee80211_sub_if_data *sdata)
70 struct ieee80211_local *local __maybe_unused = sdata->local;
73 conf = rcu_dereference_protected(sdata->vif.chanctx_conf,
86 struct ieee80211_sub_if_data *sdata;
90 list_for_each_entry(sdata, &ctx->reserved_vifs,
93 compat = &sdata->reserved_chandef;
95 compat = cfg80211_chandef_compatible(&sdata->reserved_chandef,
109 struct ieee80211_sub_if_data *sdata;
113 list_for_each_entry(sdata, &ctx->assigned_vifs,
115 if (sdata->reserved_chanctx != NULL)
119 compat = &sdata->vif.bss_conf.chandef;
122 &sdata->vif.bss_conf.chandef, compat);
224 ieee80211_get_max_required_bw(struct ieee80211_sub_if_data *sdata)
230 list_for_each_entry_rcu(sta, &sdata->local->sta_list, list) {
231 if (sdata != sta->sdata &&
232 !(sta->sdata->bss && sta->sdata->bss == sdata->bss))
246 struct ieee80211_sub_if_data *sdata;
250 list_for_each_entry_rcu(sdata, &local->interfaces, list) {
251 struct ieee80211_vif *vif = &sdata->vif;
254 if (!ieee80211_sdata_running(sdata))
257 if (rcu_access_pointer(sdata->vif.chanctx_conf) != conf)
263 width = ieee80211_get_max_required_bw(sdata);
272 ieee80211_get_max_required_bw(sdata));
294 sdata = rcu_dereference(local->monitor_sdata);
295 if (sdata && rcu_access_pointer(sdata->vif.chanctx_conf) == conf)
407 struct ieee80211_sub_if_data *sdata;
412 list_for_each_entry_rcu(sdata, &local->interfaces, list) {
413 if (sdata->radar_required) {
428 struct ieee80211_sub_if_data *sdata;
435 list_for_each_entry_rcu(sdata, &local->interfaces, list) {
436 if (!ieee80211_sdata_running(sdata))
438 if (rcu_access_pointer(sdata->vif.chanctx_conf) != conf)
440 if (!sdata->radar_required)
583 struct ieee80211_sub_if_data *sdata;
590 list_for_each_entry_rcu(sdata, &local->interfaces, list) {
592 if (!ieee80211_sdata_running(sdata))
594 if (rcu_access_pointer(sdata->vif.chanctx_conf) != conf)
596 if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
600 compat = &sdata->vif.bss_conf.chandef;
603 &sdata->vif.bss_conf.chandef, compat);
653 static int ieee80211_assign_vif_chanctx(struct ieee80211_sub_if_data *sdata,
656 struct ieee80211_local *local = sdata->local;
661 if (WARN_ON(sdata->vif.type == NL80211_IFTYPE_NAN))
664 conf = rcu_dereference_protected(sdata->vif.chanctx_conf,
670 drv_unassign_vif_chanctx(local, sdata, curr_ctx);
672 list_del(&sdata->assigned_chanctx_list);
676 ret = drv_assign_vif_chanctx(local, sdata, new_ctx);
681 list_add(&sdata->assigned_chanctx_list,
686 rcu_assign_pointer(sdata->vif.chanctx_conf, conf);
688 sdata->vif.bss_conf.idle = !conf;
698 ieee80211_recalc_txpower(sdata, false);
702 if (sdata->vif.type != NL80211_IFTYPE_P2P_DEVICE &&
703 sdata->vif.type != NL80211_IFTYPE_MONITOR)
704 ieee80211_bss_info_change_notify(sdata,
707 ieee80211_check_fast_xmit_iface(sdata);
715 struct ieee80211_sub_if_data *sdata;
724 list_for_each_entry_rcu(sdata, &local->interfaces, list) {
727 if (!ieee80211_sdata_running(sdata))
730 if (rcu_access_pointer(sdata->vif.chanctx_conf) !=
734 switch (sdata->vif.type) {
739 if (!sdata->u.mgd.associated)
754 switch (sdata->smps_mode) {
757 sdata->smps_mode);
760 needed_static = sdata->needed_rx_chains;
761 needed_dynamic = sdata->needed_rx_chains;
765 needed_dynamic = sdata->needed_rx_chains;
778 sdata = rcu_dereference(local->monitor_sdata);
779 if (sdata &&
780 rcu_access_pointer(sdata->vif.chanctx_conf) == &chanctx->conf)
805 __ieee80211_vif_copy_chanctx_to_vlans(struct ieee80211_sub_if_data *sdata,
808 struct ieee80211_local *local __maybe_unused = sdata->local;
812 if (WARN_ON(sdata->vif.type != NL80211_IFTYPE_AP))
823 conf = rcu_dereference_protected(sdata->vif.chanctx_conf,
830 list_for_each_entry(vlan, &sdata->u.ap.vlans, u.vlan.list)
834 void ieee80211_vif_copy_chanctx_to_vlans(struct ieee80211_sub_if_data *sdata,
837 struct ieee80211_local *local = sdata->local;
841 __ieee80211_vif_copy_chanctx_to_vlans(sdata, clear);
846 int ieee80211_vif_unreserve_chanctx(struct ieee80211_sub_if_data *sdata)
848 struct ieee80211_chanctx *ctx = sdata->reserved_chanctx;
850 lockdep_assert_held(&sdata->local->chanctx_mtx);
855 list_del(&sdata->reserved_chanctx_list);
856 sdata->reserved_chanctx = NULL;
858 if (ieee80211_chanctx_refcount(sdata->local, ctx) == 0) {
874 ieee80211_free_chanctx(sdata->local, ctx);
881 int ieee80211_vif_reserve_chanctx(struct ieee80211_sub_if_data *sdata,
886 struct ieee80211_local *local = sdata->local;
891 curr_ctx = ieee80211_vif_get_chanctx(sdata);
968 list_add(&sdata->reserved_chanctx_list, &new_ctx->reserved_vifs);
969 sdata->reserved_chanctx = new_ctx;
970 sdata->reserved_chandef = *chandef;
971 sdata->reserved_radar_required = radar_required;
972 sdata->reserved_ready = false;
978 ieee80211_vif_chanctx_reservation_complete(struct ieee80211_sub_if_data *sdata)
980 switch (sdata->vif.type) {
985 ieee80211_queue_work(&sdata->local->hw,
986 &sdata->csa_finalize_work);
989 ieee80211_queue_work(&sdata->local->hw,
990 &sdata->u.mgd.chswitch_work);
1007 ieee80211_vif_update_chandef(struct ieee80211_sub_if_data *sdata,
1012 sdata->vif.bss_conf.chandef = *chandef;
1014 if (sdata->vif.type != NL80211_IFTYPE_AP)
1017 list_for_each_entry(vlan, &sdata->u.ap.vlans, u.vlan.list)
1022 ieee80211_vif_use_reserved_reassign(struct ieee80211_sub_if_data *sdata)
1024 struct ieee80211_local *local = sdata->local;
1034 new_ctx = sdata->reserved_chanctx;
1035 old_ctx = ieee80211_vif_get_chanctx(sdata);
1037 if (WARN_ON(!sdata->reserved_ready))
1051 &sdata->reserved_chandef);
1057 vif_chsw[0].vif = &sdata->vif;
1061 list_del(&sdata->reserved_chanctx_list);
1062 sdata->reserved_chanctx = NULL;
1073 list_move(&sdata->assigned_chanctx_list, &new_ctx->assigned_vifs);
1074 rcu_assign_pointer(sdata->vif.chanctx_conf, &new_ctx->conf);
1076 if (sdata->vif.type == NL80211_IFTYPE_AP)
1077 __ieee80211_vif_copy_chanctx_to_vlans(sdata, false);
1079 ieee80211_check_fast_xmit_iface(sdata);
1084 if (sdata->vif.bss_conf.chandef.width != sdata->reserved_chandef.width)
1087 ieee80211_vif_update_chandef(sdata, &sdata->reserved_chandef);
1094 ieee80211_bss_info_change_notify(sdata, changed);
1097 ieee80211_vif_chanctx_reservation_complete(sdata);
1102 ieee80211_vif_use_reserved_assign(struct ieee80211_sub_if_data *sdata)
1104 struct ieee80211_local *local = sdata->local;
1109 old_ctx = ieee80211_vif_get_chanctx(sdata);
1110 new_ctx = sdata->reserved_chanctx;
1112 if (WARN_ON(!sdata->reserved_ready))
1126 &sdata->reserved_chandef);
1132 list_del(&sdata->reserved_chanctx_list);
1133 sdata->reserved_chanctx = NULL;
1135 err = ieee80211_assign_vif_chanctx(sdata, new_ctx);
1144 ieee80211_vif_chanctx_reservation_complete(sdata);
1149 ieee80211_vif_has_in_place_reservation(struct ieee80211_sub_if_data *sdata)
1153 lockdep_assert_held(&sdata->local->chanctx_mtx);
1155 new_ctx = sdata->reserved_chanctx;
1156 old_ctx = ieee80211_vif_get_chanctx(sdata);
1196 struct ieee80211_sub_if_data *sdata;
1217 list_for_each_entry(sdata, &ctx->reserved_vifs,
1220 sdata))
1223 old_ctx = ieee80211_vif_get_chanctx(sdata);
1224 vif_chsw[i].vif = &sdata->vif;
1281 struct ieee80211_sub_if_data *sdata, *sdata_tmp;
1324 list_for_each_entry(sdata, &ctx->replace_ctx->assigned_vifs,
1327 if (sdata->reserved_chanctx) {
1329 if (sdata->reserved_ready)
1346 list_for_each_entry(sdata, &ctx->reserved_vifs,
1348 if (ieee80211_vif_has_in_place_reservation(sdata) &&
1349 !sdata->reserved_ready)
1352 old_ctx = ieee80211_vif_get_chanctx(sdata);
1363 if (sdata->reserved_radar_required)
1414 list_for_each_entry(sdata, &ctx->reserved_vifs,
1418 if (!ieee80211_vif_has_in_place_reservation(sdata))
1421 rcu_assign_pointer(sdata->vif.chanctx_conf, &ctx->conf);
1423 if (sdata->vif.type == NL80211_IFTYPE_AP)
1424 __ieee80211_vif_copy_chanctx_to_vlans(sdata,
1427 ieee80211_check_fast_xmit_iface(sdata);
1429 sdata->radar_required = sdata->reserved_radar_required;
1431 if (sdata->vif.bss_conf.chandef.width !=
1432 sdata->reserved_chandef.width)
1435 ieee80211_vif_update_chandef(sdata, &sdata->reserved_chandef);
1437 ieee80211_bss_info_change_notify(sdata,
1440 ieee80211_recalc_txpower(sdata, false);
1448 list_for_each_entry_safe(sdata, sdata_tmp, &ctx->reserved_vifs,
1450 if (ieee80211_vif_get_chanctx(sdata) != ctx)
1453 list_del(&sdata->reserved_chanctx_list);
1454 list_move(&sdata->assigned_chanctx_list,
1456 sdata->reserved_chanctx = NULL;
1458 ieee80211_vif_chanctx_reservation_complete(sdata);
1468 list_for_each_entry_safe(sdata, sdata_tmp, &ctx->reserved_vifs,
1471 sdata)))
1474 if (WARN_ON(sdata->reserved_chanctx != ctx))
1477 if (!sdata->reserved_ready)
1480 if (ieee80211_vif_get_chanctx(sdata))
1482 sdata);
1484 err = ieee80211_vif_use_reserved_assign(sdata);
1487 sdata_info(sdata,
1490 ieee80211_vif_unreserve_chanctx(sdata);
1492 &sdata->wdev,
1521 list_for_each_entry_safe(sdata, sdata_tmp, &ctx->reserved_vifs,
1523 ieee80211_vif_unreserve_chanctx(sdata);
1524 ieee80211_vif_chanctx_reservation_complete(sdata);
1531 static void __ieee80211_vif_release_channel(struct ieee80211_sub_if_data *sdata)
1533 struct ieee80211_local *local = sdata->local;
1540 conf = rcu_dereference_protected(sdata->vif.chanctx_conf,
1547 if (sdata->reserved_chanctx) {
1548 if (sdata->reserved_chanctx->replace_state ==
1551 sdata->reserved_chanctx) > 1)
1554 ieee80211_vif_unreserve_chanctx(sdata);
1557 ieee80211_assign_vif_chanctx(sdata, NULL);
1561 sdata->radar_required = false;
1568 int ieee80211_vif_use_channel(struct ieee80211_sub_if_data *sdata,
1572 struct ieee80211_local *local = sdata->local;
1579 WARN_ON(sdata->dev && netif_carrier_ok(sdata->dev));
1585 sdata->wdev.iftype);
1591 sdata->radar_required = ret;
1593 ret = ieee80211_check_combinations(sdata, chandef, mode,
1598 __ieee80211_vif_release_channel(sdata);
1608 ieee80211_vif_update_chandef(sdata, chandef);
1610 ret = ieee80211_assign_vif_chanctx(sdata, ctx);
1622 sdata->radar_required = false;
1628 int ieee80211_vif_use_reserved_context(struct ieee80211_sub_if_data *sdata)
1630 struct ieee80211_local *local = sdata->local;
1638 new_ctx = sdata->reserved_chanctx;
1639 old_ctx = ieee80211_vif_get_chanctx(sdata);
1648 if (WARN_ON(sdata->reserved_ready))
1651 sdata->reserved_ready = true;
1655 return ieee80211_vif_use_reserved_reassign(sdata);
1657 return ieee80211_vif_use_reserved_assign(sdata);
1662 * a) sdata is taking part in the swapping itself and is the last one
1663 * b) sdata has switched with a re-assign reservation to an existing
1667 * sdata already switched successfully. Just spill an extra warning.
1689 int ieee80211_vif_change_bandwidth(struct ieee80211_sub_if_data *sdata,
1693 struct ieee80211_local *local = sdata->local;
1699 if (!cfg80211_chandef_usable(sdata->local->hw.wiphy, chandef,
1704 if (cfg80211_chandef_identical(chandef, &sdata->vif.bss_conf.chandef)) {
1710 sdata->vif.bss_conf.chandef.width == NL80211_CHAN_WIDTH_20_NOHT) {
1715 conf = rcu_dereference_protected(sdata->vif.chanctx_conf,
1750 ieee80211_vif_update_chandef(sdata, chandef);
1761 void ieee80211_vif_release_channel(struct ieee80211_sub_if_data *sdata)
1763 WARN_ON(sdata->dev && netif_carrier_ok(sdata->dev));
1765 lockdep_assert_held(&sdata->local->mtx);
1767 mutex_lock(&sdata->local->chanctx_mtx);
1768 __ieee80211_vif_release_channel(sdata);
1769 mutex_unlock(&sdata->local->chanctx_mtx);
1772 void ieee80211_vif_vlan_copy_chanctx(struct ieee80211_sub_if_data *sdata)
1774 struct ieee80211_local *local = sdata->local;
1778 if (WARN_ON(sdata->vif.type != NL80211_IFTYPE_AP_VLAN || !sdata->bss))
1781 ap = container_of(sdata->bss, struct ieee80211_sub_if_data, u.ap);
1787 rcu_assign_pointer(sdata->vif.chanctx_conf, conf);