diff options
author | Stephen Hemminger <shemminger@linux-foundation.org> | 2009-01-09 08:01:03 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-01-21 17:02:01 -0500 |
commit | b51414b69148433a79af5dc93463a0489492a788 (patch) | |
tree | b1583ed1e318c6f17b715c26a029418c9834b89b /net/netrom | |
parent | 004b3225c016efc90cbfe43cdf69c6331462bc56 (diff) |
netrom: 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/netrom')
-rw-r--r-- | net/netrom/af_netrom.c | 2 | ||||
-rw-r--r-- | net/netrom/nr_dev.c | 14 |
2 files changed, 3 insertions, 13 deletions
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c index e9c05b8f4f45..cba7849de98e 100644 --- a/net/netrom/af_netrom.c +++ b/net/netrom/af_netrom.c | |||
@@ -1432,7 +1432,7 @@ static int __init nr_proto_init(void) | |||
1432 | struct net_device *dev; | 1432 | struct net_device *dev; |
1433 | 1433 | ||
1434 | sprintf(name, "nr%d", i); | 1434 | sprintf(name, "nr%d", i); |
1435 | dev = alloc_netdev(sizeof(struct nr_private), name, nr_setup); | 1435 | dev = alloc_netdev(0, name, nr_setup); |
1436 | if (!dev) { | 1436 | if (!dev) { |
1437 | printk(KERN_ERR "NET/ROM: nr_proto_init - unable to allocate device structure\n"); | 1437 | printk(KERN_ERR "NET/ROM: nr_proto_init - unable to allocate device structure\n"); |
1438 | goto fail; | 1438 | goto fail; |
diff --git a/net/netrom/nr_dev.c b/net/netrom/nr_dev.c index 6caf459665f2..5b9a31a6e685 100644 --- a/net/netrom/nr_dev.c +++ b/net/netrom/nr_dev.c | |||
@@ -42,7 +42,7 @@ | |||
42 | 42 | ||
43 | int nr_rx_ip(struct sk_buff *skb, struct net_device *dev) | 43 | int nr_rx_ip(struct sk_buff *skb, struct net_device *dev) |
44 | { | 44 | { |
45 | struct net_device_stats *stats = netdev_priv(dev); | 45 | struct net_device_stats *stats = &dev->stats; |
46 | 46 | ||
47 | if (!netif_running(dev)) { | 47 | if (!netif_running(dev)) { |
48 | stats->rx_dropped++; | 48 | stats->rx_dropped++; |
@@ -171,8 +171,7 @@ static int nr_close(struct net_device *dev) | |||
171 | 171 | ||
172 | static int nr_xmit(struct sk_buff *skb, struct net_device *dev) | 172 | static int nr_xmit(struct sk_buff *skb, struct net_device *dev) |
173 | { | 173 | { |
174 | struct nr_private *nr = netdev_priv(dev); | 174 | struct net_device_stats *stats = &dev->stats; |
175 | struct net_device_stats *stats = &nr->stats; | ||
176 | unsigned int len = skb->len; | 175 | unsigned int len = skb->len; |
177 | 176 | ||
178 | if (!nr_route_frame(skb, NULL)) { | 177 | if (!nr_route_frame(skb, NULL)) { |
@@ -187,13 +186,6 @@ static int nr_xmit(struct sk_buff *skb, struct net_device *dev) | |||
187 | return 0; | 186 | return 0; |
188 | } | 187 | } |
189 | 188 | ||
190 | static struct net_device_stats *nr_get_stats(struct net_device *dev) | ||
191 | { | ||
192 | struct nr_private *nr = netdev_priv(dev); | ||
193 | |||
194 | return &nr->stats; | ||
195 | } | ||
196 | |||
197 | static const struct header_ops nr_header_ops = { | 189 | static const struct header_ops nr_header_ops = { |
198 | .create = nr_header, | 190 | .create = nr_header, |
199 | .rebuild= nr_rebuild_header, | 191 | .rebuild= nr_rebuild_header, |
@@ -215,6 +207,4 @@ void nr_setup(struct net_device *dev) | |||
215 | 207 | ||
216 | /* New-style flags. */ | 208 | /* New-style flags. */ |
217 | dev->flags = IFF_NOARP; | 209 | dev->flags = IFF_NOARP; |
218 | |||
219 | dev->get_stats = nr_get_stats; | ||
220 | } | 210 | } |