diff options
author | kpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2007-02-01 00:55:41 +0000 |
---|---|---|
committer | kpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2007-02-01 00:55:41 +0000 |
commit | 13179eb2fc4b2384550a1681513986584634bfd6 (patch) | |
tree | 5e450b5b4ef50a7dfb8268e75d04785ab0adc13e /sec.h | |
parent | 7976f3ed8ba610c565d4cd80a7f8c0643005de49 (diff) |
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
Diffstat (limited to 'sec.h')
-rw-r--r-- | sec.h | 31 |
1 files changed, 20 insertions, 11 deletions
@@ -70,7 +70,7 @@ #define NONUPDATE_DWELL_TIME 600 /* 600 samples, or 75ms */ -typedef struct +struct echo_can_state { int tx_power; int rx_power; @@ -98,11 +98,20 @@ typedef struct int32_t latest_correction; /* Indication of the magnitude of the latest adaption, or a code to indicate why adaption was skipped, for test purposes */ -} echo_can_state_t; +}; -static echo_can_state_t *echo_can_create(int len, int adaption_mode); -static void echo_can_free(echo_can_state_t *ec); -static int16_t echo_can_update(echo_can_state_t *ec, int16_t tx, int16_t rx); +static void echo_can_init(void) +{ + printk("Zaptel Echo Canceller: STEVE%s\n", ZAPTEL_ECHO_AGGRESSIVE); +} + +static void echo_can_shutdown(void) +{ +} + +static struct echo_can_state *echo_can_create(int len, int adaption_mode); +static void echo_can_free(struct echo_can_state *ec); +static int16_t echo_can_update(struct echo_can_state *ec, int16_t tx, int16_t rx); /* Original parameters : #define MIN_TX_POWER_FOR_ADAPTION 256 @@ -117,12 +126,12 @@ static int16_t echo_can_update(echo_can_state_t *ec, int16_t tx, int16_t rx); #define MIN_RX_POWER_FOR_ADAPTION 64 */ -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; void *ptr; - ptr = ec = (echo_can_state_t *) MALLOC(sizeof(*ec) + len * sizeof(int32_t) + + ptr = ec = (struct echo_can_state *) MALLOC(sizeof(*ec) + len * sizeof(int32_t) + len * 3 * sizeof(int16_t)); if (ec == NULL) return NULL; @@ -141,13 +150,13 @@ static inline echo_can_state_t *echo_can_create(int len, int adaption_mode) } /*- End of function --------------------------------------------------------*/ -static inline void echo_can_free(echo_can_state_t *ec) +static inline void echo_can_free(struct echo_can_state *ec) { FREE(ec); } /*- End of function --------------------------------------------------------*/ -static inline int16_t echo_can_update(echo_can_state_t *ec, int16_t tx, int16_t rx) +static inline int16_t echo_can_update(struct echo_can_state *ec, int16_t tx, int16_t rx) { int32_t echo_value; int clean_rx; @@ -268,7 +277,7 @@ static inline int16_t echo_can_update(echo_can_state_t *ec, int16_t tx, int16_t } /*- End of function --------------------------------------------------------*/ -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) { /* Reset hang counter to avoid adjustments after initial forced training */ |