diff options
author | Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com> | 2012-04-25 18:39:19 +0300 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2012-04-26 09:56:02 +0200 |
commit | b92241ff6c42441d0b0f57f3db9a2a0028bfdfa7 (patch) | |
tree | 519b76d248e7d2e2c8f0627d4f3b52a14f58381c /plugins | |
parent | c7e2ef6cd707dd3fab961d964538ac8f7f592554 (diff) | |
download | connman-b92241ff6c42441d0b0f57f3db9a2a0028bfdfa7.tar.gz connman-b92241ff6c42441d0b0f57f3db9a2a0028bfdfa7.tar.bz2 connman-b92241ff6c42441d0b0f57f3db9a2a0028bfdfa7.zip |
wifi: Be connected when relevant, stay connected if roaming
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/wifi.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/plugins/wifi.c b/plugins/wifi.c index 9ce380b0..6f750e53 100644 --- a/plugins/wifi.c +++ b/plugins/wifi.c @@ -1180,7 +1180,9 @@ static void interface_state(GSupplicantInterface *interface) case G_SUPPLICANT_STATE_ASSOCIATING: stop_autoscan(device); - connman_network_set_associating(network, TRUE); + if (wifi->connected == FALSE) + connman_network_set_associating(network, TRUE); + break; case G_SUPPLICANT_STATE_COMPLETED: @@ -1245,6 +1247,34 @@ static void interface_state(GSupplicantInterface *interface) wifi->state = state; + /* Saving wpa_s state policy: + * If connected and if the state changes are roaming related: + * --> We stay connected + * If completed + * --> We are connected + * All other case: + * --> We are not connected + * */ + switch (state) { + case G_SUPPLICANT_STATE_AUTHENTICATING: + case G_SUPPLICANT_STATE_ASSOCIATING: + case G_SUPPLICANT_STATE_ASSOCIATED: + case G_SUPPLICANT_STATE_4WAY_HANDSHAKE: + case G_SUPPLICANT_STATE_GROUP_HANDSHAKE: + if (wifi->connected == TRUE) + connman_warn("Probably roaming right now!" + " Staying connected..."); + else + wifi->connected = FALSE; + break; + case G_SUPPLICANT_STATE_COMPLETED: + wifi->connected = TRUE; + break; + default: + wifi->connected = FALSE; + break; + } + DBG("DONE"); } |