Skip to content

Commit

Permalink
cfg80211: Adjust 6 GHz frequency to channel conversion
Browse files Browse the repository at this point in the history
Adjust the 6 GHz frequency to channel conversion function,
the other way around was previously handled.

Signed-off-by: Amar Singhal <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
[rewrite commit message, hard-code channel 2]
Signed-off-by: Johannes Berg <[email protected]>
  • Loading branch information
Amar Singhal authored and jmberg-intel committed Aug 27, 2020
1 parent 47df8e0 commit 2d9b555
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions net/wireless/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,13 @@ 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 < 5925)
return (freq - 5000) / 5;
else if (freq == 5935)
return 2;
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.22.2 */
return (freq - 5950) / 5;
else if (freq >= 58320 && freq <= 70200)
return (freq - 56160) / 2160;
else
Expand Down

0 comments on commit 2d9b555

Please sign in to comment.