timeserver: Simplify timeserver IP address checking
[framework/connectivity/connman.git] / plugins / wifi.c
index 09d7ab4..3cd2be2 100644 (file)
@@ -825,6 +825,8 @@ static int wifi_scan_fast(struct connman_device *device)
        if (wifi->tethering == TRUE)
                return 0;
 
+       stop_autoscan(device);
+
        if (connman_device_get_scanning(device) == TRUE)
                return -EALREADY;
 
@@ -844,8 +846,6 @@ static int wifi_scan_fast(struct connman_device *device)
                return wifi_scan(device);
        }
 
-       stop_autoscan(device);
-
        connman_device_ref(device);
        ret = g_supplicant_interface_scan(wifi->interface, scan_params,
                                                scan_callback, device);
@@ -881,6 +881,8 @@ static int wifi_scan_hidden(struct connman_device *device,
        if (ssid == NULL || ssid_len == 0 || ssid_len > 32)
                return -EINVAL;
 
+       stop_autoscan(device);
+
        if (connman_device_get_scanning(device) == TRUE)
                return -EALREADY;
 
@@ -911,8 +913,6 @@ static int wifi_scan_hidden(struct connman_device *device,
        hidden->passphrase = g_strdup(passphrase);
        wifi->hidden = hidden;
 
-       stop_autoscan(device);
-
        connman_device_ref(device);
        ret = g_supplicant_interface_scan(wifi->interface, scan_params,
                        scan_callback, device);