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/de600.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/de600.c')
-rw-r--r-- | drivers/net/de600.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/net/de600.c b/drivers/net/de600.c index 5dd0d9c0eac9..421c2ca49711 100644 --- a/drivers/net/de600.c +++ b/drivers/net/de600.c | |||
@@ -154,11 +154,6 @@ static int de600_close(struct net_device *dev) | |||
154 | return 0; | 154 | return 0; |
155 | } | 155 | } |
156 | 156 | ||
157 | static struct net_device_stats *get_stats(struct net_device *dev) | ||
158 | { | ||
159 | return (struct net_device_stats *)(dev->priv); | ||
160 | } | ||
161 | |||
162 | static inline void trigger_interrupt(struct net_device *dev) | 157 | static inline void trigger_interrupt(struct net_device *dev) |
163 | { | 158 | { |
164 | de600_put_command(FLIP_IRQ); | 159 | de600_put_command(FLIP_IRQ); |
@@ -308,7 +303,7 @@ static int de600_tx_intr(struct net_device *dev, int irq_status) | |||
308 | if (!(irq_status & TX_FAILED16)) { | 303 | if (!(irq_status & TX_FAILED16)) { |
309 | tx_fifo_out = (tx_fifo_out + 1) % TX_PAGES; | 304 | tx_fifo_out = (tx_fifo_out + 1) % TX_PAGES; |
310 | ++free_tx_pages; | 305 | ++free_tx_pages; |
311 | ((struct net_device_stats *)(dev->priv))->tx_packets++; | 306 | dev->stats.tx_packets++; |
312 | netif_wake_queue(dev); | 307 | netif_wake_queue(dev); |
313 | } | 308 | } |
314 | 309 | ||
@@ -375,8 +370,8 @@ static void de600_rx_intr(struct net_device *dev) | |||
375 | 370 | ||
376 | /* update stats */ | 371 | /* update stats */ |
377 | dev->last_rx = jiffies; | 372 | dev->last_rx = jiffies; |
378 | ((struct net_device_stats *)(dev->priv))->rx_packets++; /* count all receives */ | 373 | dev->stats.rx_packets++; /* count all receives */ |
379 | ((struct net_device_stats *)(dev->priv))->rx_bytes += size; /* count all received bytes */ | 374 | dev->stats.rx_bytes += size; /* count all received bytes */ |
380 | 375 | ||
381 | /* | 376 | /* |
382 | * If any worth-while packets have been received, netif_rx() | 377 | * If any worth-while packets have been received, netif_rx() |
@@ -390,7 +385,7 @@ static struct net_device * __init de600_probe(void) | |||
390 | struct net_device *dev; | 385 | struct net_device *dev; |
391 | int err; | 386 | int err; |
392 | 387 | ||
393 | dev = alloc_etherdev(sizeof(struct net_device_stats)); | 388 | dev = alloc_etherdev(0); |
394 | if (!dev) | 389 | if (!dev) |
395 | return ERR_PTR(-ENOMEM); | 390 | return ERR_PTR(-ENOMEM); |
396 | 391 | ||
@@ -448,8 +443,6 @@ static struct net_device * __init de600_probe(void) | |||
448 | printk(":%02X",dev->dev_addr[i]); | 443 | printk(":%02X",dev->dev_addr[i]); |
449 | printk("\n"); | 444 | printk("\n"); |
450 | 445 | ||
451 | dev->get_stats = get_stats; | ||
452 | |||
453 | dev->open = de600_open; | 446 | dev->open = de600_open; |
454 | dev->stop = de600_close; | 447 | dev->stop = de600_close; |
455 | dev->hard_start_xmit = &de600_start_xmit; | 448 | dev->hard_start_xmit = &de600_start_xmit; |