summaryrefslogtreecommitdiff
path: root/plugins/wifi.c
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2012-05-25 11:17:42 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-05-25 14:54:46 +0300
commit4bf651579338f163d18b63a25c3d10846c8e2b3d (patch)
tree8669fc8ad1afa2a168dfebf1d5fbbbc5a40288e5 /plugins/wifi.c
parentbb163c7901093a4779dafd61d194627caabbdbc2 (diff)
downloadconnman-4bf651579338f163d18b63a25c3d10846c8e2b3d.tar.gz
connman-4bf651579338f163d18b63a25c3d10846c8e2b3d.tar.bz2
connman-4bf651579338f163d18b63a25c3d10846c8e2b3d.zip
wifi: Stop autoscan in the relevant place.
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.
Diffstat (limited to 'plugins/wifi.c')
-rw-r--r--plugins/wifi.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/wifi.c b/plugins/wifi.c
index 09d7ab4c..3cd2be29 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -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);