diff options
author | Alok Barsode <alok.barsode@linux.intel.com> | 2011-09-27 11:47:17 +0300 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-09-29 18:20:10 +0200 |
commit | 6971ff9c80f7155f0d119ccbbb7cf19a93a3cc26 (patch) | |
tree | 899e9baaff9f305893ceaaf87e9f9ddd7ca126ec | |
parent | 592054c266dd68160ae9c79916d3130d1f5b37d2 (diff) | |
download | connman-6971ff9c80f7155f0d119ccbbb7cf19a93a3cc26.tar.gz connman-6971ff9c80f7155f0d119ccbbb7cf19a93a3cc26.tar.bz2 connman-6971ff9c80f7155f0d119ccbbb7cf19a93a3cc26.zip |
technology: Register a rfkilled technology in technology_add_rfkill
If a technology was rfkilled before connman ran, we need to register
it. If such tech was enabled, technology->device_list will be empty.
We save the state, rfkill unblock the type and exit. When the devices
get unblocked, they are automatically enabled since we saved the enable
state.
-rw-r--r-- | src/technology.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/technology.c b/src/technology.c index 82146175..2b1763a1 100644 --- a/src/technology.c +++ b/src/technology.c @@ -859,6 +859,13 @@ int __connman_technology_enable(enum connman_service_type type, DBusMessage *msg __connman_rfkill_block(technology->type, FALSE); + /* + * An empty device list means that devices in the technology + * were rfkill blocked. The unblock above will enable the devs. + */ + if (technology->device_list == NULL) + return 0; + for (list = technology->device_list; list; list = list->next) { struct connman_device *device = list->data; @@ -1031,6 +1038,8 @@ int __connman_technology_add_rfkill(unsigned int index, if (rfkill == NULL) return -ENOMEM; + __connman_notifier_register(type); + rfkill->index = index; rfkill->type = type; rfkill->softblock = softblock; |