]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add support for new 5 GHz channels 173 and 177
authorSreeramya Soratkal <ssramya@codeaurora.org>
Mon, 23 Nov 2020 08:00:02 +0000 (13:30 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 22 Jan 2021 17:18:10 +0000 (19:18 +0200)
Add support for new channels 173 and 177 in the operating classes 125 to
130 as defined in draft IEEE P802.11ax/D8.0.

Signed-off-by: Sreeramya Soratkal <ssramya@codeaurora.org>
src/ap/dfs.c
src/common/hw_features_common.c
src/common/ieee802_11_common.c
src/drivers/driver_nl80211_event.c
wpa_supplicant/op_classes.c
wpa_supplicant/p2p_supplicant.c
wpa_supplicant/rrm.c
wpa_supplicant/wnm_sta.c

index 84db7f28d85040f56789688f6321c508f393f35c..be7726cbe9bea9e4f275783d995cef4c7bca8569 100644 (file)
@@ -81,17 +81,17 @@ static int dfs_is_chan_allowed(struct hostapd_channel_data *chan, int n_chans)
         * We will also choose this first channel as the control one.
         */
        int allowed_40[] = { 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157,
-                            184, 192 };
+                            165, 173, 184, 192 };
        /*
         * VHT80, valid channels based on center frequency:
-        * 42, 58, 106, 122, 138, 155
+        * 42, 58, 106, 122, 138, 155, 171
         */
-       int allowed_80[] = { 36, 52, 100, 116, 132, 149 };
+       int allowed_80[] = { 36, 52, 100, 116, 132, 149, 165 };
        /*
         * VHT160 valid channels based on center frequency:
-        * 50, 114
+        * 50, 114, 163
         */
-       int allowed_160[] = { 36, 100 };
+       int allowed_160[] = { 36, 100, 149 };
        int *allowed = allowed_40;
        unsigned int i, allowed_no = 0;
 
