aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/events.c
diff options
context:
space:
mode:
authorArik Nemtsov <arik@wizery.com>2016-09-27 10:09:58 (GMT)
committerJouni Malinen <j@w1.fi>2016-09-30 19:45:03 (GMT)
commitebf59eb549827ecfb7a42281721a1af9cfa0d7a1 (patch)
treec7834372cb233ce539f2dee1c32f96ebd0b74f01 /wpa_supplicant/events.c
parent746e5c2565e28a8659052e63012647bda4cc6443 (diff)
downloadhostap-ebf59eb549827ecfb7a42281721a1af9cfa0d7a1.zip
hostap-ebf59eb549827ecfb7a42281721a1af9cfa0d7a1.tar.gz
hostap-ebf59eb549827ecfb7a42281721a1af9cfa0d7a1.tar.bz2
Restart PNO/sched_scan on channel list update
As the scan channels might need to change when the channel list has been updated by the kernel. Use the simulated sched_scan timeout (wpas_scan_restart_sched_scan()) to handle a possible race where an ongoing sched_scan has stopped asynchronously while trying to restart a new sched_scan. Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Diffstat (limited to 'wpa_supplicant/events.c')
-rw-r--r--wpa_supplicant/events.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 6f8fc81..46da770 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -3219,14 +3219,16 @@ static void wpa_supplicant_update_channel_list(
free_hw_features(ifs);
ifs->hw.modes = wpa_drv_get_hw_feature_data(
ifs, &ifs->hw.num_modes, &ifs->hw.flags);
- }
- /* Restart sched_scan with updated channel list */
- if (wpa_s->sched_scanning) {
- wpa_dbg(wpa_s, MSG_DEBUG,
- "Channel list changed restart sched scan.");
- wpa_supplicant_cancel_sched_scan(wpa_s);
- wpa_supplicant_req_scan(wpa_s, 0, 0);
+ /* Restart PNO/sched_scan with updated channel list */
+ if (ifs->pno) {
+ wpas_stop_pno(ifs);
+ wpas_start_pno(ifs);
+ } else if (ifs->sched_scanning && !ifs->pno_sched_pending) {
+ wpa_dbg(ifs, MSG_DEBUG,
+ "Channel list changed - restart sched_scan");
+ wpas_scan_restart_sched_scan(ifs);
+ }
}
wpas_p2p_update_channel_list(wpa_s, WPAS_P2P_CHANNEL_UPDATE_DRIVER);