diff options
author | Stephen Hemminger <shemminger@linux-foundation.org> | 2009-01-09 08:01:05 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-01-21 17:02:02 -0500 |
commit | d289d120b46d9b6c68448b1d1c6d3edb94cdbde6 (patch) | |
tree | 2768cf64cea670ae2dc2ba688999e42ff54df62c /net/rose | |
parent | 0f6c5c8e79781974c0e660fd8bfc659b101b44fd (diff) |
rose: convert to internal net_device_stats
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rose')
-rw-r--r-- | net/rose/af_rose.c | 3 | ||||
-rw-r--r-- | net/rose/rose_dev.c | 10 |
2 files changed, 3 insertions, 10 deletions
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index 01392649b462..650139626581 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c | |||
@@ -1587,8 +1587,7 @@ static int __init rose_proto_init(void) | |||
1587 | char name[IFNAMSIZ]; | 1587 | char name[IFNAMSIZ]; |
1588 | 1588 | ||
1589 | sprintf(name, "rose%d", i); | 1589 | sprintf(name, "rose%d", i); |
1590 | dev = alloc_netdev(sizeof(struct net_device_stats), | 1590 | dev = alloc_netdev(0, name, rose_setup); |
1591 | name, rose_setup); | ||
1592 | if (!dev) { | 1591 | if (!dev) { |
1593 | printk(KERN_ERR "ROSE: rose_proto_init - unable to allocate memory\n"); | 1592 | printk(KERN_ERR "ROSE: rose_proto_init - unable to allocate memory\n"); |
1594 | rc = -ENOMEM; | 1593 | rc = -ENOMEM; |
diff --git a/net/rose/rose_dev.c b/net/rose/rose_dev.c index 12cfcf09556b..ddb566707184 100644 --- a/net/rose/rose_dev.c +++ b/net/rose/rose_dev.c | |||
@@ -57,7 +57,7 @@ static int rose_rebuild_header(struct sk_buff *skb) | |||
57 | { | 57 | { |
58 | #ifdef CONFIG_INET | 58 | #ifdef CONFIG_INET |
59 | struct net_device *dev = skb->dev; | 59 | struct net_device *dev = skb->dev; |
60 | struct net_device_stats *stats = netdev_priv(dev); | 60 | struct net_device_stats *stats = &dev->stats; |
61 | unsigned char *bp = (unsigned char *)skb->data; | 61 | unsigned char *bp = (unsigned char *)skb->data; |
62 | struct sk_buff *skbn; | 62 | struct sk_buff *skbn; |
63 | unsigned int len; | 63 | unsigned int len; |
@@ -133,7 +133,7 @@ static int rose_close(struct net_device *dev) | |||
133 | 133 | ||
134 | static int rose_xmit(struct sk_buff *skb, struct net_device *dev) | 134 | static int rose_xmit(struct sk_buff *skb, struct net_device *dev) |
135 | { | 135 | { |
136 | struct net_device_stats *stats = netdev_priv(dev); | 136 | struct net_device_stats *stats = &dev->stats; |
137 | 137 | ||
138 | if (!netif_running(dev)) { | 138 | if (!netif_running(dev)) { |
139 | printk(KERN_ERR "ROSE: rose_xmit - called when iface is down\n"); | 139 | printk(KERN_ERR "ROSE: rose_xmit - called when iface is down\n"); |
@@ -144,11 +144,6 @@ static int rose_xmit(struct sk_buff *skb, struct net_device *dev) | |||
144 | return 0; | 144 | return 0; |
145 | } | 145 | } |
146 | 146 | ||
147 | static struct net_device_stats *rose_get_stats(struct net_device *dev) | ||
148 | { | ||
149 | return netdev_priv(dev); | ||
150 | } | ||
151 | |||
152 | static const struct header_ops rose_header_ops = { | 147 | static const struct header_ops rose_header_ops = { |
153 | .create = rose_header, | 148 | .create = rose_header, |
154 | .rebuild= rose_rebuild_header, | 149 | .rebuild= rose_rebuild_header, |
@@ -169,5 +164,4 @@ void rose_setup(struct net_device *dev) | |||
169 | 164 | ||
170 | /* New-style flags. */ | 165 | /* New-style flags. */ |
171 | dev->flags = IFF_NOARP; | 166 | dev->flags = IFF_NOARP; |
172 | dev->get_stats = rose_get_stats; | ||
173 | } | 167 | } |