aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan
diff options
context:
space:
mode:
authorWang Chen <wangchen@cn.fujitsu.com>2008-11-13 02:38:36 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-13 02:38:36 -0500
commit8f15ea42b64941001a401cf855a0869e24f3a845 (patch)
tree27c7534ad70ebda6986491daeac0ebe0f1ca54ed /drivers/net/wan
parent4cf1653aa90c6320dc8032443b5e322820aa28b1 (diff)
netdevice: safe convert to netdev_priv() #part-3
We have some reasons to kill netdev->priv: 1. netdev->priv is equal to netdev_priv(). 2. netdev_priv() wraps the calculation of netdev->priv's offset, obviously netdev_priv() is more flexible than netdev->priv. But we cann't kill netdev->priv, because so many drivers reference to it directly. This patch is a safe convert for netdev->priv to netdev_priv(netdev). Since all of the netdev->priv is only for read. But it is too big to be sent in one mail. I split it to 4 parts and make every part smaller than 100,000 bytes, which is max size allowed by vger. Signed-off-by: Wang Chen <wangchen@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wan')
-rw-r--r--drivers/net/wan/dlci.c36
-rw-r--r--drivers/net/wan/sdla.c48
-rw-r--r--drivers/net/wan/x25_asy.c28
3 files changed, 56 insertions, 56 deletions
diff --git a/drivers/net/wan/dlci.c b/drivers/net/wan/dlci.c
index 5d13832978eb..a297e3efa05d 100644
--- a/drivers/net/wan/dlci.c
+++ b/drivers/net/wan/dlci.c
@@ -74,7 +74,7 @@ static int dlci_header(struct sk_buff *skb, struct net_device *dev,
74 unsigned int hlen; 74 unsigned int hlen;
75 char *dest; 75 char *dest;
76 76
77 dlp = dev->priv; 77 dlp = netdev_priv(dev);
78 78
79 hdr.control = FRAD_I_UI; 79 hdr.control = FRAD_I_UI;
80 switch(type) 80 switch(type)
@@ -110,7 +110,7 @@ static void dlci_receive(struct sk_buff *skb, struct net_device *dev)
110 struct frhdr *hdr; 110 struct frhdr *hdr;
111 int process, header; 111 int process, header;
112 112
113 dlp = dev->priv; 113 dlp = netdev_priv(dev);
114 if (!pskb_may_pull(skb, sizeof(*hdr))) { 114 if (!pskb_may_pull(skb, sizeof(*hdr))) {
115 printk(KERN_NOTICE "%s: invalid data no header\n", 115 printk(KERN_NOTICE "%s: invalid data no header\n",
116 dev->name); 116 dev->name);
@@ -196,7 +196,7 @@ static int dlci_transmit(struct sk_buff *skb, struct net_device *dev)
196 if (!skb || !dev) 196 if (!skb || !dev)
197 return(0); 197 return(0);
198 198
199 dlp = dev->priv; 199 dlp = netdev_priv(dev);
200 200
201 netif_stop_queue(dev); 201 netif_stop_queue(dev);
202 202
@@ -234,9 +234,9 @@ static int dlci_config(struct net_device *dev, struct dlci_conf __user *conf, in
234 struct frad_local *flp; 234 struct frad_local *flp;
235 int err; 235 int err;
236 236
237 dlp = dev->priv; 237 dlp = netdev_priv(dev);
238 238
239 flp = dlp->slave->priv; 239 flp = netdev_priv(dlp->slave);
240 240
241 if (!get) 241 if (!get)
242 { 242 {
@@ -268,7 +268,7 @@ static int dlci_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
268 if (!capable(CAP_NET_ADMIN)) 268 if (!capable(CAP_NET_ADMIN))
269 return(-EPERM); 269 return(-EPERM);
270 270
271 dlp = dev->priv; 271 dlp = netdev_priv(dev);
272 272
273 switch(cmd) 273 switch(cmd)
274 { 274 {
@@ -297,7 +297,7 @@ static int dlci_change_mtu(struct net_device *dev, int new_mtu)
297{ 297{
298 struct dlci_local *dlp; 298 struct dlci_local *dlp;
299 299
300 dlp = dev->priv; 300 dlp = netdev_priv(dev);
301 301
302 return((*dlp->slave->change_mtu)(dlp->slave, new_mtu)); 302 return((*dlp->slave->change_mtu)(dlp->slave, new_mtu));
303} 303}
@@ -308,7 +308,7 @@ static int dlci_open(struct net_device *dev)
308 struct frad_local *flp; 308 struct frad_local *flp;
309 int err; 309 int err;
310 310
311 dlp = dev->priv; 311 dlp = netdev_priv(dev);
312 312
313 if (!*(short *)(dev->dev_addr)) 313 if (!*(short *)(dev->dev_addr))
314 return(-EINVAL); 314 return(-EINVAL);
@@ -316,7 +316,7 @@ static int dlci_open(struct net_device *dev)
316 if (!netif_running(dlp->slave)) 316 if (!netif_running(dlp->slave))
317 return(-ENOTCONN); 317 return(-ENOTCONN);
318 318
319 flp = dlp->slave->priv; 319 flp = netdev_priv(dlp->slave);
320 err = (*flp->activate)(dlp->slave, dev); 320 err = (*flp->activate)(dlp->slave, dev);
321 if (err) 321 if (err)
322 return(err); 322 return(err);
@@ -334,9 +334,9 @@ static int dlci_close(struct net_device *dev)
334 334
335 netif_stop_queue(dev); 335 netif_stop_queue(dev);
336 336
337 dlp = dev->priv; 337 dlp = netdev_priv(dev);
338 338
339 flp = dlp->slave->priv; 339 flp = netdev_priv(dlp->slave);
340 err = (*flp->deactivate)(dlp->slave, dev); 340 err = (*flp->deactivate)(dlp->slave, dev);
341 341
342 return 0; 342 return 0;
@@ -346,7 +346,7 @@ static struct net_device_stats *dlci_get_stats(struct net_device *dev)
346{ 346{
347 struct dlci_local *dlp; 347 struct dlci_local *dlp;
348 348
349 dlp = dev->priv; 349 dlp = netdev_priv(dev);
350 350
351 return(&dlp->stats); 351 return(&dlp->stats);
352} 352}
@@ -364,7 +364,7 @@ static int dlci_add(struct dlci_add *dlci)
364 if (!slave) 364 if (!slave)
365 return -ENODEV; 365 return -ENODEV;
366 366
367 if (slave->type != ARPHRD_FRAD || slave->priv == NULL) 367 if (slave->type != ARPHRD_FRAD || netdev_priv(slave) == NULL)
368 goto err1; 368 goto err1;
369 369
370 /* create device name */ 370 /* create device name */
@@ -390,11 +390,11 @@ static int dlci_add(struct dlci_add *dlci)
390 390
391 *(short *)(master->dev_addr) = dlci->dlci; 391 *(short *)(master->dev_addr) = dlci->dlci;
392 392
393 dlp = (struct dlci_local *) master->priv; 393 dlp = netdev_priv(master);
394 dlp->slave = slave; 394 dlp->slave = slave;
395 dlp->master = master; 395 dlp->master = master;
396 396
397 flp = slave->priv; 397 flp = netdev_priv(slave);
398 err = (*flp->assoc)(slave, master); 398 err = (*flp->assoc)(slave, master);
399 if (err < 0) 399 if (err < 0)
400 goto err2; 400 goto err2;
@@ -434,9 +434,9 @@ static int dlci_del(struct dlci_add *dlci)
434 return(-EBUSY); 434 return(-EBUSY);
435 } 435 }
436 436
437 dlp = master->priv; 437 dlp = netdev_priv(master);
438 slave = dlp->slave; 438 slave = dlp->slave;
439 flp = slave->priv; 439 flp = netdev_priv(slave);
440 440
441 rtnl_lock(); 441 rtnl_lock();
442 err = (*flp->deassoc)(slave, master); 442 err = (*flp->deassoc)(slave, master);
@@ -490,7 +490,7 @@ static const struct header_ops dlci_header_ops = {
490 490
491static void dlci_setup(struct net_device *dev) 491static void dlci_setup(struct net_device *dev)
492{ 492{
493 struct dlci_local *dlp = dev->priv; 493 struct dlci_local *dlp = netdev_priv(dev);
494 494
495 dev->flags = 0; 495 dev->flags = 0;
496 dev->open = dlci_open; 496 dev->open = dlci_open;
diff --git a/drivers/net/wan/sdla.c b/drivers/net/wan/sdla.c
index 73e2f2780932..6a07ba9371db 100644
--- a/drivers/net/wan/sdla.c
+++ b/drivers/net/wan/sdla.c
@@ -185,7 +185,7 @@ static void sdla_stop(struct net_device *dev)
185{ 185{
186 struct frad_local *flp; 186 struct frad_local *flp;
187 187
188 flp = dev->priv; 188 flp = netdev_priv(dev);
189 switch(flp->type) 189 switch(flp->type)
190 { 190 {
191 case SDLA_S502A: 191 case SDLA_S502A:
@@ -212,7 +212,7 @@ static void sdla_start(struct net_device *dev)
212{ 212{
213 struct frad_local *flp; 213 struct frad_local *flp;
214 214
215 flp = dev->priv; 215 flp = netdev_priv(dev);
216 switch(flp->type) 216 switch(flp->type)
217 { 217 {
218 case SDLA_S502A: 218 case SDLA_S502A:
@@ -432,7 +432,7 @@ static int sdla_cmd(struct net_device *dev, int cmd, short dlci, short flags,
432 int ret, waiting, len; 432 int ret, waiting, len;
433 long window; 433 long window;
434 434
435 flp = dev->priv; 435 flp = netdev_priv(dev);
436 window = flp->type == SDLA_S508 ? SDLA_508_CMD_BUF : SDLA_502_CMD_BUF; 436 window = flp->type == SDLA_S508 ? SDLA_508_CMD_BUF : SDLA_502_CMD_BUF;
437 cmd_buf = (struct sdla_cmd *)(dev->mem_start + (window & SDLA_ADDR_MASK)); 437 cmd_buf = (struct sdla_cmd *)(dev->mem_start + (window & SDLA_ADDR_MASK));
438 ret = 0; 438 ret = 0;
@@ -509,7 +509,7 @@ static int sdla_activate(struct net_device *slave, struct net_device *master)
509 struct frad_local *flp; 509 struct frad_local *flp;
510 int i; 510 int i;
511 511
512 flp = slave->priv; 512 flp = netdev_priv(slave);
513 513
514 for(i=0;i<CONFIG_DLCI_MAX;i++) 514 for(i=0;i<CONFIG_DLCI_MAX;i++)
515 if (flp->master[i] == master) 515 if (flp->master[i] == master)
@@ -531,7 +531,7 @@ static int sdla_deactivate(struct net_device *slave, struct net_device *master)
531 struct frad_local *flp; 531 struct frad_local *flp;
532 int i; 532 int i;
533 533
534 flp = slave->priv; 534 flp = netdev_priv(slave);
535 535
536 for(i=0;i<CONFIG_DLCI_MAX;i++) 536 for(i=0;i<CONFIG_DLCI_MAX;i++)
537 if (flp->master[i] == master) 537 if (flp->master[i] == master)
@@ -556,7 +556,7 @@ static int sdla_assoc(struct net_device *slave, struct net_device *master)
556 if (master->type != ARPHRD_DLCI) 556 if (master->type != ARPHRD_DLCI)
557 return(-EINVAL); 557 return(-EINVAL);
558 558
559 flp = slave->priv; 559 flp = netdev_priv(slave);
560 560
561 for(i=0;i<CONFIG_DLCI_MAX;i++) 561 for(i=0;i<CONFIG_DLCI_MAX;i++)
562 { 562 {
@@ -589,7 +589,7 @@ static int sdla_deassoc(struct net_device *slave, struct net_device *master)
589 struct frad_local *flp; 589 struct frad_local *flp;
590 int i; 590 int i;
591 591
592 flp = slave->priv; 592 flp = netdev_priv(slave);
593 593
594 for(i=0;i<CONFIG_DLCI_MAX;i++) 594 for(i=0;i<CONFIG_DLCI_MAX;i++)
595 if (flp->master[i] == master) 595 if (flp->master[i] == master)
@@ -619,7 +619,7 @@ static int sdla_dlci_conf(struct net_device *slave, struct net_device *master, i
619 int i; 619 int i;
620 short len, ret; 620 short len, ret;
621 621
622 flp = slave->priv; 622 flp = netdev_priv(slave);
623 623
624 for(i=0;i<CONFIG_DLCI_MAX;i++) 624 for(i=0;i<CONFIG_DLCI_MAX;i++)
625 if (flp->master[i] == master) 625 if (flp->master[i] == master)
@@ -628,7 +628,7 @@ static int sdla_dlci_conf(struct net_device *slave, struct net_device *master, i
628 if (i == CONFIG_DLCI_MAX) 628 if (i == CONFIG_DLCI_MAX)
629 return(-ENODEV); 629 return(-ENODEV);
630 630
631 dlp = master->priv; 631 dlp = netdev_priv(master);
632 632
633 ret = SDLA_RET_OK; 633 ret = SDLA_RET_OK;
634 len = sizeof(struct dlci_conf); 634 len = sizeof(struct dlci_conf);
@@ -659,7 +659,7 @@ static int sdla_transmit(struct sk_buff *skb, struct net_device *dev)
659 unsigned long flags; 659 unsigned long flags;
660 struct buf_entry *pbuf; 660 struct buf_entry *pbuf;
661 661
662 flp = dev->priv; 662 flp = netdev_priv(dev);
663 ret = 0; 663 ret = 0;
664 accept = 1; 664 accept = 1;
665 665
@@ -755,7 +755,7 @@ static void sdla_receive(struct net_device *dev)
755 int i=0, received, success, addr, buf_base, buf_top; 755 int i=0, received, success, addr, buf_base, buf_top;
756 short dlci, len, len2, split; 756 short dlci, len, len2, split;
757 757
758 flp = dev->priv; 758 flp = netdev_priv(dev);
759 success = 1; 759 success = 1;
760 received = addr = buf_top = buf_base = 0; 760 received = addr = buf_top = buf_base = 0;
761 len = dlci = 0; 761 len = dlci = 0;
@@ -860,7 +860,7 @@ static void sdla_receive(struct net_device *dev)
860 if (success) 860 if (success)
861 { 861 {
862 flp->stats.rx_packets++; 862 flp->stats.rx_packets++;
863 dlp = master->priv; 863 dlp = netdev_priv(master);
864 (*dlp->receive)(skb, master); 864 (*dlp->receive)(skb, master);
865 } 865 }
866 866
@@ -925,7 +925,7 @@ static void sdla_poll(unsigned long device)
925 struct frad_local *flp; 925 struct frad_local *flp;
926 926
927 dev = (struct net_device *) device; 927 dev = (struct net_device *) device;
928 flp = dev->priv; 928 flp = netdev_priv(dev);
929 929
930 if (sdla_byte(dev, SDLA_502_RCV_BUF)) 930 if (sdla_byte(dev, SDLA_502_RCV_BUF))
931 sdla_receive(dev); 931 sdla_receive(dev);
@@ -941,7 +941,7 @@ static int sdla_close(struct net_device *dev)
941 int len, i; 941 int len, i;
942 short dlcis[CONFIG_DLCI_MAX]; 942 short dlcis[CONFIG_DLCI_MAX];
943 943
944 flp = dev->priv; 944 flp = netdev_priv(dev);
945 945
946 len = 0; 946 len = 0;
947 for(i=0;i<CONFIG_DLCI_MAX;i++) 947 for(i=0;i<CONFIG_DLCI_MAX;i++)
@@ -1002,7 +1002,7 @@ static int sdla_open(struct net_device *dev)
1002 int len, i; 1002 int len, i;
1003 char byte; 1003 char byte;
1004 1004
1005 flp = dev->priv; 1005 flp = netdev_priv(dev);
1006 1006
1007 if (!flp->initialized) 1007 if (!flp->initialized)
1008 return(-EPERM); 1008 return(-EPERM);
@@ -1079,7 +1079,7 @@ static int sdla_open(struct net_device *dev)
1079 for(i=0;i<CONFIG_DLCI_MAX;i++) 1079 for(i=0;i<CONFIG_DLCI_MAX;i++)
1080 if (flp->dlci[i]) 1080 if (flp->dlci[i])
1081 { 1081 {
1082 dlp = flp->master[i]->priv; 1082 dlp = netdev_priv(flp->master[i]);
1083 if (dlp->configured) 1083 if (dlp->configured)
1084 sdla_cmd(dev, SDLA_SET_DLCI_CONFIGURATION, abs(flp->dlci[i]), 0, &dlp->config, sizeof(struct dlci_conf), NULL, NULL); 1084 sdla_cmd(dev, SDLA_SET_DLCI_CONFIGURATION, abs(flp->dlci[i]), 0, &dlp->config, sizeof(struct dlci_conf), NULL, NULL);
1085 } 1085 }
@@ -1099,7 +1099,7 @@ static int sdla_config(struct net_device *dev, struct frad_conf __user *conf, in
1099 if (dev->type == 0xFFFF) 1099 if (dev->type == 0xFFFF)
1100 return(-EUNATCH); 1100 return(-EUNATCH);
1101 1101
1102 flp = dev->priv; 1102 flp = netdev_priv(dev);
1103 1103
1104 if (!get) 1104 if (!get)
1105 { 1105 {
@@ -1230,7 +1230,7 @@ static int sdla_reconfig(struct net_device *dev)
1230 struct conf_data data; 1230 struct conf_data data;
1231 int i, len; 1231 int i, len;
1232 1232
1233 flp = dev->priv; 1233 flp = netdev_priv(dev);
1234 1234
1235 len = 0; 1235 len = 0;
1236 for(i=0;i<CONFIG_DLCI_MAX;i++) 1236 for(i=0;i<CONFIG_DLCI_MAX;i++)
@@ -1255,7 +1255,7 @@ static int sdla_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
1255 if(!capable(CAP_NET_ADMIN)) 1255 if(!capable(CAP_NET_ADMIN))
1256 return -EPERM; 1256 return -EPERM;
1257 1257
1258 flp = dev->priv; 1258 flp = netdev_priv(dev);
1259 1259
1260 if (!flp->initialized) 1260 if (!flp->initialized)
1261 return(-EINVAL); 1261 return(-EINVAL);
@@ -1321,7 +1321,7 @@ static int sdla_change_mtu(struct net_device *dev, int new_mtu)
1321{ 1321{
1322 struct frad_local *flp; 1322 struct frad_local *flp;
1323 1323
1324 flp = dev->priv; 1324 flp = netdev_priv(dev);
1325 1325
1326 if (netif_running(dev)) 1326 if (netif_running(dev))
1327 return(-EBUSY); 1327 return(-EBUSY);
@@ -1338,7 +1338,7 @@ static int sdla_set_config(struct net_device *dev, struct ifmap *map)
1338 unsigned base; 1338 unsigned base;
1339 int err = -EINVAL; 1339 int err = -EINVAL;
1340 1340
1341 flp = dev->priv; 1341 flp = netdev_priv(dev);
1342 1342
1343 if (flp->initialized) 1343 if (flp->initialized)
1344 return(-EINVAL); 1344 return(-EINVAL);
@@ -1593,14 +1593,14 @@ fail:
1593static struct net_device_stats *sdla_stats(struct net_device *dev) 1593static struct net_device_stats *sdla_stats(struct net_device *dev)
1594{ 1594{
1595 struct frad_local *flp; 1595 struct frad_local *flp;
1596 flp = dev->priv; 1596 flp = netdev_priv(dev);
1597 1597
1598 return(&flp->stats); 1598 return(&flp->stats);
1599} 1599}
1600 1600
1601static void setup_sdla(struct net_device *dev) 1601static void setup_sdla(struct net_device *dev)
1602{ 1602{
1603 struct frad_local *flp = dev->priv; 1603 struct frad_local *flp = netdev_priv(dev);
1604 1604
1605 netdev_boot_setup_check(dev); 1605 netdev_boot_setup_check(dev);
1606 1606
@@ -1651,7 +1651,7 @@ static int __init init_sdla(void)
1651 1651
1652static void __exit exit_sdla(void) 1652static void __exit exit_sdla(void)
1653{ 1653{
1654 struct frad_local *flp = sdla->priv; 1654 struct frad_local *flp = netdev_priv(sdla);
1655 1655
1656 unregister_netdev(sdla); 1656 unregister_netdev(sdla);
1657 if (flp->initialized) { 1657 if (flp->initialized) {
diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c
index 3b7bdfd25148..85d789147300 100644
--- a/drivers/net/wan/x25_asy.c
+++ b/drivers/net/wan/x25_asy.c
@@ -64,7 +64,7 @@ static struct x25_asy *x25_asy_alloc(void)
64 if (dev == NULL) 64 if (dev == NULL)
65 break; 65 break;
66 66
67 sl = dev->priv; 67 sl = netdev_priv(dev);
68 /* Not in use ? */ 68 /* Not in use ? */
69 if (!test_and_set_bit(SLF_INUSE, &sl->flags)) 69 if (!test_and_set_bit(SLF_INUSE, &sl->flags))
70 return sl; 70 return sl;
@@ -86,7 +86,7 @@ static struct x25_asy *x25_asy_alloc(void)
86 return NULL; 86 return NULL;
87 87
88 /* Initialize channel control data */ 88 /* Initialize channel control data */
89 sl = dev->priv; 89 sl = netdev_priv(dev);
90 dev->base_addr = i; 90 dev->base_addr = i;
91 91
92 /* register device so that it can be ifconfig'ed */ 92 /* register device so that it can be ifconfig'ed */
@@ -120,7 +120,7 @@ static void x25_asy_free(struct x25_asy *sl)
120 120
121static int x25_asy_change_mtu(struct net_device *dev, int newmtu) 121static int x25_asy_change_mtu(struct net_device *dev, int newmtu)
122{ 122{
123 struct x25_asy *sl = dev->priv; 123 struct x25_asy *sl = netdev_priv(dev);
124 unsigned char *xbuff, *rbuff; 124 unsigned char *xbuff, *rbuff;
125 int len = 2 * newmtu; 125 int len = 2 * newmtu;
126 126
@@ -279,7 +279,7 @@ static void x25_asy_write_wakeup(struct tty_struct *tty)
279 279
280static void x25_asy_timeout(struct net_device *dev) 280static void x25_asy_timeout(struct net_device *dev)
281{ 281{
282 struct x25_asy *sl = dev->priv; 282 struct x25_asy *sl = netdev_priv(dev);
283 283
284 spin_lock(&sl->lock); 284 spin_lock(&sl->lock);
285 if (netif_queue_stopped(dev)) { 285 if (netif_queue_stopped(dev)) {
@@ -300,7 +300,7 @@ static void x25_asy_timeout(struct net_device *dev)
300 300
301static int x25_asy_xmit(struct sk_buff *skb, struct net_device *dev) 301static int x25_asy_xmit(struct sk_buff *skb, struct net_device *dev)
302{ 302{
303 struct x25_asy *sl = dev->priv; 303 struct x25_asy *sl = netdev_priv(dev);
304 int err; 304 int err;
305 305
306 if (!netif_running(sl->dev)) { 306 if (!netif_running(sl->dev)) {
@@ -371,7 +371,7 @@ static int x25_asy_data_indication(struct net_device *dev, struct sk_buff *skb)
371 371
372static void x25_asy_data_transmit(struct net_device *dev, struct sk_buff *skb) 372static void x25_asy_data_transmit(struct net_device *dev, struct sk_buff *skb)
373{ 373{
374 struct x25_asy *sl = dev->priv; 374 struct x25_asy *sl = netdev_priv(dev);
375 375
376 spin_lock(&sl->lock); 376 spin_lock(&sl->lock);
377 if (netif_queue_stopped(sl->dev) || sl->tty == NULL) { 377 if (netif_queue_stopped(sl->dev) || sl->tty == NULL) {
@@ -396,7 +396,7 @@ static void x25_asy_data_transmit(struct net_device *dev, struct sk_buff *skb)
396 396
397static void x25_asy_connected(struct net_device *dev, int reason) 397static void x25_asy_connected(struct net_device *dev, int reason)
398{ 398{
399 struct x25_asy *sl = dev->priv; 399 struct x25_asy *sl = netdev_priv(dev);
400 struct sk_buff *skb; 400 struct sk_buff *skb;
401 unsigned char *ptr; 401 unsigned char *ptr;
402 402
@@ -415,7 +415,7 @@ static void x25_asy_connected(struct net_device *dev, int reason)
415 415
416static void x25_asy_disconnected(struct net_device *dev, int reason) 416static void x25_asy_disconnected(struct net_device *dev, int reason)
417{ 417{
418 struct x25_asy *sl = dev->priv; 418 struct x25_asy *sl = netdev_priv(dev);
419 struct sk_buff *skb; 419 struct sk_buff *skb;
420 unsigned char *ptr; 420 unsigned char *ptr;
421 421
@@ -446,7 +446,7 @@ static struct lapb_register_struct x25_asy_callbacks = {
446/* Open the low-level part of the X.25 channel. Easy! */ 446/* Open the low-level part of the X.25 channel. Easy! */
447static int x25_asy_open(struct net_device *dev) 447static int x25_asy_open(struct net_device *dev)
448{ 448{
449 struct x25_asy *sl = dev->priv; 449 struct x25_asy *sl = netdev_priv(dev);
450 unsigned long len; 450 unsigned long len;
451 int err; 451 int err;
452 452
@@ -495,7 +495,7 @@ norbuff:
495/* Close the low-level part of the X.25 channel. Easy! */ 495/* Close the low-level part of the X.25 channel. Easy! */
496static int x25_asy_close(struct net_device *dev) 496static int x25_asy_close(struct net_device *dev)
497{ 497{
498 struct x25_asy *sl = dev->priv; 498 struct x25_asy *sl = netdev_priv(dev);
499 int err; 499 int err;
500 500
501 spin_lock(&sl->lock); 501 spin_lock(&sl->lock);
@@ -611,7 +611,7 @@ static void x25_asy_close_tty(struct tty_struct *tty)
611 611
612static struct net_device_stats *x25_asy_get_stats(struct net_device *dev) 612static struct net_device_stats *x25_asy_get_stats(struct net_device *dev)
613{ 613{
614 struct x25_asy *sl = dev->priv; 614 struct x25_asy *sl = netdev_priv(dev);
615 return &sl->stats; 615 return &sl->stats;
616} 616}
617 617
@@ -713,7 +713,7 @@ static int x25_asy_ioctl(struct tty_struct *tty, struct file *file,
713 713
714static int x25_asy_open_dev(struct net_device *dev) 714static int x25_asy_open_dev(struct net_device *dev)
715{ 715{
716 struct x25_asy *sl = dev->priv; 716 struct x25_asy *sl = netdev_priv(dev);
717 if (sl->tty == NULL) 717 if (sl->tty == NULL)
718 return -ENODEV; 718 return -ENODEV;
719 return 0; 719 return 0;
@@ -722,7 +722,7 @@ static int x25_asy_open_dev(struct net_device *dev)
722/* Initialise the X.25 driver. Called by the device init code */ 722/* Initialise the X.25 driver. Called by the device init code */
723static void x25_asy_setup(struct net_device *dev) 723static void x25_asy_setup(struct net_device *dev)
724{ 724{
725 struct x25_asy *sl = dev->priv; 725 struct x25_asy *sl = netdev_priv(dev);
726 726
727 sl->magic = X25_ASY_MAGIC; 727 sl->magic = X25_ASY_MAGIC;
728 sl->dev = dev; 728 sl->dev = dev;
@@ -789,7 +789,7 @@ static void __exit exit_x25_asy(void)
789 for (i = 0; i < x25_asy_maxdev; i++) { 789 for (i = 0; i < x25_asy_maxdev; i++) {
790 dev = x25_asy_devs[i]; 790 dev = x25_asy_devs[i];
791 if (dev) { 791 if (dev) {
792 struct x25_asy *sl = dev->priv; 792 struct x25_asy *sl = netdev_priv(dev);
793 793
794 spin_lock_bh(&sl->lock); 794 spin_lock_bh(&sl->lock);
795 if (sl->tty) 795 if (sl->tty)