summaryrefslogtreecommitdiff
path: root/plugins/ethernet.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-12-05 22:41:48 +0100
committerMarcel Holtmann <marcel@holtmann.org>2008-12-05 22:41:48 +0100
commit00762852ce32ff3c639241cb247290a1a5c76007 (patch)
treeef057cefe5b0abec4c4e4809faaf7556f5becd52 /plugins/ethernet.c
parent9703f77e6f49cf5bcf318c1f2d315a6250ae773d (diff)
downloadconnman-00762852ce32ff3c639241cb247290a1a5c76007.tar.gz
connman-00762852ce32ff3c639241cb247290a1a5c76007.tar.bz2
connman-00762852ce32ff3c639241cb247290a1a5c76007.zip
Use separate enable/disable callbacks
Diffstat (limited to 'plugins/ethernet.c')
-rw-r--r--plugins/ethernet.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/plugins/ethernet.c b/plugins/ethernet.c
index d6861f8d..bd2ddc29 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)