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/eql.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/eql.c')
-rw-r--r-- | drivers/net/eql.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/net/eql.c b/drivers/net/eql.c index 7266f6dbdd95..18f1364d3d5b 100644 --- a/drivers/net/eql.c +++ b/drivers/net/eql.c | |||
@@ -128,7 +128,6 @@ static int eql_open(struct net_device *dev); | |||
128 | static int eql_close(struct net_device *dev); | 128 | static int eql_close(struct net_device *dev); |
129 | static int eql_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); | 129 | static int eql_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); |
130 | static int eql_slave_xmit(struct sk_buff *skb, struct net_device *dev); | 130 | static int eql_slave_xmit(struct sk_buff *skb, struct net_device *dev); |
131 | static struct net_device_stats *eql_get_stats(struct net_device *dev); | ||
132 | 131 | ||
133 | #define eql_is_slave(dev) ((dev->flags & IFF_SLAVE) == IFF_SLAVE) | 132 | #define eql_is_slave(dev) ((dev->flags & IFF_SLAVE) == IFF_SLAVE) |
134 | #define eql_is_master(dev) ((dev->flags & IFF_MASTER) == IFF_MASTER) | 133 | #define eql_is_master(dev) ((dev->flags & IFF_MASTER) == IFF_MASTER) |
@@ -180,7 +179,6 @@ static void __init eql_setup(struct net_device *dev) | |||
180 | dev->stop = eql_close; | 179 | dev->stop = eql_close; |
181 | dev->do_ioctl = eql_ioctl; | 180 | dev->do_ioctl = eql_ioctl; |
182 | dev->hard_start_xmit = eql_slave_xmit; | 181 | dev->hard_start_xmit = eql_slave_xmit; |
183 | dev->get_stats = eql_get_stats; | ||
184 | 182 | ||
185 | /* | 183 | /* |
186 | * Now we undo some of the things that eth_setup does | 184 | * Now we undo some of the things that eth_setup does |
@@ -337,9 +335,9 @@ static int eql_slave_xmit(struct sk_buff *skb, struct net_device *dev) | |||
337 | skb->priority = 1; | 335 | skb->priority = 1; |
338 | slave->bytes_queued += skb->len; | 336 | slave->bytes_queued += skb->len; |
339 | dev_queue_xmit(skb); | 337 | dev_queue_xmit(skb); |
340 | eql->stats.tx_packets++; | 338 | dev->stats.tx_packets++; |
341 | } else { | 339 | } else { |
342 | eql->stats.tx_dropped++; | 340 | dev->stats.tx_dropped++; |
343 | dev_kfree_skb(skb); | 341 | dev_kfree_skb(skb); |
344 | } | 342 | } |
345 | 343 | ||
@@ -348,12 +346,6 @@ static int eql_slave_xmit(struct sk_buff *skb, struct net_device *dev) | |||
348 | return 0; | 346 | return 0; |
349 | } | 347 | } |
350 | 348 | ||
351 | static struct net_device_stats * eql_get_stats(struct net_device *dev) | ||
352 | { | ||
353 | equalizer_t *eql = netdev_priv(dev); | ||
354 | return &eql->stats; | ||
355 | } | ||
356 | |||
357 | /* | 349 | /* |
358 | * Private ioctl functions | 350 | * Private ioctl functions |
359 | */ | 351 | */ |