From: Suraj P Kizhakkethil Date: Thu, 10 Apr 2025 11:11:22 +0000 (+0530) Subject: mesh: Add support for 160 MHz bandwidth in 5 GHz band for mesh X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=69a4ce7c59cc1b7b0ccc050b3cfa108f184eedb6;p=thirdparty%2Fhostap.git mesh: Add support for 160 MHz bandwidth in 5 GHz band for mesh Add support for 160 MHz in 5 GHz band for mesh. Use max_oper_chwidth for 160 MHz bandwidth selection. Currently, in the hwsim test cases mesh_secure_ocv_mix_legacy and mesh_secure_ocv_mix_ht, dev0 is configured in 160 MHz bandwidth which includes DFS channels. But the test case lacks DFS checks and since the bandwidth downgrades to 80 MHz which excludes any DFS channels, the test cases pass. With the addition of 160 MHz support, the test cases fail due to the lack of DFS checks, as dev0 takes longer time to enable. Add DFS checks to the test cases mesh_secure_ocv_mix_legacy and mesh_secure_ocv_mix_ht. For the test cases mesh_secure_ocv_mix_legacy and mesh_secure_ocv_mix_ht, the regulatory domain is set using iw reg set which does not update the country in the wpa_s structure, causing the DFS channels to be disabled. Use control interface to update the regulatory domain. Signed-off-by: Suraj P Kizhakkethil --- diff --git a/tests/hwsim/test_wpas_mesh.py b/tests/hwsim/test_wpas_mesh.py index b4ae3cd23..1aa3b5c17 100644 --- a/tests/hwsim/test_wpas_mesh.py +++ b/tests/hwsim/test_wpas_mesh.py @@ -490,13 +490,15 @@ def test_mesh_secure_ocv_mix_legacy(dev, apdev): def run_mesh_secure_ocv_mix_legacy(dev, apdev): check_mesh_support(dev[0], secure=True) - set_reg(dev, 'AZ') + dev[0].set("country", "AZ") dev[0].request("SET sae_groups ") id = add_mesh_secure_net(dev[0], pmf=True, ocv=True) dev[0].set_network(id, "frequency", "5200") dev[0].set_network(id, "max_oper_chwidth", "2") dev[0].mesh_group_add(id) + check_dfs_started(dev[0]) + check_dfs_finished(dev[0]) dev[1].request("SET sae_groups ") id = add_mesh_secure_net(dev[1], pmf=True, ocv=True) @@ -516,13 +518,15 @@ def test_mesh_secure_ocv_mix_ht(dev, apdev): def run_mesh_secure_ocv_mix_ht(dev, apdev): check_mesh_support(dev[0], secure=True) - set_reg(dev, 'AZ') + dev[0].set("country", "AZ") dev[0].request("SET sae_groups ") id = add_mesh_secure_net(dev[0], pmf=True, ocv=True) dev[0].set_network(id, "frequency", "5200") dev[0].set_network(id, "max_oper_chwidth", "2") dev[0].mesh_group_add(id) + check_dfs_started(dev[0]) + check_dfs_finished(dev[0]) dev[1].request("SET sae_groups ") id = add_mesh_secure_net(dev[1], pmf=True, ocv=True) diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c index cbda854c5..9f4d452c4 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c @@ -3225,7 +3225,8 @@ static bool ibss_mesh_select_80_160mhz(struct wpa_supplicant *wpa_s, 6515, 6595, 6675, 6755, 6835, 6915, 6995 }; static const int bw160[] = { - 5955, 6115, 6275, 6435, 6595, 6755, 6915 + 5180, 5500, 5745, 5955, 6115, 6275, 6435, + 6595, 6755, 6915 }; static const int bw320[]= { 5955, 6255, 6115, 6415, 6275, 6575, 6435, @@ -3277,16 +3278,22 @@ static bool ibss_mesh_select_80_160mhz(struct wpa_supplicant *wpa_s, /* In 160 MHz, the initial four 20 MHz channels were validated * above. If 160 MHz is supported, check the remaining four 20 MHz - * channels for the total of 160 MHz bandwidth for 6 GHz. + * channels for the total of 160 MHz bandwidth. */ if ((mode->he_capab[ieee80211_mode].phy_cap[ HE_PHYCAP_CHANNEL_WIDTH_SET_IDX] & - HE_PHYCAP_CHANNEL_WIDTH_SET_160MHZ_IN_5G) && is_6ghz && + HE_PHYCAP_CHANNEL_WIDTH_SET_160MHZ_IN_5G) && + (ssid->max_oper_chwidth == CONF_OPER_CHWIDTH_160MHZ || + ssid->max_oper_chwidth == CONF_OPER_CHWIDTH_320MHZ) && ibss_mesh_is_80mhz_avail(channel + 16, mode)) { for (j = 0; j < ARRAY_SIZE(bw160); j++) { - if (freq->freq == bw160[j]) { + u8 start_chan; + + if (freq->freq >= bw160[j] && + freq->freq < bw160[j] + 160) { chwidth = CONF_OPER_CHWIDTH_160MHZ; - seg0 = channel + 14; + ieee80211_freq_to_chan(bw160[j], &start_chan); + seg0 = start_chan + 14; break; } }