]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
mesh: Set VHT/HE channel information for 80 MHz and 160 MHz
authorP Praneesh <quic_ppranees@quicinc.com>
Thu, 10 Apr 2025 11:11:21 +0000 (16:41 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 11 Apr 2025 09:56:26 +0000 (12:56 +0300)
For 80 MHz and 160 MHz bandwidths in mesh, CAC needs to be performed for
the DFS channels before the start of transmission. CAC check is based on
hostapd_config structure. Add center frequency segment index and
bandwidth to perform CAC.

Signed-off-by: P Praneesh <quic_ppranees@quicinc.com>
Signed-off-by: Suraj P Kizhakkethil <quic_surapk@quicinc.com>
wpa_supplicant/mesh.c

index 869f0b39f8f18a7b2ca6501acc15a959b4913db2..bd5b5ff9c502fbd5616ce7b37d8afd5decdc6767 100644 (file)
@@ -389,6 +389,7 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
        int basic_rates_erp[] = { 10, 20, 55, 60, 110, 120, 240, -1 };
        int rate_len;
        int frequency;
+       u8 chan;
 
        if (!wpa_s->conf->user_mpm) {
                /* not much for us to do here */
@@ -479,6 +480,25 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s,
        bss->conf->ap_max_inactivity = wpa_s->conf->mesh_max_inactivity;
        bss->conf->mesh_fwding = wpa_s->conf->mesh_fwding;
 
+       ieee80211_freq_to_chan(freq->center_freq1, &chan);
+       if (wpa_s->mesh_vht_enabled) {
+               if (freq->bandwidth == 80)
+                       conf->vht_oper_chwidth = CONF_OPER_CHWIDTH_80MHZ;
+               else if (freq->bandwidth == 160)
+                       conf->vht_oper_chwidth = CONF_OPER_CHWIDTH_160MHZ;
+               conf->vht_oper_centr_freq_seg0_idx = chan;
+       }
+
+#ifdef CONFIG_IEEE80211AX
+       if (wpa_s->mesh_he_enabled) {
+               if (freq->bandwidth == 80)
+                       conf->he_oper_chwidth = CONF_OPER_CHWIDTH_80MHZ;
+               else if (freq->bandwidth == 160)
+                       conf->he_oper_chwidth = CONF_OPER_CHWIDTH_160MHZ;
+               conf->he_oper_centr_freq_seg0_idx = chan;
+       }
+#endif /* CONFIG_IEEE80211AX */
+
        if (ieee80211_is_dfs(ssid->frequency, wpa_s->hw.modes,
                             wpa_s->hw.num_modes) && wpa_s->conf->country[0]) {
                conf->ieee80211h = 1;