Don't remove network when G_SUPPLICANT_STATE_DISCONNECTED is received 12/179712/1 accepted/tizen/unified/20180523.144422 submit/tizen/20180523.065951
authorSaurav Babu <saurav.babu@samsung.com>
Mon, 21 May 2018 09:46:26 +0000 (15:16 +0530)
committerSaurav Babu <saurav.babu@samsung.com>
Mon, 21 May 2018 09:46:26 +0000 (15:16 +0530)
In case of WPS PBC connection without SSID, sometimes few attempts fail
and on subsequent retries connection is established successfully. If we
remove network when disconnection is received for the first time from
wpa_supplicant then future retries doesn't take place and WPS connection
without SSID always fails

Change-Id: I2a5754c5e4a442e3305befdea3a94a6c728ef817
Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
gsupplicant/gsupplicant.h
gsupplicant/supplicant.c
plugins/wifi.c

index 3dff2b465473ed874e5e11250fdfed6187ccf94a..b0984b8c0b8fb3282da7e77103b5f3063a7a144b 100755 (executable)
@@ -310,9 +310,6 @@ int g_supplicant_interface_disconnect(GSupplicantInterface *interface,
                                        GSupplicantInterfaceCallback callback,
                                                        void *user_data);
 
-#if defined TIZEN_EXT
-int g_supplicant_interface_remove_network(GSupplicantInterface *interface);
-#endif
 int g_supplicant_interface_set_apscan(GSupplicantInterface *interface,
                                                        unsigned int ap_scan);
 
index 4a78cee2e14fefbbeddd627ecf52a8a7895c6f21..a403c20219d42aec462932d953572178580bf52d 100644 (file)
@@ -6509,29 +6509,6 @@ int g_supplicant_set_widi_ies(GSupplicantP2PServiceParams *p2p_service_params,
        return -EINPROGRESS;
 }
 
-#if defined TIZEN_EXT
-int g_supplicant_interface_remove_network(GSupplicantInterface *interface)
-{
-       struct interface_data *data;
-
-       SUPPLICANT_DBG("");
-
-       if (interface == NULL)
-               return -EINVAL;
-
-       if (system_available == FALSE)
-               return -EFAULT;
-
-       data = dbus_malloc0(sizeof(*data));
-       if (data == NULL)
-               return -ENOMEM;
-
-       data->interface = interface;
-
-       return network_remove(data);
-}
-#endif
-
 static const char *g_supplicant_rule0 = "type=signal,"
                                        "path=" DBUS_PATH_DBUS ","
                                        "sender=" DBUS_SERVICE_DBUS ","
index aad3b2cc1555a75e6da69e4eb6c9a16c605d6e44..c471accf5fc549dc8bce0adac70c577b2bbf156d 100755 (executable)
@@ -3138,13 +3138,6 @@ static void interface_state(GSupplicantInterface *interface)
                }
 
 #if defined TIZEN_EXT
-               int err;
-
-               err = g_supplicant_interface_remove_network(wifi->interface);
-               if (err < 0)
-                       DBG("Failed to remove network(%d)", err);
-
-
                /* Some of Wi-Fi networks are not comply Wi-Fi specification.
                 * Retry association until its retry count is expired */
                if (handle_wifi_assoc_retry(network, wifi) == true) {
@@ -3157,23 +3150,6 @@ static void interface_state(GSupplicantInterface *interface)
                        DBG("Set disconnect reason code(%d)", wifi->disconnect_code);
                        connman_network_set_disconnect_reason(network, wifi->disconnect_code);
                }
-
-               /* To avoid unnecessary repeated association in wpa_supplicant,
-                * "RemoveNetwork" should be made when Wi-Fi is disconnected */
-               if (wps != true && wifi->network && wifi->disconnecting == false) {
-                       wifi->disconnecting = true;
-                       err = g_supplicant_interface_disconnect(wifi->interface,
-                                                       disconnect_callback, wifi->network);
-                       if (err < 0)
-                               wifi->disconnecting = false;
-
-               connman_network_set_connected(network, false);
-               connman_network_set_associating(network, false);
-
-               start_autoscan(device);
-
-               break;
-               }
 #endif
 
                connman_network_set_connected(network, false);