[zaptel-commits] mattf: branch 1.4 r3082 - /branches/1.4/wct4xxp/base.c
SVN commits to the Zaptel project
zaptel-commits at lists.digium.com
Sat Sep 22 15:18:10 CDT 2007
Author: mattf
Date: Sat Sep 22 15:18:10 2007
New Revision: 3082
URL: http://svn.digium.com/view/zaptel?view=rev&rev=3082
Log:
Make some improvements in how we do event retrieval
Modified:
branches/1.4/wct4xxp/base.c
Modified: branches/1.4/wct4xxp/base.c
URL: http://svn.digium.com/view/zaptel/branches/1.4/wct4xxp/base.c?view=diff&rev=3082&r1=3081&r2=3082
==============================================================================
--- branches/1.4/wct4xxp/base.c (original)
+++ branches/1.4/wct4xxp/base.c Sat Sep 22 15:18:10 2007
@@ -725,43 +725,41 @@
static void t4_check_vpm450(struct t4 *wc)
{
int channel, tone, start, span;
-#if 1
- /* There's no point checking the interrupt, it's pointless. */
+
if (vpm450m_checkirq(wc->vpm450m)) {
-#endif
- while(vpm450m_getdtmf(wc->vpm450m, &channel, &tone, &start)) {
- span = channel & 0x3;
- channel >>= 2;
- if (!wc->t1e1)
- channel -= 5;
- else
- channel -= 1;
- if (unlikely(debug))
- printk("Got tone %s of '%c' on channel %d of span %d\n",
- (start ? "START" : "STOP"), tone, channel, span + 1);
- if (test_bit(channel, &wc->tspans[span]->dtmfmask) && (tone != 'u')) {
- if (start) {
- /* The octasic is supposed to mute us, but... Yah, you
- guessed it. */
- if (test_bit(channel, &wc->tspans[span]->dtmfmutemask)) {
- unsigned long flags;
- struct zt_chan *chan = &wc->tspans[span]->span.chans[channel];
- int y;
- spin_lock_irqsave(&chan->lock, flags);
- for (y=0;y<chan->numbufs;y++) {
- if ((chan->inreadbuf > -1) && (chan->readidx[y]))
- memset(chan->readbuf[chan->inreadbuf], ZT_XLAW(0, chan), chan->readidx[y]);
+ while(vpm450m_getdtmf(wc->vpm450m, &channel, &tone, &start)) {
+ span = channel & 0x3;
+ channel >>= 2;
+ if (!wc->t1e1)
+ channel -= 5;
+ else
+ channel -= 1;
+ if (unlikely(debug))
+ printk("Got tone %s of '%c' on channel %d of span %d\n",
+ (start ? "START" : "STOP"), tone, channel, span + 1);
+ if (test_bit(channel, &wc->tspans[span]->dtmfmask) && (tone != 'u')) {
+ if (start) {
+ /* The octasic is supposed to mute us, but... Yah, you
+ guessed it. */
+ if (test_bit(channel, &wc->tspans[span]->dtmfmutemask)) {
+ unsigned long flags;
+ struct zt_chan *chan = &wc->tspans[span]->span.chans[channel];
+ int y;
+ spin_lock_irqsave(&chan->lock, flags);
+ for (y=0;y<chan->numbufs;y++) {
+ if ((chan->inreadbuf > -1) && (chan->readidx[y]))
+ memset(chan->readbuf[chan->inreadbuf], ZT_XLAW(0, chan), chan->readidx[y]);
+ }
+ spin_unlock_irqrestore(&chan->lock, flags);
}
- spin_unlock_irqrestore(&chan->lock, flags);
+ set_bit(channel, &wc->tspans[span]->dtmfactive);
+ zt_qevent_lock(&wc->tspans[span]->span.chans[channel], (ZT_EVENT_DTMFDOWN | tone));
+ } else {
+ clear_bit(channel, &wc->tspans[span]->dtmfactive);
+ zt_qevent_lock(&wc->tspans[span]->span.chans[channel], (ZT_EVENT_DTMFUP | tone));
}
- set_bit(channel, &wc->tspans[span]->dtmfactive);
- zt_qevent_lock(&wc->tspans[span]->span.chans[channel], (ZT_EVENT_DTMFDOWN | tone));
- } else {
- clear_bit(channel, &wc->tspans[span]->dtmfactive);
- zt_qevent_lock(&wc->tspans[span]->span.chans[channel], (ZT_EVENT_DTMFUP | tone));
- }
- }
- }
+ }
+ }
}
}
More information about the zaptel-commits
mailing list