Add callbacks for Tethering enable/disable on technology level
authorMarcel Holtmann <marcel@holtmann.org>
Thu, 15 Jul 2010 15:46:27 +0000 (17:46 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 15 Jul 2010 15:46:27 +0000 (17:46 +0200)
src/connman.h
src/technology.c
src/tethering.c

index 1f4be8d..ebd94b3 100644 (file)
@@ -301,6 +301,9 @@ int __connman_technology_update_rfkill(unsigned int index,
                                                connman_bool_t hardblock);
 int __connman_technology_remove_rfkill(unsigned int index);
 
+int __connman_technology_enable_tethering(void);
+int __connman_technology_disable_tethering(void);
+
 #include <connman/device.h>
 
 int __connman_device_init(void);
index feaa95e..23f46cf 100644 (file)
@@ -100,6 +100,34 @@ void connman_technology_driver_unregister(struct connman_technology_driver *driv
        driver_list = g_slist_remove(driver_list, driver);
 }
 
+int __connman_technology_enable_tethering(void)
+{
+       GSList *list;
+
+       for (list = technology_list; list; list = list->next) {
+               struct connman_technology *technology = list->data;
+
+               if (technology->driver == NULL)
+                       continue;
+       }
+
+       return 0;
+}
+
+int __connman_technology_disable_tethering(void)
+{
+       GSList *list;
+
+       for (list = technology_list; list; list = list->next) {
+               struct connman_technology *technology = list->data;
+
+               if (technology->driver == NULL)
+                       continue;
+       }
+
+       return 0;
+}
+
 static void free_rfkill(gpointer data)
 {
        struct connman_rfkill *rfkill = data;
index 415d4bc..040d199 100644 (file)
@@ -84,10 +84,13 @@ int __connman_tethering_set_status(connman_bool_t status)
        if (status == tethering_status)
                return -EALREADY;
 
-       if (status == TRUE)
+       if (status == TRUE) {
                create_bridge(BRIDGE_NAME);
-       else
+               __connman_technology_enable_tethering();
+       } else {
+               __connman_technology_disable_tethering();
                remove_bridge(BRIDGE_NAME);
+       }
 
        tethering_status = status;