Skip to content

Commit 9cf0a0b

Browse files
Alexei Avshalom Lazarjmberg-intel
authored andcommitted
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 <[email protected]> Signed-off-by: Johannes Berg <[email protected]>
1 parent 21a5d4c commit 9cf0a0b

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

drivers/net/wireless/ath/wil6210/debugfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1436,7 +1436,7 @@ static int wil_freq_debugfs_show(struct seq_file *s, void *data)
14361436
{
14371437
struct wil6210_priv *wil = s->private;
14381438
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;
14401440

14411441
seq_printf(s, "Freq = %d\n", freq);
14421442

include/net/cfg80211.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ enum ieee80211_channel_flags {
149149
*/
150150
struct ieee80211_channel {
151151
enum nl80211_band band;
152-
u16 center_freq;
152+
u32 center_freq;
153153
u16 hw_value;
154154
u32 flags;
155155
int max_antenna_gain;

include/uapi/linux/nl80211.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4338,7 +4338,7 @@ enum nl80211_txrate_gi {
43384338
* enum nl80211_band - Frequency band
43394339
* @NL80211_BAND_2GHZ: 2.4 GHz ISM band
43404340
* @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)
43424342
* @NUM_NL80211_BANDS: number of bands, avoid using this in userspace
43434343
* since newer kernel versions may support more bands
43444344
*/

net/wireless/reg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3301,7 +3301,7 @@ void regulatory_hint_disconnect(void)
33013301
restore_regulatory_settings(false);
33023302
}
33033303

3304-
static bool freq_is_chan_12_13_14(u16 freq)
3304+
static bool freq_is_chan_12_13_14(u32 freq)
33053305
{
33063306
if (freq == ieee80211_channel_to_frequency(12, NL80211_BAND_2GHZ) ||
33073307
freq == ieee80211_channel_to_frequency(13, NL80211_BAND_2GHZ) ||

net/wireless/trace.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
} while (0)
113113

114114
#define CHAN_ENTRY __field(enum nl80211_band, band) \
115-
__field(u16, center_freq)
115+
__field(u32, center_freq)
116116
#define CHAN_ASSIGN(chan) \
117117
do { \
118118
if (chan) { \

net/wireless/util.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ int ieee80211_channel_to_frequency(int chan, enum nl80211_band band)
8888
return 5000 + chan * 5;
8989
break;
9090
case NL80211_BAND_60GHZ:
91-
if (chan < 5)
91+
if (chan < 7)
9292
return 56160 + chan * 2160;
9393
break;
9494
default:
@@ -109,7 +109,7 @@ int ieee80211_frequency_to_channel(int freq)
109109
return (freq - 4000) / 5;
110110
else if (freq <= 45000) /* DMG band lower limit */
111111
return (freq - 5000) / 5;
112-
else if (freq >= 58320 && freq <= 64800)
112+
else if (freq >= 58320 && freq <= 70200)
113113
return (freq - 56160) / 2160;
114114
else
115115
return 0;
@@ -1568,7 +1568,7 @@ bool ieee80211_chandef_to_operating_class(struct cfg80211_chan_def *chandef,
15681568
}
15691569

15701570
/* 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) {
15721572
if (chandef->width >= NL80211_CHAN_WIDTH_40)
15731573
return false;
15741574

0 commit comments

Comments
 (0)