diff options
author | Jeff Garzik <jeff@garzik.org> | 2007-10-03 20:41:50 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:51:16 -0400 |
commit | 09f75cd7bf13720738e6a196cc0107ce9a5bd5a0 (patch) | |
tree | 4c85b0b395abe7f88c87162fc22570e5de255cb1 /drivers/net/pasemi_mac.c | |
parent | ff8ac60948ba819b89e9c87083e8050fc2f89999 (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/pasemi_mac.c')
-rw-r--r-- | drivers/net/pasemi_mac.c | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/drivers/net/pasemi_mac.c b/drivers/net/pasemi_mac.c index 723685ee57aa..f310d94443a0 100644 --- a/drivers/net/pasemi_mac.c +++ b/drivers/net/pasemi_mac.c | |||
@@ -530,8 +530,8 @@ static int pasemi_mac_clean_rx(struct pasemi_mac *mac, int limit) | |||
530 | } else | 530 | } else |
531 | skb->ip_summed = CHECKSUM_NONE; | 531 | skb->ip_summed = CHECKSUM_NONE; |
532 | 532 | ||
533 | mac->stats.rx_bytes += len; | 533 | mac->netdev->stats.rx_bytes += len; |
534 | mac->stats.rx_packets++; | 534 | mac->netdev->stats.rx_packets++; |
535 | 535 | ||
536 | skb->protocol = eth_type_trans(skb, mac->netdev); | 536 | skb->protocol = eth_type_trans(skb, mac->netdev); |
537 | netif_receive_skb(skb); | 537 | netif_receive_skb(skb); |
@@ -1032,8 +1032,8 @@ static int pasemi_mac_start_tx(struct sk_buff *skb, struct net_device *dev) | |||
1032 | info->skb = skb; | 1032 | info->skb = skb; |
1033 | 1033 | ||
1034 | txring->next_to_fill++; | 1034 | txring->next_to_fill++; |
1035 | mac->stats.tx_packets++; | 1035 | dev->stats.tx_packets++; |
1036 | mac->stats.tx_bytes += skb->len; | 1036 | dev->stats.tx_bytes += skb->len; |
1037 | 1037 | ||
1038 | spin_unlock_irqrestore(&txring->lock, flags); | 1038 | spin_unlock_irqrestore(&txring->lock, flags); |
1039 | 1039 | ||
@@ -1047,14 +1047,6 @@ out_err: | |||
1047 | return NETDEV_TX_BUSY; | 1047 | return NETDEV_TX_BUSY; |
1048 | } | 1048 | } |
1049 | 1049 | ||
1050 | static struct net_device_stats *pasemi_mac_get_stats(struct net_device *dev) | ||
1051 | { | ||
1052 | struct pasemi_mac *mac = netdev_priv(dev); | ||
1053 | |||
1054 | return &mac->stats; | ||
1055 | } | ||
1056 | |||
1057 | |||
1058 | static void pasemi_mac_set_rx_mode(struct net_device *dev) | 1050 | static void pasemi_mac_set_rx_mode(struct net_device *dev) |
1059 | { | 1051 | { |
1060 | struct pasemi_mac *mac = netdev_priv(dev); | 1052 | struct pasemi_mac *mac = netdev_priv(dev); |
@@ -1223,7 +1215,6 @@ pasemi_mac_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1223 | dev->open = pasemi_mac_open; | 1215 | dev->open = pasemi_mac_open; |
1224 | dev->stop = pasemi_mac_close; | 1216 | dev->stop = pasemi_mac_close; |
1225 | dev->hard_start_xmit = pasemi_mac_start_tx; | 1217 | dev->hard_start_xmit = pasemi_mac_start_tx; |
1226 | dev->get_stats = pasemi_mac_get_stats; | ||
1227 | dev->set_multicast_list = pasemi_mac_set_rx_mode; | 1218 | dev->set_multicast_list = pasemi_mac_set_rx_mode; |
1228 | 1219 | ||
1229 | err = pasemi_mac_map_regs(mac); | 1220 | err = pasemi_mac_map_regs(mac); |