net: remove COMPAT_NET_DEV_OPS
authorAlexander Beregalov <a.beregalov@gmail.com>
Mon, 25 May 2009 08:53:53 +0000 (01:53 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 25 May 2009 08:53:53 +0000 (01:53 -0700)
All drivers are already converted to new net_device_ops API
and nobody uses old API anymore.

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/Kconfig
include/linux/netdevice.h
net/802/fddi.c
net/802/hippi.c
net/8021q/vlan_dev.c
net/appletalk/dev.c
net/core/dev.c
net/ethernet/eth.c

index 0fb446e047e7dfdb1246fd9199cc5196a217d0ff..efa659f0fb53d0271492d814bec3a38c1b50b651 100644 (file)
@@ -25,15 +25,6 @@ menuconfig NETDEVICES
 # that for each of the symbols.
 if NETDEVICES
 
-config COMPAT_NET_DEV_OPS
-       default y
-       bool "Enable older network device API compatibility"
-       ---help---
-          This option enables kernel compatibility with older network devices
-          that do not use net_device_ops interface.
-
-         If unsure, say Y.
-
 config IFB
        tristate "Intermediate Functional Block support"
        depends on NET_CLS_ACT
index f8574e76b743a9a9ddf7f67797465439b9c27601..ae3c2099a04b98070ce06475b55801912a6656b8 100644 (file)
@@ -901,44 +901,6 @@ struct net_device
        /* max exchange id for FCoE LRO by ddp */
        unsigned int            fcoe_ddp_xid;
 #endif
-
-#ifdef CONFIG_COMPAT_NET_DEV_OPS
-       struct {
-               int                     (*init)(struct net_device *dev);
-               void                    (*uninit)(struct net_device *dev);
-               int                     (*open)(struct net_device *dev);
-               int                     (*stop)(struct net_device *dev);
-               int                     (*hard_start_xmit) (struct sk_buff *skb,
-                                                           struct net_device *dev);
-               u16                     (*select_queue)(struct net_device *dev,
-                                                       struct sk_buff *skb);
-               void                    (*change_rx_flags)(struct net_device *dev,
-                                                          int flags);
-               void                    (*set_rx_mode)(struct net_device *dev);
-               void                    (*set_multicast_list)(struct net_device *dev);
-               int                     (*set_mac_address)(struct net_device *dev,
-                                                          void *addr);
-               int                     (*validate_addr)(struct net_device *dev);
-               int                     (*do_ioctl)(struct net_device *dev,
-                                                   struct ifreq *ifr, int cmd);
-               int                     (*set_config)(struct net_device *dev,
-                                                     struct ifmap *map);
-               int                     (*change_mtu)(struct net_device *dev, int new_mtu);
-               int                     (*neigh_setup)(struct net_device *dev,
-                                                      struct neigh_parms *);
-               void                    (*tx_timeout) (struct net_device *dev);
-               struct net_device_stats* (*get_stats)(struct net_device *dev);
-               void                    (*vlan_rx_register)(struct net_device *dev,
-                                                           struct vlan_group *grp);
-               void                    (*vlan_rx_add_vid)(struct net_device *dev,
-                                                          unsigned short vid);
-               void                    (*vlan_rx_kill_vid)(struct net_device *dev,
-                                                           unsigned short vid);
-#ifdef CONFIG_NET_POLL_CONTROLLER
-               void                    (*poll_controller)(struct net_device *dev);
-#endif
-       };
-#endif
 };
 #define to_net_dev(d) container_of(d, struct net_device, dev)
 
