Move external_scan_running to wpa_radio
external_scan_running should be common to all interfaces that share a radio. This fixes a case where external_scan_running was set on a single interface, but did not block scan on other interfaces. Signed-off-by: Ben Rosenfeld <ben.rosenfeld@intel.com>
This commit is contained in:
parent
0c5f01fdf2
commit
d90bfa97f4
3 changed files with 7 additions and 7 deletions
|
@ -1313,7 +1313,7 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
|
||||||
#endif /* CONFIG_NO_RANDOM_POOL */
|
#endif /* CONFIG_NO_RANDOM_POOL */
|
||||||
|
|
||||||
if (own_request && wpa_s->scan_res_handler &&
|
if (own_request && wpa_s->scan_res_handler &&
|
||||||
(wpa_s->own_scan_running || !wpa_s->external_scan_running)) {
|
(wpa_s->own_scan_running || !wpa_s->radio->external_scan_running)) {
|
||||||
void (*scan_res_handler)(struct wpa_supplicant *wpa_s,
|
void (*scan_res_handler)(struct wpa_supplicant *wpa_s,
|
||||||
struct wpa_scan_results *scan_res);
|
struct wpa_scan_results *scan_res);
|
||||||
|
|
||||||
|
@ -1334,7 +1334,7 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
|
||||||
}
|
}
|
||||||
|
|
||||||
wpa_dbg(wpa_s, MSG_DEBUG, "New scan results available (own=%u ext=%u)",
|
wpa_dbg(wpa_s, MSG_DEBUG, "New scan results available (own=%u ext=%u)",
|
||||||
wpa_s->own_scan_running, wpa_s->external_scan_running);
|
wpa_s->own_scan_running, wpa_s->radio->external_scan_running);
|
||||||
if (wpa_s->last_scan_req == MANUAL_SCAN_REQ &&
|
if (wpa_s->last_scan_req == MANUAL_SCAN_REQ &&
|
||||||
wpa_s->manual_scan_use_id && wpa_s->own_scan_running) {
|
wpa_s->manual_scan_use_id && wpa_s->own_scan_running) {
|
||||||
wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_SCAN_RESULTS "id=%u",
|
wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_SCAN_RESULTS "id=%u",
|
||||||
|
@ -1347,7 +1347,7 @@ static int _wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
|
||||||
|
|
||||||
wpas_notify_scan_done(wpa_s, 1);
|
wpas_notify_scan_done(wpa_s, 1);
|
||||||
|
|
||||||
if (!wpa_s->own_scan_running && wpa_s->external_scan_running) {
|
if (!wpa_s->own_scan_running && wpa_s->radio->external_scan_running) {
|
||||||
wpa_dbg(wpa_s, MSG_DEBUG, "Do not use results from externally requested scan operation for network selection");
|
wpa_dbg(wpa_s, MSG_DEBUG, "Do not use results from externally requested scan operation for network selection");
|
||||||
wpa_scan_results_free(scan_res);
|
wpa_scan_results_free(scan_res);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -3073,7 +3073,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
wpa_dbg(wpa_s, MSG_DEBUG, "External program started a scan");
|
wpa_dbg(wpa_s, MSG_DEBUG, "External program started a scan");
|
||||||
wpa_s->external_scan_running = 1;
|
wpa_s->radio->external_scan_running = 1;
|
||||||
wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_SCAN_STARTED);
|
wpa_msg_ctrl(wpa_s, MSG_INFO, WPA_EVENT_SCAN_STARTED);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -3089,7 +3089,7 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
|
||||||
}
|
}
|
||||||
wpa_supplicant_event_scan_results(wpa_s, data);
|
wpa_supplicant_event_scan_results(wpa_s, data);
|
||||||
wpa_s->own_scan_running = 0;
|
wpa_s->own_scan_running = 0;
|
||||||
wpa_s->external_scan_running = 0;
|
wpa_s->radio->external_scan_running = 0;
|
||||||
radio_work_check_next(wpa_s);
|
radio_work_check_next(wpa_s);
|
||||||
break;
|
break;
|
||||||
#endif /* CONFIG_NO_SCAN_PROCESSING */
|
#endif /* CONFIG_NO_SCAN_PROCESSING */
|
||||||
|
|
|
@ -3611,7 +3611,7 @@ static void radio_start_next_work(void *eloop_ctx, void *timeout_ctx)
|
||||||
|
|
||||||
wpa_s = dl_list_first(&radio->ifaces, struct wpa_supplicant,
|
wpa_s = dl_list_first(&radio->ifaces, struct wpa_supplicant,
|
||||||
radio_list);
|
radio_list);
|
||||||
if (wpa_s && wpa_s->external_scan_running) {
|
if (wpa_s && wpa_s->radio->external_scan_running) {
|
||||||
wpa_printf(MSG_DEBUG, "Delay radio work start until externally triggered scan completes");
|
wpa_printf(MSG_DEBUG, "Delay radio work start until externally triggered scan completes");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -296,6 +296,7 @@ struct wpa_global {
|
||||||
struct wpa_radio {
|
struct wpa_radio {
|
||||||
char name[16]; /* from driver_ops get_radio_name() or empty if not
|
char name[16]; /* from driver_ops get_radio_name() or empty if not
|
||||||
* available */
|
* available */
|
||||||
|
unsigned int external_scan_running:1;
|
||||||
struct dl_list ifaces; /* struct wpa_supplicant::radio_list entries */
|
struct dl_list ifaces; /* struct wpa_supplicant::radio_list entries */
|
||||||
struct dl_list work; /* struct wpa_radio_work::list entries */
|
struct dl_list work; /* struct wpa_radio_work::list entries */
|
||||||
};
|
};
|
||||||
|
@ -596,7 +597,6 @@ struct wpa_supplicant {
|
||||||
unsigned int manual_scan_only_new:1;
|
unsigned int manual_scan_only_new:1;
|
||||||
unsigned int own_scan_requested:1;
|
unsigned int own_scan_requested:1;
|
||||||
unsigned int own_scan_running:1;
|
unsigned int own_scan_running:1;
|
||||||
unsigned int external_scan_running:1;
|
|
||||||
unsigned int clear_driver_scan_cache:1;
|
unsigned int clear_driver_scan_cache:1;
|
||||||
unsigned int manual_scan_id;
|
unsigned int manual_scan_id;
|
||||||
int scan_interval; /* time in sec between scans to find suitable AP */
|
int scan_interval; /* time in sec between scans to find suitable AP */
|
||||||
|
|
Loading…
Reference in a new issue