summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin P. Fleming <kpfleming@digium.com>2009-02-02 14:13:50 +0000
committerKevin P. Fleming <kpfleming@digium.com>2009-02-02 14:13:50 +0000
commitced6afdc06c719baed23fd147fb7107f30e91072 (patch)
treeb612924a161a2cdd2f80e24763c1fc19e7b5b0cb
parentd7d0978d7ce471f6544bb4ed8eedca1ba54ce368 (diff)
Array-style echo canceller updates first appeared in Zaptel, because HPEC only supports that mode. However, when the function for doing array-style updates was written, the argument names were reversed. In Zaptel this did no harm, because HPEC was the only module that used array-style updates.
When DAHDI was created, non-array-style updates were removed, and the existing modules were converted to using array-style updates. Unfortunately the new code was written based on the argument names, which were incorrect. This caused all the echo cancellers to be broken (except HPEC, although we did not know that at the time), and it was corrected by reversing the order of the arguments passed when the array-style update function was called (leading to a confusing mismatch). This fixed all the non-HPEC modules, but left HPEC broken, which was just discovered. This commit corrects all these problems, so that the argument names and the data passed actually make sense, and all the modules work properly. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@5936 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--drivers/dahdi/dahdi-base.c2
-rw-r--r--drivers/dahdi/dahdi_echocan_jpah.c2
-rw-r--r--drivers/dahdi/dahdi_echocan_kb1.c2
-rw-r--r--drivers/dahdi/dahdi_echocan_mg2.c2
-rw-r--r--drivers/dahdi/dahdi_echocan_oslec.c2
-rw-r--r--drivers/dahdi/dahdi_echocan_sec.c2
-rw-r--r--drivers/dahdi/dahdi_echocan_sec2.c2
-rw-r--r--drivers/dahdi/hpec/dahdi_echocan_hpec.c4
-rw-r--r--drivers/dahdi/hpec/hpec.h2
-rw-r--r--include/dahdi/kernel.h2
10 files changed, 11 insertions, 11 deletions
diff --git a/drivers/dahdi/dahdi-base.c b/drivers/dahdi/dahdi-base.c
index fee2836..3343c12 100644
--- a/drivers/dahdi/dahdi-base.c
+++ b/drivers/dahdi/dahdi-base.c
@@ -6580,7 +6580,7 @@ static inline void __dahdi_ec_chunk(struct dahdi_chan *ss, unsigned char *rxchun
rxlins[x] = DAHDI_XLAW(rxchunk[x], ss);
txlins[x] = DAHDI_XLAW(txchunk[x], ss);
}
- ss->ec_current->echo_can_array_update(ss->ec_state, txlins, rxlins);
+ ss->ec_current->echo_can_array_update(ss->ec_state, rxlins, txlins);
for (x = 0; x < DAHDI_CHUNKSIZE; x++)
rxchunk[x] = DAHDI_LIN2X((int) rxlins[x], ss);
}
diff --git a/drivers/dahdi/dahdi_echocan_jpah.c b/drivers/dahdi/dahdi_echocan_jpah.c
index 5b0e745..3dda26f 100644
--- a/drivers/dahdi/dahdi_echocan_jpah.c
+++ b/drivers/dahdi/dahdi_echocan_jpah.c
@@ -71,7 +71,7 @@ static void echo_can_free(struct echo_can_state *ec)
kfree(ec);
}
-static void echo_can_update(struct echo_can_state *ec, short *iref, short *isig)
+static void echo_can_update(struct echo_can_state *ec, short *isig, short *iref)
{
unsigned int x;
diff --git a/drivers/dahdi/dahdi_echocan_kb1.c b/drivers/dahdi/dahdi_echocan_kb1.c
index b610d45..7fc2dc5 100644
--- a/drivers/dahdi/dahdi_echocan_kb1.c
+++ b/drivers/dahdi/dahdi_echocan_kb1.c
@@ -583,7 +583,7 @@ static inline short sample_update(struct echo_can_state *ec, short iref, short i
return u;
}
-static void echo_can_update(struct echo_can_state *ec, short *iref, short *isig)
+static void echo_can_update(struct echo_can_state *ec, short *isig, short *iref)
{
unsigned int x;
short result;
diff --git a/drivers/dahdi/dahdi_echocan_mg2.c b/drivers/dahdi/dahdi_echocan_mg2.c
index 6ca0860..4291edd 100644
--- a/drivers/dahdi/dahdi_echocan_mg2.c
+++ b/drivers/dahdi/dahdi_echocan_mg2.c
@@ -724,7 +724,7 @@ static inline short sample_update(struct echo_can_state *ec, short iref, short i
return u;
}
-static void echo_can_update(struct echo_can_state *ec, short *iref, short *isig)
+static void echo_can_update(struct echo_can_state *ec, short *isig, short *iref)
{
unsigned int x;
short result;
diff --git a/drivers/dahdi/dahdi_echocan_oslec.c b/drivers/dahdi/dahdi_echocan_oslec.c
index aa63599..4d1c53f 100644
--- a/drivers/dahdi/dahdi_echocan_oslec.c
+++ b/drivers/dahdi/dahdi_echocan_oslec.c
@@ -44,7 +44,7 @@ static void echo_can_free(struct echo_can_state *ec)
oslec_free((struct oslec_state *)ec);
}
-static void echo_can_update(struct echo_can_state *ec, short *iref, short *isig)
+static void echo_can_update(struct echo_can_state *ec, short *isig, short *iref)
{
unsigned int SampleNum;
diff --git a/drivers/dahdi/dahdi_echocan_sec.c b/drivers/dahdi/dahdi_echocan_sec.c
index 5dc80e0..14af244 100644
--- a/drivers/dahdi/dahdi_echocan_sec.c
+++ b/drivers/dahdi/dahdi_echocan_sec.c
@@ -272,7 +272,7 @@ static inline int16_t sample_update(struct echo_can_state *ec, int16_t tx, int16
}
/*- End of function --------------------------------------------------------*/
-static void echo_can_update(struct echo_can_state *ec, short *iref, short *isig)
+static void echo_can_update(struct echo_can_state *ec, short *isig, short *iref)
{
unsigned int x;
short result;
diff --git a/drivers/dahdi/dahdi_echocan_sec2.c b/drivers/dahdi/dahdi_echocan_sec2.c
index fa19b4c..5133cbf 100644
--- a/drivers/dahdi/dahdi_echocan_sec2.c
+++ b/drivers/dahdi/dahdi_echocan_sec2.c
@@ -279,7 +279,7 @@ static inline int16_t sample_update(struct echo_can_state *ec, int16_t tx, int16
}
/*- End of function --------------------------------------------------------*/
-static void echo_can_update(struct echo_can_state *ec, short *iref, short *isig)
+static void echo_can_update(struct echo_can_state *ec, short *isig, short *iref)
{
unsigned int x;
short result;
diff --git a/drivers/dahdi/hpec/dahdi_echocan_hpec.c b/drivers/dahdi/hpec/dahdi_echocan_hpec.c
index eb0689d..ceccf4e 100644
--- a/drivers/dahdi/hpec/dahdi_echocan_hpec.c
+++ b/drivers/dahdi/hpec/dahdi_echocan_hpec.c
@@ -72,9 +72,9 @@ static void echo_can_free(struct echo_can_state *ec)
hpec_channel_free(ec);
}
-static void echo_can_array_update(struct echo_can_state *ec, short *iref, short *isig)
+static void echo_can_array_update(struct echo_can_state *ec, short *isig, short *iref)
{
- hpec_channel_update(ec, iref, isig);
+ hpec_channel_update(ec, isig, iref);
}
DECLARE_MUTEX(alloc_lock);
diff --git a/drivers/dahdi/hpec/hpec.h b/drivers/dahdi/hpec/hpec.h
index ac0a260..832775e 100644
--- a/drivers/dahdi/hpec/hpec.h
+++ b/drivers/dahdi/hpec/hpec.h
@@ -40,7 +40,7 @@ struct echo_can_state __attribute__((regparm(0))) *hpec_channel_alloc(unsigned i
void __attribute__((regparm(0))) hpec_channel_free(struct echo_can_state *channel);
-void __attribute__((regparm(0))) hpec_channel_update(struct echo_can_state *channel, short *iref, short *isig);
+void __attribute__((regparm(0))) hpec_channel_update(struct echo_can_state *channel, short *isig, short *iref);
#endif /* !defined(_HPEC_H) */
diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h
index 0fccfea..ef304d9 100644
--- a/include/dahdi/kernel.h
+++ b/include/dahdi/kernel.h
@@ -361,7 +361,7 @@ struct dahdi_echocan {
struct module *owner;
int (*echo_can_create)(struct dahdi_echocanparams *ecp, struct dahdi_echocanparam *p, struct echo_can_state **ec);
void (*echo_can_free)(struct echo_can_state *ec);
- void (*echo_can_array_update)(struct echo_can_state *ec, short *iref, short *isig);
+ void (*echo_can_array_update)(struct echo_can_state *ec, short *isig, short *iref);
int (*echo_can_traintap)(struct echo_can_state *ec, int pos, short val);
};