summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2012-10-10 08:18:45 (GMT)
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-10-16 10:18:02 (GMT)
commit583b1a120a8b5b11654c389144d9f7f96c4cfe35 (patch)
treef47f61249fdb58d290f71e4e99f933093661634f /plugins
parentc270ca4eeaefc43ec471ba0b5383b50f4d34c0b7 (diff)
downloadconnman-583b1a120a8b5b11654c389144d9f7f96c4cfe35.zip
connman-583b1a120a8b5b11654c389144d9f7f96c4cfe35.tar.gz
connman-583b1a120a8b5b11654c389144d9f7f96c4cfe35.tar.bz2
gsupplicant: Add a new state according to 'interface_disabled'
When soft rfkill is on, wpa_supplicant sets the interface disabled and sends a state named 'interface_disabled'. Taking this information into account fixes the following issue: - disable wifi (user setting) and hard rfkill it - then un-hard rfkill it, whereafter rfkill states (soft/hard) will go like this: * from 1/1 to 0/0 * from 0/0 to 1/0 when 0/0 occurs, connman will request to enable wifi The problem with this is that enabling wifi takes quite some time and in between ConnMan will soft block wifi to disable it (according to previous user setting). Thus it will request to disable wifi but since enabling is still going on, this request won't do anything. Meanwhile wpa_supplicant will also catch the soft rfkill event and wpa_supplicant will set the state to 'interface_disabled', but since it's not handled properly by ConnMan, the wifi_enable() callback will be called and the function will assume wifi got enabled.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/wifi.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/plugins/wifi.c b/plugins/wifi.c
index 2d81f80..2984de0 100644
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -1328,6 +1328,7 @@ static connman_bool_t is_idle(struct wifi_data *wifi)
switch (wifi->state) {
case G_SUPPLICANT_STATE_UNKNOWN:
+ case G_SUPPLICANT_STATE_DISABLED:
case G_SUPPLICANT_STATE_DISCONNECTED:
case G_SUPPLICANT_STATE_INACTIVE:
case G_SUPPLICANT_STATE_SCANNING:
@@ -1357,6 +1358,7 @@ static connman_bool_t is_idle_wps(GSupplicantInterface *interface,
* actually means that we are idling. */
switch (wifi->state) {
case G_SUPPLICANT_STATE_UNKNOWN:
+ case G_SUPPLICANT_STATE_DISABLED:
case G_SUPPLICANT_STATE_DISCONNECTED:
case G_SUPPLICANT_STATE_INACTIVE:
case G_SUPPLICANT_STATE_SCANNING:
@@ -1527,6 +1529,7 @@ static void interface_state(GSupplicantInterface *interface)
break;
case G_SUPPLICANT_STATE_UNKNOWN:
+ case G_SUPPLICANT_STATE_DISABLED:
case G_SUPPLICANT_STATE_ASSOCIATED:
case G_SUPPLICANT_STATE_4WAY_HANDSHAKE:
case G_SUPPLICANT_STATE_GROUP_HANDSHAKE: