summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Kim <jeik01.kim@samsung.com>2019-07-26 12:22:49 +0000
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>2019-07-26 12:22:49 +0000
commitd9e04fb45fc32e3109e322bd02e6b7e395908ea0 (patch)
treefa520545bce6689dda94bc91536ece23ccf35e3e
parentd938dc84198bc79796aae0bd41a57eb79a1cc492 (diff)
parent04c6c60d23b121e2aed176e1a1d8a3b8525a1599 (diff)
downloadconnman-d9e04fb45fc32e3109e322bd02e6b7e395908ea0.tar.gz
connman-d9e04fb45fc32e3109e322bd02e6b7e395908ea0.tar.bz2
connman-d9e04fb45fc32e3109e322bd02e6b7e395908ea0.zip
Merge "Refactoring of scan for stored hidden profiles." into tizen
-rw-r--r--plugins/wifi.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/plugins/wifi.c b/plugins/wifi.c
index a434d5b6..9d0e3439 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -165,6 +165,7 @@ struct wifi_data {
struct connman_network *scan_pending_network;
bool allow_full_scan;
unsigned int automaxspeed_timeout;
+ GSupplicantScanParams *hidden_scan_params;
#endif
int disconnect_code;
int assoc_code;
@@ -1580,6 +1581,16 @@ static void wifi_remove(struct connman_device *device)
if (wifi->scan_params)
g_supplicant_free_scan_params(wifi->scan_params);
+#if defined TIZEN_EXT
+ if (wifi->hidden_scan_params) {
+ while (wifi->hidden_scan_params->ssids) {
+ struct scan_ssid *ssid;
+ ssid = wifi->hidden_scan_params->ssids->data;
+ wifi->hidden_scan_params->ssids = g_slist_remove(wifi->hidden_scan_params->ssids, ssid);
+ }
+ g_supplicant_free_scan_params(wifi->hidden_scan_params);
+ }
+#endif
g_free(wifi->autoscan);
g_free(wifi->identifier);
@@ -1816,6 +1827,22 @@ static int get_hidden_connections_params(struct wifi_data *wifi,
DBG("max ssids %d", driver_max_ssids);
+#if defined TIZEN_EXT
+ if (!wifi->hidden_scan_params) {
+ wifi->hidden_scan_params = g_try_malloc0(sizeof(GSupplicantScanParams));
+ if (!wifi->hidden_scan_params)
+ return 0;
+
+ if (get_hidden_connections(wifi->hidden_scan_params) == 0) {
+ g_supplicant_free_scan_params(wifi->hidden_scan_params);
+ wifi->hidden_scan_params = NULL;
+
+ return 0;
+ }
+ }
+
+ orig_params = wifi->hidden_scan_params;
+#else
if (!wifi->scan_params) {
wifi->scan_params = g_try_malloc0(sizeof(GSupplicantScanParams));
if (!wifi->scan_params)
@@ -1830,12 +1857,17 @@ static int get_hidden_connections_params(struct wifi_data *wifi,
}
orig_params = wifi->scan_params;
+#endif
/* Let's transfer driver_max_ssids params */
for (i = 0; i < driver_max_ssids; i++) {
struct scan_ssid *ssid;
+#if defined TIZEN_EXT
+ if (!wifi->hidden_scan_params->ssids)
+#else
if (!wifi->scan_params->ssids)
+#endif
break;
ssid = orig_params->ssids->data;
@@ -1863,8 +1895,13 @@ static int get_hidden_connections_params(struct wifi_data *wifi,
err:
g_slist_free_full(scan_params->ssids, g_free);
+#if defined TIZEN_EXT
+ g_supplicant_free_scan_params(wifi->hidden_scan_params);
+ wifi->hidden_scan_params = NULL;
+#else
g_supplicant_free_scan_params(wifi->scan_params);
wifi->scan_params = NULL;
+#endif
return 0;
}
@@ -1974,6 +2011,13 @@ static void scan_callback(int result, GSupplicantInterface *interface,
g_supplicant_free_scan_params(wifi->scan_params);
wifi->scan_params = NULL;
}
+
+#if defined TIZEN_EXT
+ if (wifi->hidden_scan_params && !wifi->hidden_scan_params->ssids) {
+ g_supplicant_free_scan_params(wifi->hidden_scan_params);
+ wifi->hidden_scan_params = NULL;
+ }
+#endif
}
if (result < 0)
@@ -2078,8 +2122,13 @@ static void scan_callback_hidden(int result,
if (get_hidden_connections_params(wifi, scan_params) > 0) {
ret = g_supplicant_interface_scan(wifi->interface,
scan_params,
+#if defined TIZEN_EXT
+ scan_callback,
+#else
scan_callback_hidden,
+#endif
device);
+
if (ret == 0)
return;
}