Commit cd51254f authored by Kai Germaschewski's avatar Kai Germaschewski

ISDN: Switch isdn_net_hangup() to work on isdn_net_local *

Most other isdn_net functions operate on isdn_net_local *, so should
isdn_net_hangup() do.
parent 9bf6b555
......@@ -381,7 +381,7 @@ static int isdn_net_hup_timer(unsigned long data)
if (time_after(jiffies, lp->chargetime + lp->chargeint - 2 * HZ)) {
if (lp->outgoing || lp->hupflags & ISDN_INHUP) {
isdn_net_hangup(&lp->netdev->dev);
isdn_net_hangup(lp);
return 0;
}
}
......@@ -389,17 +389,17 @@ static int isdn_net_hup_timer(unsigned long data)
if (lp->hupflags & ISDN_CHARGEHUP) {
if (lp->charge_state != ST_CHARGE_HAVE_CINT) {
dbg_net_dial("%s: did not get CINT\n", lp->name);
isdn_net_hangup(&lp->netdev->dev);
isdn_net_hangup(lp);
return 0;
} else if (time_after(jiffies, lp->chargetime + lp->chargeint)) {
dbg_net_dial("%s: chtime = %lu, chint = %d\n",
lp->name, lp->chargetime, lp->chargeint);
isdn_net_hangup(&lp->netdev->dev);
isdn_net_hangup(lp);
return 0;
}
}
} else if (lp->hupflags & ISDN_INHUP) {
isdn_net_hangup(&lp->netdev->dev);
isdn_net_hangup(lp);
return 0;
}
return 1;
......@@ -421,7 +421,7 @@ isdn_net_autohup()
if(dev->global_flags & ISDN_GLOBAL_STOPPED ||
ISDN_NET_DIALMODE(*l) == ISDN_NET_DM_OFF) {
isdn_net_hangup(&p->dev);
isdn_net_hangup(l);
continue;
}
......@@ -527,7 +527,7 @@ init_dialout(isdn_net_local *lp)
if (!lp->dial) {
printk(KERN_WARNING "%s: phone number deleted?\n",
lp->name);
isdn_net_hangup(&lp->netdev->dev);
isdn_net_hangup(lp);
return 0;
}
if (lp->dialtimeout > 0 &&
......@@ -556,7 +556,7 @@ do_dialout(isdn_net_local *lp)
else
s = "dial suppressed: dialmode `off'";
isdn_net_unreachable(&lp->netdev->dev, 0, s);
isdn_net_hangup(&lp->netdev->dev);
isdn_net_hangup(lp);
return 0;
}
......@@ -566,7 +566,7 @@ do_dialout(isdn_net_local *lp)
restore_flags(flags);
printk(KERN_WARNING "%s: phone number deleted?\n",
lp->name);
isdn_net_hangup(&lp->netdev->dev);
isdn_net_hangup(lp);
return 0;
}
if (!strncmp(lp->dial->num, "LEASED", strlen("LEASED"))) {
......@@ -589,7 +589,7 @@ do_dialout(isdn_net_local *lp)
lp->dialwait_timer = jiffies + lp->dialwait;
lp->dialstarted = 0;
isdn_net_unreachable(&lp->netdev->dev, 0, "dial: timed out");
isdn_net_hangup(&lp->netdev->dev);
isdn_net_hangup(lp);
return 0;
}
}
......@@ -607,7 +607,7 @@ do_dialout(isdn_net_local *lp)
lp->dialstarted = 0;
isdn_net_unreachable(&lp->netdev->dev, 0, "dial: tried all numbers dialmax times");
}
isdn_net_hangup(&lp->netdev->dev);
isdn_net_hangup(lp);
return 0;
}
}
......@@ -733,7 +733,7 @@ isdn_net_handle_event(isdn_net_local *lp, int pr, void *arg)
/* Remote does callback. Hangup after cbdelay,
* then wait for incoming call */
printk(KERN_INFO "%s: hangup waiting for callback ...\n", lp->name);
isdn_net_hangup(&lp->netdev->dev);
isdn_net_hangup(lp);
return 1;
case ISDN_STAT_DCONN:
/* Got D-Channel-Connect, send B-Channel-request */
......@@ -774,7 +774,7 @@ isdn_net_handle_event(isdn_net_local *lp, int pr, void *arg)
case ST_IN_WAIT_DCONN:
switch (pr) {
case EV_NET_TIMER_IN_DCONN:
isdn_net_hangup(&p->dev);
isdn_net_hangup(lp);
return 1;
case ISDN_STAT_DCONN:
del_timer(&lp->dial_timer);
......@@ -795,7 +795,7 @@ isdn_net_handle_event(isdn_net_local *lp, int pr, void *arg)
case ST_IN_WAIT_BCONN:
switch (pr) {
case EV_NET_TIMER_IN_BCONN:
isdn_net_hangup(&p->dev);
isdn_net_hangup(lp);
break;
case ISDN_STAT_BCONN:
del_timer(&lp->dial_timer);
......@@ -830,9 +830,8 @@ isdn_net_handle_event(isdn_net_local *lp, int pr, void *arg)
* Perform hangup for a net-interface.
*/
void
isdn_net_hangup(struct net_device *d)
isdn_net_hangup(isdn_net_local *lp)
{
isdn_net_local *lp = (isdn_net_local *) d->priv;
isdn_ctrl cmd;
#ifdef CONFIG_ISDN_X25
struct concap_proto *cprot = lp -> netdev -> cprot;
......@@ -846,7 +845,7 @@ isdn_net_hangup(struct net_device *d)
printk(KERN_INFO
"isdn_net: hang up slave %s before %s\n",
slp->name, lp->name);
isdn_net_hangup(lp->slave);
isdn_net_hangup(slp);
}
}
printk(KERN_INFO "isdn_net: local hangup %s\n", lp->name);
......@@ -1332,11 +1331,11 @@ isdn_net_close(struct net_device *dev)
if( cprot && cprot -> pops )
cprot -> pops -> close( cprot );
#endif
isdn_net_hangup(p);
isdn_net_hangup(p->priv);
p = (((isdn_net_local *) p->priv)->slave);
}
}
isdn_net_hangup(dev);
isdn_net_hangup(dev->priv);
isdn_MOD_DEC_USE_COUNT();
return 0;
}
......@@ -3097,10 +3096,10 @@ isdn_net_force_hangup(char *name)
q = p->local.slave;
/* If this interface has slaves, do a hangup for them also. */
while (q) {
isdn_net_hangup(q);
isdn_net_hangup(&p->local);
q = (((isdn_net_local *) q->priv)->slave);
}
isdn_net_hangup(&p->dev);
isdn_net_hangup(&p->local);
return 0;
}
return -ENODEV;
......
......@@ -41,7 +41,7 @@ extern int isdn_net_getphones(isdn_net_ioctl_phone *, char *);
extern int isdn_net_getpeer(isdn_net_ioctl_phone *, isdn_net_ioctl_phone *);
extern int isdn_net_delphone(isdn_net_ioctl_phone *);
extern int isdn_net_find_icall(int, int, int, setup_parm *);
extern void isdn_net_hangup(struct net_device *);
extern void isdn_net_hangup(isdn_net_local *);
extern void isdn_net_autohup(void);
extern int isdn_net_force_hangup(char *);
extern int isdn_net_force_dial(char *);
......
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