List Info

Thread: mattf: branch 1.4 r3082 - /branches/1.4/wct4xxp/base.c




mattf: branch 1.4 r3082 - /branches/1.4/wct4xxp/base.c
user name
2007-09-22 15:18:10
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?vi
ew=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
%dn",
-				(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
%dn",
+					(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));
-			}
-		}
-	}
+			}
+		}
 	}
 }
 


_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.c
om--

zaptel-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/zaptel-commits

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )