diff mbox series

[v2,20/24] cfg80211: Update 6 GHz starting frequency

Message ID 20200528213443.a08c02e0f9bb.If474d2bc528aa07610fef429ff83e8312079e242@changeid (mailing list archive)
State Rejected
Delegated to: Johannes Berg
Headers show
Series [v2,01/24] nl80211: really allow client-only BIGTK support | expand

Commit Message

Johannes Berg May 28, 2020, 7:34 p.m. UTC
From: Ilan Peer <ilan.peer@intel.com>

The starting frequency of the 6GHz band changed from
5940 MHz to 5950 MHz. Update the code accordingly.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 net/wireless/util.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Jouni Malinen May 28, 2020, 9:19 p.m. UTC | #1
On Thu, May 28, 2020 at 09:34:43PM +0200, Johannes Berg wrote:
> The starting frequency of the 6GHz band changed from
> 5940 MHz to 5950 MHz. Update the code accordingly.

> diff --git a/net/wireless/util.c b/net/wireless/util.c
> @@ -94,7 +94,7 @@ u32 ieee80211_channel_to_freq_khz(int chan, enum nl80211_band band)
>  	case NL80211_BAND_6GHZ:
>  		/* see 802.11ax D4.1 27.3.22.2 */
>  		if (chan <= 253)
> -			return 5940 + chan * 5;
> +			return 5950 + chan * 5;

It would be good to update that P802.11ax reference to point to a newer
version that actually matches the changed implementation, i.e., IEEE
P802.11ax/D6.1, 27.3.23.2.

> @@ -119,11 +119,11 @@ int ieee80211_freq_khz_to_channel(u32 freq)
>  		return (freq - 2407) / 5;
>  	else if (freq >= 4910 && freq <= 4980)
>  		return (freq - 4000) / 5;
> -	else if (freq < 5945)
> +	else if (freq < 5955)
>  		return (freq - 5000) / 5;

What about operating class 136 channel 2 with channel starting frequency
of 5925 MHz? This would map 5935 MHz incorrectly.

>  	else if (freq <= 45000) /* DMG band lower limit */
>  		/* see 802.11ax D4.1 27.3.22.2 */
> -		return (freq - 5940) / 5;
> +		return (freq - 5950) / 5;

Same here for the reference.
Johannes Berg May 29, 2020, 7:59 a.m. UTC | #2
On Fri, 2020-05-29 at 00:19 +0300, Jouni Malinen wrote:
> On Thu, May 28, 2020 at 09:34:43PM +0200, Johannes Berg wrote:
> > The starting frequency of the 6GHz band changed from
> > 5940 MHz to 5950 MHz. Update the code accordingly.
> > diff --git a/net/wireless/util.c b/net/wireless/util.c
> > @@ -94,7 +94,7 @@ u32 ieee80211_channel_to_freq_khz(int chan, enum nl80211_band band)
> >  	case NL80211_BAND_6GHZ:
> >  		/* see 802.11ax D4.1 27.3.22.2 */
> >  		if (chan <= 253)
> > -			return 5940 + chan * 5;
> > +			return 5950 + chan * 5;
> 
> It would be good to update that P802.11ax reference to point to a newer
> version that actually matches the changed implementation, i.e., IEEE
> P802.11ax/D6.1, 27.3.23.2.

Good point, thanks.

> > @@ -119,11 +119,11 @@ int ieee80211_freq_khz_to_channel(u32 freq)
> >  		return (freq - 2407) / 5;
> >  	else if (freq >= 4910 && freq <= 4980)
> >  		return (freq - 4000) / 5;
> > -	else if (freq < 5945)
> > +	else if (freq < 5955)
> >  		return (freq - 5000) / 5;
> 
> What about operating class 136 channel 2 with channel starting frequency
> of 5925 MHz? This would map 5935 MHz incorrectly.

Yeah. Actually, Arend had this handled:

      case NL80211_BAND_6GHZ:
-             /* see 802.11ax D4.1 27.3.22.2 */
+             /* see 802.11ax D7.0 27.3.23.2 */
+             if (chan == 2)
+                     return MHZ_TO_KHZ(5935);
              if (chan <= 253)
-                     return 5940 + chan * 5;
+                     return MHZ_TO_KHZ(5950 + chan * 5);


I've asked him to resend (somehow his patch never made it out, only his
own reply did), it was more complete anyway.

I didn't even see operating class 136 (in D6.0) though.

johannes
diff mbox series

Patch

diff --git a/net/wireless/util.c b/net/wireless/util.c
index 92585334b723..553bf1c8ee75 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -94,7 +94,7 @@  u32 ieee80211_channel_to_freq_khz(int chan, enum nl80211_band band)
 	case NL80211_BAND_6GHZ:
 		/* see 802.11ax D4.1 27.3.22.2 */
 		if (chan <= 253)
-			return 5940 + chan * 5;
+			return 5950 + chan * 5;
 		break;
 	case NL80211_BAND_60GHZ:
 		if (chan < 7)
@@ -119,11 +119,11 @@  int ieee80211_freq_khz_to_channel(u32 freq)
 		return (freq - 2407) / 5;
 	else if (freq >= 4910 && freq <= 4980)
 		return (freq - 4000) / 5;
-	else if (freq < 5945)
+	else if (freq < 5955)
 		return (freq - 5000) / 5;
 	else if (freq <= 45000) /* DMG band lower limit */
 		/* see 802.11ax D4.1 27.3.22.2 */
-		return (freq - 5940) / 5;
+		return (freq - 5950) / 5;
 	else if (freq >= 58320 && freq <= 70200)
 		return (freq - 56160) / 2160;
 	else