diff options
author | Shaun Ruffell <sruffell@digium.com> | 2010-10-20 12:23:06 +0000 |
---|---|---|
committer | Shaun Ruffell <sruffell@digium.com> | 2010-10-20 12:23:06 +0000 |
commit | 959478cbaaf1de7db9c4099d92cf23bfba7d11b8 (patch) | |
tree | 3addf8af9fdff5337a4164d9a2fb3467e1e93254 /drivers/dahdi | |
parent | 069d0eb4144b1444ba95559df699e4990b89e33d (diff) |
dahdi: Add compile time DAHDI_ECHOCAN_PROCESS_TX option.
Add optional interface to allow software echo cans to process the
transmitted samples. Can be used for things like DC removal.
I used the following patches uploaded by biohumanoid but changed the
name of 'echocan_hpf_tx' to 'echoan_process_tx and put the changes
behind a compile time option.
(issue #13562)
Reported by: biohumanoid
Patches:
kernel.h.patch uploaded by biohumanoid (license 459)
dahdi-base.c.#2.patch uploaded by biohumanoid (license 459)
Signed-off-by: Shaun Ruffell <sruffell@digium.com>
Acked-by: Kinsey Moore <kmoore@digium.com>
Acked-by: Russ Meyerriecks <rmeyerriecks@digium.com>
git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9442 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi')
-rw-r--r-- | drivers/dahdi/dahdi-base.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c index 2fcb5ec..6134192 100644 --- a/drivers/dahdi/dahdi-base.c +++ b/drivers/dahdi/dahdi-base.c @@ -2330,6 +2330,21 @@ static ssize_t dahdi_chan_write(struct file *file, const char __user *usrbuf, } chan->writen[res] = amnt; } +#ifdef CONFIG_DAHDI_ECHOCAN_PROCESS_TX + if ((chan->ec_state) && + (ECHO_MODE_ACTIVE == chan->ec_state->status.mode) && + (chan->ec_state->ops->echocan_process_tx)) { + struct ec_state *const ec_state = chan->ec_state; + for (x = 0; x < chan->writen[res]; ++x) { + short tx; + tx = DAHDI_XLAW(chan->writebuf[res][x], chan); + ec_state->ops->echocan_process_tx(ec_state, + &tx, 1); + chan->writebuf[res][x] = DAHDI_LIN2X((int) tx, + chan); + } + } +#endif chan->writeidx[res] = 0; if (chan->flags & DAHDI_FLAG_FCS) calc_fcs(chan, res); |