diff options
author | Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com> | 2012-10-02 12:27:11 +0300 |
---|---|---|
committer | Patrik Flykt <patrik.flykt@linux.intel.com> | 2012-10-03 13:18:26 +0300 |
commit | c57192242574cb314883c4837af0823aca6d435f (patch) | |
tree | 9e8a9b90be1bc633707ad18dd6ad01bd8920041c /src | |
parent | 2e592053410a01d4aa99366f81b8fc783ab03efb (diff) | |
download | connman-c57192242574cb314883c4837af0823aca6d435f.tar.gz connman-c57192242574cb314883c4837af0823aca6d435f.tar.bz2 connman-c57192242574cb314883c4837af0823aca6d435f.zip |
technology: Handle harblock if all of them have identical type
On some hardware, there exist two rfkill entities for the same type
with a cascading issue: if one is soft blocked, the other one is
hardblocked. But if the hardblock switch is set, all are hardblocked.
This patch figures out that a technology is hardblocked only if all
related rkill events get the same hardblock value.
Diffstat (limited to 'src')
-rw-r--r-- | src/technology.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/technology.c b/src/technology.c index 14861222..e9598aa5 100644 --- a/src/technology.c +++ b/src/technology.c @@ -1290,9 +1290,28 @@ void __connman_technology_set_connected(enum connman_service_type type, static void technology_apply_hardblock_change(struct connman_technology *technology, connman_bool_t hardblock) { + gboolean apply = TRUE; + GList *start, *list; + if (technology->hardblocked == hardblock) return; + start = g_hash_table_get_values(rfkill_list); + for (list = start; list != NULL; list = list->next) { + struct connman_rfkill *rfkill = list->data; + + if (rfkill->type != technology->type) + continue; + + if (rfkill->hardblock != hardblock) + apply = FALSE; + } + + g_list_free(start); + + if (apply == FALSE) + return; + technology->hardblocked = hardblock; if (hardblock == TRUE) |