From adb0910831d9f1d564dfe573be845587a5d978cf Mon Sep 17 00:00:00 2001 From: P Praneesh Date: Thu, 10 Apr 2025 16:41:21 +0530 Subject: [PATCH] mesh: Set VHT/HE channel information for 80 MHz and 160 MHz 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 Signed-off-by: Suraj P Kizhakkethil --- wpa_supplicant/mesh.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c index 869f0b39f..bd5b5ff9c 100644 --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c @@ -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; -- 2.47.2