summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2010-12-21 16:09:17 +0000
committerShaun Ruffell <sruffell@digium.com>2010-12-21 16:09:17 +0000
commit2519d0d771d440a567ca2370c396f0663faaf888 (patch)
treee91d0b78779d2c797106eb28b563ced95cbd2bd3 /drivers
parent8ea4d81f2c891424704e4400ef609f722e9dc51e (diff)
dahdi: Remove interruptible_sleep_on() calls for WINK/FLASH.
Makes it a little more clear what it is we're really waiting for. Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Russ Meyerreicks <rmeyerreicks@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9547 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers')
-rw-r--r--drivers/dahdi/dahdi-base.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c
index a29a63f..b1b09ec 100644
--- a/drivers/dahdi/dahdi-base.c
+++ b/drivers/dahdi/dahdi-base.c
@@ -5574,6 +5574,18 @@ static void set_echocan_fax_mode(struct dahdi_chan *chan, unsigned int channo, c
}
}
+static inline bool
+is_txstate(struct dahdi_chan *const chan, const int txstate)
+{
+ bool ret;
+ unsigned long flags;
+
+ spin_lock_irqsave(&chan->lock, flags);
+ ret = (txstate == chan->txstate);
+ spin_unlock_irqrestore(&chan->lock, flags);
+ return ret;
+}
+
static int dahdi_chan_ioctl(struct file *file, unsigned int cmd, unsigned long data)
{
struct dahdi_chan *const chan = chan_from_file(file);
@@ -5905,7 +5917,8 @@ static int dahdi_chan_ioctl(struct file *file, unsigned int cmd, unsigned long d
spin_unlock_irqrestore(&chan->lock, flags);
if (file->f_flags & O_NONBLOCK)
return -EINPROGRESS;
- interruptible_sleep_on(&chan->txstateq);
+ wait_event_interruptible(chan->txstateq,
+ is_txstate(chan, DAHDI_TXSIG_ONHOOK));
if (signal_pending(current))
return -ERESTARTSYS;
break;
@@ -5919,7 +5932,8 @@ static int dahdi_chan_ioctl(struct file *file, unsigned int cmd, unsigned long d
spin_unlock_irqrestore(&chan->lock, flags);
if (file->f_flags & O_NONBLOCK)
return -EINPROGRESS;
- interruptible_sleep_on(&chan->txstateq);
+ wait_event_interruptible(chan->txstateq,
+ is_txstate(chan, DAHDI_TXSIG_OFFHOOK));
if (signal_pending(current))
return -ERESTARTSYS;
break;