diff mbox series

[v2,07/23] wifi: wireless: correct validation 6G Band for primary channel

Message ID 20230301115906.314faf725255.I5e27251ac558297553b590d3917a7b6d1aae0e74@changeid (mailing list archive)
State Accepted
Delegated to: Johannes Berg
Headers show
Series cfg80211/mac80211 patches from our internal tree 2023-02-21 | expand

Commit Message

Greenman, Gregory March 1, 2023, 10:09 a.m. UTC
From: Mordechay Goodstein <mordechay.goodstein@intel.com>

Current check that beacon primary channel is in the range of 80Mhz
(abs < 80) is invalid for EHT 320Mhz due to 6G DUP beacon means that
AP transmits on all the sub 20Mhz channels the beacon.

9.4.2.249 HE Operation element - ... AP transmits Beacon frames in
non-HT duplicate PPDU with a TXVECTOR parameter CH_BANDWIDTH value
that is up to the BSS bandwidth.

So in case of 320Mhz the DUP beacon can be in upper 160 for primary
channel in the lower 160 giving possibly a absolute range of over
80Mhz.

Also this check is redundant all together, if AP has a wrong primary
channel in the beacon it's a fluty AP, and we would fail in next
steps to connect.

Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
---
 net/wireless/scan.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

Comments

Wen Gong March 2, 2023, 9:31 a.m. UTC | #1
On 3/1/2023 6:09 PM, gregory.greenman@intel.com wrote:
...
>   	 */
> -	if (channel->band == NL80211_BAND_6GHZ &&
> -	    (freq == channel->center_freq ||
> -	     abs(freq - channel->center_freq) > 80))
> +	if (freq == channel->center_freq)
>   		return channel;
>   
freq is KHz, channel->center_freq is MHz, so should change to if (freq / 
1000 == channel->center_freq)?
>   	alt_channel = ieee80211_get_channel_khz(wiphy, freq);
>   	if (!alt_channel) {
> -		if (channel->band == NL80211_BAND_2GHZ) {
> +		if (channel->band == NL80211_BAND_2GHZ ||
> +		    channel->band == NL80211_BAND_60GHZ) {

it should be NL80211_BAND_6GHZ, NOT 60GHZ?

...
Jeff Johnson March 2, 2023, 8:43 p.m. UTC | #2
On 3/1/2023 2:09 AM, gregory.greenman@intel.com wrote:
> From: Mordechay Goodstein <mordechay.goodstein@intel.com>
> 
> Current check that beacon primary channel is in the range of 80Mhz
> (abs < 80) is invalid for EHT 320Mhz due to 6G DUP beacon means that

s/Mhz/MHz/g

also suggest separating the magnitude from the units to align with SI 
nomenclature.

> AP transmits on all the sub 20Mhz channels the beacon.
> 
> 9.4.2.249 HE Operation element - ... AP transmits Beacon frames in
> non-HT duplicate PPDU with a TXVECTOR parameter CH_BANDWIDTH value
> that is up to the BSS bandwidth.
> 
> So in case of 320Mhz the DUP beacon can be in upper 160 for primary
> channel in the lower 160 giving possibly a absolute range of over

s/a absolute/an absolute/

> 80Mhz.
> 
> Also this check is redundant all together, if AP has a wrong primary
> channel in the beacon it's a fluty AP, and we would fail in next
> steps to connect.
> 
> Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
> ---
>   net/wireless/scan.c | 14 ++++++--------
>   1 file changed, 6 insertions(+), 8 deletions(-)
> 
> diff --git a/net/wireless/scan.c b/net/wireless/scan.c
> index 72e9af6158ef..0cdfbb104b80 100644
> --- a/net/wireless/scan.c
> +++ b/net/wireless/scan.c
> @@ -1885,23 +1885,21 @@ cfg80211_get_bss_channel(struct wiphy *wiphy, const u8 *ie, size_t ielen,
>   
>   	freq = ieee80211_channel_to_freq_khz(channel_number, channel->band);
>   
> -	/*
> -	 * In 6GHz, duplicated beacon indication is relevant for
> -	 * beacons only.
> +	/* Frame info (beacon/prob res) is the same as resieved channel, no need

s/resieved/received/

> +	 * for forther process.

s/forther/further/

>   	 */
> -	if (channel->band == NL80211_BAND_6GHZ &&
> -	    (freq == channel->center_freq ||
> -	     abs(freq - channel->center_freq) > 80))
> +	if (freq == channel->center_freq)
>   		return channel;
>   
>   	alt_channel = ieee80211_get_channel_khz(wiphy, freq);
>   	if (!alt_channel) {
> -		if (channel->band == NL80211_BAND_2GHZ) {
> +		if (channel->band == NL80211_BAND_2GHZ ||
> +		    channel->band == NL80211_BAND_60GHZ) {
>   			/*
>   			 * Better not allow unexpected channels when that could
>   			 * be going beyond the 1-11 range (e.g., discovering
>   			 * BSS on channel 12 when radio is configured for
> -			 * channel 11.
> +			 * channel 11) or beyond the 6G channel range.

both in subject and here can we change 6G to 6 GHz to avoid confusion 
with cellular use of "6G" and potentially WFA use of "Wi-Fi 6" where 6 
is a generation and not a frequency?


>   			 */
>   			return NULL;
>   		}
diff mbox series

Patch

diff --git a/net/wireless/scan.c b/net/wireless/scan.c
index 72e9af6158ef..0cdfbb104b80 100644
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
@@ -1885,23 +1885,21 @@  cfg80211_get_bss_channel(struct wiphy *wiphy, const u8 *ie, size_t ielen,
 
 	freq = ieee80211_channel_to_freq_khz(channel_number, channel->band);
 
-	/*
-	 * In 6GHz, duplicated beacon indication is relevant for
-	 * beacons only.
+	/* Frame info (beacon/prob res) is the same as resieved channel, no need
+	 * for forther process.
 	 */
-	if (channel->band == NL80211_BAND_6GHZ &&
-	    (freq == channel->center_freq ||
-	     abs(freq - channel->center_freq) > 80))
+	if (freq == channel->center_freq)
 		return channel;
 
 	alt_channel = ieee80211_get_channel_khz(wiphy, freq);
 	if (!alt_channel) {
-		if (channel->band == NL80211_BAND_2GHZ) {
+		if (channel->band == NL80211_BAND_2GHZ ||
+		    channel->band == NL80211_BAND_60GHZ) {
 			/*
 			 * Better not allow unexpected channels when that could
 			 * be going beyond the 1-11 range (e.g., discovering
 			 * BSS on channel 12 when radio is configured for
-			 * channel 11.
+			 * channel 11) or beyond the 6G channel range.
 			 */
 			return NULL;
 		}