From: Marcel Holtmann Date: Fri, 5 Dec 2008 21:41:48 +0000 (+0100) Subject: Use separate enable/disable callbacks X-Git-Tag: accepted/2.0alpha-wayland/20121110.002834~4526 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=00762852ce32ff3c639241cb247290a1a5c76007;p=profile%2Fivi%2Fconnman.git Use separate enable/disable callbacks --- diff --git a/plugins/ethernet.c b/plugins/ethernet.c index d6861f8..bd2ddc2 100644 --- a/plugins/ethernet.c +++ b/plugins/ethernet.c @@ -193,8 +193,6 @@ static int ethernet_probe(struct connman_element *element) ethernet->index = element->index; - iface_up(ethernet); - connman_rtnl_send_getlink(); return 0; @@ -208,19 +206,41 @@ static void ethernet_remove(struct connman_element *element) connman_element_set_data(element, NULL); - iface_down(ethernet); - ethernet_list = g_slist_remove(ethernet_list, element); g_free(ethernet); } +static int ethernet_enable(struct connman_element *element) +{ + struct ethernet_data *ethernet = connman_element_get_data(element); + + DBG("element %p name %s", element, element->name); + + iface_up(ethernet); + + return 0; +} + +static int ethernet_disable(struct connman_element *element) +{ + struct ethernet_data *ethernet = connman_element_get_data(element); + + DBG("element %p name %s", element, element->name); + + iface_down(ethernet); + + return 0; +} + static struct connman_driver ethernet_driver = { .name = "ethernet", .type = CONNMAN_ELEMENT_TYPE_DEVICE, .subtype = CONNMAN_ELEMENT_SUBTYPE_ETHERNET, .probe = ethernet_probe, .remove = ethernet_remove, + .enable = ethernet_enable, + .disable = ethernet_disable, }; static int ethernet_init(void)