From: Marcel Holtmann Date: Thu, 15 Jul 2010 15:52:58 +0000 (+0200) Subject: Add technology driver callback for setting Tethering X-Git-Tag: 2.0_alpha~2650 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f6fba1e209c93b91ccce9873e7ec187949d15b48;p=framework%2Fconnectivity%2Fconnman.git Add technology driver callback for setting Tethering --- diff --git a/include/technology.h b/include/technology.h index 5635040..7638454 100644 --- a/include/technology.h +++ b/include/technology.h @@ -42,6 +42,8 @@ struct connman_technology_driver { int priority; int (*probe) (struct connman_technology *technology); void (*remove) (struct connman_technology *technology); + int (*set_tethering) (struct connman_technology *technology, + connman_bool_t enabled); }; int connman_technology_driver_register(struct connman_technology_driver *driver); diff --git a/src/technology.c b/src/technology.c index 23f46cf..0ee91a3 100644 --- a/src/technology.c +++ b/src/technology.c @@ -100,7 +100,7 @@ void connman_technology_driver_unregister(struct connman_technology_driver *driv driver_list = g_slist_remove(driver_list, driver); } -int __connman_technology_enable_tethering(void) +static int set_tethering(connman_bool_t enabled) { GSList *list; @@ -109,23 +109,22 @@ int __connman_technology_enable_tethering(void) if (technology->driver == NULL) continue; + + if (technology->driver->set_tethering) + technology->driver->set_tethering(technology, enabled); } return 0; } -int __connman_technology_disable_tethering(void) +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 set_tethering(TRUE); +} - return 0; +int __connman_technology_disable_tethering(void) +{ + return set_tethering(FALSE); } static void free_rfkill(gpointer data)