wifi: don't fail first scan after supplicant interface is ready

If the supplicant interface became ready but the device was still
UNAVAILABLE, requesting a scan before transitioning to DISCONNECTED
would just fail because can_scan() returns FALSE when the device's
state is not >= DISCONNECTED.  Change device state first so that
doesn't happen.
This commit is contained in:
Dan Williams 2009-11-11 16:34:15 -08:00
parent b94510e3b3
commit 92db663514

View file

@ -2245,10 +2245,6 @@ supplicant_iface_state_cb_handler (gpointer user_data)
if (task->new_state == NM_SUPPLICANT_INTERFACE_STATE_READY) {
priv->scan_interval = SCAN_INTERVAL_MIN;
/* Request a scan to get latest results */
cancel_pending_scan (self);
request_wireless_scan (self);
/* If the interface can now be activated because the supplicant is now
* available, transition to DISCONNECTED.
*/
@ -2257,6 +2253,10 @@ supplicant_iface_state_cb_handler (gpointer user_data)
nm_device_state_changed (NM_DEVICE (self), NM_DEVICE_STATE_DISCONNECTED,
NM_DEVICE_STATE_REASON_SUPPLICANT_AVAILABLE);
}
/* Request a scan to get latest results */
cancel_pending_scan (self);
request_wireless_scan (self);
} else if (task->new_state == NM_SUPPLICANT_INTERFACE_STATE_DOWN) {
cleanup_association_attempt (self, FALSE);
supplicant_interface_release (self);