summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2012-06-15 14:13:42 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-06-18 10:57:19 +0300
commitf2a1f32186febe7a2b2f7ca41966fc21d032c76a (patch)
treeb8e1be9d626b408133788897e737372e96765fa8 /plugins
parentfc41a18566f0bb753fd8ce35873d1442942f464c (diff)
downloadconnman-f2a1f32186febe7a2b2f7ca41966fc21d032c76a.tar.gz
connman-f2a1f32186febe7a2b2f7ca41966fc21d032c76a.tar.bz2
connman-f2a1f32186febe7a2b2f7ca41966fc21d032c76a.zip
wifi: Stop scanning when disabling wifi
Move wifi scan stopping from wifi remove to wifi disable since only wifi disable is called when the wifi technology is disabled. Removing a wifi device will first disable it and then continue with the removal procedure.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/wifi.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/plugins/wifi.c b/plugins/wifi.c
index 3f9afad9..0b694714 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -237,12 +237,6 @@ static void wifi_remove(struct connman_device *device)
if (wifi == NULL)
return;
- 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);
@@ -637,6 +631,14 @@ static int wifi_disable(struct connman_device *device)
if (wifi->pending_network != NULL)
wifi->pending_network = NULL;
+ stop_autoscan(device);
+
+ /* In case of a user scan, device is still referenced */
+ if (connman_device_get_scanning(device) == TRUE) {
+ connman_device_set_scanning(device, FALSE);
+ connman_device_unref(wifi->device);
+ }
+
remove_networks(device, wifi);
ret = g_supplicant_interface_remove(wifi->interface, NULL, NULL);