summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/dahdi/dahdi-base.c15
-rw-r--r--include/dahdi/dahdi_config.h7
-rw-r--r--include/dahdi/kernel.h9
3 files changed, 31 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);
diff --git a/include/dahdi/dahdi_config.h b/include/dahdi/dahdi_config.h
index b0592f3..d304b6e 100644
--- a/include/dahdi/dahdi_config.h
+++ b/include/dahdi/dahdi_config.h
@@ -126,6 +126,13 @@
*/
/* #define CONFIG_DAHDI_NO_ECHOCAN_DISABLE */
+/*
+ * Define if you would like to allow software echocans to process the tx audio
+ * in addition to the rx audio. Used for things like DC removal.
+ *
+ */
+/* #define CONFIG_DAHDI_ECHOCAN_PROCESS_TX */
+
/*
* Uncomment if you happen have an early TDM400P Rev H which
* sometimes forgets its PCI ID to have wcfxs match essentially all
diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h
index b7b2c02..6edddbd 100644
--- a/include/dahdi/kernel.h
+++ b/include/dahdi/kernel.h
@@ -257,6 +257,15 @@ struct dahdi_echocan_ops {
* \return Nothing.
*/
void (*echocan_NLP_toggle)(struct dahdi_echocan_state *ec, unsigned int enable);
+
+#ifdef CONFIG_DAHDI_ECHOCAN_PROCESS_TX
+ /*! \brief Process an array of TX audio samples.
+ *
+ * \return Nothing.
+ */
+ void (*echocan_process_tx)(struct dahdi_echocan_state *ec,
+ short *tx, u32 size);
+#endif
};
/*! A factory for creating instances of software echo cancelers to be used on DAHDI channels. */