index 539e6064e6d4224fb08cac728c2fa71d2bd6e4df..3ef0ab0a543a5bfbf7e4b4cc709ba7919c82bfa5 100644 (file)
@@ -185,10 +185,6 @@ static const struct header_ops fddi_header_ops = {
 static void fddi_setup(struct net_device *dev)
 {
        dev->header_ops         = &fddi_header_ops;
-#ifdef CONFIG_COMPAT_NET_DEV_OPS
-       dev->change_mtu         = fddi_change_mtu,
-#endif
-
        dev->type               = ARPHRD_FDDI;
        dev->hard_header_len    = FDDI_K_SNAP_HLEN+3;   /* Assume 802.2 SNAP hdr len + 3 pad bytes */
        dev->mtu                = FDDI_K_SNAP_DLEN;     /* Assume max payload of 802.2 SNAP frame */
index 313b9ebf92ee23fb4b2b6e6d1dfb2ce75432368c..cd3e8e9295295fd3746cc20bd9068de5c7338d5b 100644 (file)
@@ -193,11 +193,6 @@ static const struct header_ops hippi_header_ops = {
 
 static void hippi_setup(struct net_device *dev)
 {
-#ifdef CONFIG_COMPAT_NET_DEV_OPS
-       dev->change_mtu                 = hippi_change_mtu;
-       dev->set_mac_address            = hippi_mac_addr;
-       dev->neigh_setup                = hippi_neigh_setup_dev;
-#endif
        dev->header_ops                 = &hippi_header_ops;
 
        /*
index ff7572ac548173e8e97b61a9cc1e8e5f673e7c9f..1e2ad4c7c59b157c9ca3604703c926731369c5c1 100644 (file)
@@ -644,7 +644,6 @@ static int vlan_dev_init(struct net_device *dev)
                dev->hard_header_len = real_dev->hard_header_len + VLAN_HLEN;
                dev->netdev_ops         = &vlan_netdev_ops;
        }
-       netdev_resync_ops(dev);
 
        if (is_vlan_dev(real_dev))
                subclass = 1;
index 72277d70c980be38035f11bc7aae0a1be46b8398..6c8016f618661d931467bf2a005ee1933eec1797 100644 (file)
@@ -9,21 +9,10 @@
 #include <linux/if_arp.h>
 #include <linux/if_ltalk.h>
 
-#ifdef CONFIG_COMPAT_NET_DEV_OPS
-static int ltalk_change_mtu(struct net_device *dev, int mtu)
-{
-       return -EINVAL;
-}
-#endif
-
 static void ltalk_setup(struct net_device *dev)
 {
        /* Fill in the fields of the device structure with localtalk-generic values. */
 
-#ifdef CONFIG_COMPAT_NET_DEV_OPS
-       dev->change_mtu         = ltalk_change_mtu;
-#endif
-
        dev->type               = ARPHRD_LOCALTLK;
        dev->hard_header_len    = LTALK_HLEN;
        dev->mtu                = LTALK_MTU;
index 3942266d1f6c7a0ca3c23beb1b9d1be7cc26c9cf..241613f6dd2fe2aacc87883dabc426956be0b1df 100644 (file)
@@ -4580,39 +4580,6 @@ unsigned long netdev_fix_features(unsigned long features, const char *name)
 }
 EXPORT_SYMBOL(netdev_fix_features);
 
-/* Some devices need to (re-)set their netdev_ops inside
- * ->init() or similar.  If that happens, we have to setup
- * the compat pointers again.
- */
-void netdev_resync_ops(struct net_device *dev)
-{
-#ifdef CONFIG_COMPAT_NET_DEV_OPS
-       const struct net_device_ops *ops = dev->netdev_ops;
-
-       dev->init = ops->ndo_init;
-       dev->uninit = ops->ndo_uninit;
-       dev->open = ops->ndo_open;
-       dev->change_rx_flags = ops->ndo_change_rx_flags;
-       dev->set_rx_mode = ops->ndo_set_rx_mode;
-       dev->set_multicast_list = ops->ndo_set_multicast_list;
-       dev->set_mac_address = ops->ndo_set_mac_address;
-       dev->validate_addr = ops->ndo_validate_addr;
-       dev->do_ioctl = ops->ndo_do_ioctl;
-       dev->set_config = ops->ndo_set_config;
-       dev->change_mtu = ops->ndo_change_mtu;
-       dev->neigh_setup = ops->ndo_neigh_setup;
-       dev->tx_timeout = ops->ndo_tx_timeout;
-       dev->get_stats = ops->ndo_get_stats;
-       dev->vlan_rx_register = ops->ndo_vlan_rx_register;
-       dev->vlan_rx_add_vid = ops->ndo_vlan_rx_add_vid;
-       dev->vlan_rx_kill_vid = ops->ndo_vlan_rx_kill_vid;
-#ifdef CONFIG_NET_POLL_CONTROLLER
-       dev->poll_controller = ops->ndo_poll_controller;
-#endif
-#endif
-}
-EXPORT_SYMBOL(netdev_resync_ops);
-
 /**
  *     register_netdevice      - register a network device
  *     @dev: device to register
@@ -4652,23 +4619,6 @@ int register_netdevice(struct net_device *dev)
 
        dev->iflink = -1;
 
-#ifdef CONFIG_COMPAT_NET_DEV_OPS
-       /* Netdevice_ops API compatibility support.
-        * This is temporary until all network devices are converted.
-        */
-       if (dev->netdev_ops) {
-               netdev_resync_ops(dev);
-       } else {
-               char drivername[64];
-               pr_info("%s (%s): not using net_device_ops yet\n",
-                       dev->name, netdev_drivername(dev, drivername, 64));
-
-               /* This works only because net_device_ops and the
-                  compatibility structure are the same. */
-               dev->netdev_ops = (void *) &(dev->init);
-       }
-#endif
-
        /* Init, if this function is available */
        if (dev->netdev_ops->ndo_init) {
                ret = dev->netdev_ops->ndo_init(dev);
index 280352aba4034bc2d343171e72f6942635fd74c3..5a883affecd3d2388f8fa4a27e35f2058b053518 100644 (file)
@@ -337,11 +337,6 @@ const struct header_ops eth_header_ops ____cacheline_aligned = {
 void ether_setup(struct net_device *dev)
 {
        dev->header_ops         = &eth_header_ops;
-#ifdef CONFIG_COMPAT_NET_DEV_OPS
-       dev->change_mtu         = eth_change_mtu;
-       dev->set_mac_address    = eth_mac_addr;
-       dev->validate_addr      = eth_validate_addr;
-#endif
        dev->type               = ARPHRD_ETHER;
        dev->hard_header_len    = ETH_HLEN;
        dev->mtu                = ETH_DATA_LEN;