index 511e68f9ec86cbd25b236c4f99429c64043cb426..b62c37aea98387690a23a59175d1b4e410f69f1d 100644 (file)
@@ -580,6 +580,8 @@ int hostapd_set_freq_params(struct hostapd_freq_params *data,
                                center_segment0 = 138;
                        else if (channel <= 161)
                                center_segment0 = 155;
+                       else if (channel <= 177)
+                               center_segment0 = 171;
                        data->center_freq1 = 5000 + center_segment0 * 5;
                } else {
                        /*
index 764ece92a57c378e1237c086bdebd930015e7331..886b8d0a674461e2718a0b9836dd5870e3da34b6 100644 (file)
@@ -986,8 +986,8 @@ enum hostapd_hw_mode ieee80211_freq_to_channel_ext(unsigned int freq,
                return HOSTAPD_MODE_IEEE80211A;
        }
 
-       /* 5 GHz, channels 149..169 */
-       if (freq >= 5745 && freq <= 5845) {
+       /* 5 GHz, channels 149..177 */
+       if (freq >= 5745 && freq <= 5885) {
                if ((freq - 5000) % 5)
                        return NUM_HOSTAPD_MODES;
 
@@ -1417,22 +1417,22 @@ static int ieee80211_chan_to_freq_global(u8 op_class, u8 chan)
                        return -1;
                return 5000 + 5 * chan;
        case 124: /* channels 149,153,157,161 */
-       case 126: /* channels 149,157; 40 MHz */
-       case 127: /* channels 153,161; 40 MHz */
                if (chan < 149 || chan > 161)
                        return -1;
                return 5000 + 5 * chan;
-       case 125: /* channels 149,153,157,161,165,169 */
-               if (chan < 149 || chan > 169)
+       case 125: /* channels 149,153,157,161,165,169,173,177 */
+       case 126: /* channels 149,157,165,173; 40 MHz */
+       case 127: /* channels 153,161,169,177; 40 MHz */
+               if (chan < 149 || chan > 177)
                        return -1;
                return 5000 + 5 * chan;
-       case 128: /* center freqs 42, 58, 106, 122, 138, 155; 80 MHz */
-       case 130: /* center freqs 42, 58, 106, 122, 138, 155; 80 MHz */
-               if (chan < 36 || chan > 161)
+       case 128: /* center freqs 42, 58, 106, 122, 138, 155, 171; 80 MHz */
+       case 130: /* center freqs 42, 58, 106, 122, 138, 155, 171; 80 MHz */
+               if (chan < 36 || chan > 177)
                        return -1;
                return 5000 + 5 * chan;
-       case 129: /* center freqs 50, 114; 160 MHz */
-               if (chan < 36 || chan > 128)
+       case 129: /* center freqs 50, 114, 163; 160 MHz */
+               if (chan < 36 || chan > 177)
                        return -1;
                return 5000 + 5 * chan;
        case 131: /* UHB channels, 20 MHz: 1, 5, 9.. */
@@ -1876,20 +1876,20 @@ const struct oper_class_map global_op_class[] = {
        { HOSTAPD_MODE_IEEE80211A, 122, 100, 132, 8, BW40PLUS, NO_P2P_SUPP },
        { HOSTAPD_MODE_IEEE80211A, 123, 104, 136, 8, BW40MINUS, NO_P2P_SUPP },
        { HOSTAPD_MODE_IEEE80211A, 124, 149, 161, 4, BW20, P2P_SUPP },
-       { HOSTAPD_MODE_IEEE80211A, 125, 149, 169, 4, BW20, P2P_SUPP },
-       { HOSTAPD_MODE_IEEE80211A, 126, 149, 157, 8, BW40PLUS, P2P_SUPP },
-       { HOSTAPD_MODE_IEEE80211A, 127, 153, 161, 8, BW40MINUS, P2P_SUPP },
+       { HOSTAPD_MODE_IEEE80211A, 125, 149, 177, 4, BW20, P2P_SUPP },
+       { HOSTAPD_MODE_IEEE80211A, 126, 149, 173, 8, BW40PLUS, P2P_SUPP },
+       { HOSTAPD_MODE_IEEE80211A, 127, 153, 177, 8, BW40MINUS, P2P_SUPP },
 
        /*
-        * IEEE P802.11ac/D7.0 Table E-4 actually talks about channel center
-        * frequency index 42, 58, 106, 122, 138, 155 with channel spacing of
-        * 80 MHz, but currently use the following definition for simplicity
+        * IEEE P802.11ax/D8.0 Table E-4 actually talks about channel center
+        * frequency index 42, 58, 106, 122, 138, 155, 171 with channel spacing
+        * of 80 MHz, but currently use the following definition for simplicity
         * (these center frequencies are not actual channels, which makes
         * wpas_p2p_verify_channel() fail). wpas_p2p_verify_80mhz() should take
         * care of removing invalid channels.
         */
-       { HOSTAPD_MODE_IEEE80211A, 128, 36, 161, 4, BW80, P2P_SUPP },
-       { HOSTAPD_MODE_IEEE80211A, 129, 36, 128, 4, BW160, P2P_SUPP },
+       { HOSTAPD_MODE_IEEE80211A, 128, 36, 177, 4, BW80, P2P_SUPP },
+       { HOSTAPD_MODE_IEEE80211A, 129, 36, 177, 4, BW160, P2P_SUPP },
        { HOSTAPD_MODE_IEEE80211A, 131, 1, 233, 4, BW20, NO_P2P_SUPP },
        { HOSTAPD_MODE_IEEE80211A, 132, 1, 233, 8, BW40, NO_P2P_SUPP },
        { HOSTAPD_MODE_IEEE80211A, 133, 1, 233, 16, BW80, NO_P2P_SUPP },
@@ -1911,7 +1911,7 @@ const struct oper_class_map global_op_class[] = {
         * the OneHundredAndThirty Delimiter value used in the Supported
         * Operating Classes element to indicate the end of the Operating
         * Classes field. */
-       { HOSTAPD_MODE_IEEE80211A, 130, 36, 161, 4, BW80P80, P2P_SUPP },
+       { HOSTAPD_MODE_IEEE80211A, 130, 36, 177, 4, BW80P80, P2P_SUPP },
        { -1, 0, 0, 0, 0, BW20, NO_P2P_SUPP }
 };
 
@@ -2493,16 +2493,16 @@ int op_class_to_bandwidth(u8 op_class)
        case 123: /* channels 104-136; 40 MHz */
                return 40;
        case 124: /* channels 149,153,157,161 */
-       case 125: /* channels 149,153,157,161,165,169 */
+       case 125: /* channels 149,153,157,161,165,169,173,177 */
                return 20;
-       case 126: /* channels 149,157; 40 MHz */
-       case 127: /* channels 153,161; 40 MHz */
+       case 126: /* channels 149,157,161,165,169,173; 40 MHz */
+       case 127: /* channels 153..177; 40 MHz */
                return 40;
-       case 128: /* center freqs 42, 58, 106, 122, 138, 155; 80 MHz */
+       case 128: /* center freqs 42, 58, 106, 122, 138, 155, 171; 80 MHz */
                return 80;
-       case 129: /* center freqs 50, 114; 160 MHz */
+       case 129: /* center freqs 50, 114, 163; 160 MHz */
                return 160;
-       case 130: /* center freqs 42, 58, 106, 122, 138, 155; 80+80 MHz */
+       case 130: /* center freqs 42, 58, 106, 122, 138, 155, 171; 80+80 MHz */
                return 80;
        case 131: /* UHB channels, 20 MHz: 1, 5, 9.. */
                return 20;
@@ -2554,16 +2554,16 @@ int op_class_to_ch_width(u8 op_class)
        case 123: /* channels 104-136; 40 MHz */
                return CHANWIDTH_USE_HT;
        case 124: /* channels 149,153,157,161 */
-       case 125: /* channels 149,153,157,161,165,169 */
+       case 125: /* channels 149,153,157,161,165,169,171 */
                return CHANWIDTH_USE_HT;
-       case 126: /* channels 149,157; 40 MHz */
-       case 127: /* channels 153,161; 40 MHz */
+       case 126: /* channels 149,157,165, 173; 40 MHz */
+       case 127: /* channels 153,161,169,177; 40 MHz */
                return CHANWIDTH_USE_HT;
-       case 128: /* center freqs 42, 58, 106, 122, 138, 155; 80 MHz */
+       case 128: /* center freqs 42, 58, 106, 122, 138, 155, 171; 80 MHz */
                return CHANWIDTH_80MHZ;
-       case 129: /* center freqs 50, 114; 160 MHz */
+       case 129: /* center freqs 50, 114, 163; 160 MHz */
                return CHANWIDTH_160MHZ;
-       case 130: /* center freqs 42, 58, 106, 122, 138, 155; 80+80 MHz */
+       case 130: /* center freqs 42, 58, 106, 122, 138, 155, 171; 80+80 MHz */
                return CHANWIDTH_80P80MHZ;
        case 131: /* UHB channels, 20 MHz: 1, 5, 9.. */
                return CHANWIDTH_USE_HT;
index a63059bda26eaca7e40b8166dad1a9b0f76a927f..c971001ae0b93d6e9cd8de32ea8221102e1caf57 100644 (file)
@@ -1944,7 +1944,7 @@ try_2_4_or_5:
                return 2407 + 5 * chan;
        if (chan == 14)
                return 2484;
-       if (chan >= 36 && chan <= 169)
+       if (chan >= 36 && chan <= 177)
                return 5000 + 5 * chan;
 
        return 0;
index 41b47cc6295cb64c338744a7172c6ad6907d44ee..a0ad0c2ff5725ef04892695560494a25b838c378 100644 (file)
@@ -77,7 +77,7 @@ static enum chan_allowed verify_80mhz(struct hostapd_hw_modes *mode,
        unsigned int no_ir = 0;
        const u8 *center_channels;
        size_t num_chan;
-       const u8 center_channels_5ghz[] = { 42, 58, 106, 122, 138, 155 };
+       const u8 center_channels_5ghz[] = { 42, 58, 106, 122, 138, 155, 171 };
        const u8 center_channels_6ghz[] = { 7, 23, 39, 55, 71, 87, 103, 119,
                                            135, 151, 167, 183, 199, 215 };
 
@@ -150,7 +150,7 @@ static enum chan_allowed verify_160mhz(struct hostapd_hw_modes *mode,
        unsigned int no_ir = 0;
        const u8 *center_channels;
        size_t num_chan;
-       const u8 center_channels_5ghz[] = { 50, 114 };
+       const u8 center_channels_5ghz[] = { 50, 114, 163 };
        const u8 center_channels_6ghz[] = { 15, 47, 79, 111, 143, 175, 207 };
 
        if (is_6ghz_op_class(op_class)) {
@@ -320,7 +320,7 @@ static int wpas_op_class_supported(struct wpa_supplicant *wpa_s,
 #endif /* CONFIG_VHT_OVERRIDES */
 
        if (op_class->op_class == 128) {
-               u8 channels[] = { 42, 58, 106, 122, 138, 155 };
+               u8 channels[] = { 42, 58, 106, 122, 138, 155, 171 };
 
                for (i = 0; i < ARRAY_SIZE(channels); i++) {
                        if (verify_channel(mode, op_class->op_class,
@@ -337,6 +337,8 @@ static int wpas_op_class_supported(struct wpa_supplicant *wpa_s,
                return verify_channel(mode, op_class->op_class, 50,
                                      op_class->bw) != NOT_ALLOWED ||
                        verify_channel(mode, op_class->op_class, 114,
+                                      op_class->bw) != NOT_ALLOWED ||
+                       verify_channel(mode, op_class->op_class, 163,
                                       op_class->bw) != NOT_ALLOWED;
        }
 
@@ -354,6 +356,10 @@ static int wpas_op_class_supported(struct wpa_supplicant *wpa_s,
                    verify_channel(mode, op_class->op_class, 122,
                                   op_class->bw) != NOT_ALLOWED ||
                    verify_channel(mode, op_class->op_class, 138,
+                                  op_class->bw) != NOT_ALLOWED ||
+                   verify_channel(mode, op_class->op_class, 155,
+                                  op_class->bw) != NOT_ALLOWED ||
+                   verify_channel(mode, op_class->op_class, 171,
                                   op_class->bw) != NOT_ALLOWED)
                        found++;
                if (verify_channel(mode, op_class->op_class, 106,
@@ -361,7 +367,14 @@ static int wpas_op_class_supported(struct wpa_supplicant *wpa_s,
                    verify_channel(mode, op_class->op_class, 138,
                                   op_class->bw) != NOT_ALLOWED)
                        found++;
-               if (verify_channel(mode, op_class->op_class, 155,
+               if (verify_channel(mode, op_class->op_class, 122,
+                                  op_class->bw) != NOT_ALLOWED &&
+                   verify_channel(mode, op_class->op_class, 155,
+                                  op_class->bw) != NOT_ALLOWED)
+                       found++;
+               if (verify_channel(mode, op_class->op_class, 138,
+                                  op_class->bw) != NOT_ALLOWED &&
+                   verify_channel(mode, op_class->op_class, 171,
                                   op_class->bw) != NOT_ALLOWED)
                        found++;
 
index 7d6e2dac80f686eab967236df9c26350430d4422..a1eaaf1284866f182b00e811731e3171ec257be2 100644 (file)
@@ -3578,7 +3578,7 @@ static int wpas_p2p_get_center_80mhz(struct wpa_supplicant *wpa_s,
                                     struct hostapd_hw_modes *mode,
                                     u8 channel)
 {
-       u8 center_channels[] = { 42, 58, 106, 122, 138, 155 };
+       u8 center_channels[] = { 42, 58, 106, 122, 138, 155, 171 };
        size_t i;
 
        if (mode->mode != HOSTAPD_MODE_IEEE80211A)
@@ -3639,7 +3639,7 @@ static int wpas_p2p_get_center_160mhz(struct wpa_supplicant *wpa_s,
                                     struct hostapd_hw_modes *mode,
                                     u8 channel)
 {
-       u8 center_channels[] = { 50, 114 };
+       u8 center_channels[] = { 50, 114, 163 };
        unsigned int i;
 
        if (mode->mode != HOSTAPD_MODE_IEEE80211A)
@@ -3787,7 +3787,7 @@ static int wpas_p2p_setup_channels(struct wpa_supplicant *wpa_s,
 
                        /* Check for non-continuous jump in channel index
                         * incrementation */
-                       if ((o->op_class == 128 || o->op_class == 130) &&
+                       if ((o->op_class >= 128 && o->op_class <= 130) &&
                            ch < 149 && ch + o->inc > 149)
                                ch = 149;
 
index 242496d0a1cc1e4685660f9ef6592ef080c2eca4..cf107ebaf6399bc9e0784aa79e6d72a62efd9fea 100644 (file)
@@ -556,8 +556,8 @@ static int * wpas_add_channels(const struct oper_class_map *op,
 static int * wpas_op_class_freqs(const struct oper_class_map *op,
                                 struct hostapd_hw_modes *mode, int active)
 {
-       u8 channels_80mhz_5ghz[] = { 42, 58, 106, 122, 138, 155 };
-       u8 channels_160mhz_5ghz[] = { 50, 114 };
+       u8 channels_80mhz_5ghz[] = { 42, 58, 106, 122, 138, 155, 171 };
+       u8 channels_160mhz_5ghz[] = { 50, 114, 163 };
        u8 channels_80mhz_6ghz[] = { 7, 23, 39, 55, 71, 87, 103, 119, 135, 151,
                                     167, 183, 199, 215 };
        u8 channels_160mhz_6ghz[] = { 15, 47, 79, 111, 143, 175, 207 };
index 19f1eca8a6764daed6c24a14552ce8aa7c90484b..c4c6651d42e6d9e35974940061924a39c9262e1a 100644 (file)
@@ -552,7 +552,7 @@ static int wnm_nei_get_chan(struct wpa_supplicant *wpa_s, u8 op_class, u8 chan)
                        freq = 2407 + chan * 5;
                else if (chan == 14)
                        freq = 2484;
-               else if (chan >= 36 && chan <= 169)
+               else if (chan >= 36 && chan <= 177)
                        freq = 5000 + chan * 5;
        }
        return freq;