All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wen Gong <wgong@codeaurora.org>
To: Shay Bar <shay.bar@celeno.com>
Cc: Johannes Berg <johannes@sipsolutions.net>,
	linux-wireless@vger.kernel.org, aviad.brikman@celeno.com,
	eliav.farber@celeno.com, linux-wireless-owner@vger.kernel.org,
	ath11k@lists.infradead.org
Subject: Re: [PATCH] wireless: fix wrong 160/80+80 MHz setting
Date: Wed, 30 Dec 2020 18:57:49 +0800	[thread overview]
Message-ID: <34893f267fa37b43d21c19d4c08c090e@codeaurora.org> (raw)
In-Reply-To: <20200826143139.25976-1-shay.bar@celeno.com>

On 2020-08-26 22:31, Shay Bar wrote:
> Fix cfg80211_chandef_usable():
> consider IEEE80211_VHT_CAP_EXT_NSS_BW when verifying 160/80+80 MHz.
> 
When station with below 2 bit and connect to a 160MHZ 11ac mode AP, it 
will try to use 160Mhz width after this patch,
but it does not support 160M in fact according spec of IEEE 802.11
.... .... .... .... .... .... .... 00.. = Supported Channel Width Set: 
Neither 160MHz nor 80+80 supported (0x0)
01.. .... .... .... .... .... .... .... = Extended NSS BW Support: 0x1

refer to spec of IEEE 802.11.
Table 9-250—Setting of the Supported Channel Width Set subfield and 
Extended NSS BW Support subfield at a STA transmitting the VHT 
Capabilities Information field
value of the 160Mhz is 1/2 in the table for upper configure.
NOTE 2—1/2× or 3/4× Max VHT NSS support might end up being 0, indicating 
no support.

> Based on:
> "Table 9-272 — Setting of the Supported Channel Width Set subfield and
> Extended NSS BW
> Support subfield at a STA transmitting the VHT Capabilities Information 
> field"
> From "Draft P802.11REVmd_D3.0.pdf"
> 
> Signed-off-by: Aviad Brikman <aviad.brikman@celeno.com>
> Signed-off-by: Shay Bar <shay.bar@celeno.com>
> ---
>  net/wireless/chan.c | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/net/wireless/chan.c b/net/wireless/chan.c
> index 90f0f82cd9ca..a51d11d3be33 100644
> --- a/net/wireless/chan.c
> +++ b/net/wireless/chan.c
> @@ -912,6 +912,7 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy,
>         struct ieee80211_sta_vht_cap *vht_cap;
>         struct ieee80211_edmg *edmg_cap;
>         u32 width, control_freq, cap;
> +       bool support_80_80 = false;
> 
>         if (WARN_ON(!cfg80211_chandef_valid(chandef)))
>                 return false;
> @@ -979,9 +980,16 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy,
>                         return false;
>                 break;
>         case NL80211_CHAN_WIDTH_80P80:
> -               cap = vht_cap->cap & 
> IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK;
> +               cap = vht_cap->cap;
> +               support_80_80 =
> +                       ((cap &
> +                         
> IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ) ||
> +                       (cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ 
> &&
> +                        cap & IEEE80211_VHT_CAP_EXT_NSS_BW_MASK) ||
> +                       ((cap & IEEE80211_VHT_CAP_EXT_NSS_BW_MASK) >>
> +                                   IEEE80211_VHT_CAP_EXT_NSS_BW_SHIFT 
> > 1));
>                 if (chandef->chan->band != NL80211_BAND_6GHZ &&
> -                   cap != 
> IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ)
> +                   !support_80_80)
>                         return false;
>                 /* fall through */
>         case NL80211_CHAN_WIDTH_80:
> @@ -1001,7 +1009,8 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy,
>                         return false;
>                 cap = vht_cap->cap & 
> IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK;
>                 if (cap != IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ &&
> -                   cap != 
> IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ)
> +                   cap != 
> IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ &&
> +                   !(vht_cap->cap & 
> IEEE80211_VHT_CAP_EXT_NSS_BW_MASK))
>                         return false;
>                 break;
>         default:
> --
> 2.17.1
> 
> ________________________________
> The information transmitted is intended only for the person or entity
> to which it is addressed and may contain confidential and/or
> privileged material. Any retransmission, dissemination, copying or
> other use of, or taking of any action in reliance upon this
> information is prohibited. If you received this in error, please
> contact the sender and delete the material from any computer. Nothing
> contained herein shall be deemed as a representation, warranty or a
> commitment by Celeno. No warranties are expressed or implied,
> including, but not limited to, any implied warranties of
> non-infringement, merchantability and fitness for a particular
> purpose.
> ________________________________

WARNING: multiple messages have this Message-ID (diff)
From: Wen Gong <wgong@codeaurora.org>
To: Shay Bar <shay.bar@celeno.com>
Cc: linux-wireless-owner@vger.kernel.org,
	linux-wireless@vger.kernel.org, aviad.brikman@celeno.com,
	Johannes Berg <johannes@sipsolutions.net>,
	eliav.farber@celeno.com, ath11k@lists.infradead.org
