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 --- mg2ec.h | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) (limited to 'mg2ec.h') diff --git a/mg2ec.h b/mg2ec.h index 84f3f10..5e634c0 100644 --- a/mg2ec.h +++ b/mg2ec.h @@ -76,7 +76,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; @@ -143,7 +143,16 @@ typedef struct { short lastsig[256]; int lastpos; -} echo_can_state_t; +}; + +static void echo_can_init(void) +{ + printk("Zaptel Echo Canceller: MG2%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) { @@ -171,13 +180,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; @@ -236,12 +245,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 */ @@ -556,9 +565,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; @@ -569,7 +578,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 */ @@ -578,7 +587,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 */ @@ -591,7 +600,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