On May 29, 2020 11:53:30 AM Johannes Berg <johannes@xxxxxxxxxxxxxxxx> wrote:
On Fri, 2020-05-29 at 11:41 +0200, Arend Van Spriel wrote:
It also fixes a missing MHZ_TO_KHZ() macro for 6GHz channels while at it.
Yeah, I actually saw and fixed that earlier, but whatever. I can fix up
any issues.
case NL80211_BAND_6GHZ:
- /* see 802.11ax D4.1 27.3.22.2 */
+ /* see 802.11ax D6.1 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);
So this can return 5950+5*253 == 7215
@@ -119,11 +121,14 @@ int ieee80211_freq_khz_to_channel(u32 freq)
else if (freq <= 45000) /* DMG band lower limit */
- /* see 802.11ax D4.1 27.3.22.2 */
- return (freq - 5940) / 5;
+ /* see 802.11ax D6.1 27.3.23.2 */
+ return (freq - 5950) / 5;
and here you have no real upper bound, which is fine
@@ -1662,6 +1667,40 @@ bool ieee80211_chandef_to_operating_class(struct
+ /* 6GHz, channels 1..233 */
+ if (freq == 5935) {
+ if (chandef->width != NL80211_CHAN_WIDTH_20)
+ return false;
+
+ *op_class = 136;
+ return true;
+ } else if (freq > 5935 && freq <= 7115) {
but here both the comment and the code say 7115? Should that be 1..253
and 7215, respectively?
I can fix, no need to resend.
The 802.11 spec specifies the 1..253 range. The FCC has proposed the U-NII
bands 5 to 8 for the 6G band. U-NII-8 ends at 7125 so the highest 20MHz
center freq is 7115, ie. channel 233. Have to admit that mixing the two in
this patch can be confusing. I leave it at your discretion how to fix it. I
can also resend if necessary.
Regards,
Arend