This patch series introduces improvements in the macro definitions and extending support for Multi-Link Operation (MLO) in beacon and connection monitoring logic. The first two patches address macro usage in link iteration: * Patch 1 cleans up the for_each_link_data() macro to avoid variable scoping issues, improving compatibility with static analyzers and preventing potential redefinition errors. * Patch 2 introduces a new macro, for_each_link_data_rcu(), which uses rcu_dereference() instead of sdata_dereference(), making it safe for use in atomic and RCU read-side contexts such as the RX path. The remaining patches extend the beacon and connection monitoring logic to support non-AP MLD STAs. Currently, reset beacon monitor (ieee80211_sta_reset_beacon_monitor()) and reset connection monitor timers (ieee80211_sta_reset_conn_monitor()) are handled only for non-AP non-MLD STA and do not support non-AP MLD STA. When the beacon loss/connection loss occurs in non-AP MLD STA with the current implementation, it is treated as a single link and the timers are 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 in ieee80211_sta_reset_beacon_monitor(). In ieee80211_sta_reset_conn_monitor(), the CSA flags of all links are checked. The connection monitoring logic proceeds only if none of the links have CSA active. The timeout is determined based on the link that will expire last among all links. If at least one link has not timed out, the timer is updated accordingly. The connection loss work is scheduled only when all links have timed out. 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. Since the beacon and connection monitoring logic now supports MLO, remove the MLO-related WARN_ON() checks in these paths. v3: Addressed Johannes's comment by adding a new macro for link iteration. v2: Addressed Johannes's comments. * Changed the comments special style. * Blank link after guard(rcu). * Changed the helper function name and return type in the 2nd patch. Aditya Kumar Singh (1): wifi: mac80211: fix macro scoping in for_each_link_data Maharaja Kennadyrajan (3): wifi: mac80211: Add link iteration macro for link data with rcu_dereference wifi: mac80211: extend beacon monitoring for MLO wifi: mac80211: extend connection monitoring for MLO net/mac80211/ieee80211_i.h | 17 +++++- net/mac80211/mlme.c | 117 ++++++++++++++++++++++++++++--------- 2 files changed, 104 insertions(+), 30 deletions(-) base-commit: af2d6148d2a159e1a0862bce5a2c88c1618a2b27 -- 2.17.1