Commit 2a002db2 authored by Kai Germaschewski's avatar Kai Germaschewski

ISDN: Kill isdn_net_autohup()

It's not used for the timeout controlled hangup anymore, only to
hangup depending on the dialmode, which we handle directly now.
parent 79deb1f1
...@@ -264,8 +264,6 @@ isdn_timer_funct(ulong dummy) ...@@ -264,8 +264,6 @@ isdn_timer_funct(ulong dummy)
if (tf & ISDN_TIMER_SLOW) { if (tf & ISDN_TIMER_SLOW) {
if (++isdn_timer_cnt2 >= ISDN_TIMER_1SEC) { if (++isdn_timer_cnt2 >= ISDN_TIMER_1SEC) {
isdn_timer_cnt2 = 0; isdn_timer_cnt2 = 0;
if (tf & ISDN_TIMER_NETHANGUP)
isdn_net_autohup();
if (++isdn_timer_cnt3 >= ISDN_TIMER_RINGING) { if (++isdn_timer_cnt3 >= ISDN_TIMER_RINGING) {
isdn_timer_cnt3 = 0; isdn_timer_cnt3 = 0;
if (tf & ISDN_TIMER_MODEMRING) if (tf & ISDN_TIMER_MODEMRING)
...@@ -1397,10 +1395,12 @@ isdn_ctrl_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg) ...@@ -1397,10 +1395,12 @@ isdn_ctrl_ioctl(struct inode *inode, struct file *file, uint cmd, ulong arg)
printk(KERN_INFO "isdn: Verbose-Level is %d\n", dev->net_verbose); printk(KERN_INFO "isdn: Verbose-Level is %d\n", dev->net_verbose);
return 0; return 0;
case IIOCSETGST: case IIOCSETGST:
if (arg) if (arg) {
dev->global_flags |= ISDN_GLOBAL_STOPPED; dev->global_flags |= ISDN_GLOBAL_STOPPED;
else isdn_net_hangup_all();
} else {
dev->global_flags &= ~ISDN_GLOBAL_STOPPED; dev->global_flags &= ~ISDN_GLOBAL_STOPPED;
}
printk(KERN_INFO "isdn: Global Mode %s\n", printk(KERN_INFO "isdn: Global Mode %s\n",
(dev->global_flags & ISDN_GLOBAL_STOPPED) ? "stopped" : "running"); (dev->global_flags & ISDN_GLOBAL_STOPPED) ? "stopped" : "running");
return 0; return 0;
......
...@@ -406,23 +406,6 @@ static void isdn_net_hup_timer(unsigned long data) ...@@ -406,23 +406,6 @@ static void isdn_net_hup_timer(unsigned long data)
mod_timer(&lp->hup_timer, lp->hup_timer.expires + HZ); mod_timer(&lp->hup_timer, lp->hup_timer.expires + HZ);
} }
void
isdn_net_autohup()
{
struct list_head *l;
list_for_each(l, &isdn_net_devs) {
isdn_net_dev *p = list_entry(l, isdn_net_dev, global_list);
isdn_net_local *l = &p->local;
if(dev->global_flags & ISDN_GLOBAL_STOPPED ||
ISDN_NET_DIALMODE(*l) == ISDN_NET_DM_OFF) {
isdn_net_hangup(l);
continue;
}
}
}
static void isdn_net_lp_disconnected(isdn_net_local *lp) static void isdn_net_lp_disconnected(isdn_net_local *lp)
{ {
isdn_net_rm_from_bundle(lp); isdn_net_rm_from_bundle(lp);
...@@ -864,6 +847,17 @@ isdn_net_hangup(isdn_net_local *lp) ...@@ -864,6 +847,17 @@ isdn_net_hangup(isdn_net_local *lp)
isdn_net_unbind_channel(lp); isdn_net_unbind_channel(lp);
} }
void
isdn_net_hangup_all()
{
struct list_head *l;
list_for_each(l, &isdn_net_devs) {
isdn_net_dev *p = list_entry(l, isdn_net_dev, global_list);
isdn_net_hangup(&p->local);
}
}
typedef struct { typedef struct {
unsigned short source; unsigned short source;
unsigned short dest; unsigned short dest;
...@@ -2842,6 +2836,9 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg) ...@@ -2842,6 +2836,9 @@ isdn_net_setcfg(isdn_net_ioctl_cfg * cfg)
else { else {
lp->flags |= cfg->dialmode; /* turn on selected bits */ lp->flags |= cfg->dialmode; /* turn on selected bits */
} }
if (lp->flags & ISDN_NET_DM_OFF)
isdn_net_hangup(lp);
if (cfg->chargehup) if (cfg->chargehup)
lp->hupflags |= ISDN_CHARGEHUP; lp->hupflags |= ISDN_CHARGEHUP;
else else
...@@ -3151,9 +3148,6 @@ isdn_net_realrm(isdn_net_dev *p) ...@@ -3151,9 +3148,6 @@ isdn_net_realrm(isdn_net_dev *p)
} }
} }
} }
/* If no more net-devices remain, disable auto-hangup timer */
if (list_empty(&isdn_net_devs))
isdn_timer_ctrl(ISDN_TIMER_NETHANGUP, 0);
restore_flags(flags); restore_flags(flags);
kfree(p); kfree(p);
......
...@@ -42,7 +42,7 @@ extern int isdn_net_getpeer(isdn_net_ioctl_phone *, isdn_net_ioctl_phone *); ...@@ -42,7 +42,7 @@ 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_delphone(isdn_net_ioctl_phone *);
extern int isdn_net_find_icall(int, int, int, setup_parm *); extern int isdn_net_find_icall(int, int, int, setup_parm *);
extern void isdn_net_hangup(isdn_net_local *); extern void isdn_net_hangup(isdn_net_local *);
extern void isdn_net_autohup(void); extern void isdn_net_hangup_all(void);
extern int isdn_net_force_hangup(char *); extern int isdn_net_force_hangup(char *);
extern int isdn_net_force_dial(char *); extern int isdn_net_force_dial(char *);
extern isdn_net_dev *isdn_net_findif(char *); extern isdn_net_dev *isdn_net_findif(char *);
......
...@@ -245,12 +245,10 @@ typedef struct { ...@@ -245,12 +245,10 @@ typedef struct {
#define ISDN_TIMER_MODEMPLUS 2 #define ISDN_TIMER_MODEMPLUS 2
#define ISDN_TIMER_MODEMRING 4 #define ISDN_TIMER_MODEMRING 4
#define ISDN_TIMER_MODEMXMIT 8 #define ISDN_TIMER_MODEMXMIT 8
#define ISDN_TIMER_NETHANGUP 32
#define ISDN_TIMER_CARRIER 256 /* Wait for Carrier */ #define ISDN_TIMER_CARRIER 256 /* Wait for Carrier */
#define ISDN_TIMER_FAST (ISDN_TIMER_MODEMREAD | ISDN_TIMER_MODEMPLUS | \ #define ISDN_TIMER_FAST (ISDN_TIMER_MODEMREAD | ISDN_TIMER_MODEMPLUS | \
ISDN_TIMER_MODEMXMIT) ISDN_TIMER_MODEMXMIT)
#define ISDN_TIMER_SLOW (ISDN_TIMER_MODEMRING | ISDN_TIMER_NETHANGUP | \ #define ISDN_TIMER_SLOW (ISDN_TIMER_MODEMRING | ISDN_TIMER_CARRIER)
ISDN_TIMER_CARRIER)
/* GLOBAL_FLAGS */ /* GLOBAL_FLAGS */
#define ISDN_GLOBAL_STOPPED 1 #define ISDN_GLOBAL_STOPPED 1
......
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