summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2012-10-15 12:35:22 (GMT)
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-10-16 12:07:14 (GMT)
commitbd3fe70bd9fadaa7bda00079822a8b7b75a76050 (patch)
tree0f106c5f41519a5554907b66f314cc919518010e
parent47f491badb3abce50e805567974893f1e7af15bc (diff)
downloadconnman-bd3fe70bd9fadaa7bda00079822a8b7b75a76050.zip
connman-bd3fe70bd9fadaa7bda00079822a8b7b75a76050.tar.gz
connman-bd3fe70bd9fadaa7bda00079822a8b7b75a76050.tar.bz2
technology: Recompute hardblocked state on rfkill remove event
This fixes the case of cascading rfkill switches: if enabled, hard rfkilling such technology might generate contradictory events. 1 - first all switches are hardblocked 2 - then one of these switch (usually: device's switch) gets fully unblocked 3 - then this same switch gets removed Step 2 is in contradiction with step 1, so we need to care about such switch getting removed by recomputing the hardblocked state.
-rw-r--r--src/technology.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/technology.c b/src/technology.c
index 44eeb13..976964a 100644
--- a/src/technology.c
+++ b/src/technology.c
@@ -1346,6 +1346,10 @@ static connman_bool_t technology_apply_rfkill_change(struct connman_technology *
gboolean apply = TRUE;
GList *start, *list;
+ DBG("technology %p --> %d/%d vs %d/%d",
+ technology, softblock, hardblock,
+ technology->softblocked, technology->hardblocked);
+
if (technology->hardblocked == hardblock)
goto softblock_change;
@@ -1519,6 +1523,9 @@ int __connman_technology_remove_rfkill(unsigned int index,
if (technology == NULL)
return -ENXIO;
+ technology_apply_rfkill_change(technology,
+ technology->softblocked, !technology->hardblocked);
+
technology_put(technology);
return 0;