]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
Revert "wifi: mac80211: move radar detect work to sdata"
authorAditya Kumar Singh <quic_adisi@quicinc.com>
Fri, 6 Sep 2024 06:44:19 +0000 (12:14 +0530)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 6 Sep 2024 11:01:04 +0000 (13:01 +0200)
This reverts commit ce9e660ef32e ("wifi: mac80211: move radar detect work to sdata").

To enable radar detection with MLO, it’s essential to handle it on a
per-link basis. This is because when using MLO, multiple links may already
be active and beaconing. In this scenario, another link should be able to
initiate a radar detection. Also, if underlying links are associated with
different hardware devices but grouped together for MLO, they could
potentially start radar detection simultaneously. Therefore, it makes
sense to manage radar detection settings separately for each link by moving
them back to a per-link data structure.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
Link: https://patch.msgid.link/20240906064426.2101315-2-quic_adisi@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/cfg.c
net/mac80211/ieee80211_i.h
net/mac80211/iface.c
net/mac80211/link.c
net/mac80211/mlme.c
net/mac80211/util.c

index b02b84ce2130761354829ee17b5ea9d85f8d1f81..184e9d54064b6091ac43f5be370c1044385c916e 100644 (file)
@@ -1664,7 +1664,7 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev,
 
        if (sdata->wdev.cac_started) {
                chandef = link_conf->chanreq.oper;
-               wiphy_delayed_work_cancel(wiphy, &sdata->dfs_cac_timer_work);
+               wiphy_delayed_work_cancel(wiphy, &link->dfs_cac_timer_work);
                cfg80211_cac_event(sdata->dev, &chandef,
                                   NL80211_RADAR_CAC_ABORTED,
                                   GFP_KERNEL);
@@ -3485,7 +3485,7 @@ static int ieee80211_start_radar_detection(struct wiphy *wiphy,
        if (err)
                goto out_unlock;
 
-       wiphy_delayed_work_queue(wiphy, &sdata->dfs_cac_timer_work,
+       wiphy_delayed_work_queue(wiphy, &sdata->deflink.dfs_cac_timer_work,
                                 msecs_to_jiffies(cac_time_ms));
 
  out_unlock:
@@ -3502,7 +3502,7 @@ static void ieee80211_end_cac(struct wiphy *wiphy,
 
        list_for_each_entry(sdata, &local->interfaces, list) {
                wiphy_delayed_work_cancel(wiphy,
-                                         &sdata->dfs_cac_timer_work);
+                                         &sdata->deflink.dfs_cac_timer_work);
 
                if (sdata->wdev.cac_started) {
                        ieee80211_link_release_channel(&sdata->deflink);
index 6305c4e9cca176118e60539ce78c471112807162..9c2c826ef90cee488d2c9171e8be8bb59a725593 100644 (file)
@@ -1067,6 +1067,7 @@ struct ieee80211_link_data {
        int ap_power_level; /* in dBm */
 
        bool radar_required;
+       struct wiphy_delayed_work dfs_cac_timer_work;
 
        union {
                struct ieee80211_link_data_managed mgd;
@@ -1165,8 +1166,6 @@ struct ieee80211_sub_if_data {
        struct ieee80211_link_data deflink;
        struct ieee80211_link_data __rcu *link[IEEE80211_MLD_MAX_NUM_LINKS];
 
-       struct wiphy_delayed_work dfs_cac_timer_work;
-
        /* for ieee80211_set_active_links_async() */
        struct wiphy_work activate_links_work;
        u16 desired_active_links;
index b4ad66af3af31d1bfd5f27d1633779779d08236d..7bb71ac52277387eb4dac967c66765116a411b87 100644 (file)
@@ -550,7 +550,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, bool going_do
        wiphy_work_cancel(local->hw.wiphy,
                          &sdata->deflink.color_change_finalize_work);
        wiphy_delayed_work_cancel(local->hw.wiphy,
-                                 &sdata->dfs_cac_timer_work);
+                                 &sdata->deflink.dfs_cac_timer_work);
 
        if (sdata->wdev.cac_started) {
                chandef = sdata->vif.bss_conf.chanreq.oper;
@@ -1729,8 +1729,6 @@ static void ieee80211_setup_sdata(struct ieee80211_sub_if_data *sdata,
        wiphy_work_init(&sdata->work, ieee80211_iface_work);
        wiphy_work_init(&sdata->activate_links_work,
                        ieee80211_activate_links_work);
-       wiphy_delayed_work_init(&sdata->dfs_cac_timer_work,
-                               ieee80211_dfs_cac_timer_work);
 
        switch (type) {
        case NL80211_IFTYPE_P2P_GO:
index 1a211b8d40573a2d3b15b46c2dc7ef4ce1f48d40..b4378969cbf19a6d387ca239843bfb801be16b9c 100644 (file)
@@ -45,6 +45,8 @@ void ieee80211_link_init(struct ieee80211_sub_if_data *sdata,
                          ieee80211_color_collision_detection_work);
        INIT_LIST_HEAD(&link->assigned_chanctx_list);
        INIT_LIST_HEAD(&link->reserved_chanctx_list);
+       wiphy_delayed_work_init(&link->dfs_cac_timer_work,
+                               ieee80211_dfs_cac_timer_work);
 
        if (!deflink) {
                switch (sdata->vif.type) {
index 746f51ac03068b895d2b62a31493c3f05c1e1ee6..85789c184949cddbd257f028e7bb8fc251767328 100644 (file)
@@ -3031,15 +3031,16 @@ void ieee80211_dynamic_ps_timer(struct timer_list *t)
 
 void ieee80211_dfs_cac_timer_work(struct wiphy *wiphy, struct wiphy_work *work)
 {
-       struct ieee80211_sub_if_data *sdata =
-               container_of(work, struct ieee80211_sub_if_data,
+       struct ieee80211_link_data *link =
+               container_of(work, struct ieee80211_link_data,
                             dfs_cac_timer_work.work);
-       struct cfg80211_chan_def chandef = sdata->vif.bss_conf.chanreq.oper;
+       struct cfg80211_chan_def chandef = link->conf->chanreq.oper;
+       struct ieee80211_sub_if_data *sdata = link->sdata;
 
        lockdep_assert_wiphy(sdata->local->hw.wiphy);
 
        if (sdata->wdev.cac_started) {
-               ieee80211_link_release_channel(&sdata->deflink);
+               ieee80211_link_release_channel(link);
                cfg80211_cac_event(sdata->dev, &chandef,
                                   NL80211_RADAR_CAC_FINISHED,
                                   GFP_KERNEL);
index 3b9468dc30290583e32351446487e8aef9c859f2..071cbb7929d9056c9e5c0ce62c8455fca3be7234 100644 (file)
@@ -3476,7 +3476,7 @@ void ieee80211_dfs_cac_cancel(struct ieee80211_local *local)
 
        list_for_each_entry(sdata, &local->interfaces, list) {
                wiphy_delayed_work_cancel(local->hw.wiphy,
-                                         &sdata->dfs_cac_timer_work);
+                                         &sdata->deflink.dfs_cac_timer_work);
 
                if (sdata->wdev.cac_started) {
                        chandef = sdata->vif.bss_conf.chanreq.oper;