netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: remove COMPAT_NET_DEV_OPS
@ 2009-05-23 14:17 Alexander Beregalov
  2009-05-23 14:41 ` Stephen Hemminger
  2009-05-25 21:43 ` David Miller
  0 siblings, 2 replies; 7+ messages in thread
From: Alexander Beregalov @ 2009-05-23 14:17 UTC (permalink / raw)
  To: David Miller, netdev; +Cc: Alexander Beregalov

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>
---
 drivers/net/Kconfig       |    9 --------
 include/linux/netdevice.h |   38 ----------------------------------
 net/802/fddi.c            |    4 ---
 net/802/hippi.c           |    5 ----
 net/8021q/vlan_dev.c      |    1 -
 net/appletalk/dev.c       |   11 ---------
 net/core/dev.c            |   50 ---------------------------------------------
 net/ethernet/eth.c        |    5 ----
 8 files changed, 0 insertions(+), 123 deletions(-)

diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 0fb446e..efa659f 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -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
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index f8574e7..ae3c209 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -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)
 
diff --git a/net/802/fddi.c b/net/802/fddi.c
index 539e606..3ef0ab0 100644
--- a/net/802/fddi.c
+++ b/net/802/fddi.c
@@ -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 */
diff --git a/net/802/hippi.c b/net/802/hippi.c
index 313b9eb..cd3e8e9 100644
--- a/net/802/hippi.c
+++ b/net/802/hippi.c
@@ -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;
 
 	/*
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index ff7572a..1e2ad4c 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)
 		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;
diff --git a/net/appletalk/dev.c b/net/appletalk/dev.c
index 72277d7..6c8016f 100644
--- a/net/appletalk/dev.c
+++ b/net/appletalk/dev.c
@@ -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;
diff --git a/net/core/dev.c b/net/core/dev.c
index 3942266..241613f 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)
 }
 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);
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index 280352a..5a883af 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -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;
-- 
1.6.3.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] net: remove COMPAT_NET_DEV_OPS
  2009-05-23 14:17 [PATCH] net: remove COMPAT_NET_DEV_OPS Alexander Beregalov
@ 2009-05-23 14:41 ` Stephen Hemminger
  2009-05-23 15:12   ` [PATCH] Mark COMPAT_NET_DEV_OPS option for removal Stephen Hemminger
  2009-05-23 16:55   ` [PATCH] net: remove COMPAT_NET_DEV_OPS Christoph Hellwig
  2009-05-25 21:43 ` David Miller
  1 sibling, 2 replies; 7+ messages in thread
From: Stephen Hemminger @ 2009-05-23 14:41 UTC (permalink / raw)
  To: Alexander Beregalov; +Cc: David Miller, netdev, Alexander Beregalov

On Sat, 23 May 2009 18:17:39 +0400
Alexander Beregalov <a.beregalov@gmail.com> wrote:

> 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>

This go through the feature-removal-schedule process, to
allow other drivers that live outside the tree some notice for change.


-- 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] Mark COMPAT_NET_DEV_OPS option for removal
  2009-05-23 14:41 ` Stephen Hemminger
@ 2009-05-23 15:12   ` Stephen Hemminger
  2009-05-24 21:34     ` David Miller
  2009-05-23 16:55   ` [PATCH] net: remove COMPAT_NET_DEV_OPS Christoph Hellwig
  1 sibling, 1 reply; 7+ messages in thread
From: Stephen Hemminger @ 2009-05-23 15:12 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Alexander Beregalov, David Miller, netdev

Mark the flag as deprecated and default off so users won't use it
by default. Make the message that was a informational into a full
warning with backtrace, so any usage gets noticed.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

--- a/Documentation/feature-removal-schedule.txt	2009-05-23 07:45:26.920460911 -0700
+++ b/Documentation/feature-removal-schedule.txt	2009-05-23 07:48:53.043372890 -0700
@@ -437,3 +437,14 @@ Why:	Superseded by tdfxfb. I2C/DDC suppo
 	driver but this caused driver conflicts.
 Who:	Jean Delvare <khali@linux-fr.org>
 	Krzysztof Helt <krzysztof.h1@wp.pl>
+
+---------------------------
+
+What:   COMPAT_NET_DEV_OPS interface
+When:   December 2009
+Why:    All network drivers in tree have been converted to the net_device_ops
+        interface. The compatiablity interface is no longer needed.
+
+	The interface will maintained for a short period to get out of
+        tree drivers to convert.
+Who:    Stephen Hemminger <shemminger@vayatta.com>
--- a/drivers/net/Kconfig	2009-05-23 07:49:33.004641071 -0700
+++ b/drivers/net/Kconfig	2009-05-23 08:02:53.444272608 -0700
@@ -26,13 +26,12 @@ menuconfig NETDEVICES
 if NETDEVICES
 
 config COMPAT_NET_DEV_OPS
-       default y
-       bool "Enable older network device API compatibility"
+       bool "Enable older network device API compatibility (DEPRECATED)"
+       default n
        ---help---
-          This option enables kernel compatibility with older network devices
-          that do not use net_device_ops interface.
-
-	  If unsure, say Y.
+          This option enables backward compatibility with older network devices
+          that do not use net_device_ops interface. All devices should be
+          converted to the net_device_ops.
 
 config IFB
 	tristate "Intermediate Functional Block support"
--- a/net/core/dev.c	2009-05-23 07:51:58.131254792 -0700
+++ b/net/core/dev.c	2009-05-23 07:58:25.749465521 -0700
@@ -4653,20 +4653,16 @@ int register_netdevice(struct net_device
 	dev->iflink = -1;
 
 #ifdef CONFIG_COMPAT_NET_DEV_OPS
+	WARN(!dev->netdev_ops, "%s: not using net_device_ops\n", dev->name);
 	/* Netdevice_ops API compatibility support.
 	 * This is temporary until all network devices are converted.
 	 */
