netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@linux-foundation.org>
To: David Miller <davem@davemloft.net>, klaus.kudielka@ieee.org
Cc: netdev@vger.kernel.org, linux-hams@vger.kernel.org
Subject: [patch 36/45] dmascc: convert to internal network device stats
Date: Fri, 09 Jan 2009 15:01:33 -0800	[thread overview]
Message-ID: <20090109230139.400592115@linux-foundation.org> (raw)
In-Reply-To: 20090109230057.575650817@linux-foundation.org

[-- Attachment #1: dmascc-stats.patch --]
[-- Type: text/plain, Size: 3874 bytes --]

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

--- a/drivers/net/hamradio/dmascc.c	2009-01-09 10:16:50.000000000 -0800
+++ b/drivers/net/hamradio/dmascc.c	2009-01-09 11:07:16.000000000 -0800
@@ -195,7 +195,7 @@ struct scc_priv {
 	int chip;
 	struct net_device *dev;
 	struct scc_info *info;
-	struct net_device_stats stats;
+
 	int channel;
 	int card_base, scc_cmd, scc_data;
 	int tmr_cnt, tmr_ctrl, tmr_mode;
@@ -239,7 +239,6 @@ static int scc_open(struct net_device *d
 static int scc_close(struct net_device *dev);
 static int scc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
 static int scc_send_packet(struct sk_buff *skb, struct net_device *dev);
-static struct net_device_stats *scc_get_stats(struct net_device *dev);
 static int scc_set_mac_address(struct net_device *dev, void *sa);
 
 static inline void tx_on(struct scc_priv *priv);
@@ -961,14 +960,6 @@ static int scc_send_packet(struct sk_buf
 }
 
 
-static struct net_device_stats *scc_get_stats(struct net_device *dev)
-{
-	struct scc_priv *priv = dev->ml_priv;
-
-	return &priv->stats;
-}
-
-
 static int scc_set_mac_address(struct net_device *dev, void *sa)
 {
 	memcpy(dev->dev_addr, ((struct sockaddr *) sa)->sa_data,
@@ -1216,17 +1207,17 @@ static void special_condition(struct scc
 		}
 		if (priv->rx_over) {
 			/* We had an overrun */
-			priv->stats.rx_errors++;
+			priv->dev->stats.rx_errors++;
 			if (priv->rx_over == 2)
-				priv->stats.rx_length_errors++;
+				priv->dev->stats.rx_length_errors++;
 			else
-				priv->stats.rx_fifo_errors++;
+				priv->dev->stats.rx_fifo_errors++;
 			priv->rx_over = 0;
 		} else if (rc & CRC_ERR) {
 			/* Count invalid CRC only if packet length >= minimum */
 			if (cb >= 15) {
-				priv->stats.rx_errors++;
-				priv->stats.rx_crc_errors++;
+				priv->dev->stats.rx_errors++;
+				priv->dev->stats.rx_crc_errors++;
 			}
 		} else {
 			if (cb >= 15) {
@@ -1239,8 +1230,8 @@ static void special_condition(struct scc
 					priv->rx_count++;
 					schedule_work(&priv->rx_work);
 				} else {
-					priv->stats.rx_errors++;
-					priv->stats.rx_over_errors++;
+					priv->dev->stats.rx_errors++;
+					priv->dev->stats.rx_over_errors++;
 				}
 			}
 		}
@@ -1275,7 +1266,7 @@ static void rx_bh(struct work_struct *ug
 		skb = dev_alloc_skb(cb + 1);
 		if (skb == NULL) {
 			/* Drop packet */
-			priv->stats.rx_dropped++;
+			priv->dev->stats.rx_dropped++;
 		} else {
 			/* Fill buffer */
 			data = skb_put(skb, cb + 1);
@@ -1283,8 +1274,8 @@ static void rx_bh(struct work_struct *ug
 			memcpy(&data[1], priv->rx_buf[i], cb);
 			skb->protocol = ax25_type_trans(skb, priv->dev);
 			netif_rx(skb);
-			priv->stats.rx_packets++;
-			priv->stats.rx_bytes += cb;
+			priv->dev->stats.rx_packets++;
+			priv->dev->stats.rx_bytes += cb;
 		}
 		spin_lock_irqsave(&priv->ring_lock, flags);
 		/* Move tail */
@@ -1351,15 +1342,15 @@ static void es_isr(struct scc_priv *priv
 			write_scc(priv, R1, EXT_INT_ENAB | WT_FN_RDYFN);
 		if (res) {
 			/* Update packet statistics */
-			priv->stats.tx_errors++;
-			priv->stats.tx_fifo_errors++;
+			priv->dev->stats.tx_errors++;
+			priv->dev->stats.tx_fifo_errors++;
 			/* Other underrun interrupts may already be waiting */
 			write_scc(priv, R0, RES_EXT_INT);
 			write_scc(priv, R0, RES_EXT_INT);
 		} else {
 			/* Update packet statistics */
-			priv->stats.tx_packets++;
-			priv->stats.tx_bytes += priv->tx_len[i];
+			priv->dev->stats.tx_packets++;
+			priv->dev->stats.tx_bytes += priv->tx_len[i];
 			/* Remove frame from FIFO */
 			priv->tx_tail = (i + 1) % NUM_TX_BUF;
 			priv->tx_count--;
@@ -1425,7 +1416,7 @@ static void tm_isr(struct scc_priv *priv
 		write_scc(priv, R15, DCDIE);
 		priv->rr0 = read_scc(priv, R0);
 		if (priv->rr0 & DCD) {
-			priv->stats.collisions++;
+			priv->dev->stats.collisions++;
 			rx_on(priv);
 			priv->state = RX_ON;
 		} else {



  parent reply	other threads:[~2009-01-09 23:18 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-09 23:00 [patch 00/45] Another batch of network device conversions Stephen Hemminger
2009-01-09 23:00 ` [patch 01/45] atm: br2684 internal stats Stephen Hemminger
2009-01-09 23:00 ` [patch 02/45] br2684: convert to net_device_ops Stephen Hemminger
2009-01-09 23:01 ` [patch 03/45] clip: convert to internal network_device_stats Stephen Hemminger
2009-01-09 23:01 ` [patch 04/45] lec: " Stephen Hemminger
2009-01-09 23:01 ` [patch 05/45] lec: convert to net_device_ops Stephen Hemminger
2009-01-09 23:01 ` [patch 06/45] netrom: convert to internal net_device_stats Stephen Hemminger
2009-01-10 12:54   ` Ralf Baechle DL5RB
2009-01-11  8:15     ` David Miller
2009-01-09 23:01 ` [patch 07/45] netrom: convert to net_device_ops Stephen Hemminger
2009-01-10 12:55   ` Ralf Baechle DL5RB
2009-01-09 23:01 ` [patch 08/45] rose: convert to internal net_device_stats Stephen Hemminger
2009-01-10 12:55   ` Ralf Baechle DL5RB
2009-01-09 23:01 ` [patch 09/45] rose: convert to network_device_ops Stephen Hemminger
2009-01-10 12:55   ` Ralf Baechle DL5RB
2009-01-09 23:01 ` [patch 10/45] appletalk: remove unneeded stubs Stephen Hemminger
2009-01-09 23:01 ` [patch 11/45] arcnet: convert to internal stats Stephen Hemminger
2009-01-09 23:01 ` [patch 12/45] arcnet: convert to net_device_ops Stephen Hemminger
2009-01-09 23:01 ` [patch 13/45] com20020: convert to net_devic_ops Stephen Hemminger
2009-01-09 23:01 ` [patch 14/45] 3c501: convert to net_device_ops Stephen Hemminger
2009-01-09 23:01 ` [patch 15/45] 3c505: " Stephen Hemminger
2009-01-09 23:01 ` [patch 16/45] 3c507: " Stephen Hemminger
2009-01-09 23:01 ` [patch 17/45] 3c509: " Stephen Hemminger
2009-01-09 23:01 ` [patch 18/45] 3c515: " Stephen Hemminger
2009-01-09 23:01 ` [patch 19/45] 3c523: " Stephen Hemminger
2009-01-09 23:01 ` [patch 20/45] 3c527: " Stephen Hemminger
2009-01-09 23:01 ` [patch 21/45] 3c59x: " Stephen Hemminger
2009-01-09 23:01 ` [patch 22/45] ibmtr: convert to internal network_device_stats Stephen Hemminger
2009-01-09 23:01 ` [patch 23/45] ibmtr: convert to net_device_ops Stephen Hemminger
2009-01-09 23:01 ` [patch 24/45] lanstreamer: convert to internal network stats Stephen Hemminger
2009-01-09 23:01 ` [patch 25/45] lanstreamer: convert to net_device_ops Stephen Hemminger
2009-01-09 23:01 ` [patch 26/45] olympic: convert to internal network device stats Stephen Hemminger
2009-01-09 23:01 ` [patch 27/45] olympic: convert to net_device_ops Stephen Hemminger
2009-01-09 23:01 ` [patch 28/45] tms380tr: " Stephen Hemminger
2009-01-09 23:01 ` [patch 29/45] 3c559: " Stephen Hemminger
2009-01-09 23:01 ` [patch 30/45] znet: " Stephen Hemminger
2009-01-09 23:01 ` [patch 31/45] 6pack: " Stephen Hemminger
2009-01-09 23:01 ` [patch 32/45] baycom: convert to internal net_device_stats Stephen Hemminger
2009-01-10  0:03   ` Thomas Sailer
2009-01-09 23:01 ` [patch 33/45] baycom: convert to net_device_ops Stephen Hemminger
2009-01-10  0:03   ` Thomas Sailer
2009-01-09 23:01 ` [patch 34/45] bpqether: convert to internal net_device_stats Stephen Hemminger
2009-01-09 23:01 ` [patch 35/45] bpqether: convert to net_device_ops Stephen Hemminger
2009-01-09 23:01 ` Stephen Hemminger [this message]
2009-01-09 23:01 ` [patch 37/45] dmascc: convert to network_device_ops Stephen Hemminger
2009-01-09 23:01 ` [patch 38/45] hdlcdrv: convert to internal net_device_stats Stephen Hemminger
2009-01-10  0:03   ` Thomas Sailer
2009-01-09 23:01 ` [patch 39/45] hdlcdrv: convert to net_device_ops Stephen Hemminger
2009-01-10  0:03   ` Thomas Sailer
2009-01-09 23:01 ` [patch 40/45] yam: convert to internal net_device_stats Stephen Hemminger
2009-01-09 23:01 ` [patch 41/45] yam: convert to net_device_ops Stephen Hemminger
2009-01-09 23:01 ` [patch 42/45] scc: convert to internal net_device_ops Stephen Hemminger
2009-01-09 23:01 ` [patch 43/45] mkiss: convert to internal network device stats Stephen Hemminger
2009-01-09 23:01 ` [patch 44/45] dmascc: convert to net_device_ops Stephen Hemminger
2009-01-09 23:01 ` [patch 45/45] dmascc: convert to internal net_device_ops Stephen Hemminger
2009-01-10  1:32 ` [patch 00/45] Another batch of network device conversions 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=20090109230139.400592115@linux-foundation.org \
    --to=shemminger@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=klaus.kudielka@ieee.org \
    --cc=linux-hams@vger.kernel.org \
    --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).