]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: mac80211: extend beacon monitoring for MLO
authorMaharaja Kennadyrajan <maharaja.kennadyrajan@oss.qualcomm.com>
Fri, 18 Jul 2025 06:08:36 +0000 (11:38 +0530)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 18 Jul 2025 12:08:12 +0000 (14:08 +0200)
Currently, reset beacon monitor (ieee80211_sta_reset_beacon_monitor())
timer is handled only for non-AP non-MLD STA and do not support non-AP MLD
STA. When the beacon loss occurs in non-AP MLD STA with the current
implementation, it is treated as a single link and the timer will reset
based on the timeout of the deflink, without checking all the links.

Check the CSA flags for all the links in the MLO and decide whether to
schedule the work queue for beacon loss. If any of the links has CSA
active, then beacon loss work is not scheduled.

Also, call the functions ieee80211_sta_reset_beacon_monitor() and
ieee80211_sta_reset_conn_monitor() from ieee80211_csa_switch_work() only
when all the links are CSA active.

Signed-off-by: Maharaja Kennadyrajan <maharaja.kennadyrajan@oss.qualcomm.com>
Link: https://patch.msgid.link/20250718060837.59371-4-maharaja.kennadyrajan@oss.qualcomm.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/mlme.c

index 5298dbbb5341cd2443e5b6824663e268d3ba6e32..86b69bd94b4c744bdfe9cdb8cca83a963cfa4d93 100644 (file)
@@ -2505,6 +2505,21 @@ static void ieee80211_csa_switch_work(struct wiphy *wiphy,
                }
        }
 
+       /*
+        * It is not necessary to reset these timers if any link does not
+        * have an active CSA and that link still receives the beacons
+        * when other links have active CSA.
+        */
+       for_each_link_data(sdata, link) {
+               if (!link->conf->csa_active)
+                       return;
+       }
+
+       /*
+        * Reset the beacon monitor and connection monitor timers when CSA
+        * is active for all links in MLO when channel switch occurs in all
+        * the links.
+        */
        ieee80211_sta_reset_beacon_monitor(sdata);
        ieee80211_sta_reset_conn_monitor(sdata);
 }
@@ -8473,16 +8488,32 @@ void ieee80211_sta_work(struct ieee80211_sub_if_data *sdata)
        }
 }
 
+static bool
+ieee80211_is_csa_in_progress(struct ieee80211_sub_if_data *sdata)
+{
+       /*
+        * In MLO, check the CSA flags 'active' and 'waiting_bcn' for all
+        * the links.
+        */
+       struct ieee80211_link_data *link;
+
+       guard(rcu)();
+
+       for_each_link_data_rcu(sdata, link) {
+               if (!(link->conf->csa_active &&
+                     !link->u.mgd.csa.waiting_bcn))
+                       return false;
+       }
+
+       return true;
+}
+
 static void ieee80211_sta_bcn_mon_timer(struct timer_list *t)
 {
        struct ieee80211_sub_if_data *sdata =
                timer_container_of(sdata, t, u.mgd.bcn_mon_timer);
 
-       if (WARN_ON(ieee80211_vif_is_mld(&sdata->vif)))
-               return;
-
-       if (sdata->vif.bss_conf.csa_active &&
-           !sdata->deflink.u.mgd.csa.waiting_bcn)
+       if (ieee80211_is_csa_in_progress(sdata))
                return;
 
        if (sdata->vif.driver_flags & IEEE80211_VIF_BEACON_FILTER)