diff mbox series

[1/2] wireless: mac80211: Relax flags check in bw-change logic.

Message ID 20230308232421.2672247-1-greearb@candelatech.com (mailing list archive)
State Superseded
Delegated to: Johannes Berg
Headers show
Series [1/2] wireless: mac80211: Relax flags check in bw-change logic. | expand

Commit Message

Ben Greear March 8, 2023, 11:24 p.m. UTC
From: Ben Greear <greearb@candelatech.com>

A failure was seen where AP requested change to 40Mhz, and it
failed because 160Mhz and 80P80 were disabled in ifmgd->flags.

Add check for this case so that it will not fail.

Debugging logs from the failure:

sta0001: AP 90:3c:b3:6c:41:11 changed bandwidth, new config is 5180.000 MHz, width 2 (5190.000/0 MHz) ifmgd-flags: 0x3b044 eht-oper: 0000000000000000
sta0001: AP 90:3c:b3:6c:41:11 changed caps/bw in a way we can't support (0x30000/0x3b044) - disconnect
sta0001: chandef-valid: 1 bw: 2 ifmgd->flags mask: 0x33000

Signed-off-by: Ben Greear <greearb@candelatech.com>
---
 net/mac80211/mlme.c | 8 ++++++++
 1 file changed, 8 insertions(+)
diff mbox series

Patch

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 85741e8b2787..0efca23be69b 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -497,6 +497,14 @@  static int ieee80211_config_bw(struct ieee80211_link_data *link,
 	    chandef.width > NL80211_CHAN_WIDTH_20)
 		flags |= ieee80211_chandef_downgrade(&chandef);
 
+	/* Relax check for implicit disabled. */
+	if (link->u.mgd.conn_flags & IEEE80211_CONN_DISABLE_160MHZ &&
+	    chandef.width != NL80211_CHAN_WIDTH_160)
+		flags |= IEEE80211_CONN_DISABLE_160MHZ;
+	if (link->u.mgd.conn_flags & IEEE80211_CONN_DISABLE_80P80MHZ &&
+	    chandef.width != NL80211_CHAN_WIDTH_80P80)
+		flags |= IEEE80211_CONN_DISABLE_80P80MHZ;
+
 	if (cfg80211_chandef_identical(&chandef, &link->conf->chandef))
 		return 0;