From 13179eb2fc4b2384550a1681513986584634bfd6 Mon Sep 17 00:00:00 2001 From: kpfleming Date: Thu, 1 Feb 2007 00:55:41 +0000 Subject: add support for Digium's High Performance Echo Canceller rework the top-level Makefile so kernel 2.6 modules are built by a dedicated Makefile git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@2076 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- kb1ec.h | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) (limited to 'kb1ec.h') diff --git a/kb1ec.h b/kb1ec.h index 5d614a8..b9e1cd9 100644 --- a/kb1ec.h +++ b/kb1ec.h @@ -74,7 +74,7 @@ typedef struct { } echo_can_cb_s; /* Echo canceller definition */ -typedef struct { +struct echo_can_state { /* an arbitrary ID for this echo can - this really should be settable from the calling channel... */ int id; @@ -139,7 +139,16 @@ typedef struct { int avg_Lu_i_ok; #endif -} echo_can_state_t; +}; + +static void echo_can_init(void) +{ + printk("Zaptel Echo Canceller: KB1%s\n", ZAPTEL_ECHO_AGGRESSIVE); +} + +static void echo_can_shutdown(void) +{ +} static inline void init_cb_s(echo_can_cb_s *cb, int len, void *where) { @@ -167,13 +176,13 @@ static inline short get_cc_s(echo_can_cb_s *cb, int pos) return cb->buf_d[cb->idx_d + pos]; } -static inline void init_cc(echo_can_state_t *ec, int N, int maxy, int maxu) +static inline void init_cc(struct echo_can_state *ec, int N, int maxy, int maxu) { void *ptr = ec; unsigned long tmp; /* Double-word align past end of state */ - ptr += sizeof(echo_can_state_t); + ptr += sizeof(struct echo_can_state); tmp = (unsigned long)ptr; tmp += 3; tmp &= ~3L; @@ -232,12 +241,12 @@ static inline void init_cc(echo_can_state_t *ec, int N, int maxy, int maxu) } -static inline void echo_can_free(echo_can_state_t *ec) +static inline void echo_can_free(struct echo_can_state *ec) { FREE(ec); } -static inline short echo_can_update(echo_can_state_t *ec, short iref, short isig) +static inline short echo_can_update(struct echo_can_state *ec, short iref, short isig) { /* Declare local variables that are used more than once */ @@ -515,9 +524,9 @@ static inline short echo_can_update(echo_can_state_t *ec, short iref, short isig return u; } -static inline echo_can_state_t *echo_can_create(int len, int adaption_mode) +static inline struct echo_can_state *echo_can_create(int len, int adaption_mode) { - echo_can_state_t *ec; + struct echo_can_state *ec; int maxy; int maxu; maxy = len + DEFAULT_M; @@ -528,7 +537,7 @@ static inline echo_can_state_t *echo_can_create(int len, int adaption_mode) maxy = (1 << DEFAULT_SIGMA_LY_I); if (maxu < (1 << DEFAULT_SIGMA_LU_I)) maxu = (1 << DEFAULT_SIGMA_LU_I); - ec = (echo_can_state_t *)MALLOC(sizeof(echo_can_state_t) + + ec = (struct echo_can_state *)MALLOC(sizeof(struct echo_can_state) + 4 + /* align */ sizeof(int) * len + /* a_i */ sizeof(short) * len + /* a_s */ @@ -537,7 +546,7 @@ static inline echo_can_state_t *echo_can_create(int len, int adaption_mode) 2 * sizeof(short) * (maxu) + /* u_s */ 2 * sizeof(short) * len); /* y_tilde_s */ if (ec) { - memset(ec, 0, sizeof(echo_can_state_t) + + memset(ec, 0, sizeof(struct echo_can_state) + 4 + /* align */ sizeof(int) * len + /* a_i */ sizeof(short) * len + /* a_s */ @@ -550,7 +559,7 @@ static inline echo_can_state_t *echo_can_create(int len, int adaption_mode) return ec; } -static inline int echo_can_traintap(echo_can_state_t *ec, int pos, short val) +static inline int echo_can_traintap(struct echo_can_state *ec, int pos, short val) { /* Set the hangover counter to the length of the can to * avoid adjustments occuring immediately after initial forced training -- cgit v1.2.3