technology: Add bridge name to the tethering hook
authorSamuel Ortiz <sameo@linux.intel.com>
Mon, 8 Nov 2010 15:25:15 +0000 (16:25 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Mon, 8 Nov 2010 15:25:15 +0000 (16:25 +0100)
include/technology.h
plugins/bluetooth.c
src/connman.h
src/technology.c
src/tethering.c

index e45474d..dcab267 100644 (file)
@@ -48,7 +48,7 @@ struct connman_technology_driver {
        void (*remove_interface) (struct connman_technology *technology,
                                                                int index);
        int (*set_tethering) (struct connman_technology *technology,
-                                               connman_bool_t enabled);
+                               const char *bridge, connman_bool_t enabled);
 };
 
 int connman_technology_driver_register(struct connman_technology_driver *driver);
index bf89b98..b34ca1c 100644 (file)
@@ -943,7 +943,7 @@ static void tech_remove(struct connman_technology *technology)
 }
 
 static int tech_set_tethering(struct connman_technology *technology,
-                                               connman_bool_t enabled)
+                               const char *bridge, connman_bool_t enabled)
 {
        return 0;
 }
index 27a5b36..8cb4754 100644 (file)
@@ -316,8 +316,8 @@ void __connman_technology_add_interface(enum connman_service_type type,
                                int index, const char *name, const char *ident);
 void __connman_technology_remove_interface(enum connman_service_type type,
                                int index, const char *name, const char *ident);
-int __connman_technology_enable_tethering(void);
-int __connman_technology_disable_tethering(void);
+int __connman_technology_enable_tethering(const char *bridge);
+int __connman_technology_disable_tethering(const char *bridge);
 
 connman_bool_t __connman_technology_get_blocked(enum connman_service_type type);
 
index 1626f83..37d3974 100644 (file)
@@ -177,7 +177,7 @@ void __connman_technology_remove_interface(enum connman_service_type type,
        }
 }
 
-static int set_tethering(connman_bool_t enabled)
+static int set_tethering(const char *bridge, connman_bool_t enabled)
 {
        GSList *list;
 
@@ -188,20 +188,20 @@ static int set_tethering(connman_bool_t enabled)
                        continue;
 
                if (technology->driver->set_tethering)
-                       technology->driver->set_tethering(technology, enabled);
+                       technology->driver->set_tethering(technology, bridge, enabled);
        }
 
        return 0;
 }
 
-int __connman_technology_enable_tethering(void)
+int __connman_technology_enable_tethering(const char *bridge)
 {
-       return set_tethering(TRUE);
+       return set_tethering(bridge, TRUE);
 }
 
-int __connman_technology_disable_tethering(void)
+int __connman_technology_disable_tethering(const char *bridge)
 {
-       return set_tethering(FALSE);
+       return set_tethering(bridge, FALSE);
 }
 
 static void free_rfkill(gpointer data)
index 040d199..864f22c 100644 (file)
@@ -86,9 +86,9 @@ int __connman_tethering_set_status(connman_bool_t status)
 
        if (status == TRUE) {
                create_bridge(BRIDGE_NAME);
-               __connman_technology_enable_tethering();
+               __connman_technology_enable_tethering(BRIDGE_NAME);
        } else {
-               __connman_technology_disable_tethering();
+               __connman_technology_disable_tethering(BRIDGE_NAME);
                remove_bridge(BRIDGE_NAME);
        }