diff mbox series

[BUGFIX] EHT: Relax the EHT MCS/NSS length checking

Message ID 20220510133809.1534051-1-ilan.peer@intel.com
State Changes Requested
Headers show
Series [BUGFIX] EHT: Relax the EHT MCS/NSS length checking | expand

Commit Message

Peer, Ilan May 10, 2022, 1:38 p.m. UTC
In practice if HE_PHYCAP_CHANNEL_WIDTH_SET_40MHZ_IN_2G is set
then we can stop the MCS/NSS length calculation, but continue
parsing to also handle cases that stations accidentally set it
also on 5GHz or 6GHz band.

type=bugfix
ticket=jira:WIFI-131519
fixes=I4dfaad7e9f971acd9397a5460b95faa751269a6d

Change-Id: I969cab55d670415564d6c6c3a253d3ce466cd136
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
---
 src/ap/ieee802_11_eht.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

Comments

Peer, Ilan May 11, 2022, 7:34 a.m. UTC | #1
Please ignore this one ... I'll send the right P2P fix.

Ilan.

> -----Original Message-----
> From: Peer, Ilan <ilan.peer@intel.com>
> Sent: Tuesday, May 10, 2022 16:38
> To: hostap@lists.infradead.org
> Cc: Peer, Ilan <ilan.peer@intel.com>
> Subject: [PATCH] [BUGFIX] EHT: Relax the EHT MCS/NSS length checking
> 
> In practice if HE_PHYCAP_CHANNEL_WIDTH_SET_40MHZ_IN_2G is set then
> we can stop the MCS/NSS length calculation, but continue parsing to also
> handle cases that stations accidentally set it also on 5GHz or 6GHz band.
> 
> type=bugfix
> ticket=jira:WIFI-131519
> fixes=I4dfaad7e9f971acd9397a5460b95faa751269a6d
> 
> Change-Id: I969cab55d670415564d6c6c3a253d3ce466cd136
> Signed-off-by: Ilan Peer <ilan.peer@intel.com>
> ---
>  src/ap/ieee802_11_eht.c | 17 +++++++++--------
>  1 file changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/src/ap/ieee802_11_eht.c b/src/ap/ieee802_11_eht.c index
> 32660e2d92..df26980a42 100644
> --- a/src/ap/ieee802_11_eht.c
> +++ b/src/ap/ieee802_11_eht.c
> @@ -56,13 +56,15 @@ static u8 ieee80211_eht_mcs_size(u8 he_phy_cap0,
> u8 eht_phy_cap0, u8 *mcs_set)  {
>  	u8 count = 0, mcs = 0;
> 
> -	if (he_phy_cap0 &
> HE_PHYCAP_CHANNEL_WIDTH_SET_40MHZ_IN_2G) {
> -		count = 3;
> -		mcs |= BIT(1);
> -		goto out;
> -	}
> -
> -	if (he_phy_cap0 &
> HE_PHYCAP_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G) {
> +	/*
> +	 * In practice if HE_PHYCAP_CHANNEL_WIDTH_SET_40MHZ_IN_2G is
> set then we
> +	 * can stop the MCS/NSS length calculation, but continue parsing to
> also
> +	 * handle the cases that a station accidentally set it also on 5GHz or
> +	 * 6GHz band.
> +	 */
> +	if (he_phy_cap0 &
> +	    (HE_PHYCAP_CHANNEL_WIDTH_SET_40MHZ_IN_2G |
> +	     HE_PHYCAP_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G)) {
>  		mcs |= BIT(1);
>  		count += 3;
>  	}
> @@ -82,7 +84,6 @@ static u8 ieee80211_eht_mcs_size(u8 he_phy_cap0, u8
> eht_phy_cap0, u8 *mcs_set)
>  		mcs = BIT(0);
>  	}
> 
> -out:
>  	if (mcs_set)
>  		*mcs_set = mcs;
> 
> --
> 2.25.1
diff mbox series

Patch

diff --git a/src/ap/ieee802_11_eht.c b/src/ap/ieee802_11_eht.c
index 32660e2d92..df26980a42 100644
--- a/src/ap/ieee802_11_eht.c
+++ b/src/ap/ieee802_11_eht.c
@@ -56,13 +56,15 @@  static u8 ieee80211_eht_mcs_size(u8 he_phy_cap0, u8 eht_phy_cap0, u8 *mcs_set)
 {
 	u8 count = 0, mcs = 0;
 
-	if (he_phy_cap0 & HE_PHYCAP_CHANNEL_WIDTH_SET_40MHZ_IN_2G) {
-		count = 3;
-		mcs |= BIT(1);
-		goto out;
-	}
-
-	if (he_phy_cap0 & HE_PHYCAP_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G) {
+	/*
+	 * In practice if HE_PHYCAP_CHANNEL_WIDTH_SET_40MHZ_IN_2G is set then we
+	 * can stop the MCS/NSS length calculation, but continue parsing to also
+	 * handle the cases that a station accidentally set it also on 5GHz or
+	 * 6GHz band.
+	 */
+	if (he_phy_cap0 &
+	    (HE_PHYCAP_CHANNEL_WIDTH_SET_40MHZ_IN_2G |
+	     HE_PHYCAP_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G)) {
 		mcs |= BIT(1);
 		count += 3;
 	}
@@ -82,7 +84,6 @@  static u8 ieee80211_eht_mcs_size(u8 he_phy_cap0, u8 eht_phy_cap0, u8 *mcs_set)
 		mcs = BIT(0);
 	}
 
-out:
 	if (mcs_set)
 		*mcs_set = mcs;