diff --git a/include/net/netrom.h b/include/net/netrom.h index ad05d7a3c55d85b2547a02df78567b53d719a996..a6bf6e0f606aed23ac8a8b4a2583bc5d7d6a8d19 100644 --- a/include/net/netrom.h +++ b/include/net/netrom.h @@ -6,6 +6,7 @@ #ifndef _NETROM_H #define _NETROM_H + #include #include #include @@ -58,6 +59,10 @@ enum { #define NR_MAX_WINDOW_SIZE 127 /* Maximum Window Allowable - 127 */ #define NR_MAX_PACKET_SIZE 236 /* Maximum Packet Length - 236 */ +struct nr_private { + struct net_device_stats stats; +}; + struct nr_sock { struct sock sock; ax25_address user_addr, source_addr, dest_addr; diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c index 8c3d3a78481eb8bf4401d21600a6c245da3820ab..e5d82d711cae2ea36e1e36e652fdeebd0b5db591 100644 --- a/net/netrom/af_netrom.c +++ b/net/netrom/af_netrom.c @@ -1392,8 +1392,7 @@ static int __init nr_proto_init(void) struct net_device *dev; sprintf(name, "nr%d", i); - dev = alloc_netdev(sizeof(struct net_device_stats), name, - nr_setup); + dev = alloc_netdev(sizeof(struct nr_private), name, nr_setup); if (!dev) { printk(KERN_ERR "NET/ROM: nr_proto_init - unable to allocate device structure\n"); goto fail; diff --git a/net/netrom/nr_dev.c b/net/netrom/nr_dev.c index 909aa7f5074412368686b59a39315edc1a5292af..4e66eef9a03479f0ead803fabdfb3d1f73e0b18f 100644 --- a/net/netrom/nr_dev.c +++ b/net/netrom/nr_dev.c @@ -160,10 +160,9 @@ static int nr_close(struct net_device *dev) static int nr_xmit(struct sk_buff *skb, struct net_device *dev) { - struct net_device_stats *stats = netdev_priv(dev); - unsigned int len; - - len = skb->len; + struct nr_private *nr = netdev_priv(dev); + struct net_device_stats *stats = &nr->stats; + unsigned int len = skb->len; if (!nr_route_frame(skb, NULL)) { kfree_skb(skb); @@ -179,7 +178,9 @@ static int nr_xmit(struct sk_buff *skb, struct net_device *dev) static struct net_device_stats *nr_get_stats(struct net_device *dev) { - return netdev_priv(dev); + struct nr_private *nr = netdev_priv(dev); + + return &nr->stats; } void nr_setup(struct net_device *dev)