aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexei Avshalom Lazar <ailizaro@codeaurora.org>2018-08-13 08:33:00 -0400
committerJohannes Berg <johannes.berg@intel.com>2018-08-28 05:23:08 -0400
commit9cf0a0b4b64ae103cf0e7dfaa72b44ecda24c0eb (patch)
treefea11a7f68a5ecd192b168f45308c6f088e94ad2
parent21a5d4c3a45ca608477a083096cfbce76e449a0c (diff)
cfg80211: Add support for 60GHz band channels 5 and 6
The current support in the 60GHz band is for channels 1-4. Add support for channels 5 and 6. This requires enlarging ieee80211_channel.center_freq from u16 to u32. Signed-off-by: Alexei Avshalom Lazar <ailizaro@codeaurora.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-rw-r--r--drivers/net/wireless/ath/wil6210/debugfs.c2
-rw-r--r--include/net/cfg80211.h2
-rw-r--r--include/uapi/linux/nl80211.h2
-rw-r--r--net/wireless/reg.c2
-rw-r--r--net/wireless/trace.h2
-rw-r--r--net/wireless/util.c6
6 files changed, 8 insertions, 8 deletions
diff --git a/drivers/net/wireless/ath/wil6210/debugfs.c b/drivers/net/wireless/ath/wil6210/debugfs.c
index 51c3330bc316..49533f884993 100644
--- a/drivers/net/wireless/ath/wil6210/debugfs.c
+++ b/drivers/net/wireless/ath/wil6210/debugfs.c
@@ -1436,7 +1436,7 @@ static int wil_freq_debugfs_show(struct seq_file *s, void *data)
1436{ 1436{
1437 struct wil6210_priv *wil = s->private; 1437 struct wil6210_priv *wil = s->private;
1438 struct wireless_dev *wdev = wil->main_ndev->ieee80211_ptr; 1438 struct wireless_dev *wdev = wil->main_ndev->ieee80211_ptr;
1439 u16 freq = wdev->chandef.chan ? wdev->chandef.chan->center_freq : 0; 1439 u32 freq = wdev->chandef.chan ? wdev->chandef.chan->center_freq : 0;
1440 1440
1441 seq_printf(s, "Freq = %d\n", freq); 1441 seq_printf(s, "Freq = %d\n", freq);
1442 1442
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 4f57f770f602..46c4cbf54903 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -149,7 +149,7 @@ enum ieee80211_channel_flags {
149 */ 149 */
150struct ieee80211_channel { 150struct ieee80211_channel {
151 enum nl80211_band band; 151 enum nl80211_band band;
152 u16 center_freq; 152 u32 center_freq;
153 u16 hw_value; 153 u16 hw_value;
154 u32 flags; 154 u32 flags;
155 int max_antenna_gain; 155 int max_antenna_gain;
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
index 7acc16f34942..023989604fc6 100644
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
@@ -4338,7 +4338,7 @@ enum nl80211_txrate_gi {
4338 * enum nl80211_band - Frequency band 4338 * enum nl80211_band - Frequency band
4339 * @NL80211_BAND_2GHZ: 2.4 GHz ISM band 4339 * @NL80211_BAND_2GHZ: 2.4 GHz ISM band
4340 * @NL80211_BAND_5GHZ: around 5 GHz band (4.9 - 5.7 GHz) 4340 * @NL80211_BAND_5GHZ: around 5 GHz band (4.9 - 5.7 GHz)
4341 * @NL80211_BAND_60GHZ: around 60 GHz band (58.32 - 64.80 GHz) 4341 * @NL80211_BAND_60GHZ: around 60 GHz band (58.32 - 69.12 GHz)
4342 * @NUM_NL80211_BANDS: number of bands, avoid using this in userspace 4342 * @NUM_NL80211_BANDS: number of bands, avoid using this in userspace
4343 * since newer kernel versions may support more bands 4343 * since newer kernel versions may support more bands
4344 */ 4344 */
diff --git a/net/wireless/reg.c b/net/wireless/reg.c
index 325d74a94a36..043d43573ca2 100644
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
@@ -3301,7 +3301,7 @@ void regulatory_hint_disconnect(void)
3301 restore_regulatory_settings(false); 3301 restore_regulatory_settings(false);
3302} 3302}
3303 3303
3304static bool freq_is_chan_12_13_14(u16 freq) 3304static bool freq_is_chan_12_13_14(u32 freq)
3305{ 3305{
3306 if (freq == ieee80211_channel_to_frequency(12, NL80211_BAND_2GHZ) || 3306 if (freq == ieee80211_channel_to_frequency(12, NL80211_BAND_2GHZ) ||
3307 freq == ieee80211_channel_to_frequency(13, NL80211_BAND_2GHZ) || 3307 freq == ieee80211_channel_to_frequency(13, NL80211_BAND_2GHZ) ||
diff --git a/net/wireless/trace.h b/net/wireless/trace.h
index 7c73510b161f..5e7eec849200 100644
--- a/net/wireless/trace.h
+++ b/net/wireless/trace.h
@@ -112,7 +112,7 @@
112 } while (0) 112 } while (0)
113 113
114#define CHAN_ENTRY __field(enum nl80211_band, band) \ 114#define CHAN_ENTRY __field(enum nl80211_band, band) \
115 __field(u16, center_freq) 115 __field(u32, center_freq)
116#define CHAN_ASSIGN(chan) \ 116#define CHAN_ASSIGN(chan) \
117 do { \ 117 do { \
118 if (chan) { \ 118 if (chan) { \
diff --git a/net/wireless/util.c b/net/wireless/util.c
index 7bdcfe19b3ef..2a89db5f2db7 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -88,7 +88,7 @@ int ieee80211_channel_to_frequency(int chan, enum nl80211_band band)
88 return 5000 + chan * 5; 88 return 5000 + chan * 5;
89 break; 89 break;
90 case NL80211_BAND_60GHZ: 90 case NL80211_BAND_60GHZ:
91 if (chan < 5) 91 if (chan < 7)
92 return 56160 + chan * 2160; 92 return 56160 + chan * 2160;
93 break; 93 break;
94 default: 94 default:
@@ -109,7 +109,7 @@ int ieee80211_frequency_to_channel(int freq)
109 return (freq - 4000) / 5; 109 return (freq - 4000) / 5;
110 else if (freq <= 45000) /* DMG band lower limit */ 110 else if (freq <= 45000) /* DMG band lower limit */
111 return (freq - 5000) / 5; 111 return (freq - 5000) / 5;
112 else if (freq >= 58320 && freq <= 64800) 112 else if (freq >= 58320 && freq <= 70200)
113 return (freq - 56160) / 2160; 113 return (freq - 56160) / 2160;
114 else 114 else
115 return 0; 115 return 0;
@@ -1568,7 +1568,7 @@ bool ieee80211_chandef_to_operating_class(struct cfg80211_chan_def *chandef,
1568 } 1568 }
1569 1569
1570 /* 56.16 GHz, channel 1..4 */ 1570 /* 56.16 GHz, channel 1..4 */
1571 if (freq >= 56160 + 2160 * 1 && freq <= 56160 + 2160 * 4) { 1571 if (freq >= 56160 + 2160 * 1 && freq <= 56160 + 2160 * 6) {
1572 if (chandef->width >= NL80211_CHAN_WIDTH_40) 1572 if (chandef->width >= NL80211_CHAN_WIDTH_40)
1573 return false; 1573 return false;
1574 1574