static DBusConnection *connection;
-static GHashTable *device_table;
static GSList *technology_list = NULL;
struct connman_rfkill {
technology_put(technology);
}
-static void unregister_technology(gpointer data)
-{
- struct connman_technology *technology = data;
-
- technology_put(technology);
-}
-
int __connman_technology_add_device(struct connman_device *device)
{
struct connman_technology *technology;
if (technology == NULL)
return -ENXIO;
- g_hash_table_insert(device_table, device, technology);
-
if (g_atomic_int_get(&technology->blocked))
goto done;
type = __connman_device_get_service_type(device);
__connman_notifier_unregister(type);
- technology = g_hash_table_lookup(device_table, device);
+ technology = technology_find(type);
if (technology == NULL)
return -ENXIO;
state_changed(technology);
}
- g_hash_table_remove(device_table, device);
-
return 0;
}
connection = connman_dbus_get_connection();
- device_table = g_hash_table_new_full(g_direct_hash, g_direct_equal,
- NULL, unregister_technology);
-
return 0;
}
{
DBG("");
- g_hash_table_destroy(device_table);
-
dbus_connection_unref(connection);
}