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