-	if (dev->netdev_ops) {
+	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));
-
+	else
 		/* 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 */

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] net: remove COMPAT_NET_DEV_OPS
  2009-05-23 14:41 ` Stephen Hemminger
  2009-05-23 15:12   ` [PATCH] Mark COMPAT_NET_DEV_OPS option for removal Stephen Hemminger
@ 2009-05-23 16:55   ` Christoph Hellwig
  2009-05-24 21:32     ` David Miller
  1 sibling, 1 reply; 7+ messages in thread
From: Christoph Hellwig @ 2009-05-23 16:55 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: Alexander Beregalov, David Miller, netdev

On Sat, May 23, 2009 at 07:41:43AM -0700, Stephen Hemminger wrote:
> On Sat, 23 May 2009 18:17:39 +0400
> Alexander Beregalov <a.beregalov@gmail.com> wrote:
> 
> > 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>
> 
> This go through the feature-removal-schedule process, to
> allow other drivers that live outside the tree some notice for change.

I don't think so.  We do tons of API changes and don't do such a process
around it.  Removal of the old pointers gives a clear compilation
breakage so it's not even dangerous.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] net: remove COMPAT_NET_DEV_OPS
  2009-05-23 16:55   ` [PATCH] net: remove COMPAT_NET_DEV_OPS Christoph Hellwig
@ 2009-05-24 21:32     ` David Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2009-05-24 21:32 UTC (permalink / raw)
  To: hch; +Cc: shemminger, a.beregalov, netdev

From: Christoph Hellwig <hch@infradead.org>
Date: Sat, 23 May 2009 12:55:31 -0400

> On Sat, May 23, 2009 at 07:41:43AM -0700, Stephen Hemminger wrote:
>> On Sat, 23 May 2009 18:17:39 +0400
>> Alexander Beregalov <a.beregalov@gmail.com> wrote:
>> 
>> > 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>
>> 
>> This go through the feature-removal-schedule process, to
>> allow other drivers that live outside the tree some notice for change.
> 
> I don't think so.  We do tons of API changes and don't do such a process
> around it.  Removal of the old pointers gives a clear compilation
> breakage so it's not even dangerous.

I completely agree and plan to get rid of this compat ops stuff
for 2.6.31

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Mark COMPAT_NET_DEV_OPS option for removal
  2009-05-23 15:12   ` [PATCH] Mark COMPAT_NET_DEV_OPS option for removal Stephen Hemminger
@ 2009-05-24 21:34     ` David Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2009-05-24 21:34 UTC (permalink / raw)
  To: shemminger; +Cc: a.beregalov, netdev

From: Stephen Hemminger <shemminger@vyatta.com>
Date: Sat, 23 May 2009 08:12:21 -0700

> Mark the flag as deprecated and default off so users won't use it
> by default. Make the message that was a informational into a full
> warning with backtrace, so any usage gets noticed.
> 
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>

NAK, we're just going to toss this now in 2.6.31, there
is nothing to gain by keeping this stuff around.  It's
an internal API change rather than something visible to
users.

And it results in a clear compilation error for stale
external code not yet converted.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] net: remove COMPAT_NET_DEV_OPS
  2009-05-23 14:17 [PATCH] net: remove COMPAT_NET_DEV_OPS Alexander Beregalov
  2009-05-23 14:41 ` Stephen Hemminger
@ 2009-05-25 21:43 ` David Miller
  1 sibling, 0 replies; 7+ messages in thread
From: David Miller @ 2009-05-25 21:43 UTC (permalink / raw)
  To: a.beregalov; +Cc: netdev

From: Alexander Beregalov <a.beregalov@gmail.com>
Date: Sat, 23 May 2009 18:17:39 +0400

> 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>

With great pleasure I've applied this and will push it out to
net-next-2.6 after some quick build testing.

Thanks!

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-05-25 21:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-23 14:17 [PATCH] net: remove COMPAT_NET_DEV_OPS Alexander Beregalov
2009-05-23 14:41 ` Stephen Hemminger
2009-05-23 15:12   ` [PATCH] Mark COMPAT_NET_DEV_OPS option for removal Stephen Hemminger
2009-05-24 21:34     ` David Miller
2009-05-23 16:55   ` [PATCH] net: remove COMPAT_NET_DEV_OPS Christoph Hellwig
2009-05-24 21:32     ` David Miller
2009-05-25 21:43 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).