Subject: Re: [PATCH] wireless: fix wrong 160/80+80 MHz setting
Date: Wed, 30 Dec 2020 18:57:49 +0800	[thread overview]
Message-ID: <34893f267fa37b43d21c19d4c08c090e@codeaurora.org> (raw)
In-Reply-To: <20200826143139.25976-1-shay.bar@celeno.com>

On 2020-08-26 22:31, Shay Bar wrote:
> Fix cfg80211_chandef_usable():
> consider IEEE80211_VHT_CAP_EXT_NSS_BW when verifying 160/80+80 MHz.
> 
When station with below 2 bit and connect to a 160MHZ 11ac mode AP, it 
will try to use 160Mhz width after this patch,
but it does not support 160M in fact according spec of IEEE 802.11
.... .... .... .... .... .... .... 00.. = Supported Channel Width Set: 
Neither 160MHz nor 80+80 supported (0x0)
01.. .... .... .... .... .... .... .... = Extended NSS BW Support: 0x1

refer to spec of IEEE 802.11.
Table 9-250—Setting of the Supported Channel Width Set subfield and 
Extended NSS BW Support subfield at a STA transmitting the VHT 
Capabilities Information field
value of the 160Mhz is 1/2 in the table for upper configure.
NOTE 2—1/2× or 3/4× Max VHT NSS support might end up being 0, indicating 
no support.

> Based on:
> "Table 9-272 — Setting of the Supported Channel Width Set subfield and
> Extended NSS BW
> Support subfield at a STA transmitting the VHT Capabilities Information 
> field"
> From "Draft P802.11REVmd_D3.0.pdf"
> 
> Signed-off-by: Aviad Brikman <aviad.brikman@celeno.com>
> Signed-off-by: Shay Bar <shay.bar@celeno.com>
> ---
>  net/wireless/chan.c | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/net/wireless/chan.c b/net/wireless/chan.c
> index 90f0f82cd9ca..a51d11d3be33 100644
> --- a/net/wireless/chan.c
> +++ b/net/wireless/chan.c
> @@ -912,6 +912,7 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy,
>         struct ieee80211_sta_vht_cap *vht_cap;
>         struct ieee80211_edmg *edmg_cap;
>         u32 width, control_freq, cap;
> +       bool support_80_80 = false;
> 
>         if (WARN_ON(!cfg80211_chandef_valid(chandef)))
>                 return false;
> @@ -979,9 +980,16 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy,
>                         return false;
>                 break;
>         case NL80211_CHAN_WIDTH_80P80:
> -               cap = vht_cap->cap & 
> IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK;
> +               cap = vht_cap->cap;
> +               support_80_80 =
> +                       ((cap &
> +                         
> IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ) ||
> +                       (cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ 
> &&
> +                        cap & IEEE80211_VHT_CAP_EXT_NSS_BW_MASK) ||
> +                       ((cap & IEEE80211_VHT_CAP_EXT_NSS_BW_MASK) >>
> +                                   IEEE80211_VHT_CAP_EXT_NSS_BW_SHIFT 
> > 1));
>                 if (chandef->chan->band != NL80211_BAND_6GHZ &&
> -                   cap != 
> IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ)
> +                   !support_80_80)
>                         return false;
>                 /* fall through */
>         case NL80211_CHAN_WIDTH_80:
> @@ -1001,7 +1009,8 @@ bool cfg80211_chandef_usable(struct wiphy *wiphy,
>                         return false;
>                 cap = vht_cap->cap & 
> IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK;
>                 if (cap != IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ &&
> -                   cap != 
> IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ)
> +                   cap != 
> IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ &&
> +                   !(vht_cap->cap & 
> IEEE80211_VHT_CAP_EXT_NSS_BW_MASK))
>                         return false;
>                 break;
>         default:
> --
> 2.17.1
> 
> ________________________________
> The information transmitted is intended only for the person or entity
> to which it is addressed and may contain confidential and/or
> privileged material. Any retransmission, dissemination, copying or
> other use of, or taking of any action in reliance upon this
> information is prohibited. If you received this in error, please
> contact the sender and delete the material from any computer. Nothing
> contained herein shall be deemed as a representation, warranty or a
> commitment by Celeno. No warranties are expressed or implied,
> including, but not limited to, any implied warranties of
> non-infringement, merchantability and fitness for a particular
> purpose.
> ________________________________

-- 
ath11k mailing list
ath11k@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/ath11k

  reply	other threads:[~2020-12-30 10:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-26 14:31 [PATCH] wireless: fix wrong 160/80+80 MHz setting Shay Bar
2020-12-30 10:57 ` Wen Gong [this message]
2020-12-30 10:57   ` Wen Gong
2020-12-30 15:02   ` Shay Bar
2020-12-30 15:02     ` Shay Bar
2021-05-19  7:23 ` Wen Gong
2021-05-19  7:23   ` Wen Gong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=34893f267fa37b43d21c19d4c08c090e@codeaurora.org \
    --to=wgong@codeaurora.org \
    --cc=ath11k@lists.infradead.org \
    --cc=aviad.brikman@celeno.com \
    --cc=eliav.farber@celeno.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless-owner@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=shay.bar@celeno.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.