From b574418782d181cbd69a271704d8d3f3a3d38fb6 Mon Sep 17 00:00:00 2001 From: matteo Date: Mon, 24 Feb 2003 06:00:31 +0000 Subject: Mon Feb 24 07:00:01 CET 2003 git-svn-id: http://svn.digium.com/svn/zaptel/trunk@150 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- tor2.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'tor2.c') 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) { -- cgit v1.2.3