Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d248fd77902fcf33b0bc49ab521930877d94890f
Commit:     d248fd77902fcf33b0bc49ab521930877d94890f
Parent:     21511abd0a248a3f225d3b611cfabb93124605a7
Author:     Florian Fainelli <[EMAIL PROTECTED]>
AuthorDate: Wed Dec 12 22:34:55 2007 +0100
Committer:  Francois Romieu <[EMAIL PROTECTED]>
CommitDate: Tue Feb 5 23:29:02 2008 +0100

    r6040: do not use a private stats structure to store statistics
    
    Signed-off-by: Florian Fainelli <[EMAIL PROTECTED]>
    Signed-off-by: Francois Romieu <[EMAIL PROTECTED]>
---
 drivers/net/r6040.c |   34 ++++++++++++++++++++--------------
 1 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/drivers/net/r6040.c b/drivers/net/r6040.c
index 2334f4e..325a8e4 100644
--- a/drivers/net/r6040.c
+++ b/drivers/net/r6040.c
@@ -174,7 +174,6 @@ struct r6040_private {
        struct net_device *dev;
        struct mii_if_info mii_if;
        struct napi_struct napi;
-       struct net_device_stats stats;
        u16     napi_rx_running;
        void __iomem *base;
 };
@@ -280,11 +279,11 @@ static struct net_device_stats *r6040_get_stats(struct 
net_device *dev)
        unsigned long flags;
 
        spin_lock_irqsave(&priv->lock, flags);
-       priv->stats.rx_crc_errors += ioread8(ioaddr + ME_CNT1);
-       priv->stats.multicast += ioread8(ioaddr + ME_CNT0);
+       dev->stats.rx_crc_errors += ioread8(ioaddr + ME_CNT1);
+       dev->stats.multicast += ioread8(ioaddr + ME_CNT0);
        spin_unlock_irqrestore(&priv->lock, flags);
 
-       return &priv->stats;
+       return &dev->stats;
 }
 
 /* Stop RDC MAC and Free the allocated resource */
@@ -432,19 +431,24 @@ static int r6040_rx(struct net_device *dev, int limit)
 
                /* Check for errors */
                err = ioread16(ioaddr + MLSR);
-               if (err & 0x0400) priv->stats.rx_errors++;
+               if (err & 0x0400)
+                       dev->stats.rx_errors++;
                /* RX FIFO over-run */
-               if (err & 0x8000) priv->stats.rx_fifo_errors++;
+               if (err & 0x8000)
+                       dev->stats.rx_fifo_errors++;
                /* RX descriptor unavailable */
-               if (err & 0x0080) priv->stats.rx_frame_errors++;
+               if (err & 0x0080)
+                       dev->stats.rx_frame_errors++;
                /* Received packet with length over buffer lenght */
-               if (err & 0x0020) priv->stats.rx_over_errors++;
+               if (err & 0x0020)
+                       dev->stats.rx_over_errors++;
                /* Received packet with too long or short */
-               if (err & (0x0010|0x0008)) priv->stats.rx_length_errors++;
+               if (err & (0x0010 | 0x0008))
+                       dev->stats.rx_length_errors++;
                /* Received packet with CRC errors */
                if (err & 0x0004) {
                        spin_lock(&priv->lock);
-                       priv->stats.rx_crc_errors++;
+                       dev->stats.rx_crc_errors++;
                        spin_unlock(&priv->lock);
                }
 
@@ -469,8 +473,8 @@ static int r6040_rx(struct net_device *dev, int limit)
                        /* Send to upper layer */
                        netif_receive_skb(skb_ptr);
                        dev->last_rx = jiffies;
-                       priv->dev->stats.rx_packets++;
-                       priv->dev->stats.rx_bytes += descptr->len;
+                       dev->stats.rx_packets++;
+                       dev->stats.rx_bytes += descptr->len;
                        /* To next descriptor */
                        descptr = descptr->vndescp;
                        priv->rx_free_desc--;
@@ -498,8 +502,10 @@ static void r6040_tx(struct net_device *dev)
                /* Check for errors */
                err = ioread16(ioaddr + MLSR);
 
-               if (err & 0x0200) priv->stats.rx_fifo_errors++;
-               if (err & (0x2000 | 0x4000)) priv->stats.tx_carrier_errors++;
+               if (err & 0x0200)
+                       dev->stats.rx_fifo_errors++;
+               if (err & (0x2000 | 0x4000))
+                       dev->stats.tx_carrier_errors++;
 
                if (descptr->status & 0x8000)
                        break; /* Not complte */
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to