netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Bjørn Mork" <bjorn@mork.no>
To: netdev@vger.kernel.org
Subject: Re: [PATCH]: sunvnet netdev ops conversion...
Date: Fri, 20 Mar 2009 12:43:00 +0100	[thread overview]
Message-ID: <87prgcju7v.fsf@nemi.mork.no> (raw)
In-Reply-To: 20090320.013448.251351318.davem@davemloft.net

David Miller <davem@davemloft.net> writes:
> From: Yang Hongyang <yanghy@cn.fujitsu.com>
> Date: Fri, 20 Mar 2009 16:30:59 +0800
>
>> David Miller wrote:
>> > Committed to net-next-2.6...
>> > 
>> > sunvnet: Convert to net_device_ops.
>> 
>> I noticed that there are other drivers's  net_device_ops 
>> need to be converted,is these convert nessary?
>
> Not necessary, but desirable.  Once all drivers are
> converted we can remove the compatability code.

Just thinking... Would it make sense, at some point before removing the
compatibility layer, to add tests for partial conversions?  I noticed
the sungem bug just fixed by Stephen Hemminger 
( http://permalink.gmane.org/gmane.linux.network/122756 )
which could have been caught by the patch below.

This will also ease the transition of "driver sets", like usbnet and
it's children, where a number of drivers need to make the conversion
together.  Don't know if that's a big problem, but it did stop my first
attempt to convert usbnet because I was uncertain whether I had caught
all of the necessary mini driver conversions.

Signed-off-by: Bjørn Mork <bjorn@mork.no>
---

 net/core/dev.c |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/net/core/dev.c b/net/core/dev.c
index f112970..ad3e780 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4359,6 +4359,34 @@ int register_netdevice(struct net_device *dev)
 	 * This is temporary until all network devices are converted.
 	 */
 	if (dev->netdev_ops) {
+		/* drivers using netdev_ops should not set any of these */
+		if (dev->init ||
+		    dev->uninit ||
+		    dev->open ||
+		    dev->change_rx_flags ||
+		    dev->set_rx_mode ||
+		    dev->set_multicast_list ||
+		    dev->set_mac_address ||
+		    dev->validate_addr ||
+		    dev->do_ioctl ||
+		    dev->set_config ||
+		    dev->change_mtu ||
+		    dev->neigh_setup ||
+		    dev->tx_timeout ||
+		    dev->get_stats ||
+		    dev->vlan_rx_register ||
+		    dev->vlan_rx_add_vid ||
+		    dev->vlan_rx_kill_vid
+#ifdef CONFIG_NET_POLL_CONTROLLER
+		    || dev->poll_controller
+#endif
+			) {
+			char drivername[64];
+
+			pr_info("%s (%s): mixing netdev_ops and old API\n",
+				dev->name, netdev_drivername(dev, drivername, 
+							     64));
+		}
 		netdev_resync_ops(dev);
 	} else {
 		char drivername[64];


  reply	other threads:[~2009-03-20 11:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-20  7:52 [PATCH]: sunvnet netdev ops conversion David Miller
2009-03-20  8:30 ` Yang Hongyang
2009-03-20  8:34   ` David Miller
2009-03-20 11:43     ` Bjørn Mork [this message]
2009-03-20 14:19       ` Jiri Pirko
2009-03-20 16:16         ` Stephen Hemminger
2009-03-20 22:54           ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87prgcju7v.fsf@nemi.mork.no \
    --to=bjorn@mork.no \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).