diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c index 2858cbdd2..46e7cf1ab 100644 --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c @@ -64,8 +64,6 @@ static int wpas_select_network_from_last_scan(struct wpa_supplicant *wpa_s, bool trigger_6ghz_scan, union wpa_event_data *data); #endif /* CONFIG_NO_SCAN_PROCESSING */ -static int wpas_trigger_6ghz_scan(struct wpa_supplicant *wpa_s, - union wpa_event_data *data); int wpas_temp_disabled(struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid) @@ -2400,6 +2398,32 @@ static int wpa_supplicant_need_to_roam(struct wpa_supplicant *wpa_s, } +static int wpas_trigger_6ghz_scan(struct wpa_supplicant *wpa_s, + union wpa_event_data *data) +{ + struct wpa_driver_scan_params params; + unsigned int j; + + wpa_dbg(wpa_s, MSG_INFO, "Triggering 6GHz-only scan"); + os_memset(¶ms, 0, sizeof(params)); + params.non_coloc_6ghz = wpa_s->last_scan_non_coloc_6ghz; + for (j = 0; j < data->scan_info.num_ssids; j++) + params.ssids[j] = data->scan_info.ssids[j]; + params.num_ssids = data->scan_info.num_ssids; + wpa_add_scan_freqs_list(wpa_s, HOSTAPD_MODE_IEEE80211A, ¶ms, + true, false, false); + if (!wpa_supplicant_trigger_scan(wpa_s, ¶ms, true, true)) { + wpa_s->scan_in_progress_6ghz = true; + wpas_notify_scan_in_progress_6ghz(wpa_s); + os_free(params.freqs); + return 1; + } + wpa_dbg(wpa_s, MSG_INFO, "Failed to trigger 6GHz-only scan"); + os_free(params.freqs); + return 0; +} + + static bool wpas_short_ssid_match(struct wpa_supplicant *wpa_s, struct wpa_scan_results *scan_res) { @@ -2664,32 +2688,6 @@ scan_work_done: } -static int wpas_trigger_6ghz_scan(struct wpa_supplicant *wpa_s, - union wpa_event_data *data) -{ - struct wpa_driver_scan_params params; - unsigned int j; - - wpa_dbg(wpa_s, MSG_INFO, "Triggering 6GHz-only scan"); - os_memset(¶ms, 0, sizeof(params)); - params.non_coloc_6ghz = wpa_s->last_scan_non_coloc_6ghz; - for (j = 0; j < data->scan_info.num_ssids; j++) - params.ssids[j] = data->scan_info.ssids[j]; - params.num_ssids = data->scan_info.num_ssids; - wpa_add_scan_freqs_list(wpa_s, HOSTAPD_MODE_IEEE80211A, ¶ms, - true, false, false); - if (!wpa_supplicant_trigger_scan(wpa_s, ¶ms, true, true)) { - wpa_s->scan_in_progress_6ghz = true; - wpas_notify_scan_in_progress_6ghz(wpa_s); - os_free(params.freqs); - return 1; - } - wpa_dbg(wpa_s, MSG_INFO, "Failed to trigger 6GHz-only scan"); - os_free(params.freqs); - return 0; -} - - /** * Select a network from the last scan * @wpa_s: Pointer to wpa_supplicant data