summaryrefslogtreecommitdiff
path: root/torisa.c
diff options
context:
space:
mode:
authormarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2002-08-17 00:28:51 +0000
committermarkster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2002-08-17 00:28:51 +0000
commit9ba4e07b16bf5efa450f9ab3b9f1eaa937d54a82 (patch)
tree82eaee499b6fddeb273ac4614748ec2148d27fd5 /torisa.c
parentcae7000b30d70bede209225c841cf2702c84fb0f (diff)
Version 0.3.0 from FTP
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@98 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'torisa.c')
-rwxr-xr-xtorisa.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/torisa.c b/torisa.c
index 19a81a3..b7c67a8 100755
--- a/torisa.c
+++ b/torisa.c
@@ -132,6 +132,7 @@ static rwlock_t torisa;
static u_char readdata[2][64][ZT_MAX_CHUNKSIZE];
static u_char writedata[2][64][ZT_MAX_CHUNKSIZE];
+static u_char last_ecwrite[2][32];
static int curread;
static unsigned long base;
@@ -441,6 +442,11 @@ static int torisa_startup(struct zt_span *span)
alreadyrunning = span->flags & ZT_FLAG_RUNNING;
+ /* initialize the start value for the last ec buffer */
+ for(i = 0; i < span->channels; i++)
+ {
+ last_ecwrite[tspan - 1][i] = ZT_LIN2X(0,&span->chans[i]);
+ }
crcing = "";
if (card_type == TYPE_T1) { /* if its a T1 card */
if (!alreadyrunning) {
@@ -669,8 +675,8 @@ static struct tasklet_struct torisa_tlet;
static void torisa_tasklet(unsigned long data)
{
- int x;
-
+ int x,y;
+ u_char mychunk[2][ZT_CHUNKSIZE];
taskletrun++;
if (taskletpending) {
taskletexec++;
@@ -679,13 +685,30 @@ static void torisa_tasklet(unsigned long data)
if (spans[1].flags & ZT_FLAG_RUNNING) {
/* Perform echo cancellation */
for (x=0;x<channels_per_span;x++)
- zt_ec_chunk(&spans[1].chans[x], spans[1].chans[x].readchunk, writedata[1-curread][x + channels_per_span]);
+ {
+ for(y = 0; y < ZT_CHUNKSIZE; y++)
+ {
+ mychunk[1][y] = last_ecwrite[1][x];
+ last_ecwrite[1][x] =
+ writedata[1-curread][x + channels_per_span][y];
+ }
+ zt_ec_chunk(&spans[1].chans[x],
+ spans[1].chans[x].readchunk,mychunk[1]);
+ }
zt_receive(&spans[1]);
}
if (spans[0].flags & ZT_FLAG_RUNNING) {
/* Perform echo cancellation */
for (x=0;x<channels_per_span;x++)
- zt_ec_chunk(&spans[0].chans[x], spans[0].chans[x].readchunk, writedata[1-curread][x]);
+ {
+ for(y = 0; y < ZT_CHUNKSIZE; y++)
+ {
+ mychunk[0][y] = last_ecwrite[0][x];
+ last_ecwrite[0][x] = writedata[1-curread][x][y];
+ }
+ zt_ec_chunk(&spans[0].chans[x],
+ spans[0].chans[x].readchunk,mychunk[0]);
+ }
zt_receive(&spans[0]);
}