cfg80211: Adjust 6 GHz frequency to channel conversion

Adjust the 6 GHz frequency to channel conversion function,
the other way around was previously handled.

Change-Id: I3a10fbef7ece7b86f44ac9bd09556f9d89d1844c
CRs-Fixed: 3183686
Signed-off-by: Amar Singhal <asinghal@codeaurora.org>
Link: https://lore.kernel.org/r/1592599921-10607-1-git-send-email-asinghal@codeaurora.org
Git-commit: 2d9b55508556ccee6410310fb9ea2482fd3328eb
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Madhvapathi Sriram <msriram@codeaurora.org>
This commit is contained in:
Amar Singhal 2020-06-18 16:24:37 -07:00 committed by Gerrit - the friendly Code Review server
parent 40d5f114ad
commit 67b2d0e37e

View file

@ -117,11 +117,13 @@ int ieee80211_freq_khz_to_channel(u32 freq)
return (freq - 2407) / 5; return (freq - 2407) / 5;
else if (freq >= 4910 && freq <= 4980) else if (freq >= 4910 && freq <= 4980)
return (freq - 4000) / 5; return (freq - 4000) / 5;
else if (freq < 5940) else if (freq < 5925)
return (freq - 5000) / 5; return (freq - 5000) / 5;
else if (freq == 5935)
return 2;
else if (freq <= 45000) /* DMG band lower limit */ else if (freq <= 45000) /* DMG band lower limit */
/* see 802.11ax D4.1 27.3.22.2 */ /* see 802.11ax D6.1 27.3.23.2 */
return (freq - 5940) / 5; return (freq - 5950) / 5;
else if (freq >= 58320 && freq <= 70200) else if (freq >= 58320 && freq <= 70200)
return (freq - 56160) / 2160; return (freq - 56160) / 2160;
else else