summaryrefslogtreecommitdiff
path: root/src/technology.c
diff options
context:
space:
mode:
authorPatrik Flykt <patrik.flykt@linux.intel.com>2013-01-28 17:44:37 +0200
committerPatrik Flykt <patrik.flykt@linux.intel.com>2013-01-30 10:28:02 +0200
commit1daefbd49f0b75533c1b0cfc7444ad748064333c (patch)
tree5434d99cacfd1db09ba85f08d14b985690034c51 /src/technology.c
parent69b4c5dea3a3486246c847ea149047c25c7717ae (diff)
downloadconnman-1daefbd49f0b75533c1b0cfc7444ad748064333c.tar.gz
connman-1daefbd49f0b75533c1b0cfc7444ad748064333c.tar.bz2
connman-1daefbd49f0b75533c1b0cfc7444ad748064333c.zip
technology: Enable/disable individual devices also with rfkill
In order to keep ConnMan devices in sync with Bluz 5 adapters, the individual devices need to be enabled/disabled also when unblocking/blocking them with rfkill. Thus enable devices after unblocking and disable devices before blocking with rfkill.
Diffstat (limited to 'src/technology.c')
-rw-r--r--src/technology.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/technology.c b/src/technology.c
index bc02bec9..799e2533 100644
--- a/src/technology.c
+++ b/src/technology.c
@@ -598,6 +598,9 @@ static int technology_affect_devices(struct connman_technology *technology,
static int technology_enable(struct connman_technology *technology)
{
+ int err = 0;
+ int err_dev;
+
DBG("technology %p enable", technology);
__sync_synchronize();
@@ -608,13 +611,20 @@ static int technology_enable(struct connman_technology *technology)
return -EBUSY;
if (technology->rfkill_driven == TRUE)
- return __connman_rfkill_block(technology->type, FALSE);
+ err = __connman_rfkill_block(technology->type, FALSE);
+
+ err_dev = technology_affect_devices(technology, TRUE);
- return technology_affect_devices(technology, TRUE);
+ if (technology->rfkill_driven == FALSE)
+ err = err_dev;
+
+ return err;
}
static int technology_disable(struct connman_technology *technology)
{
+ int err;
+
DBG("technology %p disable", technology);
__sync_synchronize();
@@ -627,10 +637,12 @@ static int technology_disable(struct connman_technology *technology)
if (technology->tethering == TRUE)
set_tethering(technology, FALSE);
+ err = technology_affect_devices(technology, FALSE);
+
if (technology->rfkill_driven == TRUE)
- return __connman_rfkill_block(technology->type, TRUE);
+ err = __connman_rfkill_block(technology->type, TRUE);
- return technology_affect_devices(technology, FALSE);
+ return err;
}
static DBusMessage *set_powered(struct connman_technology *technology,