Add support for technology interface
[framework/connectivity/connman.git] / src / device.c
index da8ee89..c78e421 100644 (file)
@@ -2,7 +2,7 @@
  *
  *  Connection Manager
  *
- *  Copyright (C) 2007-2009  Intel Corporation. All rights reserved.
+ *  Copyright (C) 2007-2010  Intel Corporation. All rights reserved.
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License version 2 as
@@ -478,13 +478,6 @@ static GDBusSignalTable device_signals[] = {
        { },
 };
 
-static void emit_devices_signal(void)
-{
-       connman_dbus_property_changed_array(CONNMAN_MANAGER_PATH,
-                       CONNMAN_MANAGER_INTERFACE, "Devices",
-                       DBUS_TYPE_OBJECT_PATH, __connman_device_list, NULL);
-}
-
 static int register_interface(struct connman_element *element)
 {
        struct connman_device *device = element->device;
@@ -501,8 +494,6 @@ static int register_interface(struct connman_element *element)
 
        device->registered = TRUE;
 
-       emit_devices_signal();
-
        return 0;
 }
 
@@ -514,8 +505,6 @@ static void unregister_interface(struct connman_element *element)
 
        device->registered = FALSE;
 
-       emit_devices_signal();
-
        g_dbus_unregister_interface(connection, element->path,
                                                CONNMAN_DEVICE_INTERFACE);
 }
@@ -535,6 +524,8 @@ static int setup_device(struct connman_device *device)
                return err;
        }
 
+       __connman_technology_add_device(device);
+
        type = __connman_device_get_service_type(device);
        __connman_notifier_register(type);
 
@@ -545,6 +536,9 @@ static int setup_device(struct connman_device *device)
                break;
        }
 
+       if (__connman_udev_get_blocked(device->phyindex) == TRUE)
+               return 0;
+
        if (device->offlinemode == FALSE &&
                                device->powered_persistent == TRUE)
                __connman_device_enable(device);
@@ -593,6 +587,8 @@ static void remove_device(struct connman_device *device)
        type = __connman_device_get_service_type(device);
        __connman_notifier_unregister(type);
 
+       __connman_technology_remove_device(device);
+
        unregister_interface(&device->element);
 
        if (device->driver->remove)