2023-03-08 23:24:30

by Ben Greear

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

From: Ben Greear <[email protected]>

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 <[email protected]>
---
net/mac80211/mlme.c | 8 ++++++++
1 file changed, 8 insertions(+)

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;

--
2.39.1



2023-03-08 23:24:34

by Ben Greear

[permalink] [raw]
Subject: [PATCH 2/2] wireless: mac80211: fix ath10k wave-2 in 80mhz mode in config_bw logic.

From: Ben Greear <[email protected]>

It was complaining about the 'DISABLE_HE' flag mismatch,
so ensure that if ifmgd has DISABLE_HE set, then 'flags'
also will have that flag set.

Signed-off-by: Ben Greear <[email protected]>
---
net/mac80211/mlme.c | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 0efca23be69b..52c8f2770757 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -505,6 +505,10 @@ static int ieee80211_config_bw(struct ieee80211_link_data *link,
chandef.width != NL80211_CHAN_WIDTH_80P80)
flags |= IEEE80211_CONN_DISABLE_80P80MHZ;

+ /* if ifmgd has HE disabled, then we cannot re-enable that here. */
+ if (link->u.mgd.conn_flags & IEEE80211_STA_DISABLE_HE)
+ flags |= IEEE80211_STA_DISABLE_HE;
+
if (cfg80211_chandef_identical(&chandef, &link->conf->chandef))
return 0;

--
2.39.1


2023-03-08 23:37:19

by Ben Greear

[permalink] [raw]
Subject: Re: [PATCH 2/2] wireless: mac80211: fix ath10k wave-2 in 80mhz mode in config_bw logic.

Please ignore this one, I sent the wrong patch.

On 3/8/23 15:24, [email protected] wrote:
> From: Ben Greear <[email protected]>
>
> It was complaining about the 'DISABLE_HE' flag mismatch,
> so ensure that if ifmgd has DISABLE_HE set, then 'flags'
> also will have that flag set.
>
> Signed-off-by: Ben Greear <[email protected]>
> ---
> net/mac80211/mlme.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
> index 0efca23be69b..52c8f2770757 100644
> --- a/net/mac80211/mlme.c
> +++ b/net/mac80211/mlme.c
> @@ -505,6 +505,10 @@ static int ieee80211_config_bw(struct ieee80211_link_data *link,
> chandef.width != NL80211_CHAN_WIDTH_80P80)
> flags |= IEEE80211_CONN_DISABLE_80P80MHZ;
>
> + /* if ifmgd has HE disabled, then we cannot re-enable that here. */
> + if (link->u.mgd.conn_flags & IEEE80211_STA_DISABLE_HE)
> + flags |= IEEE80211_STA_DISABLE_HE;
> +
> if (cfg80211_chandef_identical(&chandef, &link->conf->chandef))
> return 0;
>

--
Ben Greear <[email protected]>
Candela Technologies Inc http://www.candelatech.com