If not stopped before checking the scanning status of the device, we might
not raise a user initiated scan just because an autoscan is going one which
is bogus.
if (wifi->tethering == TRUE)
return 0;
+ stop_autoscan(device);
+
if (connman_device_get_scanning(device) == TRUE)
return -EALREADY;
return wifi_scan(device);
}
- stop_autoscan(device);
-
connman_device_ref(device);
ret = g_supplicant_interface_scan(wifi->interface, scan_params,
scan_callback, device);
if (ssid == NULL || ssid_len == 0 || ssid_len > 32)
return -EINVAL;
+ stop_autoscan(device);
+
if (connman_device_get_scanning(device) == TRUE)
return -EALREADY;
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);