From: Tomasz Bursztyka Date: Mon, 15 Oct 2012 12:35:14 +0000 (+0300) Subject: technology: Add a marker to know if a technology is rfkill driven X-Git-Tag: 1.9~36 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=75a2878a29945d9f4f9db135d82336109a888f5d;p=platform%2Fupstream%2Fconnman.git technology: Add a marker to know if a technology is rfkill driven Useful for coming patches: enabling/disabling technologies will be done differently whether technology is rfkill driven or not: - if rfkill driven -> enabled will rely on rfkill states - if not -> enabled will rely on driver/devices states --- diff --git a/src/technology.c b/src/technology.c index 3f7141ad..11bf0c0c 100644 --- a/src/technology.c +++ b/src/technology.c @@ -73,6 +73,7 @@ struct connman_technology { GSList *scan_pending; + connman_bool_t rfkill_driven; connman_bool_t hardblocked; connman_bool_t dbus_registered; }; @@ -548,7 +549,8 @@ void __connman_technology_list_struct(DBusMessageIter *array) struct connman_technology *technology = list->data; if (technology->path == NULL || - technology->hardblocked == TRUE) + (technology->rfkill_driven == TRUE && + technology->hardblocked == TRUE)) continue; dbus_message_iter_open_container(array, DBUS_TYPE_STRUCT, @@ -644,7 +646,7 @@ static DBusMessage *set_powered(struct connman_technology *technology, DBusMessage *reply = NULL; int err = 0; - if (technology->hardblocked == TRUE) { + if (technology->rfkill_driven && technology->hardblocked == TRUE) { err = -EACCES; goto make_reply; } @@ -925,7 +927,8 @@ static const GDBusSignalTable technology_signals[] = { static gboolean technology_dbus_register(struct connman_technology *technology) { if (technology->dbus_registered == TRUE || - technology->hardblocked == TRUE) + (technology->rfkill_driven && + technology->hardblocked == TRUE)) return TRUE; if (g_dbus_register_interface(connection, technology->path, @@ -984,6 +987,8 @@ static struct connman_technology *technology_get(enum connman_service_type type) technology->refcount = 1; + technology->rfkill_driven = FALSE; + if (type == CONNMAN_SERVICE_TYPE_ETHERNET) technology->hardblocked = FALSE; else @@ -1379,6 +1384,8 @@ done: if (technology == NULL) return -ENXIO; + technology->rfkill_driven = TRUE; + technology_apply_hardblock_change(technology, hardblock); /*