aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bfin_mac.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2007-10-03 20:41:50 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:51:16 -0400
commit09f75cd7bf13720738e6a196cc0107ce9a5bd5a0 (patch)
tree4c85b0b395abe7f88c87162fc22570e5de255cb1 /drivers/net/bfin_mac.c
parentff8ac60948ba819b89e9c87083e8050fc2f89999 (diff)
[NET] drivers/net: statistics cleanup #1 -- save memory and shrink code
We now have struct net_device_stats embedded in struct net_device, and the default ->get_stats() hook does the obvious thing for us. Run through drivers/net/* and remove the driver-local storage of statistics, and driver-local ->get_stats() hook where applicable. This was just the low-hanging fruit in drivers/net; plenty more drivers remain to be updated. [ Resolved conflicts with napi_struct changes and fix sunqe build regression... -DaveM ] Signed-off-by: Jeff Garzik <jeff@garzik.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bfin_mac.c')
-rw-r--r--drivers/net/bfin_mac.c25
1 files changed, 5 insertions, 20 deletions
diff --git a/drivers/net/bfin_mac.c b/drivers/net/bfin_mac.c
index e5bbcbe8de5f..cebe55440e13 100644
--- a/drivers/net/bfin_mac.c
+++ b/drivers/net/bfin_mac.c
@@ -579,8 +579,8 @@ out:
579 adjust_tx_list(); 579 adjust_tx_list();
580 current_tx_ptr = current_tx_ptr->next; 580 current_tx_ptr = current_tx_ptr->next;
581 dev->trans_start = jiffies; 581 dev->trans_start = jiffies;
582 lp->stats.tx_packets++; 582 dev->stats.tx_packets++;
583 lp->stats.tx_bytes += (skb->len); 583 dev->stats.tx_bytes += (skb->len);
584 return 0; 584 return 0;
585} 585}
586 586
@@ -596,7 +596,7 @@ static void bf537mac_rx(struct net_device *dev)
596 if (!new_skb) { 596 if (!new_skb) {
597 printk(KERN_NOTICE DRV_NAME 597 printk(KERN_NOTICE DRV_NAME
598 ": rx: low on mem - packet dropped\n"); 598 ": rx: low on mem - packet dropped\n");
599 lp->stats.rx_dropped++; 599 dev->stats.rx_dropped++;
600 goto out; 600 goto out;
601 } 601 }
602 /* reserve 2 bytes for RXDWA padding */ 602 /* reserve 2 bytes for RXDWA padding */
@@ -618,8 +618,8 @@ static void bf537mac_rx(struct net_device *dev)
618#endif 618#endif
619 619
620 netif_rx(skb); 620 netif_rx(skb);
621 lp->stats.rx_packets++; 621 dev->stats.rx_packets++;
622 lp->stats.rx_bytes += len; 622 dev->stats.rx_bytes += len;
623 current_rx_ptr->status.status_word = 0x00000000; 623 current_rx_ptr->status.status_word = 0x00000000;
624 current_rx_ptr = current_rx_ptr->next; 624 current_rx_ptr = current_rx_ptr->next;
625 625
@@ -733,20 +733,6 @@ static void bf537mac_timeout(struct net_device *dev)
733} 733}
734 734
735/* 735/*
736 * Get the current statistics.
737 * This may be called with the card open or closed.
738 */
739static struct net_device_stats *bf537mac_query_statistics(struct net_device
740 *dev)
741{
742 struct bf537mac_local *lp = netdev_priv(dev);
743
744 pr_debug("%s: %s\n", dev->name, __FUNCTION__);
745
746 return &lp->stats;
747}
748
749/*
750 * This routine will, depending on the values passed to it, 736 * This routine will, depending on the values passed to it,
751 * either make it accept multicast packets, go into 737 * either make it accept multicast packets, go into
752 * promiscuous mode (for TCPDUMP and cousins) or accept 738 * promiscuous mode (for TCPDUMP and cousins) or accept
@@ -891,7 +877,6 @@ static int __init bf537mac_probe(struct net_device *dev)
891 dev->stop = bf537mac_close; 877 dev->stop = bf537mac_close;
892 dev->hard_start_xmit = bf537mac_hard_start_xmit; 878 dev->hard_start_xmit = bf537mac_hard_start_xmit;
893 dev->tx_timeout = bf537mac_timeout; 879 dev->tx_timeout = bf537mac_timeout;
894 dev->get_stats = bf537mac_query_statistics;
895 dev->set_multicast_list = bf537mac_set_multicast_list; 880 dev->set_multicast_list = bf537mac_set_multicast_list;
896#ifdef CONFIG_NET_POLL_CONTROLLER 881#ifdef CONFIG_NET_POLL_CONTROLLER
897 dev->poll_controller = bf537mac_poll; 882 dev->poll_controller = bf537mac_poll;