Commit 83c5d21c authored by Kai Germaschewski's avatar Kai Germaschewski

ISDN: combine isdn_net_dev and isdn_net_local

They were always allocated together and had a one-to-one relationship,
so let's just make them one thing.
parent ff213a05
...@@ -510,9 +510,9 @@ isdn_status_callback(isdn_ctrl * c) ...@@ -510,9 +510,9 @@ isdn_status_callback(isdn_ctrl * c)
/* Schedule connection-setup */ /* Schedule connection-setup */
isdn_net_dial(); isdn_net_dial();
for ( p = dev->netdev; p; p = p->next ) for ( p = dev->netdev; p; p = p->next )
if (p->local->isdn_slot == isdn_dc2minor(di, cmd.arg)) { if (p->local.isdn_slot == isdn_dc2minor(di, cmd.arg)) {
strcpy( cmd.parm.setup.eazmsn, p->local->msn ); strcpy( cmd.parm.setup.eazmsn, p->local.msn );
isdn_slot_command(p->local->isdn_slot, ISDN_CMD_ACCEPTD, &cmd); isdn_slot_command(p->local.isdn_slot, ISDN_CMD_ACCEPTD, &cmd);
retval = 1; retval = 1;
break; break;
} }
......
...@@ -92,7 +92,7 @@ enum { ...@@ -92,7 +92,7 @@ enum {
*/ */
static __inline__ int isdn_net_device_started(isdn_net_dev *n) static __inline__ int isdn_net_device_started(isdn_net_dev *n)
{ {
isdn_net_local *lp = n->local; isdn_net_local *lp = &n->local;
struct net_device *dev; struct net_device *dev;
if (lp->master) if (lp->master)
...@@ -360,7 +360,7 @@ isdn_net_autohup() ...@@ -360,7 +360,7 @@ isdn_net_autohup()
anymore = 0; anymore = 0;
while (p) { while (p) {
isdn_net_local *l = p->local; isdn_net_local *l = &p->local;
if (jiffies == last_jiffies) if (jiffies == last_jiffies)
l->cps = l->transcount; l->cps = l->transcount;
else else
...@@ -475,7 +475,7 @@ isdn_net_stat_callback(int idx, isdn_ctrl *c) ...@@ -475,7 +475,7 @@ isdn_net_stat_callback(int idx, isdn_ctrl *c)
if (!p) if (!p)
return 0; return 0;
lp = p->local; lp = &p->local;
return isdn_net_handle_event(lp, cmd, c); return isdn_net_handle_event(lp, cmd, c);
} }
...@@ -882,7 +882,7 @@ isdn_net_dial(void) ...@@ -882,7 +882,7 @@ isdn_net_dial(void)
isdn_net_dev *p = dev->netdev; isdn_net_dev *p = dev->netdev;
for (p = dev->netdev; p; p = p->next) { for (p = dev->netdev; p; p = p->next) {
isdn_net_local *lp = p->local; isdn_net_local *lp = &p->local;
if (lp->dialstate == ST_0) if (lp->dialstate == ST_0)
continue; continue;
...@@ -1181,7 +1181,7 @@ isdn_net_xmit(struct net_device *ndev, struct sk_buff *skb) ...@@ -1181,7 +1181,7 @@ isdn_net_xmit(struct net_device *ndev, struct sk_buff *skb)
lp->sqfull = 0; lp->sqfull = 0;
} }
/* this is a hack to allow auto-hangup for slaves on moderate loads */ /* this is a hack to allow auto-hangup for slaves on moderate loads */
nd->queue = nd->local; nd->queue = &nd->local;
} }
return retv; return retv;
...@@ -1932,7 +1932,7 @@ isdn_net_rcv_skb(int idx, struct sk_buff *skb) ...@@ -1932,7 +1932,7 @@ isdn_net_rcv_skb(int idx, struct sk_buff *skb)
isdn_net_dev *p = isdn_slot_rx_netdev(idx); isdn_net_dev *p = isdn_slot_rx_netdev(idx);
if (p) { if (p) {
isdn_net_local *lp = p->local; isdn_net_local *lp = &p->local;
if ((lp->flags & ISDN_NET_CONNECTED) && if ((lp->flags & ISDN_NET_CONNECTED) &&
(lp->dialstate == ST_0)) { (lp->dialstate == ST_0)) {
isdn_net_receive(&p->dev, skb); isdn_net_receive(&p->dev, skb);
...@@ -2134,13 +2134,13 @@ isdn_net_swapbind(int drvidx) ...@@ -2134,13 +2134,13 @@ isdn_net_swapbind(int drvidx)
dbg_net_icall("n_fi: swapping ch of %d\n", drvidx); dbg_net_icall("n_fi: swapping ch of %d\n", drvidx);
p = dev->netdev; p = dev->netdev;
while (p) { while (p) {
if (p->local->pre_device == drvidx) if (p->local.pre_device == drvidx)
switch (p->local->pre_channel) { switch (p->local.pre_channel) {
case 0: case 0:
p->local->pre_channel = 1; p->local.pre_channel = 1;
break; break;
case 1: case 1:
p->local->pre_channel = 0; p->local.pre_channel = 0;
break; break;
} }
p = (isdn_net_dev *) p->next; p = (isdn_net_dev *) p->next;
...@@ -2225,7 +2225,7 @@ p = dev->netdev; ...@@ -2225,7 +2225,7 @@ p = dev->netdev;
dev->usage[idx]); dev->usage[idx]);
while (p) { while (p) {
int matchret; int matchret;
isdn_net_local *lp = p->local; isdn_net_local *lp = &p->local;
/* If last check has triggered as binding-swap, revert it */ /* If last check has triggered as binding-swap, revert it */
switch (swapped) { switch (swapped) {
...@@ -2490,7 +2490,7 @@ isdn_net_findif(char *name) ...@@ -2490,7 +2490,7 @@ isdn_net_findif(char *name)
isdn_net_dev *p = dev->netdev; isdn_net_dev *p = dev->netdev;
while (p) { while (p) {
if (!strcmp(p->local->name, name)) if (!strcmp(p->local.name, name))
return p; return p;
p = (isdn_net_dev *) p->next; p = (isdn_net_dev *) p->next;
} }
...@@ -2572,7 +2572,7 @@ isdn_net_force_dial(char *name) ...@@ -2572,7 +2572,7 @@ isdn_net_force_dial(char *name)
if (!p) if (!p)
return -ENODEV; return -ENODEV;
return (isdn_net_force_dial_lp(p->local)); return (isdn_net_force_dial_lp(&p->local));
} }
/* /*
...@@ -2593,26 +2593,20 @@ isdn_net_new(char *name, struct net_device *master) ...@@ -2593,26 +2593,20 @@ isdn_net_new(char *name, struct net_device *master)
return NULL; return NULL;
} }
memset(netdev, 0, sizeof(isdn_net_dev)); memset(netdev, 0, sizeof(isdn_net_dev));
if (!(netdev->local = (isdn_net_local *) kmalloc(sizeof(isdn_net_local), GFP_KERNEL))) {
printk(KERN_WARNING "isdn_net: Could not allocate device locals\n");
kfree(netdev);
return NULL;
}
memset(netdev->local, 0, sizeof(isdn_net_local));
if (name == NULL) if (name == NULL)
strcpy(netdev->local->name, " "); strcpy(netdev->local.name, " ");
else else
strcpy(netdev->local->name, name); strcpy(netdev->local.name, name);
strcpy(netdev->dev.name, netdev->local->name); strcpy(netdev->dev.name, netdev->local.name);
netdev->dev.priv = netdev->local; netdev->dev.priv = &netdev->local;
netdev->dev.init = isdn_net_init; netdev->dev.init = isdn_net_init;
netdev->local->p_encap = ISDN_NET_ENCAP_RAWIP; netdev->local.p_encap = ISDN_NET_ENCAP_RAWIP;
if (master) { if (master) {
/* Device shall be a slave */ /* Device shall be a slave */
struct net_device *p = (((isdn_net_local *) master->priv)->slave); struct net_device *p = (((isdn_net_local *) master->priv)->slave);
struct net_device *q = master; struct net_device *q = master;
netdev->local->master = master; netdev->local.master = master;
/* Put device at end of slave-chain */ /* Put device at end of slave-chain */
while (p) { while (p) {
q = p; q = p;
...@@ -2628,49 +2622,48 @@ isdn_net_new(char *name, struct net_device *master) ...@@ -2628,49 +2622,48 @@ isdn_net_new(char *name, struct net_device *master)
netdev->dev.watchdog_timeo = ISDN_NET_TX_TIMEOUT; netdev->dev.watchdog_timeo = ISDN_NET_TX_TIMEOUT;
if (register_netdev(&netdev->dev) != 0) { if (register_netdev(&netdev->dev) != 0) {
printk(KERN_WARNING "isdn_net: Could not register net-device\n"); printk(KERN_WARNING "isdn_net: Could not register net-device\n");
kfree(netdev->local);
kfree(netdev); kfree(netdev);
return NULL; return NULL;
} }
} }
netdev->local->magic = ISDN_NET_MAGIC; netdev->local.magic = ISDN_NET_MAGIC;
netdev->queue = netdev->local; netdev->queue = &netdev->local;
spin_lock_init(&netdev->queue_lock); spin_lock_init(&netdev->queue_lock);
netdev->local->last = netdev->local; netdev->local.last = &netdev->local;
netdev->local->netdev = netdev; netdev->local.netdev = netdev;
netdev->local->next = netdev->local; netdev->local.next = &netdev->local;
netdev->local->tqueue.sync = 0; netdev->local.tqueue.sync = 0;
netdev->local->tqueue.routine = isdn_net_softint; netdev->local.tqueue.routine = isdn_net_softint;
netdev->local->tqueue.data = netdev->local; netdev->local.tqueue.data = &netdev->local;
spin_lock_init(&netdev->local->xmit_lock); spin_lock_init(&netdev->local.xmit_lock);
netdev->local->isdn_slot = -1; netdev->local.isdn_slot = -1;
netdev->local->pre_device = -1; netdev->local.pre_device = -1;
netdev->local->pre_channel = -1; netdev->local.pre_channel = -1;
netdev->local->exclusive = -1; netdev->local.exclusive = -1;
netdev->local->ppp_slot = -1; netdev->local.ppp_slot = -1;
netdev->local->pppbind = -1; netdev->local.pppbind = -1;
skb_queue_head_init(&netdev->local->super_tx_queue); skb_queue_head_init(&netdev->local.super_tx_queue);
netdev->local->l2_proto = ISDN_PROTO_L2_X75I; netdev->local.l2_proto = ISDN_PROTO_L2_X75I;
netdev->local->l3_proto = ISDN_PROTO_L3_TRANS; netdev->local.l3_proto = ISDN_PROTO_L3_TRANS;
netdev->local->triggercps = 6000; netdev->local.triggercps = 6000;
netdev->local->slavedelay = 10 * HZ; netdev->local.slavedelay = 10 * HZ;
netdev->local->hupflags = ISDN_INHUP; /* Do hangup even on incoming calls */ netdev->local.hupflags = ISDN_INHUP; /* Do hangup even on incoming calls */
netdev->local->onhtime = 10; /* Default hangup-time for saving costs netdev->local.onhtime = 10; /* Default hangup-time for saving costs
of those who forget configuring this */ of those who forget configuring this */
netdev->local->dialmax = 1; netdev->local.dialmax = 1;
netdev->local->flags = ISDN_NET_CBHUP | ISDN_NET_DM_MANUAL; /* Hangup before Callback, manual dial */ netdev->local.flags = ISDN_NET_CBHUP | ISDN_NET_DM_MANUAL; /* Hangup before Callback, manual dial */
netdev->local->cbdelay = 25; /* Wait 5 secs before Callback */ netdev->local.cbdelay = 25; /* Wait 5 secs before Callback */
netdev->local->dialtimeout = -1; /* Infinite Dial-Timeout */ netdev->local.dialtimeout = -1; /* Infinite Dial-Timeout */
netdev->local->dialwait = 5 * HZ; /* Wait 5 sec. after failed dial */ netdev->local.dialwait = 5 * HZ; /* Wait 5 sec. after failed dial */
netdev->local->dialstarted = 0; /* Jiffies of last dial-start */ netdev->local.dialstarted = 0; /* Jiffies of last dial-start */
netdev->local->dialwait_timer = 0; /* Jiffies of earliest next dial-start */ netdev->local.dialwait_timer = 0; /* Jiffies of earliest next dial-start */
/* Put into to netdev-chain */ /* Put into to netdev-chain */
netdev->next = (void *) dev->netdev; netdev->next = dev->netdev;
dev->netdev = netdev; dev->netdev = netdev;
return netdev->dev.name; return netdev->dev.name;
} }
...@@ -2692,7 +2685,7 @@ isdn_net_newslave(char *parm) ...@@ -2692,7 +2685,7 @@ isdn_net_newslave(char *parm)
if (!(n = isdn_net_findif(parm))) if (!(n = isdn_net_findif(parm)))
return NULL; return NULL;
/* Master must be a real interface, not a slave */ /* Master must be a real interface, not a slave */
if (n->local->master) if (n->local.master)
return NULL; return NULL;
/* Master must not be started yet */ /* Master must not be started yet */
if (isdn_net_device_started(n)) if (isdn_net_device_started(n))
...@@ -2721,7 +2714,7 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg) ...@@ -2721,7 +2714,7 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg)
ulong flags; ulong flags;
#endif #endif
if (p) { if (p) {
isdn_net_local *lp = p->local; isdn_net_local *lp = &p->local;
/* See if any registered driver supports the features we want */ /* See if any registered driver supports the features we want */
features = ((1 << cfg->l2_proto) << ISDN_FEATURE_L2_SHIFT) | features = ((1 << cfg->l2_proto) << ISDN_FEATURE_L2_SHIFT) |
...@@ -2781,7 +2774,7 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg) ...@@ -2781,7 +2774,7 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg)
case ISDN_NET_ENCAP_X25IFACE: case ISDN_NET_ENCAP_X25IFACE:
#ifndef CONFIG_ISDN_X25 #ifndef CONFIG_ISDN_X25
printk(KERN_WARNING "%s: isdn-x25 support not configured\n", printk(KERN_WARNING "%s: isdn-x25 support not configured\n",
p->local->name); p->local.name);
return -EINVAL; return -EINVAL;
#else #else
p->dev.type = ARPHRD_X25; /* change ARP type */ p->dev.type = ARPHRD_X25; /* change ARP type */
...@@ -2797,7 +2790,7 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg) ...@@ -2797,7 +2790,7 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg)
break; break;
printk(KERN_WARNING printk(KERN_WARNING
"%s: encapsulation protocol %d not supported\n", "%s: encapsulation protocol %d not supported\n",
p->local->name, cfg->p_encap); p->local.name, cfg->p_encap);
return -EINVAL; return -EINVAL;
} }
if (strlen(cfg->drvid)) { if (strlen(cfg->drvid)) {
...@@ -2947,7 +2940,7 @@ isdn_net_getcfg(isdn_net_ioctl_cfg * cfg) ...@@ -2947,7 +2940,7 @@ isdn_net_getcfg(isdn_net_ioctl_cfg * cfg)
isdn_net_dev *p = isdn_net_findif(cfg->name); isdn_net_dev *p = isdn_net_findif(cfg->name);
if (p) { if (p) {
isdn_net_local *lp = p->local; isdn_net_local *lp = &p->local;
strcpy(cfg->eaz, lp->msn); strcpy(cfg->eaz, lp->msn);
cfg->exclusive = lp->exclusive; cfg->exclusive = lp->exclusive;
...@@ -3006,8 +2999,8 @@ isdn_net_addphone(isdn_net_ioctl_phone * phone) ...@@ -3006,8 +2999,8 @@ isdn_net_addphone(isdn_net_ioctl_phone * phone)
if (!(n = (isdn_net_phone *) kmalloc(sizeof(isdn_net_phone), GFP_KERNEL))) if (!(n = (isdn_net_phone *) kmalloc(sizeof(isdn_net_phone), GFP_KERNEL)))
return -ENOMEM; return -ENOMEM;
strcpy(n->num, phone->phone); strcpy(n->num, phone->phone);
n->next = p->local->phone[phone->outgoing & 1]; n->next = p->local.phone[phone->outgoing & 1];
p->local->phone[phone->outgoing & 1] = n; p->local.phone[phone->outgoing & 1] = n;
return 0; return 0;
} }
return -ENODEV; return -ENODEV;
...@@ -3029,7 +3022,7 @@ isdn_net_getphones(isdn_net_ioctl_phone * phone, char *phones) ...@@ -3029,7 +3022,7 @@ isdn_net_getphones(isdn_net_ioctl_phone * phone, char *phones)
if (!p) if (!p)
return -ENODEV; return -ENODEV;
inout &= 1; inout &= 1;
for (n = p->local->phone[inout]; n; n = n->next) { for (n = p->local.phone[inout]; n; n = n->next) {
if (more) { if (more) {
put_user(' ', phones++); put_user(' ', phones++);
count++; count++;
...@@ -3063,7 +3056,7 @@ isdn_net_getpeer(isdn_net_ioctl_phone *phone, isdn_net_ioctl_phone *peer) ...@@ -3063,7 +3056,7 @@ isdn_net_getpeer(isdn_net_ioctl_phone *phone, isdn_net_ioctl_phone *peer)
* in (partially) wrong number copied to user. This race * in (partially) wrong number copied to user. This race
* currently ignored. * currently ignored.
*/ */
idx = p->local->isdn_slot; idx = p->local.isdn_slot;
if (idx<0) return -ENOTCONN; if (idx<0) return -ENOTCONN;
/* for pre-bound channels, we need this extra check */ /* for pre-bound channels, we need this extra check */
if (strncmp(isdn_slot_num(idx),"???",3) == 0 ) return -ENOTCONN; if (strncmp(isdn_slot_num(idx),"???",3) == 0 ) return -ENOTCONN;
...@@ -3087,16 +3080,16 @@ isdn_net_delphone(isdn_net_ioctl_phone * phone) ...@@ -3087,16 +3080,16 @@ isdn_net_delphone(isdn_net_ioctl_phone * phone)
if (p) { if (p) {
save_flags(flags); save_flags(flags);
cli(); cli();
n = p->local->phone[inout]; n = p->local.phone[inout];
m = NULL; m = NULL;
while (n) { while (n) {
if (!strcmp(n->num, phone->phone)) { if (!strcmp(n->num, phone->phone)) {
if (p->local->dial == n) if (p->local.dial == n)
p->local->dial = n->next; p->local.dial = n->next;
if (m) if (m)
m->next = n->next; m->next = n->next;
else else
p->local->phone[inout] = n->next; p->local.phone[inout] = n->next;
kfree(n); kfree(n);
restore_flags(flags); restore_flags(flags);
return 0; return 0;
...@@ -3124,15 +3117,15 @@ isdn_net_rmallphone(isdn_net_dev * p) ...@@ -3124,15 +3117,15 @@ isdn_net_rmallphone(isdn_net_dev * p)
save_flags(flags); save_flags(flags);
cli(); cli();
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
n = p->local->phone[i]; n = p->local.phone[i];
while (n) { while (n) {
m = n->next; m = n->next;
kfree(n); kfree(n);
n = m; n = m;
} }
p->local->phone[i] = NULL; p->local.phone[i] = NULL;
} }
p->local->dial = NULL; p->local.dial = NULL;
restore_flags(flags); restore_flags(flags);
return 0; return 0;
} }
...@@ -3147,9 +3140,9 @@ isdn_net_force_hangup(char *name) ...@@ -3147,9 +3140,9 @@ isdn_net_force_hangup(char *name)
struct net_device *q; struct net_device *q;
if (p) { if (p) {
if (p->local->isdn_slot < 0) if (p->local.isdn_slot < 0)
return 1; return 1;
q = p->local->slave; q = p->local.slave;
/* If this interface has slaves, do a hangup for them also. */ /* If this interface has slaves, do a hangup for them also. */
while (q) { while (q) {
isdn_net_hangup(q); isdn_net_hangup(q);
...@@ -3182,16 +3175,16 @@ isdn_net_realrm(isdn_net_dev * p, isdn_net_dev * q) ...@@ -3182,16 +3175,16 @@ isdn_net_realrm(isdn_net_dev * p, isdn_net_dev * q)
/* Free all phone-entries */ /* Free all phone-entries */
isdn_net_rmallphone(p); isdn_net_rmallphone(p);
/* If interface is bound exclusive, free channel-usage */ /* If interface is bound exclusive, free channel-usage */
if (p->local->exclusive != -1) if (p->local.exclusive != -1)
isdn_unexclusive_channel(p->local->pre_device, p->local->pre_channel); isdn_unexclusive_channel(p->local.pre_device, p->local.pre_channel);
if (p->local->master) { if (p->local.master) {
/* It's a slave-device, so update master's slave-pointer if necessary */ /* It's a slave-device, so update master's slave-pointer if necessary */
if (((isdn_net_local *) (p->local->master->priv))->slave == &p->dev) if (((isdn_net_local *) (p->local.master->priv))->slave == &p->dev)
((isdn_net_local *) (p->local->master->priv))->slave = p->local->slave; ((isdn_net_local *) (p->local.master->priv))->slave = p->local.slave;
} else { } else {
/* Unregister only if it's a master-device */ /* Unregister only if it's a master-device */
p->dev.hard_header_cache = p->local->org_hhc; p->dev.hard_header_cache = p->local.org_hhc;
p->dev.header_cache_update = p->local->org_hcu; p->dev.header_cache_update = p->local.org_hcu;
unregister_netdev(&p->dev); unregister_netdev(&p->dev);
} }
/* Unlink device from chain */ /* Unlink device from chain */
...@@ -3199,13 +3192,13 @@ isdn_net_realrm(isdn_net_dev * p, isdn_net_dev * q) ...@@ -3199,13 +3192,13 @@ isdn_net_realrm(isdn_net_dev * p, isdn_net_dev * q)
q->next = p->next; q->next = p->next;
else else
dev->netdev = p->next; dev->netdev = p->next;
if (p->local->slave) { if (p->local.slave) {
/* If this interface has a slave, remove it also */ /* If this interface has a slave, remove it also */
char *slavename = ((isdn_net_local *) (p->local->slave->priv))->name; char *slavename = ((isdn_net_local *) (p->local.slave->priv))->name;
isdn_net_dev *n = dev->netdev; isdn_net_dev *n = dev->netdev;
q = NULL; q = NULL;
while (n) { while (n) {
if (!strcmp(n->local->name, slavename)) { if (!strcmp(n->local.name, slavename)) {
isdn_net_realrm(n, q); isdn_net_realrm(n, q);
break; break;
} }
...@@ -3217,7 +3210,6 @@ isdn_net_realrm(isdn_net_dev * p, isdn_net_dev * q) ...@@ -3217,7 +3210,6 @@ isdn_net_realrm(isdn_net_dev * p, isdn_net_dev * q)
if (dev->netdev == NULL) if (dev->netdev == NULL)
isdn_timer_ctrl(ISDN_TIMER_NETHANGUP, 0); isdn_timer_ctrl(ISDN_TIMER_NETHANGUP, 0);
restore_flags(flags); restore_flags(flags);
kfree(p->local);
kfree(p); kfree(p);
return 0; return 0;
...@@ -3236,7 +3228,7 @@ isdn_net_rm(char *name) ...@@ -3236,7 +3228,7 @@ isdn_net_rm(char *name)
p = dev->netdev; p = dev->netdev;
q = NULL; q = NULL;
while (p) { while (p) {
if (!strcmp(p->local->name, name)) if (!strcmp(p->local.name, name))
return (isdn_net_realrm(p, q)); return (isdn_net_realrm(p, q));
q = p; q = p;
p = (isdn_net_dev *) p->next; p = (isdn_net_dev *) p->next;
...@@ -3260,7 +3252,7 @@ isdn_net_rmall(void) ...@@ -3260,7 +3252,7 @@ isdn_net_rmall(void)
save_flags(flags); save_flags(flags);
cli(); cli();
while (dev->netdev) { while (dev->netdev) {
if (!dev->netdev->local->master) { if (!dev->netdev->local.master) {
/* Remove master-devices only, slaves get removed with their master */ /* Remove master-devices only, slaves get removed with their master */
if ((ret = isdn_net_realrm(dev->netdev, NULL))) { if ((ret = isdn_net_realrm(dev->netdev, NULL))) {
restore_flags(flags); restore_flags(flags);
......
...@@ -131,7 +131,7 @@ static __inline__ void isdn_net_rm_from_bundle(isdn_net_local *lp) ...@@ -131,7 +131,7 @@ static __inline__ void isdn_net_rm_from_bundle(isdn_net_local *lp)
if (master_lp->netdev->queue == lp) { if (master_lp->netdev->queue == lp) {
master_lp->netdev->queue = lp->next; master_lp->netdev->queue = lp->next;
if (lp->next == lp) { /* last in queue */ if (lp->next == lp) { /* last in queue */
master_lp->netdev->queue = master_lp->netdev->local; master_lp->netdev->queue = &master_lp->netdev->local;
} }
} }
lp->next = lp->last = lp; /* (re)set own pointers */ lp->next = lp->last = lp; /* (re)set own pointers */
......
...@@ -169,7 +169,7 @@ isdn_ppp_bind(isdn_net_local * lp) ...@@ -169,7 +169,7 @@ isdn_ppp_bind(isdn_net_local * lp)
char exclusive[ISDN_MAX_CHANNELS]; /* exclusive flags */ char exclusive[ISDN_MAX_CHANNELS]; /* exclusive flags */
memset(exclusive, 0, ISDN_MAX_CHANNELS); memset(exclusive, 0, ISDN_MAX_CHANNELS);
while (net_dev) { /* step through net devices to find exclusive minors */ while (net_dev) { /* step through net devices to find exclusive minors */
isdn_net_local *lp = net_dev->local; isdn_net_local *lp = &net_dev->local;
if (lp->pppbind >= 0) if (lp->pppbind >= 0)
exclusive[lp->pppbind] = 1; exclusive[lp->pppbind] = 1;
net_dev = net_dev->next; net_dev = net_dev->next;
...@@ -974,7 +974,7 @@ void isdn_ppp_receive(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buf ...@@ -974,7 +974,7 @@ void isdn_ppp_receive(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buf
int slot; int slot;
int proto; int proto;
if (net_dev->local->master) if (net_dev->local.master)
BUG(); // we're called with the master device always BUG(); // we're called with the master device always
slot = lp->ppp_slot; slot = lp->ppp_slot;
...@@ -1077,12 +1077,12 @@ isdn_ppp_push_higher(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff ...@@ -1077,12 +1077,12 @@ isdn_ppp_push_higher(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff
case PPP_VJC_UNCOMP: case PPP_VJC_UNCOMP:
if (is->debug & 0x20) if (is->debug & 0x20)
printk(KERN_DEBUG "isdn_ppp: VJC_UNCOMP\n"); printk(KERN_DEBUG "isdn_ppp: VJC_UNCOMP\n");
if (net_dev->local->ppp_slot < 0) { if (net_dev->local.ppp_slot < 0) {
printk(KERN_ERR __FUNCTION__": net_dev->local->ppp_slot(%d) out of range\n", printk(KERN_ERR __FUNCTION__": net_dev->local->ppp_slot(%d) out of range\n",
net_dev->local->ppp_slot); net_dev->local.ppp_slot);
goto drop_packet; goto drop_packet;
} }
if (slhc_remember(ippp_table[net_dev->local->ppp_slot]->slcomp, skb->data, skb->len) <= 0) { if (slhc_remember(ippp_table[net_dev->local.ppp_slot]->slcomp, skb->data, skb->len) <= 0) {
printk(KERN_WARNING "isdn_ppp: received illegal VJC_UNCOMP frame!\n"); printk(KERN_WARNING "isdn_ppp: received illegal VJC_UNCOMP frame!\n");
goto drop_packet; goto drop_packet;
} }
...@@ -1103,12 +1103,12 @@ isdn_ppp_push_higher(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff ...@@ -1103,12 +1103,12 @@ isdn_ppp_push_higher(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff
} }
skb_put(skb, skb_old->len + 128); skb_put(skb, skb_old->len + 128);
memcpy(skb->data, skb_old->data, skb_old->len); memcpy(skb->data, skb_old->data, skb_old->len);
if (net_dev->local->ppp_slot < 0) { if (net_dev->local.ppp_slot < 0) {
printk(KERN_ERR __FUNCTION__": net_dev->local->ppp_slot(%d) out of range\n", printk(KERN_ERR __FUNCTION__": net_dev->local->ppp_slot(%d) out of range\n",
net_dev->local->ppp_slot); net_dev->local.ppp_slot);
goto drop_packet; goto drop_packet;
} }
pkt_len = slhc_uncompress(ippp_table[net_dev->local->ppp_slot]->slcomp, pkt_len = slhc_uncompress(ippp_table[net_dev->local.ppp_slot]->slcomp,
skb->data, skb_old->len); skb->data, skb_old->len);
kfree_skb(skb_old); kfree_skb(skb_old);
if (pkt_len < 0) if (pkt_len < 0)
...@@ -1144,7 +1144,7 @@ isdn_ppp_push_higher(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff ...@@ -1144,7 +1144,7 @@ isdn_ppp_push_higher(isdn_net_dev * net_dev, isdn_net_local * lp, struct sk_buff
return; return;
drop_packet: drop_packet:
net_dev->local->stats.rx_dropped++; net_dev->local.stats.rx_dropped++;
kfree_skb(skb); kfree_skb(skb);
} }
...@@ -1976,7 +1976,7 @@ isdn_ppp_dial_slave(char *name) ...@@ -1976,7 +1976,7 @@ isdn_ppp_dial_slave(char *name)
if (!(ndev = isdn_net_findif(name))) if (!(ndev = isdn_net_findif(name)))
return 1; return 1;
lp = ndev->local; lp = &ndev->local;
if (!(lp->flags & ISDN_NET_CONNECTED)) if (!(lp->flags & ISDN_NET_CONNECTED))
return 5; return 5;
...@@ -2007,7 +2007,7 @@ isdn_ppp_hangup_slave(char *name) ...@@ -2007,7 +2007,7 @@ isdn_ppp_hangup_slave(char *name)
if (!(ndev = isdn_net_findif(name))) if (!(ndev = isdn_net_findif(name)))
return 1; return 1;
lp = ndev->local; lp = &ndev->local;
if (!(lp->flags & ISDN_NET_CONNECTED)) if (!(lp->flags & ISDN_NET_CONNECTED))
return 5; return 5;
......
...@@ -386,7 +386,7 @@ typedef struct isdn_net_local_s { ...@@ -386,7 +386,7 @@ typedef struct isdn_net_local_s {
/* the interface itself */ /* the interface itself */
typedef struct isdn_net_dev_s { typedef struct isdn_net_dev_s {
isdn_net_local *local; isdn_net_local local;
isdn_net_local *queue; /* circular list of all bundled isdn_net_local *queue; /* circular list of all bundled
channels, which are currently channels, which are currently
online */ online */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment