From 2f088e1e27e0905da6d9b527bfff2a569bdef458 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 14 Jan 2008 06:06:50 +0100 Subject: [PATCH] Remove unneeded callbacks from 802.03 and 802.11 plugins --- include/iface.h | 9 +++++---- plugins/80203.c | 4 +--- plugins/80211.c | 46 ++++++++++++---------------------------------- 3 files changed, 18 insertions(+), 41 deletions(-) diff --git a/include/iface.h b/include/iface.h index 601253d..96e9c4f 100644 --- a/include/iface.h +++ b/include/iface.h @@ -38,10 +38,10 @@ enum connman_iface_type { }; enum connman_iface_flags { - CONNMAN_IFACE_FLAG_RTNL = (1 << 0), - CONNMAN_IFACE_FLAG_IPV4 = (1 << 1), - CONNMAN_IFACE_FLAG_IPV6 = (1 << 2), - CONNMAN_IFACE_FLAG_CARRIER_DETECT = (1 << 3), + CONNMAN_IFACE_FLAG_RTNL = (1 << 0), + CONNMAN_IFACE_FLAG_IPV4 = (1 << 1), + CONNMAN_IFACE_FLAG_IPV6 = (1 << 2), + CONNMAN_IFACE_FLAG_SCANNING = (1 << 3), }; enum connman_iface_state { @@ -122,6 +122,7 @@ struct connman_iface_driver { int (*scan) (struct connman_iface *iface); int (*connect) (struct connman_iface *iface, struct connman_network *network); + int (*disconnect) (struct connman_iface *iface); void (*set_network) (struct connman_iface *iface, const char *network); diff --git a/plugins/80203.c b/plugins/80203.c index 65a22aa..d916c97 100644 --- a/plugins/80203.c +++ b/plugins/80203.c @@ -24,7 +24,6 @@ #endif #include -#include #include #include @@ -36,8 +35,7 @@ static int iface_probe(struct connman_iface *iface) iface->type = CONNMAN_IFACE_TYPE_80203; iface->flags = CONNMAN_IFACE_FLAG_RTNL | - CONNMAN_IFACE_FLAG_IPV4 | - CONNMAN_IFACE_FLAG_CARRIER_DETECT; + CONNMAN_IFACE_FLAG_IPV4; return 0; } diff --git a/plugins/80211.c b/plugins/80211.c index d8decec..3327d10 100644 --- a/plugins/80211.c +++ b/plugins/80211.c @@ -217,30 +217,6 @@ static void iface_remove(struct connman_iface *iface) free(data); } -static int iface_activate(struct connman_iface *iface) -{ - struct iface_data *data = connman_iface_get_data(iface); - - printf("[802.11] activate %s\n", data->ifname); - - connman_iface_update(iface, CONNMAN_IFACE_STATE_ENABLED); - - return 0; -} - -static int iface_shutdown(struct connman_iface *iface) -{ - struct iface_data *data = connman_iface_get_data(iface); - - printf("[802.11] shutdown %s\n", data->ifname); - - __supplicant_stop(iface); - - connman_iface_update(iface, CONNMAN_IFACE_STATE_OFF); - - return 0; -} - static int iface_scan(struct connman_iface *iface) { struct iface_data *data = connman_iface_get_data(iface); @@ -289,6 +265,17 @@ static int iface_connect(struct connman_iface *iface, return 0; } +static int iface_disconnect(struct connman_iface *iface) +{ + struct iface_data *data = connman_iface_get_data(iface); + + printf("[802.11] disconnect %s\n", data->ifname); + + __supplicant_stop(iface); + + return 0; +} + static void iface_set_network(struct connman_iface *iface, const char *network) { @@ -313,13 +300,6 @@ static void iface_set_passphrase(struct connman_iface *iface, data->passphrase = g_strdup(passphrase); } -static void iface_carrier(struct connman_iface *iface, int carrier) -{ - printf("[802.11] carrier %s\n", carrier ? "on" : "off"); - - connman_iface_indicate_carrier(iface, carrier); -} - static void parse_genie(struct station_data *station, unsigned char *data, int len) { @@ -535,13 +515,11 @@ static struct connman_iface_driver iface_driver = { .capability = "net.80211", .probe = iface_probe, .remove = iface_remove, - .activate = iface_activate, - .shutdown = iface_shutdown, .scan = iface_scan, .connect = iface_connect, + .disconnect = iface_disconnect, .set_network = iface_set_network, .set_passphrase = iface_set_passphrase, - .rtnl_carrier = iface_carrier, .rtnl_wireless = iface_wireless, }; -- 2.7.4