]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/net/bfin_mac.c
[NET] drivers/net: statistics cleanup #1 -- save memory and shrink code
[karo-tx-linux.git] / drivers / net / bfin_mac.c
index e5bbcbe8de5f573d40cd6372607f90ad38986b7d..cebe55440e13227f959bc7d0ba083fa08f8c46b9 100644 (file)
@@ -579,8 +579,8 @@ out:
        adjust_tx_list();
        current_tx_ptr = current_tx_ptr->next;
        dev->trans_start = jiffies;
-       lp->stats.tx_packets++;
-       lp->stats.tx_bytes += (skb->len);
+       dev->stats.tx_packets++;
+       dev->stats.tx_bytes += (skb->len);
        return 0;
 }
 
@@ -596,7 +596,7 @@ static void bf537mac_rx(struct net_device *dev)
        if (!new_skb) {
                printk(KERN_NOTICE DRV_NAME
                       ": rx: low on mem - packet dropped\n");
-               lp->stats.rx_dropped++;
+               dev->stats.rx_dropped++;
                goto out;
        }
        /* reserve 2 bytes for RXDWA padding */
@@ -618,8 +618,8 @@ static void bf537mac_rx(struct net_device *dev)
 #endif
 
        netif_rx(skb);
-       lp->stats.rx_packets++;
-       lp->stats.rx_bytes += len;
+       dev->stats.rx_packets++;
+       dev->stats.rx_bytes += len;
        current_rx_ptr->status.status_word = 0x00000000;
        current_rx_ptr = current_rx_ptr->next;
 
@@ -732,20 +732,6 @@ static void bf537mac_timeout(struct net_device *dev)
        netif_wake_queue(dev);
 }
 
-/*
- * Get the current statistics.
- * This may be called with the card open or closed.
- */
-static struct net_device_stats *bf537mac_query_statistics(struct net_device
-                                                         *dev)
-{
-       struct bf537mac_local *lp = netdev_priv(dev);
-
-       pr_debug("%s: %s\n", dev->name, __FUNCTION__);
-
-       return &lp->stats;
-}
-
 /*
  * This routine will, depending on the values passed to it,
  * either make it accept multicast packets, go into
@@ -891,7 +877,6 @@ static int __init bf537mac_probe(struct net_device *dev)
        dev->stop = bf537mac_close;
        dev->hard_start_xmit = bf537mac_hard_start_xmit;
        dev->tx_timeout = bf537mac_timeout;
-       dev->get_stats = bf537mac_query_statistics;
        dev->set_multicast_list = bf537mac_set_multicast_list;
 #ifdef CONFIG_NET_POLL_CONTROLLER
        dev->poll_controller = bf537mac_poll;