public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta•com>
To: David Miller <davem@davemloft•net>
Cc: netdev@vger•kernel.org
Subject: [PATCH 8/8] sch_teql: convert to net_device_ops
Date: Mon, 05 Jan 2009 12:14:50 -0800	[thread overview]
Message-ID: <20090105201514.904622653@vyatta.com> (raw)
In-Reply-To: 20090105201442.749889072@vyatta.com

[-- Attachment #1: sch_teql.patch --]
[-- Type: text/plain, Size: 1862 bytes --]

Convert this driver to net_device_ops.

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


--- a/net/sched/sch_teql.c	2009-01-04 21:54:09.746040057 -0800
+++ b/net/sched/sch_teql.c	2009-01-04 22:12:59.598053054 -0800
@@ -289,9 +289,9 @@ restart:
 
 	do {
 		struct net_device *slave = qdisc_dev(q);
-		struct netdev_queue *slave_txq;
+		struct netdev_queue *slave_txq = netdev_get_tx_queue(slave, 0);
+		const struct net_device_ops *slave_ops = slave->netdev_ops;
 
-		slave_txq = netdev_get_tx_queue(slave, 0);
 		if (slave_txq->qdisc_sleeping != q)
 			continue;
 		if (__netif_subqueue_stopped(slave, subq) ||
@@ -305,7 +305,7 @@ restart:
 			if (__netif_tx_trylock(slave_txq)) {
 				if (!netif_tx_queue_stopped(slave_txq) &&
 				    !netif_tx_queue_frozen(slave_txq) &&
-				    slave->hard_start_xmit(skb, slave) == 0) {
+				    slave_ops->ndo_start_xmit(skb, slave) == 0) {
 					__netif_tx_unlock(slave_txq);
 					master->slaves = NEXT_SLAVE(q);
 					netif_wake_queue(dev);
@@ -420,6 +420,14 @@ static int teql_master_mtu(struct net_de
 	return 0;
 }
 
+static const struct net_device_ops teql_netdev_ops = {
+	.ndo_open	= teql_master_open,
+	.ndo_stop	= teql_master_close,
+	.ndo_start_xmit	= teql_master_xmit,
+	.ndo_get_stats	= teql_master_stats,
+	.ndo_change_mtu	= teql_master_mtu,
+};
+
 static __init void teql_master_setup(struct net_device *dev)
 {
 	struct teql_master *master = netdev_priv(dev);
@@ -436,11 +444,7 @@ static __init void teql_master_setup(str
 	ops->destroy	=	teql_destroy;
 	ops->owner	=	THIS_MODULE;
 
-	dev->open		= teql_master_open;
-	dev->hard_start_xmit	= teql_master_xmit;
-	dev->stop		= teql_master_close;
-	dev->get_stats		= teql_master_stats;
-	dev->change_mtu		= teql_master_mtu;
+	dev->netdev_ops =       &teql_netdev_ops;
 	dev->type		= ARPHRD_VOID;
 	dev->mtu		= 1500;
 	dev->tx_queue_len	= 100;

-- 


  parent reply	other threads:[~2009-01-05 20:24 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-05 20:14 [PATCH 0/8] More net_device ops Stephen Hemminger
2009-01-05 20:14 ` [PATCH 2/8] bonding: use net_device_ops Stephen Hemminger
2009-01-06 18:42   ` David Miller
2009-01-05 20:14 ` [PATCH 3/8] wireless: convert wireless ioctl to net_device_ops Stephen Hemminger
     [not found]   ` <20090105201514.442703045-ZtmgI6mnKB3QT0dZR+AlfA@public.gmane.org>
2009-01-06 18:42     ` David Miller
2009-01-05 20:14 ` [PATCH 4/8] dsa: convert " Stephen Hemminger
     [not found]   ` <20090106060705.GG4414@server.marvell.com>
2009-01-06 18:43     ` David Miller
2009-01-06 22:51       ` Stephen Hemminger
2009-01-07  0:45         ` David Miller
2009-01-05 20:14 ` [PATCH 5/8] virtio: " Stephen Hemminger
2009-01-06  9:40   ` Mark McLoughlin
2009-01-06 18:44     ` David Miller
2009-01-05 20:14 ` [PATCH 6/8] xen-netfront: " Stephen Hemminger
2009-01-06  0:17   ` Jeremy Fitzhardinge
2009-01-06 18:45   ` David Miller
2009-01-05 20:14 ` [PATCH 7/8] infiniband: driver API update Stephen Hemminger
2009-01-05 21:02   ` Roland Dreier
2009-01-05 21:22     ` [ofa-general] [PATCH 1/3] infiniband: amso100 convert to net_device_ops Stephen Hemminger
2009-01-05 21:22       ` [ofa-general] [PATCH 2/3] infiniband: nes_nic " Stephen Hemminger
2009-01-05 21:23         ` [ofa-general] [PATCH 3/3] infiniband: ipoib " Stephen Hemminger
2009-01-06  5:07           ` Roland Dreier
2009-01-06 18:46             ` [ofa-general] " David Miller
2009-01-06 18:45     ` [ofa-general] Re: [PATCH 7/8] infiniband: driver API update David Miller
2009-01-05 20:14 ` Stephen Hemminger [this message]
2009-01-06 18:46   ` [PATCH 8/8] sch_teql: convert to net_device_ops David Miller
     [not found] ` <20090105201514.192918670@vyatta.com>
2009-01-06 18:41   ` [PATCH 1/8] irda: convert to internal stats 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=20090105201514.904622653@vyatta.com \
    --to=shemminger@vyatta$(echo .)com \
    --cc=davem@davemloft$(echo .)net \
    --cc=netdev@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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