return FALSE;
}
-static int technology_enable(struct connman_technology *technology)
+static int technology_enable(struct connman_technology *technology,
+ connman_bool_t hardblock)
{
GSList *list;
int err = 0;
goto done;
}
+ if (hardblock == TRUE && technology->enable_persistent == FALSE)
+ goto done;
+
__connman_rfkill_block(technology->type, FALSE);
for (list = technology->device_list; list; list = list->next) {
return err;
}
-static int technology_disable(struct connman_technology *technology)
+static int technology_disable(struct connman_technology *technology,
+ connman_bool_t hardblock)
{
GSList *list;
int err = 0;
if (technology->tethering == TRUE)
set_tethering(technology, FALSE);
- __connman_rfkill_block(technology->type, TRUE);
+ if (hardblock == FALSE)
+ __connman_rfkill_block(technology->type, TRUE);
for (list = technology->device_list; list; list = list->next) {
struct connman_device *device = list->data;
int err;
if (powered == TRUE) {
- err = technology_enable(technology);
+ err = technology_enable(technology, FALSE);
persistent = TRUE;
} else {
- err = technology_disable(technology);
+ err = technology_disable(technology, FALSE);
persistent = FALSE;
}
struct connman_technology *technology = list->data;
if (offlinemode)
- err = technology_disable(technology);
+ err = technology_disable(technology, FALSE);
if (!offlinemode && technology->enable_persistent)
- err = technology_enable(technology);
+ err = technology_enable(technology, FALSE);
}
if (err == 0 || err == -EINPROGRESS || err == -EALREADY) {
technology->hardblocked = hardblock;
- if (hardblock == TRUE)
+ if (hardblock == TRUE) {
DBG("%s is switched off.", get_name(technology->type));
+ technology_disable(technology, TRUE);
+ } else
+ technology_enable(technology, TRUE);
+
}
int __connman_technology_add_rfkill(unsigned int index,