connman_bool_t softblock,
connman_bool_t hardblock);
int __connman_technology_update_rfkill(unsigned int index,
+ enum connman_service_type type,
connman_bool_t softblock,
connman_bool_t hardblock);
-int __connman_technology_remove_rfkill(unsigned int index);
+int __connman_technology_remove_rfkill(unsigned int index,
+ enum connman_service_type type);
void __connman_technology_add_interface(enum connman_service_type type,
int index, const char *name, const char *ident);
event->type, event->op,
event->soft, event->hard);
+ type = convert_type(event->type);
+
switch (event->op) {
case RFKILL_OP_ADD:
- type = convert_type(event->type);
__connman_technology_add_rfkill(event->idx, type,
event->soft, event->hard);
break;
case RFKILL_OP_DEL:
- __connman_technology_remove_rfkill(event->idx);
+ __connman_technology_remove_rfkill(event->idx, type);
break;
case RFKILL_OP_CHANGE:
- __connman_technology_update_rfkill(event->idx, event->soft,
- event->hard);
+ __connman_technology_update_rfkill(event->idx, type,
+ event->soft, event->hard);
break;
default:
break;
static DBusConnection *connection;
-static GHashTable *rfkill_table;
static GHashTable *device_table;
static GSList *technology_list = NULL;
rfkill->softblock = softblock;
rfkill->hardblock = hardblock;
- g_hash_table_replace(rfkill_table, &rfkill->index, technology);
-
g_hash_table_replace(technology->rfkill_list, &rfkill->index, rfkill);
blocked = (softblock || hardblock) ? TRUE : FALSE;
}
int __connman_technology_update_rfkill(unsigned int index,
+ enum connman_service_type type,
connman_bool_t softblock,
connman_bool_t hardblock)
{
DBG("index %u soft %u hard %u", index, softblock, hardblock);
- technology = g_hash_table_lookup(rfkill_table, &index);
+ technology = technology_find(type);
if (technology == NULL)
return -ENXIO;
return 0;
}
-int __connman_technology_remove_rfkill(unsigned int index)
+int __connman_technology_remove_rfkill(unsigned int index,
+ enum connman_service_type type)
{
struct connman_technology *technology;
struct connman_rfkill *rfkill;
DBG("index %u", index);
- technology = g_hash_table_lookup(rfkill_table, &index);
+ technology = technology_find(type);
if (technology == NULL)
return -ENXIO;
g_hash_table_remove(technology->rfkill_list, &index);
- g_hash_table_remove(rfkill_table, &index);
-
if (blocked &&
g_atomic_int_dec_and_test(&technology->blocked) == TRUE) {
technology_blocked(technology, FALSE);
connection = connman_dbus_get_connection();
- rfkill_table = g_hash_table_new_full(g_int_hash, g_int_equal,
- NULL, unregister_technology);
device_table = g_hash_table_new_full(g_direct_hash, g_direct_equal,
NULL, unregister_technology);
DBG("");
g_hash_table_destroy(device_table);
- g_hash_table_destroy(rfkill_table);
dbus_connection_unref(connection);
}