diff options
author | Patrick McHardy <kaber@trash.net> | 2007-06-13 12:04:06 -0700 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-07-10 22:14:23 -0700 |
commit | 58651b24acfd9a6fd3b217b52e577ce34b0932af (patch) | |
tree | 7e6d77a0de777c5a8391a6e25b9bc4493ee43401 | |
parent | 38f7b870d4a6a5d3ec21557e849620cb7d032965 (diff) | |
download | blackbird-op-linux-58651b24acfd9a6fd3b217b52e577ce34b0932af.tar.gz blackbird-op-linux-58651b24acfd9a6fd3b217b52e577ce34b0932af.zip |
[DUMMY]: Use dev->stats
Use dev->stats instead of netdev_priv().
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/dummy.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c index 60673bc292c0..91b474c9bba0 100644 --- a/drivers/net/dummy.c +++ b/drivers/net/dummy.c @@ -38,7 +38,6 @@ static int numdummies = 1; static int dummy_xmit(struct sk_buff *skb, struct net_device *dev); -static struct net_device_stats *dummy_get_stats(struct net_device *dev); static int dummy_set_address(struct net_device *dev, void *p) { @@ -59,7 +58,6 @@ static void set_multicast_list(struct net_device *dev) static void __init dummy_setup(struct net_device *dev) { /* Initialize the device structure. */ - dev->get_stats = dummy_get_stats; dev->hard_start_xmit = dummy_xmit; dev->set_multicast_list = set_multicast_list; dev->set_mac_address = dummy_set_address; @@ -76,20 +74,13 @@ static void __init dummy_setup(struct net_device *dev) static int dummy_xmit(struct sk_buff *skb, struct net_device *dev) { - struct net_device_stats *stats = netdev_priv(dev); - - stats->tx_packets++; - stats->tx_bytes+=skb->len; + dev->stats.tx_packets++; + dev->stats.tx_bytes += skb->len; dev_kfree_skb(skb); return 0; } -static struct net_device_stats *dummy_get_stats(struct net_device *dev) -{ - return netdev_priv(dev); -} - static struct net_device **dummies; /* Number of dummy devices to be set up by this module. */ @@ -101,8 +92,7 @@ static int __init dummy_init_one(int index) struct net_device *dev_dummy; int err; - dev_dummy = alloc_netdev(sizeof(struct net_device_stats), - "dummy%d", dummy_setup); + dev_dummy = alloc_netdev(0, "dummy%d", dummy_setup); if (!dev_dummy) return -ENOMEM; |