]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
6 GHz: Change 6 GHz channels per IEEE P802.11ax/D6.1
authorWu Gao <wugao@codeaurora.org>
Mon, 8 Jun 2020 06:27:12 +0000 (14:27 +0800)
committerJouni Malinen <j@w1.fi>
Tue, 23 Jun 2020 21:29:37 +0000 (00:29 +0300)
The channel numbering/center frequencies was changed in IEEE
P802.11ax/D6.1. The center frequencies of the channels were shifted by
10 MHz. Also, a new operating class 136 was defined with a single
channel 2. Add required support to change the channelization as per IEEE
P802.11ax/D6.1.

Signed-off-by: Wu Gao<wugao@codeaurora.org>
Signed-off-by: Vamsi Krishna <vamsin@codeaurora.org>
hostapd/hostapd.conf
src/common/ieee802_11_common.c
wpa_supplicant/op_classes.c

index 060738c34acb5a8081660cc0cd0c29b18f382a35..91ac96785be15d6d030421435a14ac1acd11d7fb 100644 (file)
@@ -210,7 +210,7 @@ channel=1
 # Frequency list can be provided as range using hyphen ('-') or individual
 # frequencies can be specified by comma (',') separated values
 # Default: all frequencies allowed in selected hw_mode
-#freqlist=2437,5945,5965
+#freqlist=2437,5955,5975
 #freqlist=2437,5985-6105
 
 # Exclude DFS channels from ACS
@@ -822,11 +822,11 @@ wmm_ac_vo_acm=0
 #he_rts_threshold=0
 
 # HE operating channel information; see matching vht_* parameters for details.
-# On the 6 GHz band the center freq calculation starts from 5.940 GHz offset.
-# For example idx=3 would result in 5955 MHz center frequency. In addition,
+# On the 6 GHz band the center freq calculation starts from 5.950 GHz offset.
+# For example idx=3 would result in 5965 MHz center frequency. In addition,
 # he_oper_chwidth is ignored, and the channel width is derived from the
 # configured operating class or center frequency indexes (see
-# IEEE P802.11ax/D4.3 Annex E, Table E-4).
+# IEEE P802.11ax/D6.1 Annex E, Table E-4).
 #he_oper_chwidth
 #he_oper_centr_freq_seg0_idx
 #he_oper_centr_freq_seg1_idx
index c4e744693d5615f5d0fc05e51dae3120e021364d..c0c569bc6c14b98dfc5b6739de4593bf8dc225ee 100644 (file)
@@ -1029,9 +1029,9 @@ enum hostapd_hw_mode ieee80211_freq_to_channel_ext(unsigned int freq,
                return HOSTAPD_MODE_IEEE80211A;
        }
 
