aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Beregalov <a.beregalov@gmail.com>2009-05-25 04:53:53 -0400
committerDavid S. Miller <davem@davemloft.net>2009-05-25 04:53:53 -0400
commite3804cbebb67887879102925961d41b503f7fbe3 (patch)
tree0c2290608f511bf97978767e159121e3009c56e3
parentc649c0e31d5736a4b7c5c3454182091dda4bbe62 (diff)
net: remove COMPAT_NET_DEV_OPS
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>
-rw-r--r--drivers/net/Kconfig9
-rw-r--r--include/linux/netdevice.h38
-rw-r--r--net/802/fddi.c4
-rw-r--r--net/802/hippi.c5
-rw-r--r--net/8021q/vlan_dev.c1
-rw-r--r--net/appletalk/dev.c11
-rw-r--r--net/core/dev.c50
-rw-r--r--net/ethernet/eth.c5
8 files changed, 0 insertions, 123 deletions
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 0fb446e047e7..efa659f0fb53 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -25,15 +25,6 @@ menuconfig NETDEVICES
25# that for each of the symbols. 25# that for each of the symbols.
26if NETDEVICES 26if NETDEVICES
27 27
28config COMPAT_NET_DEV_OPS
29 default y
30 bool "Enable older network device API compatibility"
31 ---help---
32 This option enables kernel compatibility with older network devices
33 that do not use net_device_ops interface.
34
35 If unsure, say Y.
36
37config IFB 28config IFB
38 tristate "Intermediate Functional Block support" 29 tristate "Intermediate Functional Block support"
39 depends on NET_CLS_ACT 30 depends on NET_CLS_ACT
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index f8574e76b743..ae3c2099a04b 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -901,44 +901,6 @@ struct net_device
901 /* max exchange id for FCoE LRO by ddp */ 901 /* max exchange id for FCoE LRO by ddp */
902 unsigned int fcoe_ddp_xid; 902 unsigned int fcoe_ddp_xid;
903#endif 903#endif
904
905#ifdef CONFIG_COMPAT_NET_DEV_OPS
906 struct {
907 int (*init)(struct net_device *dev);
908 void (*uninit)(struct net_device *dev);
909 int (*open)(struct net_device *dev);
910 int (*stop)(struct net_device *dev);
911 int (*hard_start_xmit) (struct sk_buff *skb,
912 struct net_device *dev);
913 u16 (*select_queue)(struct net_device *dev,
914 struct sk_buff *skb);
915 void (*change_rx_flags)(struct net_device *dev,
916 int flags);
917 void (*set_rx_mode)(struct net_device *dev);
918 void (*set_multicast_list)(struct net_device *dev);
919 int (*set_mac_address)(struct net_device *dev,
920 void *addr);
921 int (*validate_addr)(struct net_device *dev);
922 int (*do_ioctl)(struct net_device *dev,
923 struct ifreq *ifr, int cmd);
924 int (*set_config)(struct net_device *dev,
925 struct ifmap *map);
926 int (*change_mtu)(struct net_device *dev, int new_mtu);
927 int (*neigh_setup)(struct net_device *dev,
928 struct neigh_parms *);
929 void (*tx_timeout) (struct net_device *dev);
930 struct net_device_stats* (*get_stats)(struct net_device *dev);
931 void (*vlan_rx_register)(struct net_device *dev,
932 struct vlan_group *grp);
933 void (*vlan_rx_add_vid)(struct net_device *dev,
934 unsigned short vid);
935 void (*vlan_rx_kill_vid)(struct net_device *dev,
936 unsigned short vid);
937#ifdef CONFIG_NET_POLL_CONTROLLER
938 void (*poll_controller)(struct net_device *dev);
939#endif
940 };
941#endif
942}; 904};
943#define to_net_dev(d) container_of(d, struct net_device, dev) 905#define to_net_dev(d) container_of(d, struct net_device, dev)
944 906
diff --git a/net/802/fddi.c b/net/802/fddi.c
index 539e6064e6d4..3ef0ab0a543a 100644
--- a/net/802/fddi.c
+++ b/net/802/fddi.c
@@ -185,10 +185,6 @@ static const struct header_ops fddi_header_ops = {
185static void fddi_setup(struct net_device *dev) 185static void fddi_setup(struct net_device *dev)
186{ 186{
187 dev->header_ops = &fddi_header_ops; 187 dev->header_ops = &fddi_header_ops;
188#ifdef CONFIG_COMPAT_NET_DEV_OPS
189 dev->change_mtu = fddi_change_mtu,
190#endif
191
192 dev->type = ARPHRD_FDDI; 188 dev->type = ARPHRD_FDDI;
193 dev->hard_header_len = FDDI_K_SNAP_HLEN+3; /* Assume 802.2 SNAP hdr len + 3 pad bytes */ 189 dev->hard_header_len = FDDI_K_SNAP_HLEN+3; /* Assume 802.2 SNAP hdr len + 3 pad bytes */
194 dev->mtu = FDDI_K_SNAP_DLEN; /* Assume max payload of 802.2 SNAP frame */ 190 dev->mtu = FDDI_K_SNAP_DLEN; /* Assume max payload of 802.2 SNAP frame */
diff --git a/net/802/hippi.c b/net/802/hippi.c
index 313b9ebf92ee..cd3e8e929529 100644
--- a/net/802/hippi.c
+++ b/net/802/hippi.c
@@ -193,11 +193,6 @@ static const struct header_ops hippi_header_ops = {
193 193
194static void hippi_setup(struct net_device *dev) 194static void hippi_setup(struct net_device *dev)
195{ 195{
196#ifdef CONFIG_COMPAT_NET_DEV_OPS
197 dev->change_mtu = hippi_change_mtu;
198 dev->set_mac_address = hippi_mac_addr;
199 dev->neigh_setup = hippi_neigh_setup_dev;
200#endif
201 dev->header_ops = &hippi_header_ops; 196 dev->header_ops = &hippi_header_ops;
202 197
203 /* 198 /*
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index ff7572ac5481..1e2ad4c7c59b 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -644,7 +644,6 @@ static int vlan_dev_init(struct net_device *dev)
644 dev->hard_header_len = real_dev->hard_header_len + VLAN_HLEN; 644 dev->hard_header_len = real_dev->hard_header_len + VLAN_HLEN;
645 dev->netdev_ops = &vlan_netdev_ops; 645 dev->netdev_ops = &vlan_netdev_ops;
646 } 646 }
647 netdev_resync_ops(dev);
648 647
649 if (is_vlan_dev(real_dev)) 648 if (is_vlan_dev(real_dev))
650 subclass = 1; 649 subclass = 1;
diff --git a/net/appletalk/dev.c b/net/appletalk/dev.c
index 72277d70c980..6c8016f61866 100644
--- a/net/appletalk/dev.c
+++ b/net/appletalk/dev.c
@@ -9,21 +9,10 @@
9#include <linux/if_arp.h> 9#include <linux/if_arp.h>
10#include <linux/if_ltalk.h> 10#include <linux/if_ltalk.h>
11 11
12#ifdef CONFIG_COMPAT_NET_DEV_OPS
13static int ltalk_change_mtu(struct net_device *dev, int mtu)
14{
15 return -EINVAL;
16}
17#endif
18
19static void ltalk_setup(struct net_device *dev) 12static void ltalk_setup(struct net_device *dev)
20{ 13{
21 /* Fill in the fields of the device structure with localtalk-generic values. */ 14 /* Fill in the fields of the device structure with localtalk-generic values. */
22 15
23#ifdef CONFIG_COMPAT_NET_DEV_OPS
24 dev->change_mtu = ltalk_change_mtu;
25#endif
26
27 dev->type = ARPHRD_LOCALTLK; 16 dev->type = ARPHRD_LOCALTLK;
28 dev->hard_header_len = LTALK_HLEN; 17 dev->hard_header_len = LTALK_HLEN;
29 dev->mtu = LTALK_MTU; 18 dev->mtu = LTALK_MTU;
diff --git a/net/core/dev.c b/net/core/dev.c
index 3942266d1f6c..241613f6dd2f 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4580,39 +4580,6 @@ unsigned long netdev_fix_features(unsigned long features, const char *name)
4580} 4580}
4581EXPORT_SYMBOL(netdev_fix_features); 4581EXPORT_SYMBOL(netdev_fix_features);
4582 4582
4583/* Some devices need to (re-)set their netdev_ops inside
4584 * ->init() or similar. If that happens, we have to setup
4585 * the compat pointers again.
4586 */
4587void netdev_resync_ops(struct net_device *dev)
4588{
4589#ifdef CONFIG_COMPAT_NET_DEV_OPS
4590 const struct net_device_ops *ops = dev->netdev_ops;
4591
4592 dev->init = ops->ndo_init;
4593 dev->uninit = ops->ndo_uninit;
4594 dev->open = ops->ndo_open;
4595 dev->change_rx_flags = ops->ndo_change_rx_flags;
4596 dev->set_rx_mode = ops->ndo_set_rx_mode;
4597 dev->set_multicast_list = ops->ndo_set_multicast_list;
4598 dev->set_mac_address = ops->ndo_set_mac_address;
4599 dev->validate_addr = ops->ndo_validate_addr;
4600 dev->do_ioctl = ops->ndo_do_ioctl;
4601 dev->set_config = ops->ndo_set_config;
4602 dev->change_mtu = ops->ndo_change_mtu;
4603 dev->neigh_setup = ops->ndo_neigh_setup;
4604 dev->tx_timeout = ops->ndo_tx_timeout;
4605 dev->get_stats = ops->ndo_get_stats;
4606 dev->vlan_rx_register = ops->ndo_vlan_rx_register;
4607 dev->vlan_rx_add_vid = ops->ndo_vlan_rx_add_vid;
4608 dev->vlan_rx_kill_vid = ops->ndo_vlan_rx_kill_vid;
4609#ifdef CONFIG_NET_POLL_CONTROLLER
4610 dev->poll_controller = ops->ndo_poll_controller;
4611#endif
4612#endif
4613}
4614EXPORT_SYMBOL(netdev_resync_ops);
4615
4616/** 4583/**
4617 * register_netdevice - register a network device 4584 * register_netdevice - register a network device
4618 * @dev: device to register 4585 * @dev: device to register
@@ -4652,23 +4619,6 @@ int register_netdevice(struct net_device *dev)
4652 4619
4653 dev->iflink = -1; 4620 dev->iflink = -1;
4654 4621
4655#ifdef CONFIG_COMPAT_NET_DEV_OPS
4656 /* Netdevice_ops API compatibility support.
4657 * This is temporary until all network devices are converted.
4658 */
4659 if (dev->netdev_ops) {
4660 netdev_resync_ops(dev);
4661 } else {
4662 char drivername[64];
4663 pr_info("%s (%s): not using net_device_ops yet\n",
4664 dev->name, netdev_drivername(dev, drivername, 64));
4665
4666 /* This works only because net_device_ops and the
4667 compatibility structure are the same. */
4668 dev->netdev_ops = (void *) &(dev->init);
4669 }
4670#endif
4671
4672 /* Init, if this function is available */ 4622 /* Init, if this function is available */
4673 if (dev->netdev_ops->ndo_init) { 4623 if (dev->netdev_ops->ndo_init) {
4674 ret = dev->netdev_ops->ndo_init(dev); 4624 ret = dev->netdev_ops->ndo_init(dev);
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index 280352aba403..5a883affecd3 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -337,11 +337,6 @@ const struct header_ops eth_header_ops ____cacheline_aligned = {
337void ether_setup(struct net_device *dev) 337void ether_setup(struct net_device *dev)
338{ 338{
339 dev->header_ops = &eth_header_ops; 339 dev->header_ops = &eth_header_ops;
340#ifdef CONFIG_COMPAT_NET_DEV_OPS
341 dev->change_mtu = eth_change_mtu;
342 dev->set_mac_address = eth_mac_addr;
343 dev->validate_addr = eth_validate_addr;
344#endif
345 dev->type = ARPHRD_ETHER; 340 dev->type = ARPHRD_ETHER;
346 dev->hard_header_len = ETH_HLEN; 341 dev->hard_header_len = ETH_HLEN;
347 dev->mtu = ETH_DATA_LEN; 342 dev->mtu = ETH_DATA_LEN;