summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJukka Rissanen <jukka.rissanen@linux.intel.com>2013-07-15 17:25:46 +0300
committerZhang zhengguang <zhengguang.zhang@intel.com>2013-08-09 10:38:05 +0800
commit271c6d901cc54617a4ce4d8ad1d69da980665a8d (patch)
treea40d64ccd5f23304f28abb8b7ce093b038642b1c
parentf19f2485b1c7e8b585472d3dfc60f791b45c3b3b (diff)
downloadconnman-271c6d901cc54617a4ce4d8ad1d69da980665a8d.tar.gz
connman-271c6d901cc54617a4ce4d8ad1d69da980665a8d.tar.bz2
connman-271c6d901cc54617a4ce4d8ad1d69da980665a8d.zip
Upstream/technology: Follow external rfkill events and act accordingly
Fix bug: CM-645 Fix bug: TIVI-1044 Upstream commit id: 48dbff35d34257dc7055a35aae2a19ed0a06825b
-rw-r--r--src/technology.c33
1 files changed, 27 insertions, 6 deletions
diff --git a/src/technology.c b/src/technology.c
index d8f23c10..3b8f6a82 100644
--- a/src/technology.c
+++ b/src/technology.c
@@ -1726,14 +1726,35 @@ int __connman_technology_update_rfkill(unsigned int index,
return 0;
/*
- * Depending on softblocked state we unblock/block according to
- * persistent state.
+ * State diagram how to set the block status from individual
+ * technology status fields:
+ *
+ * enabled | softblocked | offline | is
+ * | | | blocked
+ * -----------+---------------+-----------+----------
+ * no | no | no | yes
+ * yes | no | no | no
+ * no | yes | no | yes
+ * yes | yes | no | yes
+ * no | no | yes | yes
+ * yes | no | yes | no
+ * no | yes | yes | yes
+ * yes | yes | yes | yes
+ *
+ * The enabled is controlled by dbus API (typically
+ * from UI). softblocked is set either by dbus API or by
+ * external event. Offline (flight mode) is set via dbus
+ * API.
*/
- if (technology->softblocked == TRUE &&
- technology->enable_persistent == TRUE)
+
+ DBG("type %d enabled %d soft %d hard %d blocked %d",
+ type, technology->enabled,
+ technology->softblocked, technology->hardblocked,
+ !(technology->enabled && !technology->softblocked));
+
+ if (technology->enabled && !technology->softblocked)
return __connman_rfkill_block(type, FALSE);
- else if (technology->softblocked == FALSE &&
- technology->enable_persistent == FALSE)
+ else
return __connman_rfkill_block(type, TRUE);
return 0;