summaryrefslogtreecommitdiff
path: root/src/technology.c
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2012-10-15 15:35:14 +0300
committerPatrik Flykt <patrik.flykt@linux.intel.com>2012-10-16 15:02:52 +0300
commit75a2878a29945d9f4f9db135d82336109a888f5d (patch)
tree37d13f90f750d586f37f398b1ec7e218e84ba26d /src/technology.c
parent911b920a34803672825a5e085c602dd0ff037e34 (diff)
downloadconnman-75a2878a29945d9f4f9db135d82336109a888f5d.tar.gz
connman-75a2878a29945d9f4f9db135d82336109a888f5d.tar.bz2
connman-75a2878a29945d9f4f9db135d82336109a888f5d.zip
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
Diffstat (limited to 'src/technology.c')
-rw-r--r--src/technology.c13
1 files changed, 10 insertions, 3 deletions
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);
/*