summaryrefslogtreecommitdiff
path: root/plugins/wifi.c
diff options
context:
space:
mode:
authorNiraj Kumar Goit <niraj.g@samsung.com>2019-03-29 16:05:49 +0530
committerNiraj Kumar Goit <niraj.g@samsung.com>2019-04-05 12:56:09 +0530
commit69efc565b595bb39ebdbe635f063675ecf59278c (patch)
tree33c51a4e1d04ba61a143033e32afda67cd93cf83 /plugins/wifi.c
parent85074ce75ce1749e270dc9951d003d4a3c1f9cab (diff)
downloadconnman-accepted/tizen/unified/20190410.061801.tar.gz
connman-accepted/tizen/unified/20190410.061801.tar.bz2
connman-accepted/tizen/unified/20190410.061801.zip
Added support of Multiple same SSIDs including band steering.submit/tizen/20190409.131053accepted/tizen/unified/20190410.061801
When there are multiple APs with the same SSID and security, this patch support below features: 1. If AP does not respond to probe request during connection procedure, connman tries to connect with the next available BSSID before sending disconnected event to application. 2. If connection with AP is failed during association due to ASSOC_REJECT, connman tries to connect with the next available BSSID before sending disconnected event to application. Change-Id: Ie80939bd013a12b9c88e91a1fd5a05fbb57c1833 Signed-off-by: Niraj Kumar Goit <niraj.g@samsung.com>
Diffstat (limited to 'plugins/wifi.c')
-rw-r--r--plugins/wifi.c42
1 files changed, 41 insertions, 1 deletions
diff --git a/plugins/wifi.c b/plugins/wifi.c
index cd543be9..dfcff59c 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -3261,7 +3261,32 @@ static void ssid_init(GSupplicantSSID *ssid, struct connman_network *network)
ssid->pin_wps = connman_network_get_string(network, "WiFi.PinWPS");
#if defined TIZEN_EXT
- ssid->bssid = connman_network_get_bssid(network);
+ GSList *bssid_list = (GSList *)connman_network_get_bssid_list(network);
+ if (bssid_list && g_slist_length(bssid_list) > 1) {
+ GSList *list;
+ char buff[MAC_ADDRESS_LENGTH];
+ for (list = bssid_list; list; list = list->next) {
+ struct connman_bssids * bssids = (struct connman_bssids *)list->data;
+
+ g_snprintf(buff, MAC_ADDRESS_LENGTH, "%02x:%02x:%02x:%02x:%02x:%02x",
+ bssids->bssid[0], bssids->bssid[1], bssids->bssid[2],
+ bssids->bssid[3], bssids->bssid[4], bssids->bssid[5]);
+ buff[MAC_ADDRESS_LENGTH - 1] = '\0';
+
+ char *last_bssid = connman_network_get_last_bssid(network);
+
+ if (strcmp(last_bssid, buff) == 0) {
+ DBG("last_bssid match, try next bssid");
+ continue;
+ } else {
+ connman_network_set_last_bssid(network, buff);
+
+ ssid->bssid = &(bssids->bssid[0]);
+ break;
+ }
+ }
+ } else
+ ssid->bssid = connman_network_get_bssid(network);
ssid->eap_keymgmt = network_eap_keymgmt(
connman_network_get_string(network, "WiFi.KeymgmtType"));
@@ -3740,7 +3765,11 @@ static bool handle_assoc_status_code(GSupplicantInterface *interface,
struct wifi_data *wifi)
{
if (wifi->state == G_SUPPLICANT_STATE_ASSOCIATING &&
+#if defined TIZEN_EXT
+ wifi->assoc_code > 0 &&
+#else
wifi->assoc_code == ASSOC_STATUS_NO_CLIENT &&
+#endif
wifi->load_shaping_retries < LOAD_SHAPING_MAX_RETRIES) {
wifi->load_shaping_retries ++;
return TRUE;
@@ -3962,8 +3991,15 @@ static void interface_state(GSupplicantInterface *interface)
if (is_idle(wifi))
break;
+#if defined TIZEN_EXT
+ if (handle_assoc_status_code(interface, wifi)) {
+ network_connect(network);
+ break;
+ }
+#else
if (handle_assoc_status_code(interface, wifi))
break;
+#endif
/* If previous state was 4way-handshake, then
* it's either: psk was incorrect and thus we retry
@@ -4593,6 +4629,10 @@ static void network_changed(GSupplicantNetwork *network, const char *property)
bssid_list = (GSList *)g_supplicant_network_get_bssid_list(network);
connman_network_set_bssid_list(connman_network, bssid_list);
connman_network_set_phy_mode(connman_network, phy_mode);
+
+ if (g_str_equal(property, "CheckMultiBssidConnect") &&
+ connman_network_get_associating(connman_network))
+ network_connect(connman_network);
#endif
}