diff options
Diffstat (limited to 'drivers/isdn')
-rw-r--r-- | drivers/isdn/act2000/module.c | 2 | ||||
-rw-r--r-- | drivers/isdn/divert/divert_procfs.c | 7 | ||||
-rw-r--r-- | drivers/isdn/hisax/elsa.c | 9 | ||||
-rw-r--r-- | drivers/isdn/hisax/elsa_ser.c | 3 | ||||
-rw-r--r-- | drivers/isdn/hysdn/hysdn_proclog.c | 7 | ||||
-rw-r--r-- | drivers/isdn/i4l/isdn_common.c | 15 | ||||
-rw-r--r-- | drivers/isdn/i4l/isdn_ppp.c | 61 | ||||
-rw-r--r-- | drivers/isdn/pcbit/drv.c | 6 | ||||
-rw-r--r-- | drivers/isdn/sc/init.c | 4 |
9 files changed, 72 insertions, 42 deletions
diff --git a/drivers/isdn/act2000/module.c b/drivers/isdn/act2000/module.c index b4147c0b14b7..c3a1b061838d 100644 --- a/drivers/isdn/act2000/module.c +++ b/drivers/isdn/act2000/module.c @@ -796,7 +796,7 @@ static void __exit act2000_exit(void) act2000_card *last; while (card) { unregister_card(card); - del_timer(&card->ptimer); + del_timer_sync(&card->ptimer); card = card->next; } card = cards; diff --git a/drivers/isdn/divert/divert_procfs.c b/drivers/isdn/divert/divert_procfs.c index fb4f1bac0133..1c5dc345e7c5 100644 --- a/drivers/isdn/divert/divert_procfs.c +++ b/drivers/isdn/divert/divert_procfs.c @@ -86,12 +86,13 @@ isdn_divert_read(struct file *file, char __user *buf, size_t count, loff_t *off) struct divert_info *inf; int len; - if (!*((struct divert_info **) file->private_data)) { + if (!(inf = *((struct divert_info **) file->private_data))) { if (file->f_flags & O_NONBLOCK) return -EAGAIN; - interruptible_sleep_on(&(rd_queue)); + wait_event_interruptible(rd_queue, (inf = + *((struct divert_info **) file->private_data))); } - if (!(inf = *((struct divert_info **) file->private_data))) + if (!inf) return (0); inf->usage_cnt--; /* new usage count */ diff --git a/drivers/isdn/hisax/elsa.c b/drivers/isdn/hisax/elsa.c index 2be1c8a3bb5f..d8ef64da26f1 100644 --- a/drivers/isdn/hisax/elsa.c +++ b/drivers/isdn/hisax/elsa.c @@ -509,7 +509,8 @@ static void set_arcofi(struct IsdnCardState *cs, int bc) { cs->dc.isac.arcofi_bc = bc; arcofi_fsm(cs, ARCOFI_START, &ARCOFI_COP_5); - interruptible_sleep_on(&cs->dc.isac.arcofi_wait); + wait_event_interruptible(cs->dc.isac.arcofi_wait, + cs->dc.isac.arcofi_state == ARCOFI_NOP); } static int @@ -528,7 +529,8 @@ check_arcofi(struct IsdnCardState *cs) } cs->dc.isac.arcofi_bc = 0; arcofi_fsm(cs, ARCOFI_START, &ARCOFI_VERSION); - interruptible_sleep_on(&cs->dc.isac.arcofi_wait); + wait_event_interruptible(cs->dc.isac.arcofi_wait, + cs->dc.isac.arcofi_state == ARCOFI_NOP); if (!test_and_clear_bit(FLG_ARCOFI_ERROR, &cs->HW_Flags)) { debugl1(cs, "Arcofi response received %d bytes", cs->dc.isac.mon_rxp); p = cs->dc.isac.mon_rx; @@ -595,7 +597,8 @@ check_arcofi(struct IsdnCardState *cs) Elsa_Types[cs->subtyp], cs->hw.elsa.base + 8); arcofi_fsm(cs, ARCOFI_START, &ARCOFI_XOP_0); - interruptible_sleep_on(&cs->dc.isac.arcofi_wait); + wait_event_interruptible(cs->dc.isac.arcofi_wait, + cs->dc.isac.arcofi_state == ARCOFI_NOP); return (1); } return (0); diff --git a/drivers/isdn/hisax/elsa_ser.c b/drivers/isdn/hisax/elsa_ser.c index 3f84dd8f1757..a2a358c1dc8e 100644 --- a/drivers/isdn/hisax/elsa_ser.c +++ b/drivers/isdn/hisax/elsa_ser.c @@ -573,7 +573,8 @@ modem_l2l1(struct PStack *st, int pr, void *arg) test_and_clear_bit(BC_FLG_ACTIV, &bcs->Flag); bcs->cs->dc.isac.arcofi_bc = st->l1.bc; arcofi_fsm(bcs->cs, ARCOFI_START, &ARCOFI_XOP_0); - interruptible_sleep_on(&bcs->cs->dc.isac.arcofi_wait); + wait_event_interruptible(bcs->cs->dc.isac.arcofi_wait, + bcs->cs->dc.isac.arcofi_state == ARCOFI_NOP); bcs->cs->hw.elsa.MFlag = 1; } else { printk(KERN_WARNING "ElsaSer: unknown pr %x\n", pr); diff --git a/drivers/isdn/hysdn/hysdn_proclog.c b/drivers/isdn/hysdn/hysdn_proclog.c index b61e8d5e84ad..7b5fd8fb1761 100644 --- a/drivers/isdn/hysdn/hysdn_proclog.c +++ b/drivers/isdn/hysdn/hysdn_proclog.c @@ -175,14 +175,15 @@ hysdn_log_read(struct file *file, char __user *buf, size_t count, loff_t *off) int len; hysdn_card *card = PDE_DATA(file_inode(file)); - if (!*((struct log_data **) file->private_data)) { + if (!(inf = *((struct log_data **) file->private_data))) { struct procdata *pd = card->proclog; if (file->f_flags & O_NONBLOCK) return (-EAGAIN); - interruptible_sleep_on(&(pd->rd_queue)); + wait_event_interruptible(pd->rd_queue, (inf = + *((struct log_data **) file->private_data))); } - if (!(inf = *((struct log_data **) file->private_data))) + if (!inf) return (0); inf->usage_cnt--; /* new usage count */ diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c index 9bb12ba3191f..9b856e1890d1 100644 --- a/drivers/isdn/i4l/isdn_common.c +++ b/drivers/isdn/i4l/isdn_common.c @@ -777,7 +777,8 @@ isdn_readbchan(int di, int channel, u_char *buf, u_char *fp, int len, wait_queue return 0; if (skb_queue_empty(&dev->drv[di]->rpqueue[channel])) { if (sleep) - interruptible_sleep_on(sleep); + wait_event_interruptible(*sleep, + !skb_queue_empty(&dev->drv[di]->rpqueue[channel])); else return 0; } @@ -1072,7 +1073,8 @@ isdn_read(struct file *file, char __user *buf, size_t count, loff_t *off) retval = -EAGAIN; goto out; } - interruptible_sleep_on(&(dev->info_waitq)); + wait_event_interruptible(dev->info_waitq, + file->private_data); } p = isdn_statstr(); file->private_data = NULL; @@ -1128,7 +1130,8 @@ isdn_read(struct file *file, char __user *buf, size_t count, loff_t *off) retval = -EAGAIN; goto out; } - interruptible_sleep_on(&(dev->drv[drvidx]->st_waitq)); + wait_event_interruptible(dev->drv[drvidx]->st_waitq, + dev->drv[drvidx]->stavail); } if (dev->drv[drvidx]->interface->readstat) { if (count > dev->drv[drvidx]->stavail) @@ -1188,8 +1191,8 @@ isdn_write(struct file *file, const char __user *buf, size_t count, loff_t *off) goto out; } chidx = isdn_minor2chan(minor); - while ((retval = isdn_writebuf_stub(drvidx, chidx, buf, count)) == 0) - interruptible_sleep_on(&dev->drv[drvidx]->snd_waitq[chidx]); + wait_event_interruptible(dev->drv[drvidx]->snd_waitq[chidx], + (retval = isdn_writebuf_stub(drvidx, chidx, buf, count))); goto out; } if (minor <= ISDN_MINOR_CTRLMAX) { @@ -2378,7 +2381,7 @@ static void __exit isdn_exit(void) } isdn_tty_exit(); unregister_chrdev(ISDN_MAJOR, "isdn"); - del_timer(&dev->timer); + del_timer_sync(&dev->timer); /* call vfree with interrupts enabled, else it will hang */ vfree(dev); printk(KERN_NOTICE "ISDN-subsystem unloaded\n"); diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c index 38ceac5053a0..a5da511e3c9a 100644 --- a/drivers/isdn/i4l/isdn_ppp.c +++ b/drivers/isdn/i4l/isdn_ppp.c @@ -378,10 +378,15 @@ isdn_ppp_release(int min, struct file *file) is->slcomp = NULL; #endif #ifdef CONFIG_IPPP_FILTER - kfree(is->pass_filter); - is->pass_filter = NULL; - kfree(is->active_filter); - is->active_filter = NULL; + if (is->pass_filter) { + sk_unattached_filter_destroy(is->pass_filter); + is->pass_filter = NULL; + } + + if (is->active_filter) { + sk_unattached_filter_destroy(is->active_filter); + is->active_filter = NULL; + } #endif /* TODO: if this was the previous master: link the stuff to the new master */ @@ -629,25 +634,41 @@ isdn_ppp_ioctl(int min, struct file *file, unsigned int cmd, unsigned long arg) #ifdef CONFIG_IPPP_FILTER case PPPIOCSPASS: { + struct sock_fprog fprog; struct sock_filter *code; - int len = get_filter(argp, &code); + int err, len = get_filter(argp, &code); + if (len < 0) return len; - kfree(is->pass_filter); - is->pass_filter = code; - is->pass_len = len; - break; + + fprog.len = len; + fprog.filter = code; + + if (is->pass_filter) + sk_unattached_filter_destroy(is->pass_filter); + err = sk_unattached_filter_create(&is->pass_filter, &fprog); + kfree(code); + + return err; } case PPPIOCSACTIVE: { + struct sock_fprog fprog; struct sock_filter *code; - int len = get_filter(argp, &code); + int err, len = get_filter(argp, &code); + if (len < 0) return len; - kfree(is->active_filter); - is->active_filter = code; - is->active_len = len; - break; + + fprog.len = len; + fprog.filter = code; + + if (is->active_filter) + sk_unattached_filter_destroy(is->active_filter); + err = sk_unattached_filter_create(&is->active_filter, &fprog); + kfree(code); + + return err; } #endif /* CONFIG_IPPP_FILTER */ default: @@ -1147,14 +1168,14 @@ isdn_ppp_push_higher(isdn_net_dev *net_dev, isdn_net_local *lp, struct sk_buff * } if (is->pass_filter - && sk_run_filter(skb, is->pass_filter) == 0) { + && SK_RUN_FILTER(is->pass_filter, skb) == 0) { if (is->debug & 0x2) printk(KERN_DEBUG "IPPP: inbound frame filtered.\n"); kfree_skb(skb); return; } if (!(is->active_filter - && sk_run_filter(skb, is->active_filter) == 0)) { + && SK_RUN_FILTER(is->active_filter, skb) == 0)) { if (is->debug & 0x2) printk(KERN_DEBUG "IPPP: link-active filter: resetting huptimer.\n"); lp->huptimer = 0; @@ -1293,14 +1314,14 @@ isdn_ppp_xmit(struct sk_buff *skb, struct net_device *netdev) } if (ipt->pass_filter - && sk_run_filter(skb, ipt->pass_filter) == 0) { + && SK_RUN_FILTER(ipt->pass_filter, skb) == 0) { if (ipt->debug & 0x4) printk(KERN_DEBUG "IPPP: outbound frame filtered.\n"); kfree_skb(skb); goto unlock; } if (!(ipt->active_filter - && sk_run_filter(skb, ipt->active_filter) == 0)) { + && SK_RUN_FILTER(ipt->active_filter, skb) == 0)) { if (ipt->debug & 0x4) printk(KERN_DEBUG "IPPP: link-active filter: resetting huptimer.\n"); lp->huptimer = 0; @@ -1490,9 +1511,9 @@ int isdn_ppp_autodial_filter(struct sk_buff *skb, isdn_net_local *lp) } drop |= is->pass_filter - && sk_run_filter(skb, is->pass_filter) == 0; + && SK_RUN_FILTER(is->pass_filter, skb) == 0; drop |= is->active_filter - && sk_run_filter(skb, is->active_filter) == 0; + && SK_RUN_FILTER(is->active_filter, skb) == 0; skb_push(skb, IPPP_MAX_HEADER - 4); return drop; diff --git a/drivers/isdn/pcbit/drv.c b/drivers/isdn/pcbit/drv.c index 1eaf62273903..f02cc506fbfa 100644 --- a/drivers/isdn/pcbit/drv.c +++ b/drivers/isdn/pcbit/drv.c @@ -796,6 +796,7 @@ static void set_running_timeout(unsigned long ptr) #endif dev = (struct pcbit_dev *) ptr; + dev->l2_state = L2_DOWN; wake_up_interruptible(&dev->set_running_wq); } @@ -818,7 +819,8 @@ static int set_protocol_running(struct pcbit_dev *dev) add_timer(&dev->set_running_timer); - interruptible_sleep_on(&dev->set_running_wq); + wait_event(dev->set_running_wq, dev->l2_state == L2_RUNNING || + dev->l2_state == L2_DOWN); del_timer(&dev->set_running_timer); @@ -842,8 +844,6 @@ static int set_protocol_running(struct pcbit_dev *dev) printk(KERN_DEBUG "pcbit: initialization failed\n"); printk(KERN_DEBUG "pcbit: firmware not loaded\n"); - dev->l2_state = L2_DOWN; - #ifdef DEBUG printk(KERN_DEBUG "Bank3 = %02x\n", readb(dev->sh_mem + BANK3)); diff --git a/drivers/isdn/sc/init.c b/drivers/isdn/sc/init.c index 92acc81f844d..d6f19b168e8a 100644 --- a/drivers/isdn/sc/init.c +++ b/drivers/isdn/sc/init.c @@ -390,8 +390,8 @@ static void __exit sc_exit(void) /* * kill the timers */ - del_timer(&(sc_adapter[i]->reset_timer)); - del_timer(&(sc_adapter[i]->stat_timer)); + del_timer_sync(&(sc_adapter[i]->reset_timer)); + del_timer_sync(&(sc_adapter[i]->stat_timer)); /* * Tell I4L we're toast |