Search Linux Wireless

[PATCH] cfg80211: fix channel to frequency mapping in 5.9GHz range

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Currently the frequencies (5910 - 5980) cannot be used because they
are mapped into the 4.9GHz channels; this patch closes that hole.

Signed-off-by: Dennis H Jensen <dennis.h.jensen@xxxxxxxxxxx>
---
 net/wireless/util.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/wireless/util.c b/net/wireless/util.c
index 3c8be61..59b763f 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -79,6 +79,8 @@ int ieee80211_channel_to_frequency(int chan, enum ieee80211_band band)
 	case IEEE80211_BAND_5GHZ:
 		if (chan >= 182 && chan <= 196)
 			return 4000 + chan * 5;
+		else if (chan > 196)
+			return 5000 + (chan - 15) * 5;
 		else
 			return 5000 + chan * 5;
 		break;
@@ -102,6 +104,8 @@ int ieee80211_frequency_to_channel(int freq)
 		return (freq - 2407) / 5;
 	else if (freq >= 4910 && freq <= 4980)
 		return (freq - 4000) / 5;
+	else if (freq >= 5910)
+		return (freq - 5000) / 5 + 15;
 	else if (freq <= 45000) /* DMG band lower limit */
 		return (freq - 5000) / 5;
 	else if (freq >= 58320 && freq <= 64800)
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux