Remove unneeded callbacks from 802.03 and 802.11 plugins
authorMarcel Holtmann <marcel@holtmann.org>
Mon, 14 Jan 2008 05:06:50 +0000 (06:06 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Mon, 14 Jan 2008 05:06:50 +0000 (06:06 +0100)
include/iface.h
plugins/80203.c
plugins/80211.c

index 601253d..96e9c4f 100644 (file)
@@ -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);
index 65a22aa..d916c97 100644 (file)
@@ -24,7 +24,6 @@
 #endif
 
 #include <stdio.h>
-#include <arpa/inet.h>
 
 #include <connman/plugin.h>
 #include <connman/iface.h>
@@ -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;
 }
index d8decec..3327d10 100644 (file)
@@ -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,
 };