aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/netrom.h5
-rw-r--r--net/netrom/af_netrom.c3
-rw-r--r--net/netrom/nr_dev.c11
3 files changed, 12 insertions, 7 deletions
diff --git a/include/net/netrom.h b/include/net/netrom.h
index ad05d7a3c55d..a6bf6e0f606a 100644
--- a/include/net/netrom.h
+++ b/include/net/netrom.h
@@ -6,6 +6,7 @@
6 6
7#ifndef _NETROM_H 7#ifndef _NETROM_H
8#define _NETROM_H 8#define _NETROM_H
9
9#include <linux/netrom.h> 10#include <linux/netrom.h>
10#include <linux/list.h> 11#include <linux/list.h>
11#include <net/sock.h> 12#include <net/sock.h>
@@ -58,6 +59,10 @@ enum {
58#define NR_MAX_WINDOW_SIZE 127 /* Maximum Window Allowable - 127 */ 59#define NR_MAX_WINDOW_SIZE 127 /* Maximum Window Allowable - 127 */
59#define NR_MAX_PACKET_SIZE 236 /* Maximum Packet Length - 236 */ 60#define NR_MAX_PACKET_SIZE 236 /* Maximum Packet Length - 236 */
60 61
62struct nr_private {
63 struct net_device_stats stats;
64};
65
61struct nr_sock { 66struct nr_sock {
62 struct sock sock; 67 struct sock sock;
63 ax25_address user_addr, source_addr, dest_addr; 68 ax25_address user_addr, source_addr, dest_addr;
diff --git a/net/netrom/af_netrom.c b/net/netrom/af_netrom.c
index 8c3d3a78481e..e5d82d711cae 100644
--- a/net/netrom/af_netrom.c
+++ b/net/netrom/af_netrom.c
@@ -1392,8 +1392,7 @@ static int __init nr_proto_init(void)
1392 struct net_device *dev; 1392 struct net_device *dev;
1393 1393
1394 sprintf(name, "nr%d", i); 1394 sprintf(name, "nr%d", i);
1395 dev = alloc_netdev(sizeof(struct net_device_stats), name, 1395 dev = alloc_netdev(sizeof(struct nr_private), name, nr_setup);
1396 nr_setup);
1397 if (!dev) { 1396 if (!dev) {
1398 printk(KERN_ERR "NET/ROM: nr_proto_init - unable to allocate device structure\n"); 1397 printk(KERN_ERR "NET/ROM: nr_proto_init - unable to allocate device structure\n");
1399 goto fail; 1398 goto fail;
diff --git a/net/netrom/nr_dev.c b/net/netrom/nr_dev.c
index 909aa7f50744..4e66eef9a034 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)
160 160
161static int nr_xmit(struct sk_buff *skb, struct net_device *dev) 161static int nr_xmit(struct sk_buff *skb, struct net_device *dev)
162{ 162{
163 struct net_device_stats *stats = netdev_priv(dev); 163 struct nr_private *nr = netdev_priv(dev);
164 unsigned int len; 164 struct net_device_stats *stats = &nr->stats;
165 165 unsigned int len = skb->len;
166 len = skb->len;
167 166
168 if (!nr_route_frame(skb, NULL)) { 167 if (!nr_route_frame(skb, NULL)) {
169 kfree_skb(skb); 168 kfree_skb(skb);
@@ -179,7 +178,9 @@ static int nr_xmit(struct sk_buff *skb, struct net_device *dev)
179 178
180static struct net_device_stats *nr_get_stats(struct net_device *dev) 179static struct net_device_stats *nr_get_stats(struct net_device *dev)
181{ 180{
182 return netdev_priv(dev); 181 struct nr_private *nr = netdev_priv(dev);
182
183 return &nr->stats;
183} 184}
184 185
185void nr_setup(struct net_device *dev) 186void nr_setup(struct net_device *dev)