Commit d289d120 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

rose: convert to internal net_device_stats

Signed-off-by: default avatarStephen Hemminger <shemminger@vyatta.com>
Acked-by: default avatarRalf Baechle <ralf@linux-mips.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0f6c5c8e
...@@ -1587,8 +1587,7 @@ static int __init rose_proto_init(void) ...@@ -1587,8 +1587,7 @@ static int __init rose_proto_init(void)
char name[IFNAMSIZ]; char name[IFNAMSIZ];
sprintf(name, "rose%d", i); sprintf(name, "rose%d", i);
dev = alloc_netdev(sizeof(struct net_device_stats), dev = alloc_netdev(0, name, rose_setup);
name, rose_setup);
if (!dev) { if (!dev) {
printk(KERN_ERR "ROSE: rose_proto_init - unable to allocate memory\n"); printk(KERN_ERR "ROSE: rose_proto_init - unable to allocate memory\n");
rc = -ENOMEM; rc = -ENOMEM;
......
...@@ -57,7 +57,7 @@ static int rose_rebuild_header(struct sk_buff *skb) ...@@ -57,7 +57,7 @@ static int rose_rebuild_header(struct sk_buff *skb)
{ {
#ifdef CONFIG_INET #ifdef CONFIG_INET
struct net_device *dev = skb->dev; struct net_device *dev = skb->dev;
struct net_device_stats *stats = netdev_priv(dev); struct net_device_stats *stats = &dev->stats;
unsigned char *bp = (unsigned char *)skb->data; unsigned char *bp = (unsigned char *)skb->data;
struct sk_buff *skbn; struct sk_buff *skbn;
unsigned int len; unsigned int len;
...@@ -133,7 +133,7 @@ static int rose_close(struct net_device *dev) ...@@ -133,7 +133,7 @@ static int rose_close(struct net_device *dev)
static int rose_xmit(struct sk_buff *skb, struct net_device *dev) static int rose_xmit(struct sk_buff *skb, struct net_device *dev)
{ {
struct net_device_stats *stats = netdev_priv(dev); struct net_device_stats *stats = &dev->stats;
if (!netif_running(dev)) { if (!netif_running(dev)) {
printk(KERN_ERR "ROSE: rose_xmit - called when iface is down\n"); 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,11 +144,6 @@ static int rose_xmit(struct sk_buff *skb, struct net_device *dev)
return 0; return 0;
} }
static struct net_device_stats *rose_get_stats(struct net_device *dev)
{
return netdev_priv(dev);
}
static const struct header_ops rose_header_ops = { static const struct header_ops rose_header_ops = {
.create = rose_header, .create = rose_header,
.rebuild= rose_rebuild_header, .rebuild= rose_rebuild_header,
...@@ -169,5 +164,4 @@ void rose_setup(struct net_device *dev) ...@@ -169,5 +164,4 @@ void rose_setup(struct net_device *dev)
/* New-style flags. */ /* New-style flags. */
dev->flags = IFF_NOARP; dev->flags = IFF_NOARP;
dev->get_stats = rose_get_stats;
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment