summaryrefslogtreecommitdiff
path: root/net/wireless
diff options
context:
space:
mode:
authorAmar Singhal <asinghal@codeaurora.org>2020-06-19 13:52:01 -0700
committerJohannes Berg <johannes.berg@intel.com>2020-08-27 10:53:21 +0200
commit2d9b55508556ccee6410310fb9ea2482fd3328eb (patch)
tree4be85950905b235a0e82ff77a7f531c9a4e708f3 /net/wireless
parent47df8e059b49a80c179fae39256bcd7096810934 (diff)
cfg80211: Adjust 6 GHz frequency to channel conversion
Adjust the 6 GHz frequency to channel conversion function, the other way around was previously handled. Signed-off-by: Amar Singhal <asinghal@codeaurora.org> Link: https://lore.kernel.org/r/1592599921-10607-1-git-send-email-asinghal@codeaurora.org [rewrite commit message, hard-code channel 2] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless')
-rw-r--r--net/wireless/util.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/net/wireless/util.c b/net/wireless/util.c
index dfad1c0f57ad..c62eb3d9ab3d 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -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