[NETROM]: Introduct stuct nr_private

NET/ROM's virtual interfaces don't have a proper private data
structure yet. Create struct nr_private and put the statistics there.

Signed-off-by: Ralf Baechle DL5RB <ralf@linux-mips.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by Ralf Baechle and committed by David S. Miller b88a762b e21ce8c7

+12 -7
+5
include/net/netrom.h
··· 6 7 #ifndef _NETROM_H 8 #define _NETROM_H 9 #include <linux/netrom.h> 10 #include <linux/list.h> 11 #include <net/sock.h> ··· 58 #define NR_MODULUS 256 59 #define NR_MAX_WINDOW_SIZE 127 /* Maximum Window Allowable - 127 */ 60 #define NR_MAX_PACKET_SIZE 236 /* Maximum Packet Length - 236 */ 61 62 struct nr_sock { 63 struct sock sock;
··· 6 7 #ifndef _NETROM_H 8 #define _NETROM_H 9 + 10 #include <linux/netrom.h> 11 #include <linux/list.h> 12 #include <net/sock.h> ··· 57 #define NR_MODULUS 256 58 #define NR_MAX_WINDOW_SIZE 127 /* Maximum Window Allowable - 127 */ 59 #define NR_MAX_PACKET_SIZE 236 /* Maximum Packet Length - 236 */ 60 + 61 + struct nr_private { 62 + struct net_device_stats stats; 63 + }; 64 65 struct nr_sock { 66 struct sock sock;
+1 -2
net/netrom/af_netrom.c
··· 1392 struct net_device *dev; 1393 1394 sprintf(name, "nr%d", i); 1395 - dev = alloc_netdev(sizeof(struct net_device_stats), name, 1396 - nr_setup); 1397 if (!dev) { 1398 printk(KERN_ERR "NET/ROM: nr_proto_init - unable to allocate device structure\n"); 1399 goto fail;
··· 1392 struct net_device *dev; 1393 1394 sprintf(name, "nr%d", i); 1395 + dev = alloc_netdev(sizeof(struct nr_private), name, nr_setup); 1396 if (!dev) { 1397 printk(KERN_ERR "NET/ROM: nr_proto_init - unable to allocate device structure\n"); 1398 goto fail;
+6 -5
net/netrom/nr_dev.c
··· 160 161 static int nr_xmit(struct sk_buff *skb, struct net_device *dev) 162 { 163 - struct net_device_stats *stats = netdev_priv(dev); 164 - unsigned int len; 165 - 166 - len = skb->len; 167 168 if (!nr_route_frame(skb, NULL)) { 169 kfree_skb(skb); ··· 178 179 static struct net_device_stats *nr_get_stats(struct net_device *dev) 180 { 181 - return netdev_priv(dev); 182 } 183 184 void nr_setup(struct net_device *dev)
··· 160 161 static int nr_xmit(struct sk_buff *skb, struct net_device *dev) 162 { 163 + struct nr_private *nr = netdev_priv(dev); 164 + struct net_device_stats *stats = &nr->stats; 165 + unsigned int len = skb->len; 166 167 if (!nr_route_frame(skb, NULL)) { 168 kfree_skb(skb); ··· 179 180 static struct net_device_stats *nr_get_stats(struct net_device *dev) 181 { 182 + struct nr_private *nr = netdev_priv(dev); 183 + 184 + return &nr->stats; 185 } 186 187 void nr_setup(struct net_device *dev)