stop_autoscan(device);
+ /* In case of a user scan, device is still referenced */
+ if (connman_device_get_scanning(device) == TRUE)
+ connman_device_unref(wifi->device);
+
iface_list = g_list_remove(iface_list, wifi);
remove_networks(device, wifi);
if (wifi->tethering == TRUE)
return 0;
+ if (connman_device_get_scanning(device) == TRUE)
+ return -EALREADY;
+
connman_device_ref(device);
ret = g_supplicant_interface_scan(wifi->interface, NULL,
if (wifi->tethering == TRUE)
return 0;
+ stop_autoscan(device);
+
+ if (connman_device_get_scanning(device) == TRUE)
+ return -EALREADY;
+
driver_max_ssids = g_supplicant_interface_get_max_scan_ssids(
wifi->interface);
DBG("max ssids %d", driver_max_ssids);
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;
+
scan_params = g_try_malloc0(sizeof(GSupplicantScanParams));
if (scan_params == NULL)
return -ENOMEM;
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);