diff mbox series

[v2,3/9] wifi: nl80211: allow CAC while other links are beaconing during MLO

Message ID 20240626045216.3754013-4-quic_adisi@quicinc.com (mailing list archive)
State Changes Requested
Delegated to: Johannes Berg
Headers show
Series wifi: cfg80211/mac80211: add DFS support for MLO | expand

Commit Message

Aditya Kumar Singh June 26, 2024, 4:52 a.m. UTC
Currently if any of the link is beaconing, CAC can not be started.

However, with MLO, it is possible that interface is beaconing already on a
link that did not require CAC, but now another link is being started that
does require CAC. Hence, same check does not apply to MLO.

Add changes to check the link under consideration is beaconing or not in
case of MLO.

Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
---
 net/wireless/nl80211.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

Comments

Johannes Berg June 26, 2024, 12:25 p.m. UTC | #1
On Wed, 2024-06-26 at 10:22 +0530, Aditya Kumar Singh wrote:
> Currently if any of the link is beaconing, CAC can not be started.
> 
> However, with MLO, it is possible that interface is beaconing already on a
> link that did not require CAC, but now another link is being started that
> does require CAC. Hence, same check does not apply to MLO.
> 
> Add changes to check the link under consideration is beaconing or not in
> case of MLO.

Also this really doesn't even do what it says, since it just checks link
0 ... I think some reordering here would be better.

I'm also not sure it all needs to be in this many patches? Might be
easier to have fewer, and put e.g. patch 6 first since it's just trivial
prep.

johannes
Aditya Kumar Singh June 27, 2024, 3:47 a.m. UTC | #2
On 6/26/24 17:55, Johannes Berg wrote:
> On Wed, 2024-06-26 at 10:22 +0530, Aditya Kumar Singh wrote:
>> Currently if any of the link is beaconing, CAC can not be started.
>>
>> However, with MLO, it is possible that interface is beaconing already on a
>> link that did not require CAC, but now another link is being started that
>> does require CAC. Hence, same check does not apply to MLO.
>>
>> Add changes to check the link under consideration is beaconing or not in
>> case of MLO.
> 
> Also this really doesn't even do what it says, since it just checks link
> 0 ... I think some reordering here would be better.
> 
> I'm also not sure it all needs to be in this many patches? Might be
> easier to have fewer, and put e.g. patch 6 first since it's just trivial
> prep.
> 

Sure will do.
diff mbox series

Patch

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index b44332dc52be..7420a966997f 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -10025,7 +10025,20 @@  static int nl80211_start_radar_detection(struct sk_buff *skb,
 		goto unlock;
 	}
 
-	if (cfg80211_beaconing_iface_active(wdev) || wdev->links[0].cac_started) {
+	if (cfg80211_beaconing_iface_active(wdev)) {
+		/* During MLO other link(s) can beacon, only the current link
+		 * can not already beacon
+		 */
+		if (wdev->valid_links &&
+		    !wdev->links[0].ap.beacon_interval) {
+			/* nothing */
+		} else {
+			err = -EBUSY;
+			goto unlock;
+		}
+	}
+
+	if (wdev->links[0].cac_started) {
 		err = -EBUSY;
 		goto unlock;
 	}