-       if (freq > 5940 && freq <= 7105) {
+       if (freq > 5950 && freq <= 7115) {
                int bw;
-               u8 idx = (freq - 5940) / 5;
+               u8 idx = (freq - 5950) / 5;
 
                bw = center_idx_to_bw_6ghz(idx);
                if (bw < 0)
@@ -1042,6 +1042,12 @@ enum hostapd_hw_mode ieee80211_freq_to_channel_ext(unsigned int freq,
                return HOSTAPD_MODE_IEEE80211A;
        }
 
+       if (freq == 5935) {
+               *op_class = 136;
+               *channel = (freq - 5925) / 5;
+               return HOSTAPD_MODE_IEEE80211A;
+       }
+
        /* 56.16 GHz, channel 1..6 */
        if (freq >= 56160 + 2160 * 1 && freq <= 56160 + 2160 * 6) {
                if (sec_channel)
@@ -1418,7 +1424,11 @@ static int ieee80211_chan_to_freq_global(u8 op_class, u8 chan)
        case 135: /* UHB channels, 80+80 MHz: 7, 23, 39.. */
                if (chan < 1 || chan > 233)
                        return -1;
-               return 5940 + chan * 5;
+               return 5950 + chan * 5;
+       case 136: /* UHB channels, 20 MHz: 2 */
+               if (chan == 2)
+                       return 5935;
+               return -1;
        case 180: /* 60 GHz band, channels 1..8 */
                if (chan < 1 || chan > 8)
                        return -1;
@@ -2208,10 +2218,13 @@ int center_idx_to_bw_6ghz(u8 idx)
 
 int is_6ghz_freq(int freq)
 {
-       if (freq < 5940 || freq > 7105)
+       if (freq < 5935 || freq > 7115)
                return 0;
 
-       if (center_idx_to_bw_6ghz((freq - 5940) / 5) < 0)
+       if (freq == 5935)
+               return 1;
+
+       if (center_idx_to_bw_6ghz((freq - 5950) / 5) < 0)
                return 0;
 
        return 1;
@@ -2220,7 +2233,7 @@ int is_6ghz_freq(int freq)
 
 int is_6ghz_op_class(u8 op_class)
 {
-       return op_class >= 131 && op_class <= 135;
+       return op_class >= 131 && op_class <= 136;
 }
 
 
@@ -2228,14 +2241,14 @@ int is_6ghz_psc_frequency(int freq)
 {
        int i;
 
-       if (!is_6ghz_freq(freq))
+       if (!is_6ghz_freq(freq) || freq == 5935)
                return 0;
-       if ((((freq - 5940) / 5) & 0x3) != 0x1)
+       if ((((freq - 5950) / 5) & 0x3) != 0x1)
                return 0;
 
-       i = (freq - 5940 + 55) % 80;
+       i = (freq - 5950 + 55) % 80;
        if (i == 0)
-               i = (freq - 5940 + 55) / 80;
+               i = (freq - 5950 + 55) / 80;
 
        if (i >= 1 && i <= 15)
                return 1;
@@ -2471,6 +2484,8 @@ int op_class_to_bandwidth(u8 op_class)
        case 134: /* UHB channels, 160 MHz: 15, 47, 79.. */
        case 135: /* UHB channels, 80+80 MHz: 7, 23, 39.. */
                return 160;
+       case 136: /* UHB channels, 20 MHz: 2 */
+               return 20;
        case 180: /* 60 GHz band, channels 1..8 */
                return 2160;
        case 181: /* 60 GHz band, EDMG CB2, channels 9..15 */
@@ -2531,6 +2546,8 @@ int op_class_to_ch_width(u8 op_class)
                return CHANWIDTH_160MHZ;
        case 135: /* UHB channels, 80+80 MHz: 7, 23, 39.. */
                return CHANWIDTH_80P80MHZ;
+       case 136: /* UHB channels, 20 MHz: 2 */
+               return CHANWIDTH_USE_HT;
        case 180: /* 60 GHz band, channels 1..8 */
                return CHANWIDTH_2160MHZ;
        case 181: /* 60 GHz band, EDMG CB2, channels 9..15 */
index 983801faa4218e0d47d656e952876bd5ef8e1995..bd97fee54b2ce0641acac5342fb45a93bd0eacb1 100644 (file)
@@ -22,13 +22,13 @@ static enum chan_allowed allow_channel(struct hostapd_hw_modes *mode,
                                       unsigned int *flags)
 {
        int i;
-       int is_6ghz = op_class >= 131 && op_class <= 135;
+       int is_6ghz = op_class >= 131 && op_class <= 136;
 
        for (i = 0; i < mode->num_channels; i++) {
                int chan_is_6ghz;
 
-               chan_is_6ghz = mode->channels[i].freq > 5940 &&
-                       mode->channels[i].freq <= 7105;
+               chan_is_6ghz = mode->channels[i].freq >= 5935 &&
+                       mode->channels[i].freq <= 7115;
                if (is_6ghz == chan_is_6ghz && mode->channels[i].chan == chan)
                        break;
        }