summaryrefslogtreecommitdiff
path: root/tor2.c
diff options
context:
space:
mode:
authormatteo <matteo@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2003-02-24 06:00:31 +0000
committermatteo <matteo@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2003-02-24 06:00:31 +0000
commitb574418782d181cbd69a271704d8d3f3a3d38fb6 (patch)
treead59f16dc60d92c9e6c8371347a9ab96c09ebc42 /tor2.c
parent29117b53a69aac3bd45cec6138603e36cd265fd0 (diff)
Mon Feb 24 07:00:01 CET 2003
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@150 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'tor2.c')
-rwxr-xr-xtor2.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/tor2.c b/tor2.c
index 8b3e64e..e672296 100755
--- a/tor2.c
+++ b/tor2.c
@@ -648,8 +648,9 @@ static int tor2_rbsbits(struct zt_chan *chan, int bits)
printk("Setting bits to %d on channel %s\n", bits, chan->name);
#endif
if (p->tor->cardtype == TYPE_E1) { /* do it E1 way */
- if (chan->chanpos > 30) return 0; /* cant do this for chan 31 */
+ if (chan->chanpos == 16) return 0;
n = chan->chanpos - 1;
+ if (chan->chanpos > 16) n--;
k = p->span;
b = (n % 15) + 1;
c = p->tor->txsigs[k][b];
@@ -657,7 +658,7 @@ static int tor2_rbsbits(struct zt_chan *chan, int bits)
c &= (15 << m); /* keep the other nibble */
c |= (bits & 15) << (4 - m); /* put our new nibble here */
p->tor->txsigs[k][b] = c;
- /* output them into the chip */
+ /* output them to the chip */
t1out(p->tor,k + 1,0x40 + b,c);
return 0;
}
@@ -1190,10 +1191,10 @@ static void tor2_intr(int irq, void *dev_id, struct pt_regs *regs)
for(k = 1; k <= 4; k++) {
c = t1in(tor,k,0x31 + j);
rxc = c & 15;
- if (rxc != tor->spans[k - 1].chans[j + 15].rxsig) {
+ if (rxc != tor->spans[k - 1].chans[j + 16].rxsig) {
/* Check for changes in received bits */
- if (!(tor->spans[k - 1].chans[j + 15].sig & ZT_SIG_CLEAR))
- zt_rbsbits(&tor->spans[k - 1].chans[j + 15], rxc);
+ if (!(tor->spans[k - 1].chans[j + 16].sig & ZT_SIG_CLEAR))
+ zt_rbsbits(&tor->spans[k - 1].chans[j + 16], rxc);
}
rxc = c >> 4;
if (rxc != tor->spans[k - 1].chans[j].rxsig) {