diff options
author | Karsten Keil <kkeil@suse.de> | 2007-10-08 23:37:11 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:54:57 -0400 |
commit | d62a38d1ab350f787e4941e42a3d3e97971e38f5 (patch) | |
tree | b1bfb1e5123e10943653f5ad5063449311ca7836 | |
parent | 3607c44676583e80122c1fed23f34d003cdd6979 (diff) |
[ISDN]: Change I4L to use alloc_netdev().
Signed-off-by: Karsten Keil <kkeil@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/isdn/i4l/isdn_net.c | 169 | ||||
-rw-r--r-- | drivers/isdn/i4l/isdn_ppp.c | 6 | ||||
-rw-r--r-- | include/linux/isdn.h | 2 |
3 files changed, 92 insertions, 85 deletions
diff --git a/drivers/isdn/i4l/isdn_net.c b/drivers/isdn/i4l/isdn_net.c index 54546604656d..7c9cb7e19f2e 100644 --- a/drivers/isdn/i4l/isdn_net.c +++ b/drivers/isdn/i4l/isdn_net.c | |||
@@ -77,7 +77,7 @@ static __inline__ int isdn_net_device_started(isdn_net_dev *n) | |||
77 | if (lp->master) | 77 | if (lp->master) |
78 | dev = lp->master; | 78 | dev = lp->master; |
79 | else | 79 | else |
80 | dev = &n->dev; | 80 | dev = n->dev; |
81 | return netif_running(dev); | 81 | return netif_running(dev); |
82 | } | 82 | } |
83 | 83 | ||
@@ -90,7 +90,7 @@ static __inline__ void isdn_net_device_wake_queue(isdn_net_local *lp) | |||
90 | if (lp->master) | 90 | if (lp->master) |
91 | netif_wake_queue(lp->master); | 91 | netif_wake_queue(lp->master); |
92 | else | 92 | else |
93 | netif_wake_queue(&lp->netdev->dev); | 93 | netif_wake_queue(lp->netdev->dev); |
94 | } | 94 | } |
95 | 95 | ||
96 | /* | 96 | /* |
@@ -102,7 +102,7 @@ static __inline__ void isdn_net_device_stop_queue(isdn_net_local *lp) | |||
102 | if (lp->master) | 102 | if (lp->master) |
103 | netif_stop_queue(lp->master); | 103 | netif_stop_queue(lp->master); |
104 | else | 104 | else |
105 | netif_stop_queue(&lp->netdev->dev); | 105 | netif_stop_queue(lp->netdev->dev); |
106 | } | 106 | } |
107 | 107 | ||
108 | /* | 108 | /* |
@@ -287,7 +287,7 @@ isdn_net_unbind_channel(isdn_net_local * lp) | |||
287 | BEWARE! This chunk of code cannot be called from hardware | 287 | BEWARE! This chunk of code cannot be called from hardware |
288 | interrupt handler. I hope it is true. --ANK | 288 | interrupt handler. I hope it is true. --ANK |
289 | */ | 289 | */ |
290 | qdisc_reset(lp->netdev->dev.qdisc); | 290 | qdisc_reset(lp->netdev->dev->qdisc); |
291 | } | 291 | } |
292 | lp->dialstate = 0; | 292 | lp->dialstate = 0; |
293 | dev->rx_netdev[isdn_dc2minor(lp->isdn_device, lp->isdn_channel)] = NULL; | 293 | dev->rx_netdev[isdn_dc2minor(lp->isdn_device, lp->isdn_channel)] = NULL; |
@@ -345,27 +345,27 @@ isdn_net_autohup(void) | |||
345 | l->chargetime += l->chargeint; | 345 | l->chargetime += l->chargeint; |
346 | if (time_after(jiffies, l->chargetime + l->chargeint - 2 * HZ)) | 346 | if (time_after(jiffies, l->chargetime + l->chargeint - 2 * HZ)) |
347 | if (l->outgoing || l->hupflags & ISDN_INHUP) | 347 | if (l->outgoing || l->hupflags & ISDN_INHUP) |
348 | isdn_net_hangup(&p->dev); | 348 | isdn_net_hangup(p->dev); |
349 | } else if (l->outgoing) { | 349 | } else if (l->outgoing) { |
350 | if (l->hupflags & ISDN_CHARGEHUP) { | 350 | if (l->hupflags & ISDN_CHARGEHUP) { |
351 | if (l->hupflags & ISDN_WAITCHARGE) { | 351 | if (l->hupflags & ISDN_WAITCHARGE) { |
352 | printk(KERN_DEBUG "isdn_net: Hupflags of %s are %X\n", | 352 | printk(KERN_DEBUG "isdn_net: Hupflags of %s are %X\n", |
353 | l->name, l->hupflags); | 353 | l->name, l->hupflags); |
354 | isdn_net_hangup(&p->dev); | 354 | isdn_net_hangup(p->dev); |
355 | } else if (time_after(jiffies, l->chargetime + l->chargeint)) { | 355 | } else if (time_after(jiffies, l->chargetime + l->chargeint)) { |
356 | printk(KERN_DEBUG | 356 | printk(KERN_DEBUG |
357 | "isdn_net: %s: chtime = %lu, chint = %d\n", | 357 | "isdn_net: %s: chtime = %lu, chint = %d\n", |
358 | l->name, l->chargetime, l->chargeint); | 358 | l->name, l->chargetime, l->chargeint); |
359 | isdn_net_hangup(&p->dev); | 359 | isdn_net_hangup(p->dev); |
360 | } | 360 | } |
361 | } else | 361 | } else |
362 | isdn_net_hangup(&p->dev); | 362 | isdn_net_hangup(p->dev); |
363 | } else if (l->hupflags & ISDN_INHUP) | 363 | } else if (l->hupflags & ISDN_INHUP) |
364 | isdn_net_hangup(&p->dev); | 364 | isdn_net_hangup(p->dev); |
365 | } | 365 | } |
366 | 366 | ||
367 | if(dev->global_flags & ISDN_GLOBAL_STOPPED || (ISDN_NET_DIALMODE(*l) == ISDN_NET_DM_OFF)) { | 367 | if(dev->global_flags & ISDN_GLOBAL_STOPPED || (ISDN_NET_DIALMODE(*l) == ISDN_NET_DM_OFF)) { |
368 | isdn_net_hangup(&p->dev); | 368 | isdn_net_hangup(p->dev); |
369 | break; | 369 | break; |
370 | } | 370 | } |
371 | } | 371 | } |
@@ -579,7 +579,7 @@ isdn_net_dial(void) | |||
579 | if (!lp->dial) { | 579 | if (!lp->dial) { |
580 | printk(KERN_WARNING "%s: phone number deleted?\n", | 580 | printk(KERN_WARNING "%s: phone number deleted?\n", |
581 | lp->name); | 581 | lp->name); |
582 | isdn_net_hangup(&p->dev); | 582 | isdn_net_hangup(p->dev); |
583 | break; | 583 | break; |
584 | } | 584 | } |
585 | anymore = 1; | 585 | anymore = 1; |
@@ -616,8 +616,8 @@ isdn_net_dial(void) | |||
616 | s = "dial suppressed: isdn system stopped"; | 616 | s = "dial suppressed: isdn system stopped"; |
617 | else | 617 | else |
618 | s = "dial suppressed: dialmode `off'"; | 618 | s = "dial suppressed: dialmode `off'"; |
619 | isdn_net_unreachable(&p->dev, NULL, s); | 619 | isdn_net_unreachable(p->dev, NULL, s); |
620 | isdn_net_hangup(&p->dev); | 620 | isdn_net_hangup(p->dev); |
621 | break; | 621 | break; |
622 | } | 622 | } |
623 | cmd.driver = lp->isdn_device; | 623 | cmd.driver = lp->isdn_device; |
@@ -633,7 +633,7 @@ isdn_net_dial(void) | |||
633 | if (!lp->dial) { | 633 | if (!lp->dial) { |
634 | printk(KERN_WARNING "%s: phone number deleted?\n", | 634 | printk(KERN_WARNING "%s: phone number deleted?\n", |
635 | lp->name); | 635 | lp->name); |
636 | isdn_net_hangup(&p->dev); | 636 | isdn_net_hangup(p->dev); |
637 | break; | 637 | break; |
638 | } | 638 | } |
639 | if (!strncmp(lp->dial->num, "LEASED", strlen("LEASED"))) { | 639 | if (!strncmp(lp->dial->num, "LEASED", strlen("LEASED"))) { |
@@ -644,8 +644,8 @@ isdn_net_dial(void) | |||
644 | if (time_after(jiffies, lp->dialstarted + lp->dialtimeout)) { | 644 | if (time_after(jiffies, lp->dialstarted + lp->dialtimeout)) { |
645 | lp->dialwait_timer = jiffies + lp->dialwait; | 645 | lp->dialwait_timer = jiffies + lp->dialwait; |
646 | lp->dialstarted = 0; | 646 | lp->dialstarted = 0; |
647 | isdn_net_unreachable(&p->dev, NULL, "dial: timed out"); | 647 | isdn_net_unreachable(p->dev, NULL, "dial: timed out"); |
648 | isdn_net_hangup(&p->dev); | 648 | isdn_net_hangup(p->dev); |
649 | break; | 649 | break; |
650 | } | 650 | } |
651 | 651 | ||
@@ -674,9 +674,9 @@ isdn_net_dial(void) | |||
674 | if (lp->dialtimeout == 0) { | 674 | if (lp->dialtimeout == 0) { |
675 | lp->dialwait_timer = jiffies + lp->dialwait; | 675 | lp->dialwait_timer = jiffies + lp->dialwait; |
676 | lp->dialstarted = 0; | 676 | lp->dialstarted = 0; |
677 | isdn_net_unreachable(&p->dev, NULL, "dial: tried all numbers dialmax times"); | 677 | isdn_net_unreachable(p->dev, NULL, "dial: tried all numbers dialmax times"); |
678 | } | 678 | } |
679 | isdn_net_hangup(&p->dev); | 679 | isdn_net_hangup(p->dev); |
680 | break; | 680 | break; |
681 | } | 681 | } |
682 | } | 682 | } |
@@ -758,7 +758,7 @@ isdn_net_dial(void) | |||
758 | cmd.arg = lp->isdn_channel + (lp->l3_proto << 8); | 758 | cmd.arg = lp->isdn_channel + (lp->l3_proto << 8); |
759 | isdn_command(&cmd); | 759 | isdn_command(&cmd); |
760 | if (lp->dtimer++ > ISDN_TIMER_DTIMEOUT15) | 760 | if (lp->dtimer++ > ISDN_TIMER_DTIMEOUT15) |
761 | isdn_net_hangup(&p->dev); | 761 | isdn_net_hangup(p->dev); |
762 | else { | 762 | else { |
763 | anymore = 1; | 763 | anymore = 1; |
764 | lp->dialstate++; | 764 | lp->dialstate++; |
@@ -781,7 +781,7 @@ isdn_net_dial(void) | |||
781 | printk(KERN_DEBUG "dialtimer4: %d\n", lp->dtimer); | 781 | printk(KERN_DEBUG "dialtimer4: %d\n", lp->dtimer); |
782 | #endif | 782 | #endif |
783 | if (lp->dtimer++ > ISDN_TIMER_DTIMEOUT10) | 783 | if (lp->dtimer++ > ISDN_TIMER_DTIMEOUT10) |
784 | isdn_net_hangup(&p->dev); | 784 | isdn_net_hangup(p->dev); |
785 | else | 785 | else |
786 | anymore = 1; | 786 | anymore = 1; |
787 | break; | 787 | break; |
@@ -1618,7 +1618,7 @@ isdn_net_ciscohdlck_slarp_send_reply(isdn_net_local *lp) | |||
1618 | __be32 addr = 0; /* local ipv4 address */ | 1618 | __be32 addr = 0; /* local ipv4 address */ |
1619 | __be32 mask = 0; /* local netmask */ | 1619 | __be32 mask = 0; /* local netmask */ |
1620 | 1620 | ||
1621 | if ((in_dev = lp->netdev->dev.ip_ptr) != NULL) { | 1621 | if ((in_dev = lp->netdev->dev->ip_ptr) != NULL) { |
1622 | /* take primary(first) address of interface */ | 1622 | /* take primary(first) address of interface */ |
1623 | struct in_ifaddr *ifa = in_dev->ifa_list; | 1623 | struct in_ifaddr *ifa = in_dev->ifa_list; |
1624 | if (ifa != NULL) { | 1624 | if (ifa != NULL) { |
@@ -1866,7 +1866,7 @@ isdn_net_rcv_skb(int idx, struct sk_buff *skb) | |||
1866 | isdn_net_local *lp = p->local; | 1866 | isdn_net_local *lp = p->local; |
1867 | if ((lp->flags & ISDN_NET_CONNECTED) && | 1867 | if ((lp->flags & ISDN_NET_CONNECTED) && |
1868 | (!lp->dialstate)) { | 1868 | (!lp->dialstate)) { |
1869 | isdn_net_receive(&p->dev, skb); | 1869 | isdn_net_receive(p->dev, skb); |
1870 | return 1; | 1870 | return 1; |
1871 | } | 1871 | } |
1872 | } | 1872 | } |
@@ -2507,6 +2507,42 @@ isdn_net_force_dial(char *name) | |||
2507 | } | 2507 | } |
2508 | 2508 | ||
2509 | /* | 2509 | /* |
2510 | * Helper for alloc_netdev() | ||
2511 | */ | ||
2512 | static void _isdn_setup(struct net_device *dev) | ||
2513 | { | ||
2514 | isdn_net_local *lp = dev->priv; | ||
2515 | |||
2516 | dev->flags = IFF_NOARP | IFF_POINTOPOINT; | ||
2517 | lp->p_encap = ISDN_NET_ENCAP_RAWIP; | ||
2518 | lp->magic = ISDN_NET_MAGIC; | ||
2519 | lp->last = lp; | ||
2520 | lp->next = lp; | ||
2521 | lp->isdn_device = -1; | ||
2522 | lp->isdn_channel = -1; | ||
2523 | lp->pre_device = -1; | ||
2524 | lp->pre_channel = -1; | ||
2525 | lp->exclusive = -1; | ||
2526 | lp->ppp_slot = -1; | ||
2527 | lp->pppbind = -1; | ||
2528 | skb_queue_head_init(&lp->super_tx_queue); | ||
2529 | lp->l2_proto = ISDN_PROTO_L2_X75I; | ||
2530 | lp->l3_proto = ISDN_PROTO_L3_TRANS; | ||
2531 | lp->triggercps = 6000; | ||
2532 | lp->slavedelay = 10 * HZ; | ||
2533 | lp->hupflags = ISDN_INHUP; /* Do hangup even on incoming calls */ | ||
2534 | lp->onhtime = 10; /* Default hangup-time for saving costs */ | ||
2535 | lp->dialmax = 1; | ||
2536 | /* Hangup before Callback, manual dial */ | ||
2537 | lp->flags = ISDN_NET_CBHUP | ISDN_NET_DM_MANUAL; | ||
2538 | lp->cbdelay = 25; /* Wait 5 secs before Callback */ | ||
2539 | lp->dialtimeout = -1; /* Infinite Dial-Timeout */ | ||
2540 | lp->dialwait = 5 * HZ; /* Wait 5 sec. after failed dial */ | ||
2541 | lp->dialstarted = 0; /* Jiffies of last dial-start */ | ||
2542 | lp->dialwait_timer = 0; /* Jiffies of earliest next dial-start */ | ||
2543 | } | ||
2544 | |||
2545 | /* | ||
2510 | * Allocate a new network-interface and initialize its data structures. | 2546 | * Allocate a new network-interface and initialize its data structures. |
2511 | */ | 2547 | */ |
2512 | char * | 2548 | char * |
@@ -2519,23 +2555,21 @@ isdn_net_new(char *name, struct net_device *master) | |||
2519 | printk(KERN_WARNING "isdn_net: interface %s already exists\n", name); | 2555 | printk(KERN_WARNING "isdn_net: interface %s already exists\n", name); |
2520 | return NULL; | 2556 | return NULL; |
2521 | } | 2557 | } |
2558 | if (name == NULL) | ||
2559 | name = " "; | ||
2522 | if (!(netdev = kzalloc(sizeof(isdn_net_dev), GFP_KERNEL))) { | 2560 | if (!(netdev = kzalloc(sizeof(isdn_net_dev), GFP_KERNEL))) { |
2523 | printk(KERN_WARNING "isdn_net: Could not allocate net-device\n"); | 2561 | printk(KERN_WARNING "isdn_net: Could not allocate net-device\n"); |
2524 | return NULL; | 2562 | return NULL; |
2525 | } | 2563 | } |
2526 | if (!(netdev->local = kzalloc(sizeof(isdn_net_local), GFP_KERNEL))) { | 2564 | netdev->dev = alloc_netdev(sizeof(isdn_net_local), name, _isdn_setup); |
2527 | printk(KERN_WARNING "isdn_net: Could not allocate device locals\n"); | 2565 | if (!netdev->dev) { |
2566 | printk(KERN_WARNING "isdn_net: Could not allocate network device\n"); | ||
2528 | kfree(netdev); | 2567 | kfree(netdev); |
2529 | return NULL; | 2568 | return NULL; |
2530 | } | 2569 | } |
2531 | if (name == NULL) | 2570 | netdev->local = netdev->dev->priv; |
2532 | strcpy(netdev->local->name, " "); | 2571 | strcpy(netdev->local->name, netdev->dev->name); |
2533 | else | 2572 | netdev->dev->init = isdn_net_init; |
2534 | strcpy(netdev->local->name, name); | ||
2535 | strcpy(netdev->dev.name, netdev->local->name); | ||
2536 | netdev->dev.priv = netdev->local; | ||
2537 | netdev->dev.init = isdn_net_init; | ||
2538 | netdev->local->p_encap = ISDN_NET_ENCAP_RAWIP; | ||
2539 | if (master) { | 2573 | if (master) { |
2540 | /* Device shall be a slave */ | 2574 | /* Device shall be a slave */ |
2541 | struct net_device *p = (((isdn_net_local *) master->priv)->slave); | 2575 | struct net_device *p = (((isdn_net_local *) master->priv)->slave); |
@@ -2547,60 +2581,33 @@ isdn_net_new(char *name, struct net_device *master) | |||
2547 | q = p; | 2581 | q = p; |
2548 | p = (((isdn_net_local *) p->priv)->slave); | 2582 | p = (((isdn_net_local *) p->priv)->slave); |
2549 | } | 2583 | } |
2550 | ((isdn_net_local *) q->priv)->slave = &(netdev->dev); | 2584 | ((isdn_net_local *) q->priv)->slave = netdev->dev; |
2551 | } else { | 2585 | } else { |
2552 | /* Device shall be a master */ | 2586 | /* Device shall be a master */ |
2553 | /* | 2587 | /* |
2554 | * Watchdog timer (currently) for master only. | 2588 | * Watchdog timer (currently) for master only. |
2555 | */ | 2589 | */ |
2556 | netdev->dev.tx_timeout = isdn_net_tx_timeout; | 2590 | netdev->dev->tx_timeout = isdn_net_tx_timeout; |
2557 | netdev->dev.watchdog_timeo = ISDN_NET_TX_TIMEOUT; | 2591 | netdev->dev->watchdog_timeo = ISDN_NET_TX_TIMEOUT; |
2558 | if (register_netdev(&netdev->dev) != 0) { | 2592 | if (register_netdev(netdev->dev) != 0) { |
2559 | printk(KERN_WARNING "isdn_net: Could not register net-device\n"); | 2593 | printk(KERN_WARNING "isdn_net: Could not register net-device\n"); |
2560 | kfree(netdev->local); | 2594 | free_netdev(netdev->dev); |
2561 | kfree(netdev); | 2595 | kfree(netdev); |
2562 | return NULL; | 2596 | return NULL; |
2563 | } | 2597 | } |
2564 | } | 2598 | } |
2565 | netdev->local->magic = ISDN_NET_MAGIC; | ||
2566 | |||
2567 | netdev->queue = netdev->local; | 2599 | netdev->queue = netdev->local; |
2568 | spin_lock_init(&netdev->queue_lock); | 2600 | spin_lock_init(&netdev->queue_lock); |
2569 | 2601 | ||
2570 | netdev->local->last = netdev->local; | ||
2571 | netdev->local->netdev = netdev; | 2602 | netdev->local->netdev = netdev; |
2572 | netdev->local->next = netdev->local; | ||
2573 | 2603 | ||
2574 | INIT_WORK(&netdev->local->tqueue, isdn_net_softint); | 2604 | INIT_WORK(&netdev->local->tqueue, isdn_net_softint); |
2575 | spin_lock_init(&netdev->local->xmit_lock); | 2605 | spin_lock_init(&netdev->local->xmit_lock); |
2576 | 2606 | ||
2577 | netdev->local->isdn_device = -1; | ||
2578 | netdev->local->isdn_channel = -1; | ||
2579 | netdev->local->pre_device = -1; | ||
2580 | netdev->local->pre_channel = -1; | ||
2581 | netdev->local->exclusive = -1; | ||
2582 | netdev->local->ppp_slot = -1; | ||
2583 | netdev->local->pppbind = -1; | ||
2584 | skb_queue_head_init(&netdev->local->super_tx_queue); | ||
2585 | netdev->local->l2_proto = ISDN_PROTO_L2_X75I; | ||
2586 | netdev->local->l3_proto = ISDN_PROTO_L3_TRANS; | ||
2587 | netdev->local->triggercps = 6000; | ||
2588 | netdev->local->slavedelay = 10 * HZ; | ||
2589 | netdev->local->hupflags = ISDN_INHUP; /* Do hangup even on incoming calls */ | ||
2590 | netdev->local->onhtime = 10; /* Default hangup-time for saving costs | ||
2591 | of those who forget configuring this */ | ||
2592 | netdev->local->dialmax = 1; | ||
2593 | netdev->local->flags = ISDN_NET_CBHUP | ISDN_NET_DM_MANUAL; /* Hangup before Callback, manual dial */ | ||
2594 | netdev->local->cbdelay = 25; /* Wait 5 secs before Callback */ | ||
2595 | netdev->local->dialtimeout = -1; /* Infinite Dial-Timeout */ | ||
2596 | netdev->local->dialwait = 5 * HZ; /* Wait 5 sec. after failed dial */ | ||
2597 | netdev->local->dialstarted = 0; /* Jiffies of last dial-start */ | ||
2598 | netdev->local->dialwait_timer = 0; /* Jiffies of earliest next dial-start */ | ||
2599 | |||
2600 | /* Put into to netdev-chain */ | 2607 | /* Put into to netdev-chain */ |
2601 | netdev->next = (void *) dev->netdev; | 2608 | netdev->next = (void *) dev->netdev; |
2602 | dev->netdev = netdev; | 2609 | dev->netdev = netdev; |
2603 | return netdev->dev.name; | 2610 | return netdev->dev->name; |
2604 | } | 2611 | } |
2605 | 2612 | ||
2606 | char * | 2613 | char * |
@@ -2625,7 +2632,7 @@ isdn_net_newslave(char *parm) | |||
2625 | /* Master must not be started yet */ | 2632 | /* Master must not be started yet */ |
2626 | if (isdn_net_device_started(n)) | 2633 | if (isdn_net_device_started(n)) |
2627 | return NULL; | 2634 | return NULL; |
2628 | return (isdn_net_new(newname, &(n->dev))); | 2635 | return (isdn_net_new(newname, n->dev)); |
2629 | } | 2636 | } |
2630 | return NULL; | 2637 | return NULL; |
2631 | } | 2638 | } |
@@ -2694,9 +2701,9 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg) | |||
2694 | lp->name); | 2701 | lp->name); |
2695 | return -EINVAL; | 2702 | return -EINVAL; |
2696 | #else | 2703 | #else |
2697 | p->dev.type = ARPHRD_PPP; /* change ARP type */ | 2704 | p->dev->type = ARPHRD_PPP; /* change ARP type */ |
2698 | p->dev.addr_len = 0; | 2705 | p->dev->addr_len = 0; |
2699 | p->dev.do_ioctl = isdn_ppp_dev_ioctl; | 2706 | p->dev->do_ioctl = isdn_ppp_dev_ioctl; |
2700 | #endif | 2707 | #endif |
2701 | break; | 2708 | break; |
2702 | case ISDN_NET_ENCAP_X25IFACE: | 2709 | case ISDN_NET_ENCAP_X25IFACE: |
@@ -2705,12 +2712,12 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg) | |||
2705 | p->local->name); | 2712 | p->local->name); |
2706 | return -EINVAL; | 2713 | return -EINVAL; |
2707 | #else | 2714 | #else |
2708 | p->dev.type = ARPHRD_X25; /* change ARP type */ | 2715 | p->dev->type = ARPHRD_X25; /* change ARP type */ |
2709 | p->dev.addr_len = 0; | 2716 | p->dev->addr_len = 0; |
2710 | #endif | 2717 | #endif |
2711 | break; | 2718 | break; |
2712 | case ISDN_NET_ENCAP_CISCOHDLCK: | 2719 | case ISDN_NET_ENCAP_CISCOHDLCK: |
2713 | p->dev.do_ioctl = isdn_ciscohdlck_dev_ioctl; | 2720 | p->dev->do_ioctl = isdn_ciscohdlck_dev_ioctl; |
2714 | break; | 2721 | break; |
2715 | default: | 2722 | default: |
2716 | if( cfg->p_encap >= 0 && | 2723 | if( cfg->p_encap >= 0 && |
@@ -2837,14 +2844,14 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg) | |||
2837 | } | 2844 | } |
2838 | if (cfg->p_encap != lp->p_encap) { | 2845 | if (cfg->p_encap != lp->p_encap) { |
2839 | if (cfg->p_encap == ISDN_NET_ENCAP_RAWIP) { | 2846 | if (cfg->p_encap == ISDN_NET_ENCAP_RAWIP) { |
2840 | p->dev.header_ops = NULL; | 2847 | p->dev->header_ops = NULL; |
2841 | p->dev.flags = IFF_NOARP|IFF_POINTOPOINT; | 2848 | p->dev->flags = IFF_NOARP|IFF_POINTOPOINT; |
2842 | } else { | 2849 | } else { |
2843 | p->dev.header_ops = &isdn_header_ops; | 2850 | p->dev->header_ops = &isdn_header_ops; |
2844 | if (cfg->p_encap == ISDN_NET_ENCAP_ETHER) | 2851 | if (cfg->p_encap == ISDN_NET_ENCAP_ETHER) |
2845 | p->dev.flags = IFF_BROADCAST | IFF_MULTICAST; | 2852 | p->dev->flags = IFF_BROADCAST | IFF_MULTICAST; |
2846 | else | 2853 | else |
2847 | p->dev.flags = IFF_NOARP|IFF_POINTOPOINT; | 2854 | p->dev->flags = IFF_NOARP|IFF_POINTOPOINT; |
2848 | } | 2855 | } |
2849 | } | 2856 | } |
2850 | lp->p_encap = cfg->p_encap; | 2857 | lp->p_encap = cfg->p_encap; |
@@ -3064,7 +3071,7 @@ isdn_net_force_hangup(char *name) | |||
3064 | isdn_net_hangup(q); | 3071 | isdn_net_hangup(q); |
3065 | q = (((isdn_net_local *) q->priv)->slave); | 3072 | q = (((isdn_net_local *) q->priv)->slave); |
3066 | } | 3073 | } |
3067 | isdn_net_hangup(&p->dev); | 3074 | isdn_net_hangup(p->dev); |
3068 | return 0; | 3075 | return 0; |
3069 | } | 3076 | } |
3070 | return -ENODEV; | 3077 | return -ENODEV; |
@@ -3092,11 +3099,11 @@ isdn_net_realrm(isdn_net_dev * p, isdn_net_dev * q) | |||
3092 | isdn_unexclusive_channel(p->local->pre_device, p->local->pre_channel); | 3099 | isdn_unexclusive_channel(p->local->pre_device, p->local->pre_channel); |
3093 | if (p->local->master) { | 3100 | if (p->local->master) { |
3094 | /* It's a slave-device, so update master's slave-pointer if necessary */ | 3101 | /* It's a slave-device, so update master's slave-pointer if necessary */ |
3095 | if (((isdn_net_local *) (p->local->master->priv))->slave == &p->dev) | 3102 | if (((isdn_net_local *) (p->local->master->priv))->slave == p->dev) |
3096 | ((isdn_net_local *) (p->local->master->priv))->slave = p->local->slave; | 3103 | ((isdn_net_local *) (p->local->master->priv))->slave = p->local->slave; |
3097 | } else { | 3104 | } else { |
3098 | /* Unregister only if it's a master-device */ | 3105 | /* Unregister only if it's a master-device */ |
3099 | unregister_netdev(&p->dev); | 3106 | unregister_netdev(p->dev); |
3100 | } | 3107 | } |
3101 | /* Unlink device from chain */ | 3108 | /* Unlink device from chain */ |
3102 | spin_lock_irqsave(&dev->lock, flags); | 3109 | spin_lock_irqsave(&dev->lock, flags); |
@@ -3124,7 +3131,7 @@ isdn_net_realrm(isdn_net_dev * p, isdn_net_dev * q) | |||
3124 | /* If no more net-devices remain, disable auto-hangup timer */ | 3131 | /* If no more net-devices remain, disable auto-hangup timer */ |
3125 | if (dev->netdev == NULL) | 3132 | if (dev->netdev == NULL) |
3126 | isdn_timer_ctrl(ISDN_TIMER_NETHANGUP, 0); | 3133 | isdn_timer_ctrl(ISDN_TIMER_NETHANGUP, 0); |
3127 | kfree(p->local); | 3134 | free_netdev(p->dev); |
3128 | kfree(p); | 3135 | kfree(p); |
3129 | 3136 | ||
3130 | return 0; | 3137 | return 0; |
diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c index 387392cb3d68..0e5e59f84344 100644 --- a/drivers/isdn/i4l/isdn_ppp.c +++ b/drivers/isdn/i4l/isdn_ppp.c | |||
@@ -360,7 +360,7 @@ isdn_ppp_release(int min, struct file *file) | |||
360 | * isdn_ppp_free() sets is->lp to NULL and lp->ppp_slot to -1 | 360 | * isdn_ppp_free() sets is->lp to NULL and lp->ppp_slot to -1 |
361 | * removing the IPPP_CONNECT flag omits calling of isdn_ppp_wakeup_daemon() | 361 | * removing the IPPP_CONNECT flag omits calling of isdn_ppp_wakeup_daemon() |
362 | */ | 362 | */ |
363 | isdn_net_hangup(&p->dev); | 363 | isdn_net_hangup(p->dev); |
364 | } | 364 | } |
365 | for (i = 0; i < NUM_RCV_BUFFS; i++) { | 365 | for (i = 0; i < NUM_RCV_BUFFS; i++) { |
366 | kfree(is->rq[i].buf); | 366 | kfree(is->rq[i].buf); |
@@ -531,7 +531,7 @@ isdn_ppp_ioctl(int min, struct file *file, unsigned int cmd, unsigned long arg) | |||
531 | if (lp) { | 531 | if (lp) { |
532 | /* OK .. we are ready to send buffers */ | 532 | /* OK .. we are ready to send buffers */ |
533 | is->pppcfg = val; /* isdn_ppp_xmit test for SC_ENABLE_IP !!! */ | 533 | is->pppcfg = val; /* isdn_ppp_xmit test for SC_ENABLE_IP !!! */ |
534 | netif_wake_queue(&lp->netdev->dev); | 534 | netif_wake_queue(lp->netdev->dev); |
535 | break; | 535 | break; |
536 | } | 536 | } |
537 | } | 537 | } |
@@ -1023,7 +1023,7 @@ void isdn_ppp_receive(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buf | |||
1023 | static void | 1023 | static void |
1024 | isdn_ppp_push_higher(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff *skb, int proto) | 1024 | isdn_ppp_push_higher(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff *skb, int proto) |
1025 | { | 1025 | { |
1026 | struct net_device *dev = &net_dev->dev; | 1026 | struct net_device *dev = net_dev->dev; |
1027 | struct ippp_struct *is, *mis; | 1027 | struct ippp_struct *is, *mis; |
1028 | isdn_net_local *mlp = NULL; | 1028 | isdn_net_local *mlp = NULL; |
1029 | int slot; | 1029 | int slot; |
diff --git a/include/linux/isdn.h b/include/linux/isdn.h index a6fb366748bb..ad09506554a3 100644 --- a/include/linux/isdn.h +++ b/include/linux/isdn.h | |||
@@ -382,7 +382,7 @@ typedef struct isdn_net_dev_s { | |||
382 | online */ | 382 | online */ |
383 | spinlock_t queue_lock; /* lock to protect queue */ | 383 | spinlock_t queue_lock; /* lock to protect queue */ |
384 | void *next; /* Pointer to next isdn-interface */ | 384 | void *next; /* Pointer to next isdn-interface */ |
385 | struct net_device dev; /* interface to upper levels */ | 385 | struct net_device *dev; /* interface to upper levels */ |
386 | #ifdef CONFIG_ISDN_PPP | 386 | #ifdef CONFIG_ISDN_PPP |
387 | ippp_bundle * pb; /* pointer to the common bundle structure | 387 | ippp_bundle * pb; /* pointer to the common bundle structure |
388 | * with the per-bundle data */ | 388 | * with the per-bundle data */ |