summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2012-07-04 14:24:41 (GMT)
committerMarcel Holtmann <marcel@holtmann.org>2012-07-05 07:08:40 (GMT)
commit5b45fc2b74bcb7244afee60ae651749f882dbe9e (patch)
tree7043aa00f896c60fd8752d8acd32b9b1c76b3985 /plugins
parentaff46402fdbd86925cee5de4d36546b8b289b99b (diff)
downloadconnman-5b45fc2b74bcb7244afee60ae651749f882dbe9e.zip
connman-5b45fc2b74bcb7244afee60ae651749f882dbe9e.tar.gz
connman-5b45fc2b74bcb7244afee60ae651749f882dbe9e.tar.bz2
wifi: Add support for autoscan request
Diffstat (limited to 'plugins')
-rw-r--r--plugins/wifi.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/plugins/wifi.c b/plugins/wifi.c
index 0a842f9..c0f7ddc 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -604,6 +604,18 @@ static void setup_autoscan(struct wifi_data *wifi)
start_autoscan(wifi->device);
}
+static void interface_autoscan_callback(int result,
+ GSupplicantInterface *interface,
+ void *user_data)
+{
+ struct wifi_data *wifi = user_data;
+
+ if (result < 0) {
+ DBG("Could not enable Autoscan, falling back...");
+ setup_autoscan(wifi);
+ }
+}
+
static void interface_create_callback(int result,
GSupplicantInterface *interface,
void *user_data)
@@ -636,7 +648,11 @@ static void interface_create_callback(int result,
return;
/* Setting up automatic scanning */
- setup_autoscan(wifi);
+ if (g_supplicant_interface_autoscan(interface, AUTOSCAN_DEFAULT,
+ interface_autoscan_callback, wifi) < 0) {
+ DBG("Could not enable Autoscan, falling back...");
+ setup_autoscan(wifi);
+ }
}
static int wifi_enable(struct connman_device *device)