summaryrefslogtreecommitdiff
path: root/src/technology.c
diff options
context:
space:
mode:
authorAlok Barsode <alok.barsode@nokia.com>2011-02-16 11:03:30 +0200
committerSamuel Ortiz <sameo@linux.intel.com>2011-02-16 15:07:02 +0100
commitb72172db05162f16d4be93179c3d18b0a1700edc (patch)
treeb94b0b8bfaca8e6224069191710b501f03bec28e /src/technology.c
parent63132a024bcf9c7127599c40a77da2099bc2ac66 (diff)
downloadconnman-b72172db05162f16d4be93179c3d18b0a1700edc.tar.gz
connman-b72172db05162f16d4be93179c3d18b0a1700edc.tar.bz2
connman-b72172db05162f16d4be93179c3d18b0a1700edc.zip
technology: Rename __connman_technology_[enable|disable]_device
Diffstat (limited to 'src/technology.c')
-rw-r--r--src/technology.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/technology.c b/src/technology.c
index aa6fde01..dc8b8456 100644
--- a/src/technology.c
+++ b/src/technology.c
@@ -674,21 +674,17 @@ int __connman_technology_remove_device(struct connman_device *device)
return 0;
}
-int __connman_technology_enable_device(struct connman_device *device)
+int __connman_technology_enable(enum connman_service_type type)
{
struct connman_technology *technology;
- enum connman_service_type type;
-
- DBG("device %p", device);
- technology = g_hash_table_lookup(device_table, device);
+ technology = technology_find(type);
if (technology == NULL)
return -ENXIO;
if (g_atomic_int_get(&technology->blocked))
return -ERFKILL;
- type = __connman_device_get_service_type(device);
__connman_notifier_enable(type);
if (g_atomic_int_exchange_and_add(&technology->enabled, 1) == 0) {
@@ -699,22 +695,18 @@ int __connman_technology_enable_device(struct connman_device *device)
return 0;
}
-int __connman_technology_disable_device(struct connman_device *device)
+int __connman_technology_disable(enum connman_service_type type)
{
struct connman_technology *technology;
- enum connman_service_type type;
GSList *list;
- DBG("device %p", device);
-
- type = __connman_device_get_service_type(device);
- __connman_notifier_disable(type);
-
- technology = g_hash_table_lookup(device_table, device);
+ technology = technology_find(type);
if (technology == NULL)
return -ENXIO;
if (g_atomic_int_dec_and_test(&technology->enabled) == TRUE) {
+ __connman_notifier_disable(type);
+
technology->state = CONNMAN_TECHNOLOGY_STATE_AVAILABLE;
state_changed(technology);
}