static void torisa_tasklet(unsigned long data) { int x,y; u_char mychunk[2][ZT_CHUNKSIZE]; taskletrun++; if (taskletpending) { taskletexec++; /* Perform receive data calculations. Reverse to run most likely master last */ if (spans[1].flags & ZT_FLAG_RUNNING) { /* Perform echo cancellation */ for (x=0;x<channels_per_span;x++) { 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++) { 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]); } /* Prepare next set for transmission */ if (spans[1].flags & ZT_FLAG_RUNNING) zt_transmit(&spans[1]); if (spans[0].flags & ZT_FLAG_RUNNING) zt_transmit(&spans[0]); } taskletpending = 0; }
static void ztdummy_timer(void *arg) { struct ztdummy_state *ztd; ztd = ddi_get_soft_state(ztdummy_statep, 0); zt_receive(&ztd->span); zt_transmit(&ztd->span); }