diff options
author | Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com> | 2012-07-04 17:24:41 +0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2012-07-05 09:08:40 +0200 |
commit | 5b45fc2b74bcb7244afee60ae651749f882dbe9e (patch) | |
tree | 7043aa00f896c60fd8752d8acd32b9b1c76b3985 /plugins/wifi.c | |
parent | aff46402fdbd86925cee5de4d36546b8b289b99b (diff) | |
download | connman-5b45fc2b74bcb7244afee60ae651749f882dbe9e.tar.gz connman-5b45fc2b74bcb7244afee60ae651749f882dbe9e.tar.bz2 connman-5b45fc2b74bcb7244afee60ae651749f882dbe9e.zip |
wifi: Add support for autoscan request
Diffstat (limited to 'plugins/wifi.c')
-rw-r--r-- | plugins/wifi.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/plugins/wifi.c b/plugins/wifi.c index 0a842f9b..c0f7ddc4 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) |