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/dgrs.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/dgrs.c')
-rw-r--r-- | drivers/net/dgrs.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/drivers/net/dgrs.c b/drivers/net/dgrs.c index ddedb76303d5..a9ef79da3dc7 100644 --- a/drivers/net/dgrs.c +++ b/drivers/net/dgrs.c | |||
@@ -194,11 +194,6 @@ static int dgrs_nicmode; | |||
194 | typedef struct | 194 | typedef struct |
195 | { | 195 | { |
196 | /* | 196 | /* |
197 | * Stuff for generic ethercard I/F | ||
198 | */ | ||
199 | struct net_device_stats stats; | ||
200 | |||
201 | /* | ||
202 | * DGRS specific data | 197 | * DGRS specific data |
203 | */ | 198 | */ |
204 | char *vmem; | 199 | char *vmem; |
@@ -499,7 +494,7 @@ dgrs_rcv_frame( | |||
499 | if ((skb = dev_alloc_skb(len+5)) == NULL) | 494 | if ((skb = dev_alloc_skb(len+5)) == NULL) |
500 | { | 495 | { |
501 | printk("%s: dev_alloc_skb failed for rcv buffer\n", devN->name); | 496 | printk("%s: dev_alloc_skb failed for rcv buffer\n", devN->name); |
502 | ++privN->stats.rx_dropped; | 497 | ++dev0->stats.rx_dropped; |
503 | /* discarding the frame */ | 498 | /* discarding the frame */ |
504 | goto out; | 499 | goto out; |
505 | } | 500 | } |
@@ -667,8 +662,8 @@ again: | |||
667 | skb->protocol = eth_type_trans(skb, devN); | 662 | skb->protocol = eth_type_trans(skb, devN); |
668 | netif_rx(skb); | 663 | netif_rx(skb); |
669 | devN->last_rx = jiffies; | 664 | devN->last_rx = jiffies; |
670 | ++privN->stats.rx_packets; | 665 | ++devN->stats.rx_packets; |
671 | privN->stats.rx_bytes += len; | 666 | devN->stats.rx_bytes += len; |
672 | 667 | ||
673 | out: | 668 | out: |
674 | cbp->xmit.status = I596_CB_STATUS_C | I596_CB_STATUS_OK; | 669 | cbp->xmit.status = I596_CB_STATUS_C | I596_CB_STATUS_OK; |
@@ -776,7 +771,7 @@ frame_done: | |||
776 | priv0->rfdp->status = I596_RFD_C | I596_RFD_OK; | 771 | priv0->rfdp->status = I596_RFD_C | I596_RFD_OK; |
777 | priv0->rfdp = (I596_RFD *) S2H(priv0->rfdp->next); | 772 | priv0->rfdp = (I596_RFD *) S2H(priv0->rfdp->next); |
778 | 773 | ||
779 | ++privN->stats.tx_packets; | 774 | ++devN->stats.tx_packets; |
780 | 775 | ||
781 | dev_kfree_skb (skb); | 776 | dev_kfree_skb (skb); |
782 | return (0); | 777 | return (0); |
@@ -806,16 +801,6 @@ static int dgrs_close( struct net_device *dev ) | |||
806 | } | 801 | } |
807 | 802 | ||
808 | /* | 803 | /* |
809 | * Get statistics | ||
810 | */ | ||
811 | static struct net_device_stats *dgrs_get_stats( struct net_device *dev ) | ||
812 | { | ||
813 | DGRS_PRIV *priv = (DGRS_PRIV *) dev->priv; | ||
814 | |||
815 | return (&priv->stats); | ||
816 | } | ||
817 | |||
818 | /* | ||
819 | * Set multicast list and/or promiscuous mode | 804 | * Set multicast list and/or promiscuous mode |
820 | */ | 805 | */ |
821 | 806 | ||
@@ -1213,7 +1198,6 @@ dgrs_probe1(struct net_device *dev) | |||
1213 | */ | 1198 | */ |
1214 | dev->open = &dgrs_open; | 1199 | dev->open = &dgrs_open; |
1215 | dev->stop = &dgrs_close; | 1200 | dev->stop = &dgrs_close; |
1216 | dev->get_stats = &dgrs_get_stats; | ||
1217 | dev->hard_start_xmit = &dgrs_start_xmit; | 1201 | dev->hard_start_xmit = &dgrs_start_xmit; |
1218 | dev->set_multicast_list = &dgrs_set_multicast_list; | 1202 | dev->set_multicast_list = &dgrs_set_multicast_list; |
1219 | dev->do_ioctl = &dgrs_ioctl; | 1203 | dev->do_ioctl = &dgrs_ioctl; |