aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn')
-rw-r--r--drivers/isdn/divert/divert_procfs.c7
-rw-r--r--drivers/isdn/hisax/elsa.c9
-rw-r--r--drivers/isdn/hisax/elsa_ser.c3
-rw-r--r--drivers/isdn/hysdn/hysdn_proclog.c7
-rw-r--r--drivers/isdn/i4l/isdn_common.c13
-rw-r--r--drivers/isdn/pcbit/drv.c6
6 files changed, 27 insertions, 18 deletions
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)
86 struct divert_info *inf; 86 struct divert_info *inf;
87 int len; 87 int len;
88 88
89 if (!*((struct divert_info **) file->private_data)) { 89 if (!(inf = *((struct divert_info **) file->private_data))) {
90 if (file->f_flags & O_NONBLOCK) 90 if (file->f_flags & O_NONBLOCK)
91 return -EAGAIN; 91 return -EAGAIN;
92 interruptible_sleep_on(&(rd_queue)); 92 wait_event_interruptible(rd_queue, (inf =
93 *((struct divert_info **) file->private_data)));
93 } 94 }
94 if (!(inf = *((struct divert_info **) file->private_data))) 95 if (!inf)
95 return (0); 96 return (0);
96 97
97 inf->usage_cnt--; /* new usage count */ 98 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
509set_arcofi(struct IsdnCardState *cs, int bc) { 509set_arcofi(struct IsdnCardState *cs, int bc) {
510 cs->dc.isac.arcofi_bc = bc; 510 cs->dc.isac.arcofi_bc = bc;
511 arcofi_fsm(cs, ARCOFI_START, &ARCOFI_COP_5); 511 arcofi_fsm(cs, ARCOFI_START, &ARCOFI_COP_5);
512 interruptible_sleep_on(&cs->dc.isac.arcofi_wait); 512 wait_event_interruptible(cs->dc.isac.arcofi_wait,
513 cs->dc.isac.arcofi_state == ARCOFI_NOP);
513} 514}
514 515
515static int 516static int
@@ -528,7 +529,8 @@ check_arcofi(struct IsdnCardState *cs)
528 } 529 }
529 cs->dc.isac.arcofi_bc = 0; 530 cs->dc.isac.arcofi_bc = 0;
530 arcofi_fsm(cs, ARCOFI_START, &ARCOFI_VERSION); 531 arcofi_fsm(cs, ARCOFI_START, &ARCOFI_VERSION);
531 interruptible_sleep_on(&cs->dc.isac.arcofi_wait); 532 wait_event_interruptible(cs->dc.isac.arcofi_wait,
533 cs->dc.isac.arcofi_state == ARCOFI_NOP);
532 if (!test_and_clear_bit(FLG_ARCOFI_ERROR, &cs->HW_Flags)) { 534 if (!test_and_clear_bit(FLG_ARCOFI_ERROR, &cs->HW_Flags)) {
533 debugl1(cs, "Arcofi response received %d bytes", cs->dc.isac.mon_rxp); 535 debugl1(cs, "Arcofi response received %d bytes", cs->dc.isac.mon_rxp);
534 p = cs->dc.isac.mon_rx; 536 p = cs->dc.isac.mon_rx;
@@ -595,7 +597,8 @@ check_arcofi(struct IsdnCardState *cs)
595 Elsa_Types[cs->subtyp], 597 Elsa_Types[cs->subtyp],
596 cs->hw.elsa.base + 8); 598 cs->hw.elsa.base + 8);
597 arcofi_fsm(cs, ARCOFI_START, &ARCOFI_XOP_0); 599 arcofi_fsm(cs, ARCOFI_START, &ARCOFI_XOP_0);
598 interruptible_sleep_on(&cs->dc.isac.arcofi_wait); 600 wait_event_interruptible(cs->dc.isac.arcofi_wait,
601 cs->dc.isac.arcofi_state == ARCOFI_NOP);
599 return (1); 602 return (1);
600 } 603 }
601 return (0); 604 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)
573 test_and_clear_bit(BC_FLG_ACTIV, &bcs->Flag); 573 test_and_clear_bit(BC_FLG_ACTIV, &bcs->Flag);
574 bcs->cs->dc.isac.arcofi_bc = st->l1.bc; 574 bcs->cs->dc.isac.arcofi_bc = st->l1.bc;
575 arcofi_fsm(bcs->cs, ARCOFI_START, &ARCOFI_XOP_0); 575 arcofi_fsm(bcs->cs, ARCOFI_START, &ARCOFI_XOP_0);
576 interruptible_sleep_on(&bcs->cs->dc.isac.arcofi_wait); 576 wait_event_interruptible(bcs->cs->dc.isac.arcofi_wait,
577 bcs->cs->dc.isac.arcofi_state == ARCOFI_NOP);
577 bcs->cs->hw.elsa.MFlag = 1; 578 bcs->cs->hw.elsa.MFlag = 1;
578 } else { 579 } else {
579 printk(KERN_WARNING "ElsaSer: unknown pr %x\n", pr); 580 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)
175 int len; 175 int len;
176 hysdn_card *card = PDE_DATA(file_inode(file)); 176 hysdn_card *card = PDE_DATA(file_inode(file));
177 177
178 if (!*((struct log_data **) file->private_data)) { 178 if (!(inf = *((struct log_data **) file->private_data))) {
179 struct procdata *pd = card->proclog; 179 struct procdata *pd = card->proclog;
180 if (file->f_flags & O_NONBLOCK) 180 if (file->f_flags & O_NONBLOCK)
181 return (-EAGAIN); 181 return (-EAGAIN);
182 182
183 interruptible_sleep_on(&(pd->rd_queue)); 183 wait_event_interruptible(pd->rd_queue, (inf =
184 *((struct log_data **) file->private_data)));
184 } 185 }
185 if (!(inf = *((struct log_data **) file->private_data))) 186 if (!inf)
186 return (0); 187 return (0);
187 188
188 inf->usage_cnt--; /* new usage count */ 189 inf->usage_cnt--; /* new usage count */
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c
index 9bb12ba3191f..130f21643154 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
777 return 0; 777 return 0;
778 if (skb_queue_empty(&dev->drv[di]->rpqueue[channel])) { 778 if (skb_queue_empty(&dev->drv[di]->rpqueue[channel])) {
779 if (sleep) 779 if (sleep)
780 interruptible_sleep_on(sleep); 780 wait_event_interruptible(*sleep,
781 !skb_queue_empty(&dev->drv[di]->rpqueue[channel]));
781 else 782 else
782 return 0; 783 return 0;
783 } 784 }
@@ -1072,7 +1073,8 @@ isdn_read(struct file *file, char __user *buf, size_t count, loff_t *off)
1072 retval = -EAGAIN; 1073 retval = -EAGAIN;
1073 goto out; 1074 goto out;
1074 } 1075 }
1075 interruptible_sleep_on(&(dev->info_waitq)); 1076 wait_event_interruptible(dev->info_waitq,
1077 file->private_data);
1076 } 1078 }
1077 p = isdn_statstr(); 1079 p = isdn_statstr();
1078 file->private_data = NULL; 1080 file->private_data = NULL;
@@ -1128,7 +1130,8 @@ isdn_read(struct file *file, char __user *buf, size_t count, loff_t *off)
1128 retval = -EAGAIN; 1130 retval = -EAGAIN;
1129 goto out; 1131 goto out;
1130 } 1132 }
1131 interruptible_sleep_on(&(dev->drv[drvidx]->st_waitq)); 1133 wait_event_interruptible(dev->drv[drvidx]->st_waitq,
1134 dev->drv[drvidx]->stavail);
1132 } 1135 }
1133 if (dev->drv[drvidx]->interface->readstat) { 1136 if (dev->drv[drvidx]->interface->readstat) {
1134 if (count > dev->drv[drvidx]->stavail) 1137 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)
1188 goto out; 1191 goto out;
1189 } 1192 }
1190 chidx = isdn_minor2chan(minor); 1193 chidx = isdn_minor2chan(minor);
1191 while ((retval = isdn_writebuf_stub(drvidx, chidx, buf, count)) == 0) 1194 wait_event_interruptible(dev->drv[drvidx]->snd_waitq[chidx],
1192 interruptible_sleep_on(&dev->drv[drvidx]->snd_waitq[chidx]); 1195 (retval = isdn_writebuf_stub(drvidx, chidx, buf, count)));
1193 goto out; 1196 goto out;
1194 } 1197 }
1195 if (minor <= ISDN_MINOR_CTRLMAX) { 1198 if (minor <= ISDN_MINOR_CTRLMAX) {
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)
796#endif 796#endif
797 dev = (struct pcbit_dev *) ptr; 797 dev = (struct pcbit_dev *) ptr;
798 798
799 dev->l2_state = L2_DOWN;
799 wake_up_interruptible(&dev->set_running_wq); 800 wake_up_interruptible(&dev->set_running_wq);
800} 801}
801 802
@@ -818,7 +819,8 @@ static int set_protocol_running(struct pcbit_dev *dev)
818 819
819 add_timer(&dev->set_running_timer); 820 add_timer(&dev->set_running_timer);
820 821
821 interruptible_sleep_on(&dev->set_running_wq); 822 wait_event(dev->set_running_wq, dev->l2_state == L2_RUNNING ||
823 dev->l2_state == L2_DOWN);
822 824
823 del_timer(&dev->set_running_timer); 825 del_timer(&dev->set_running_timer);
824 826
@@ -842,8 +844,6 @@ static int set_protocol_running(struct pcbit_dev *dev)
842 printk(KERN_DEBUG "pcbit: initialization failed\n"); 844 printk(KERN_DEBUG "pcbit: initialization failed\n");
843 printk(KERN_DEBUG "pcbit: firmware not loaded\n"); 845 printk(KERN_DEBUG "pcbit: firmware not loaded\n");
844 846
845 dev->l2_state = L2_DOWN;
846
847#ifdef DEBUG 847#ifdef DEBUG
848 printk(KERN_DEBUG "Bank3 = %02x\n", 848 printk(KERN_DEBUG "Bank3 = %02x\n",
849 readb(dev->sh_mem + BANK3)); 849 readb(dev->sh_mem + BANK3));