All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@linux-foundation.org>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: [patch 11/30] wan: convert sdla driver to net_device_ops
Date: Thu, 26 Mar 2009 18:11:25 -0700	[thread overview]
Message-ID: <20090327011255.745791643@linux-foundation.org> (raw)
In-Reply-To: 20090327011114.169107105@linux-foundation.org

[-- Attachment #1: sdla-netdev.patch --]
[-- Type: text/plain, Size: 2896 bytes --]

Also use internal net_device_stats

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


--- a/drivers/net/wan/sdla.c	2009-03-21 12:37:00.000000000 -0700
+++ b/drivers/net/wan/sdla.c	2009-03-26 15:40:26.996589787 -0700
@@ -714,19 +714,19 @@ static int sdla_transmit(struct sk_buff 
 		switch (ret)
 		{
 			case SDLA_RET_OK:
-				flp->stats.tx_packets++;
+				dev->stats.tx_packets++;
 				ret = DLCI_RET_OK;
 				break;
 
 			case SDLA_RET_CIR_OVERFLOW:
 			case SDLA_RET_BUF_OVERSIZE:
 			case SDLA_RET_NO_BUFS:
-				flp->stats.tx_dropped++;
+				dev->stats.tx_dropped++;
 				ret = DLCI_RET_DROP;
 				break;
 
 			default:
-				flp->stats.tx_errors++;
+				dev->stats.tx_errors++;
 				ret = DLCI_RET_ERR;
 				break;
 		}
@@ -807,7 +807,7 @@ static void sdla_receive(struct net_devi
 		if (i == CONFIG_DLCI_MAX)
 		{
 			printk(KERN_NOTICE "%s: Received packet from invalid DLCI %i, ignoring.", dev->name, dlci);
-			flp->stats.rx_errors++;
+			dev->stats.rx_errors++;
 			success = 0;
 		}
 	}
@@ -819,7 +819,7 @@ static void sdla_receive(struct net_devi
 		if (skb == NULL) 
 		{
 			printk(KERN_NOTICE "%s: Memory squeeze, dropping packet.\n", dev->name);
-			flp->stats.rx_dropped++; 
+			dev->stats.rx_dropped++;
 			success = 0;
 		}
 		else
@@ -859,7 +859,7 @@ static void sdla_receive(struct net_devi
 
 	if (success)
 	{
-		flp->stats.rx_packets++;
+		dev->stats.rx_packets++;
 		dlp = netdev_priv(master);
 		(*dlp->receive)(skb, master);
 	}
@@ -1590,13 +1590,14 @@ fail:
 	return err;
 }
  
-static struct net_device_stats *sdla_stats(struct net_device *dev)
-{
-	struct frad_local *flp;
-	flp = netdev_priv(dev);
-
-	return(&flp->stats);
-}
+static const struct net_device_ops sdla_netdev_ops = {
+	.ndo_open	= sdla_open,
+	.ndo_stop	= sdla_close,
+	.ndo_do_ioctl	= sdla_ioctl,
+	.ndo_set_config	= sdla_set_config,
+	.ndo_start_xmit	= sdla_transmit,
+	.ndo_change_mtu	= sdla_change_mtu,
+};
 
 static void setup_sdla(struct net_device *dev)
 {
@@ -1604,20 +1605,13 @@ static void setup_sdla(struct net_device
 
 	netdev_boot_setup_check(dev);
 
+	dev->netdev_ops		= &sdla_netdev_ops;
 	dev->flags		= 0;
 	dev->type		= 0xFFFF;
 	dev->hard_header_len	= 0;
 	dev->addr_len		= 0;
 	dev->mtu		= SDLA_MAX_MTU;
 
-	dev->open		= sdla_open;
-	dev->stop		= sdla_close;
-	dev->do_ioctl		= sdla_ioctl;
-	dev->set_config		= sdla_set_config;
-	dev->get_stats		= sdla_stats;
-	dev->hard_start_xmit	= sdla_transmit;
-	dev->change_mtu		= sdla_change_mtu;
-
 	flp->activate		= sdla_activate;
 	flp->deactivate		= sdla_deactivate;
 	flp->assoc		= sdla_assoc;
--- a/include/linux/if_frad.h	2009-03-21 12:37:09.000000000 -0700
+++ b/include/linux/if_frad.h	2009-03-26 15:37:38.067344521 -0700
@@ -153,7 +153,6 @@ struct frhdr
 
 struct dlci_local
 {
-   struct net_device_stats stats;
    struct net_device      *master;
    struct net_device      *slave;
    struct dlci_conf       config;



  parent reply	other threads:[~2009-03-27  1:27 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-27  1:11 [patch 00/30] last of the x86 net_device_ops Stephen Hemminger
2009-03-27  1:11 ` [patch 01/30] 3c503, smc-ultra: netdev_ops bugs Stephen Hemminger
2009-03-27  7:50   ` David Miller
2009-03-27  1:11 ` [uml-devel] [patch 02/30] uml: convert network device to internal network device stats Stephen Hemminger
2009-03-27  1:11   ` Stephen Hemminger
2009-03-27  7:50   ` [uml-devel] " David Miller
2009-03-27  7:50     ` David Miller
2009-03-27  1:11 ` [uml-devel] [patch 03/30] uml: convert network device to netdevice ops Stephen Hemminger
2009-03-27  1:11   ` Stephen Hemminger
2009-03-27  7:50   ` [uml-devel] " David Miller
2009-03-27  7:50     ` David Miller
2009-03-27  1:11 ` [patch 04/30] appletalk: convert cops to internal net_device_stats Stephen Hemminger
2009-03-27  7:50   ` David Miller
2009-03-27  1:11 ` [patch 05/30] To: acme@ghostprotocols.net Subjetct: appltetalk: convert cops device to net_device ops Stephen Hemminger
2009-03-27  7:50   ` [patch 05/30] " David Miller
2009-03-27  1:11 ` [patch 06/30] appletalk: convert LTPC to use internal net_device_stats Stephen Hemminger
2009-03-27  7:50   ` David Miller
2009-03-27  1:11 ` [patch 07/30] appletalk: convert LTPC to net_device_ops Stephen Hemminger
2009-03-27  7:50   ` David Miller
2009-03-27  1:11 ` [patch 08/30] IRDA: convert donauboe " Stephen Hemminger
2009-03-27  7:50   ` David Miller
2009-03-27  1:11 ` [patch 09/30] tokenring: convert drivers " Stephen Hemminger
2009-03-27  7:50   ` David Miller
2009-03-27  1:11 ` [patch 10/30] tokenring: convert smctr " Stephen Hemminger
2009-03-27  7:50   ` David Miller
2009-03-27  1:11 ` Stephen Hemminger [this message]
2009-03-27  7:50   ` [patch 11/30] wan: convert sdla driver " David Miller
2009-03-27  1:11 ` [patch 12/30] wireless: convert arlan " Stephen Hemminger
2009-03-27  1:11   ` Stephen Hemminger
2009-03-27  7:51   ` David Miller
2009-03-27  1:11 ` [patch 13/30] wireless: convert wavelan " Stephen Hemminger
2009-03-27  1:11   ` Stephen Hemminger
2009-03-27  7:51   ` David Miller
2009-03-27  7:51     ` David Miller
2009-03-27  1:11 ` [patch 14/30] netdev: seeq8005 convert " Stephen Hemminger
2009-03-27  7:51   ` David Miller
2009-03-27  1:11 ` [patch 15/30] netdev: smc9194 " Stephen Hemminger
2009-03-27  7:51   ` David Miller
2009-03-27  1:11 ` [patch 16/30] netdev: smc-ultra32 " Stephen Hemminger
2009-03-27  7:51   ` David Miller
2009-03-27  1:11 ` [patch 17/30] netdev: smc-ultra fix netpoll Stephen Hemminger
2009-03-27  7:51   ` David Miller
2009-03-27  1:11 ` [patch 18/30] lance: convert to net_device_ops Stephen Hemminger
2009-03-27  7:51   ` David Miller
2009-03-27  1:11 ` [patch 19/30] netdev: ibmlana " Stephen Hemminger
2009-03-27  7:51   ` David Miller
2009-03-27  1:11 ` [patch 20/30] netdev: convert eexpress " Stephen Hemminger
2009-03-27  7:51   ` David Miller
2009-03-27  1:11 ` [patch 21/30] netdev: convert eexpro " Stephen Hemminger
2009-03-27  7:51   ` David Miller
2009-03-27  1:11 ` [patch 22/30] netdev: convert at1700 " Stephen Hemminger
2009-03-27  7:51   ` David Miller
2009-03-27  7:52   ` David Miller
2009-03-27  1:11 ` [patch 23/30] netdev: convert depca " Stephen Hemminger
2009-03-27  7:52   ` David Miller
2009-03-27  1:11 ` [patch 24/30] netdev: convert ewrk3 " Stephen Hemminger
2009-03-27  7:52   ` David Miller
2009-03-27  1:11 ` [patch 25/30] netdev: convert ni52 " Stephen Hemminger
2009-03-27  7:52   ` David Miller
2009-03-27  1:11 ` [patch 26/30] netdev: convert ni65 " Stephen Hemminger
2009-03-27  7:52   ` David Miller
2009-03-27  1:11 ` [patch 27/30] netdev: convert ac3200 " Stephen Hemminger
2009-03-27  7:52   ` David Miller
2009-03-27  7:52   ` David Miller
2009-03-27  1:11 ` [patch 28/30] netdev: convert lp486e " Stephen Hemminger
2009-03-27  7:52   ` David Miller
2009-03-27  1:11 ` [patch 29/30] netdev: convert cs89x0 " Stephen Hemminger
2009-03-27  7:52   ` David Miller
2009-03-27  1:11 ` [patch 30/30] netdev: convert eth16i " Stephen Hemminger
2009-03-27  7:52   ` 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=20090327011255.745791643@linux-foundation.org \
    --to=shemminger@linux-foundation.org \
    --cc=davem@davemloft.net \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.