]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/net/arm/am79c961a.c
Merge branch 'master' into tk71
[mv-sheeva.git] / drivers / net / arm / am79c961a.c
index 8c496fb1ac9e5fc17108d9b14ba5ac489030740c..0c9217f48b72060d77c6ac20eaa592011cb4a009 100644 (file)
@@ -300,8 +300,6 @@ am79c961_open(struct net_device *dev)
        struct dev_priv *priv = netdev_priv(dev);
        int ret;
 
-       memset (&priv->stats, 0, sizeof (priv->stats));
-
        ret = request_irq(dev->irq, am79c961_interrupt, 0, dev->name, dev);
        if (ret)
                return ret;
@@ -342,15 +340,6 @@ am79c961_close(struct net_device *dev)
        return 0;
 }
 
-/*
- * Get the current statistics.
- */
-static struct net_device_stats *am79c961_getstats (struct net_device *dev)
-{
-       struct dev_priv *priv = netdev_priv(dev);
-       return &priv->stats;
-}
-
 static void am79c961_mc_hash(char *addr, unsigned short *hash)
 {
        if (addr[0] & 0x01) {
@@ -510,14 +499,14 @@ am79c961_rx(struct net_device *dev, struct dev_priv *priv)
 
                if ((status & (RMD_ERR|RMD_STP|RMD_ENP)) != (RMD_STP|RMD_ENP)) {
                        am_writeword (dev, hdraddr + 2, RMD_OWN);
-                       priv->stats.rx_errors ++;
+                       dev->stats.rx_errors++;
                        if (status & RMD_ERR) {
                                if (status & RMD_FRAM)
-                                       priv->stats.rx_frame_errors ++;
+                                       dev->stats.rx_frame_errors++;
                                if (status & RMD_CRC)
-                                       priv->stats.rx_crc_errors ++;
+                                       dev->stats.rx_crc_errors++;
                        } else if (status & RMD_STP)
-                               priv->stats.rx_length_errors ++;
+                               dev->stats.rx_length_errors++;
                        continue;
                }
 
@@ -531,12 +520,12 @@ am79c961_rx(struct net_device *dev, struct dev_priv *priv)
                        am_writeword(dev, hdraddr + 2, RMD_OWN);
                        skb->protocol = eth_type_trans(skb, dev);
                        netif_rx(skb);
-                       priv->stats.rx_bytes += len;
-                       priv->stats.rx_packets ++;
+                       dev->stats.rx_bytes += len;
+                       dev->stats.rx_packets++;
                } else {
                        am_writeword (dev, hdraddr + 2, RMD_OWN);
                        printk (KERN_WARNING "%s: memory squeeze, dropping packet.\n", dev->name);
-                       priv->stats.rx_dropped ++;
+                       dev->stats.rx_dropped++;
                        break;
                }
        } while (1);
@@ -565,7 +554,7 @@ am79c961_tx(struct net_device *dev, struct dev_priv *priv)
                if (status & TMD_ERR) {
                        u_int status2;
 
-                       priv->stats.tx_errors ++;
+                       dev->stats.tx_errors++;
 
                        status2 = am_readword (dev, hdraddr + 6);
 
@@ -575,18 +564,18 @@ am79c961_tx(struct net_device *dev, struct dev_priv *priv)
                        am_writeword (dev, hdraddr + 6, 0);
 
                        if (status2 & TST_RTRY)
-                               priv->stats.collisions += 16;
+                               dev->stats.collisions += 16;
                        if (status2 & TST_LCOL)
-                               priv->stats.tx_window_errors ++;
+                               dev->stats.tx_window_errors++;
                        if (status2 & TST_LCAR)
-                               priv->stats.tx_carrier_errors ++;
+                               dev->stats.tx_carrier_errors++;
                        if (status2 & TST_UFLO)
-                               priv->stats.tx_fifo_errors ++;
+                               dev->stats.tx_fifo_errors++;
                        continue;
                }
-               priv->stats.tx_packets ++;
+               dev->stats.tx_packets++;
                len = am_readword (dev, hdraddr + 4);
-               priv->stats.tx_bytes += -len;
+               dev->stats.tx_bytes += -len;
        } while (priv->txtail != priv->txhead);
 
        netif_wake_queue(dev);
@@ -616,7 +605,7 @@ am79c961_interrupt(int irq, void *dev_id)
                }
                if (status & CSR0_MISS) {
                        handled = 1;
-                       priv->stats.rx_dropped ++;
+                       dev->stats.rx_dropped++;
                }
                if (status & CSR0_CERR) {
                        handled = 1;
@@ -668,7 +657,6 @@ static const struct net_device_ops am79c961_netdev_ops = {
        .ndo_open               = am79c961_open,
        .ndo_stop               = am79c961_close,
        .ndo_start_xmit         = am79c961_sendpacket,
-       .ndo_get_stats          = am79c961_getstats,
        .ndo_set_multicast_list = am79c961_setmulticastlist,
        .ndo_tx_timeout         = am79c961_timeout,
        .ndo_validate_addr      = eth_validate_addr,