Use minimal scan delay upon EVENT_INTERFACE_ADDED
This patch resets the static interface_count to zero in case of wpa_supplicant_driver_init() call for wpa_s which is in INTERFACE_DISABLED state. This interface_count is used for the delay of the scan which is now minimal for dynamically added interfaces. This may collide with a scan for another interface, but the same is true for any chosen delay in this scenario. Also the state change to DISCONNECTED is moved to wpa_supplicant_driver_init() so it will move from INTERFACE_DISABLED to INACTIVE when there are no enabled networks. Tested-by: Hante Meuleman <meuleman@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com>
This commit is contained in:
parent
5ddd07cb37
commit
a0e9d89203
2 changed files with 4 additions and 1 deletions
|
@ -2311,7 +2311,6 @@ wpa_supplicant_event_interface_status(struct wpa_supplicant *wpa_s,
|
||||||
wpa_msg(wpa_s, MSG_INFO, "Failed to initialize the "
|
wpa_msg(wpa_s, MSG_INFO, "Failed to initialize the "
|
||||||
"driver after interface was added");
|
"driver after interface was added");
|
||||||
}
|
}
|
||||||
wpa_supplicant_set_state(wpa_s, WPA_DISCONNECTED);
|
|
||||||
break;
|
break;
|
||||||
case EVENT_INTERFACE_REMOVED:
|
case EVENT_INTERFACE_REMOVED:
|
||||||
wpa_dbg(wpa_s, MSG_DEBUG, "Configured interface was removed");
|
wpa_dbg(wpa_s, MSG_DEBUG, "Configured interface was removed");
|
||||||
|
|
|
@ -2623,6 +2623,10 @@ int wpa_supplicant_driver_init(struct wpa_supplicant *wpa_s)
|
||||||
wpa_s->prev_scan_wildcard = 0;
|
wpa_s->prev_scan_wildcard = 0;
|
||||||
|
|
||||||
if (wpa_supplicant_enabled_networks(wpa_s)) {
|
if (wpa_supplicant_enabled_networks(wpa_s)) {
|
||||||
|
if (wpa_s->wpa_state == WPA_INTERFACE_DISABLED) {
|
||||||
|
wpa_supplicant_set_state(wpa_s, WPA_DISCONNECTED);
|
||||||
|
interface_count = 0;
|
||||||
|
}
|
||||||
if (wpa_supplicant_delayed_sched_scan(wpa_s, interface_count,
|
if (wpa_supplicant_delayed_sched_scan(wpa_s, interface_count,
|
||||||
100000))
|
100000))
|
||||||
wpa_supplicant_req_scan(wpa_s, interface_count,
|
wpa_supplicant_req_scan(wpa_s, interface_count,
|
||||||
|
|
Loading…
Reference in a new issue