summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2013-03-01 11:17:58 (GMT)
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-03-05 11:22:24 (GMT)
commit0ba752cd651f972554f573534794b6e17c0e15fb (patch)
tree90067307a9d2d635d91ed4df3ac713380dc5e6b6 /plugins
parent00881d31e4e7cbbc57a101e68099103e9604f9ca (diff)
downloadconnman-0ba752cd651f972554f573534794b6e17c0e15fb.zip
connman-0ba752cd651f972554f573534794b6e17c0e15fb.tar.gz
connman-0ba752cd651f972554f573534794b6e17c0e15fb.tar.bz2
wifi: Preliminary fix for autoscanning known hidden SSIDs
Currently, it relies on max_ssids to know how many SSIDs it can provide as paremeters. However, patch 6af0579c434058536fb40480f40f5e9895cfe863, which fixes an issue about fast scanning, affects such feature. Therefore, as a default, it will fallback to 1 if given max_ssids is 0. There is still the issue that it will autoscan only max_ssid (1 or more) known hidden SSIDs. This need to be fixed. Reported by Sameer Naik
Diffstat (limited to 'plugins')
-rw-r--r--plugins/wifi.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/plugins/wifi.c b/plugins/wifi.c
index 4b097fc..dd79cd3 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -530,7 +530,8 @@ static void scan_callback_hidden(int result,
{
struct connman_device *device = user_data;
struct wifi_data *wifi = connman_device_get_data(device);
- int driver_max_ssids;
+ GSupplicantScanParams *scan_params;
+ int driver_max_ssids, ret;
DBG("result %d wifi %p", result, wifi);
@@ -539,32 +540,30 @@ static void scan_callback_hidden(int result,
/*
* Scan hidden networks so that we can autoconnect to them.
+ * We will assume 1 as a default number of ssid to scan.
*/
driver_max_ssids = g_supplicant_interface_get_max_scan_ssids(
wifi->interface);
- DBG("max ssids %d", driver_max_ssids);
+ if (driver_max_ssids == 0)
+ driver_max_ssids = 1;
- if (driver_max_ssids > 0) {
- GSupplicantScanParams *scan_params;
- int ret;
+ DBG("max ssids %d", driver_max_ssids);
- scan_params = g_try_malloc0(sizeof(GSupplicantScanParams));
- if (scan_params == NULL)
- goto out;
+ scan_params = g_try_malloc0(sizeof(GSupplicantScanParams));
+ if (scan_params == NULL)
+ goto out;
- if (get_hidden_connections(driver_max_ssids,
- scan_params) > 0) {
- ret = g_supplicant_interface_scan(wifi->interface,
+ if (get_hidden_connections(driver_max_ssids, scan_params) > 0) {
+ ret = g_supplicant_interface_scan(wifi->interface,
scan_params,
scan_callback,
device);
- if (ret == 0)
- return;
- }
-
- g_supplicant_free_scan_params(scan_params);
+ if (ret == 0)
+ return;
}
+ g_supplicant_free_scan_params(scan_params);
+
out:
scan_callback(result, interface, user_data);
}