Do not start new radio work on scan completion during ext work

Externally triggered scan could result in a new radio work item getting
started even when external radio work was in progress. Delay such start
until the external work is completed.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2014-12-01 17:49:19 +02:00 committed by Jouni Malinen
parent 243dcc4ae4
commit e374522827
3 changed files with 10 additions and 0 deletions

View File

@ -5976,6 +5976,7 @@ static void wpa_supplicant_ctrl_iface_flush(struct wpa_supplicant *wpa_s)
eapol_sm_notify_logoff(wpa_s->eapol, FALSE);
radio_remove_works(wpa_s, NULL, 1);
wpa_s->ext_work_in_progress = 0;
wpa_s->next_ssid = NULL;
@ -6029,6 +6030,7 @@ static void wpas_ctrl_radio_work_timeout(void *eloop_ctx, void *timeout_ctx)
"Timing out external radio work %u (%s)",
ework->id, work->type);
wpa_msg(work->wpa_s, MSG_INFO, EXT_RADIO_WORK_TIMEOUT "%u", ework->id);
work->wpa_s->ext_work_in_progress = 0;
radio_work_done(work);
os_free(ework);
}
@ -6050,6 +6052,7 @@ static void wpas_ctrl_radio_work_cb(struct wpa_radio_work *work, int deinit)
wpa_dbg(work->wpa_s, MSG_DEBUG, "Starting external radio work %u (%s)",
ework->id, ework->type);
wpa_msg(work->wpa_s, MSG_INFO, EXT_RADIO_WORK_START "%u", ework->id);
work->wpa_s->ext_work_in_progress = 1;
if (!ework->timeout)
ework->timeout = 10;
eloop_register_timeout(ework->timeout, 0, wpas_ctrl_radio_work_timeout,
@ -6129,6 +6132,7 @@ static int wpas_ctrl_radio_work_done(struct wpa_supplicant *wpa_s, char *cmd)
"Completed external radio work %u (%s)",
ework->id, ework->type);
eloop_cancel_timeout(wpas_ctrl_radio_work_timeout, work, NULL);
wpa_s->ext_work_in_progress = 0;
radio_work_done(work);
os_free(ework);
return 3; /* "OK\n" */

View File

@ -3513,6 +3513,11 @@ void radio_work_check_next(struct wpa_supplicant *wpa_s)
if (dl_list_empty(&radio->work))
return;
if (wpa_s->ext_work_in_progress) {
wpa_printf(MSG_DEBUG,
"External radio work in progress - delay start of pending item");
return;
}
eloop_cancel_timeout(radio_start_next_work, radio, NULL);
eloop_register_timeout(0, 0, radio_start_next_work, radio, NULL);
}

View File

@ -888,6 +888,7 @@ struct wpa_supplicant {
unsigned int ext_mgmt_frame_handling:1;
unsigned int ext_eapol_frame_io:1;
unsigned int wmm_ac_supported:1;
unsigned int ext_work_in_progress:1;
#ifdef CONFIG_WNM
u8 wnm_dialog_token;