From b90098c77b2138c777e047a7b5df74483720b76e Mon Sep 17 00:00:00 2001 From: Harshitha Prem Date: Tue, 20 Dec 2022 23:23:49 +0530 Subject: [PATCH] wpa_supplicant: optimize single wiphy scan In case of single phy with multiple band scenario, mesh ping fails for vdev (say 5G) because mesh key is installed in different band (say 6G). This is because, when mesh vap is started scan is triggered without the frequency information. Hence,on driver side it scans for all bands(say 2G, 5G, and 6G). For each scan on particular band a vdev is created with same macaddr on the driver which leads to incorrect key installation. To handle this, add changes to send all the frequencies corresponding to the band being configured by user Signed-off-by: Harshitha Prem --- wpa_supplicant/scan.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -555,6 +555,22 @@ static void wpa_supplicant_optimize_freq wpa_s->known_wps_freq = 0; /* only do this once */ } #endif /* CONFIG_WPS */ + if (params->freqs == NULL && wpa_s->hw.num_modes > 1) { + u8 channel; + enum hostapd_hw_mode hw_mode; + struct wpa_ssid *ssid = wpa_s->conf->ssid; + + if (!ssid) { + wpa_dbg(wpa_s, MSG_ERROR, "Cannot optimize for multi band"); + return; + } + hw_mode = ieee80211_freq_to_chan(ssid->frequency, &channel); + if (hw_mode == NUM_HOSTAPD_MODES) + return; + wpa_add_scan_freqs_list(wpa_s, hw_mode, + params, is_6ghz_freq(ssid->frequency), + false, false); + } }