wifi: Register technology driver
authorSamuel Ortiz <sameo@linux.intel.com>
Tue, 30 Nov 2010 19:12:34 +0000 (20:12 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Thu, 2 Dec 2010 11:07:28 +0000 (12:07 +0100)
plugins/wifi.c

index eacace4e33058060594b151a9dc4123db94a3257..542ab2f55d322edd043fefd76fe7f2de4e1b30fd 100644 (file)
@@ -44,6 +44,7 @@
 #include <connman/inet.h>
 #include <connman/device.h>
 #include <connman/rtnl.h>
+#include <connman/technology.h>
 #include <connman/log.h>
 #include <connman/option.h>
 
@@ -632,6 +633,28 @@ static struct connman_network_driver network_driver = {
        .disconnect     = network_disconnect,
 };
 
+static int tech_probe(struct connman_technology *technology)
+{
+       return 0;
+}
+
+static void tech_remove(struct connman_technology *technology)
+{
+}
+
+static int tech_set_regdom(struct connman_technology *technology, const char *alpha2)
+{
+       return 0;
+}
+
+static struct connman_technology_driver tech_driver = {
+       .name           = "bluetooth",
+       .type           = CONNMAN_SERVICE_TYPE_BLUETOOTH,
+       .probe          = tech_probe,
+       .remove         = tech_remove,
+       .set_regdom     = tech_set_regdom,
+};
+
 static int wifi_init(void)
 {
        int err;
@@ -646,6 +669,13 @@ static int wifi_init(void)
                return err;
        }
 
+       err = connman_technology_driver_register(&tech_driver);
+       if (err < 0) {
+               g_supplicant_unregister(&callbacks);
+               connman_network_driver_unregister(&network_driver);
+               return err;
+       }
+
        return 0;
 }
 
@@ -653,6 +683,8 @@ static void wifi_exit(void)
 {
        DBG();
 
+       connman_technology_driver_unregister(&tech_driver);
+
        g_supplicant_unregister(&callbacks);
 
        connman_network_driver_unregister(&network_driver);