char *path;
GHashTable *rfkill_list;
GSList *device_list;
+ gint enabled;
};
static void free_rfkill(gpointer data)
DBG("device %p", device);
type = __connman_device_get_service_type(device);
+ __connman_notifier_register(type);
technology = technology_get(type);
if (technology == NULL)
int __connman_technology_remove_device(struct connman_device *device)
{
struct connman_technology *technology;
+ enum connman_service_type type;
DBG("device %p", device);
+ type = __connman_device_get_service_type(device);
+ __connman_notifier_unregister(type);
+
technology = g_hash_table_lookup(device_table, device);
if (technology == NULL)
return -ENXIO;
return 0;
}
+int __connman_technology_enable_device(struct connman_device *device)
+{
+ struct connman_technology *technology;
+ enum connman_service_type type;
+
+ DBG("device %p", device);
+
+ type = __connman_device_get_service_type(device);
+ __connman_notifier_enable(type);
+
+ technology = g_hash_table_lookup(device_table, device);
+ if (technology == NULL)
+ return -ENXIO;
+
+ if (g_atomic_int_exchange_and_add(&technology->enabled, 1) == 0) {
+ technology->state = CONNMAN_TECHNOLOGY_STATE_ENABLED;
+ state_changed(technology);
+ }
+
+ return 0;
+}
+
+int __connman_technology_disable_device(struct connman_device *device)
+{
+ struct connman_technology *technology;
+ enum connman_service_type type;
+
+ DBG("device %p", device);
+
+ type = __connman_device_get_service_type(device);
+ __connman_notifier_disable(type);
+
+ technology = g_hash_table_lookup(device_table, device);
+ if (technology == NULL)
+ return -ENXIO;
+
+ if (g_atomic_int_dec_and_test(&technology->enabled) == TRUE) {
+ technology->state = CONNMAN_TECHNOLOGY_STATE_AVAILABLE;
+ state_changed(technology);
+ }
+
+ return 0;
+}
+
int __connman_technology_add_rfkill(unsigned int index,
enum connman_service_type type,
connman_bool_t softblock,