summaryrefslogtreecommitdiff
path: root/wct1xxp.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 /wct1xxp.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 'wct1xxp.c')
-rwxr-xr-xwct1xxp.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/wct1xxp.c b/wct1xxp.c
index 2df2bde..a90a19b 100755
--- a/wct1xxp.c
+++ b/wct1xxp.c
@@ -555,13 +555,15 @@ static int t1xxp_rbsbits(struct zt_chan *chan, int bits)
/* Byte offset */
spin_lock_irqsave(&wc->lock, flags);
if (wc->ise1) {
- if (chan->chanpos > 15) {
- mask = (bits | (wc->chans[chan->chanpos - 15].txsig << 4));
- __t1_set_reg(wc, 0x41 + chan->chanpos - 15, mask);
- } else if (chan->chanpos < 15) {
- mask = ((bits << 4) | wc->chans[chan->chanpos + 15].txsig);
- __t1_set_reg(wc, 0x41 + chan->chanpos, mask);
+ if (chan->chanpos < 16) {
+ mask = ((bits << 4) | wc->chans[chan->chanpos - 1 + 16].txsig);
+ __t1_set_reg(wc, 0x40 + chan->chanpos, mask);
+ }
+ else if (chan->chanpos > 16) {
+ mask = (bits | (wc->chans[chan->chanpos - 1 - 16].txsig << 4));
+ __t1_set_reg(wc, 0x40 + chan->chanpos - 16, mask);
}
+ wc->chans[chan->chanpos - 1].txsig = bits;
} else {
b = (chan->chanpos - 1) / 8;
o = (chan->chanpos - 1) % 8;
@@ -950,13 +952,13 @@ static void __t1xxp_check_sigbits(struct t1xxp *wc, int x)
if (wc->ise1) {
/* Read 5 registers at a time, loading 10 channels at a time */
- for (i = (x *5); i < (x * 5) + 5; i++) {
+ for (i = (x * 5); i < (x * 5) + 5; i++) {
a = __t1_get_reg(wc, 0x31 + i);
/* Get high channel in low bits */
rxs = (a & 0xf);
- if (!(wc->chans[i+15].sig & ZT_SIG_CLEAR)) {
- if (wc->chans[i+15].rxsig != rxs)
- zt_rbsbits(&wc->chans[i+15], rxs);
+ if (!(wc->chans[i+16].sig & ZT_SIG_CLEAR)) {
+ if (wc->chans[i+16].rxsig != rxs)
+ zt_rbsbits(&wc->chans[i+16], rxs);
}
rxs = (a >> 4) & 0xf;
if (!(wc->chans[i].sig & ZT_SIG_CLEAR)) {