[svn-commits] kpfleming: branch linux/kpfleming/echocan_work r6360 - in /linux/team/kpflemi...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Apr 14 11:35:27 CDT 2009


Author: kpfleming
Date: Tue Apr 14 11:35:23 2009
New Revision: 6360

URL: http://svn.digium.com/svn-view/dahdi?view=rev&rev=6360
Log:
start documentation of echo canceler API structures and operations functions

rename some more structure fields and operations functions to be clearer


Modified:
    linux/team/kpfleming/echocan_work/drivers/dahdi/Kbuild
    linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi-base.c
    linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_jpah.c
    linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_kb1.c
    linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_mg2.c
    linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_oslec.c
    linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_sec.c
    linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_sec2.c
    linux/team/kpfleming/echocan_work/drivers/dahdi/hpec/dahdi_echocan_hpec.c
    linux/team/kpfleming/echocan_work/drivers/dahdi/hpec/hpec.h
    linux/team/kpfleming/echocan_work/include/dahdi/kernel.h

Modified: linux/team/kpfleming/echocan_work/drivers/dahdi/Kbuild
URL: http://svn.digium.com/svn-view/dahdi/linux/team/kpfleming/echocan_work/drivers/dahdi/Kbuild?view=diff&rev=6360&r1=6359&r2=6360
==============================================================================
--- linux/team/kpfleming/echocan_work/drivers/dahdi/Kbuild (original)
+++ linux/team/kpfleming/echocan_work/drivers/dahdi/Kbuild Tue Apr 14 11:35:23 2009
@@ -31,12 +31,12 @@
 
 # Only enable this if you think you know what you're doing. This is not
 # supported yet:
-#obj-m += dahdi_echocan_oslec.o
+obj-m += dahdi_echocan_oslec.o
 #
 # A quick and dirty way to build OSLEC, if you happened to place it
 # yourself in the dahdi source tree. This is experimental. See README
 # regarding OSLEC.
-#obj-m += ../staging/echo/
+obj-m += ../staging/echo/
 
 CFLAGS_MODULE += -I$(DAHDI_INCLUDE) -I$(src)
 

Modified: linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi-base.c
URL: http://svn.digium.com/svn-view/dahdi/linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi-base.c?view=diff&rev=6360&r1=6359&r2=6360
==============================================================================
--- linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi-base.c (original)
+++ linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi-base.c Tue Apr 14 11:35:23 2009
@@ -142,8 +142,8 @@
 EXPORT_SYMBOL(dahdi_register_chardev);
 EXPORT_SYMBOL(dahdi_unregister_chardev);
 
-EXPORT_SYMBOL(dahdi_register_echocan);
-EXPORT_SYMBOL(dahdi_unregister_echocan);
+EXPORT_SYMBOL(dahdi_register_echocan_factory);
+EXPORT_SYMBOL(dahdi_unregister_echocan_factory);
 
 EXPORT_SYMBOL(dahdi_set_hpec_ioctl);
 
@@ -390,7 +390,7 @@
 	struct list_head list;
 };
 
-int dahdi_register_echocan(const struct dahdi_echocan_factory *ec)
+int dahdi_register_echocan_factory(const struct dahdi_echocan_factory *ec)
 {
 	struct ecfactory *cur;
 
@@ -419,7 +419,7 @@
 	return 0;
 }
 
-void dahdi_unregister_echocan(const struct dahdi_echocan_factory *ec)
+void dahdi_unregister_echocan_factory(const struct dahdi_echocan_factory *ec)
 {
 	struct ecfactory *cur, *next;
 
@@ -6627,7 +6627,7 @@
 				txlins[x] = DAHDI_XLAW(txchunk[x], ss);
 			}
 			ss->ec_state->events.all = 0;
-			ss->ec_state->owner->echocan_array_update(ss->ec_state, rxlins, txlins);
+			ss->ec_state->owner->echocan_array_update(ss->ec_state, rxlins, txlins, DAHDI_CHUNKSIZE);
 			if (ss->ec_state->events.all) {
 				process_echocan_events(ss);
 			}

Modified: linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_jpah.c
URL: http://svn.digium.com/svn-view/dahdi/linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_jpah.c?view=diff&rev=6360&r1=6359&r2=6360
==============================================================================
--- linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_jpah.c (original)
+++ linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_jpah.c Tue Apr 14 11:35:23 2009
@@ -43,7 +43,7 @@
 static int echo_can_create(struct dahdi_echocanparams *ecp, struct dahdi_echocanparam *p,
 			   struct dahdi_echocan_state **ec);
 static void echo_can_free(struct dahdi_echocan_state *ec);
-static void echo_can_array_update(struct dahdi_echocan_state *ec, short *isig, short *iref);
+static void echo_can_array_update(struct dahdi_echocan_state *ec, short *isig, const short *iref, __u32 size);
 static int echo_can_traintap(struct dahdi_echocan_state *ec, int pos, short val);
 
 static const struct dahdi_echocan_factory my_factory = {
@@ -52,7 +52,7 @@
 	.echocan_create = echo_can_create,
 };
 
-static const struct dahdi_echocan me = {
+static const struct dahdi_echocan_ops me = {
 	.echocan_free = echo_can_free,
 	.echocan_array_update = echo_can_array_update,
 	.echocan_traintap = echo_can_traintap,
@@ -92,12 +92,12 @@
 	kfree(pvt);
 }
 
-static void echo_can_array_update(struct dahdi_echocan_state *ec, short *isig, short *iref)
+static void echo_can_array_update(struct dahdi_echocan_state *ec, short *isig, const short *iref, __u32 size)
 {
 	struct ec_pvt *pvt = dahdi_to_pvt(ec);
-	unsigned int x;
+	__u32 x;
 
-	for (x = 0; x < DAHDI_CHUNKSIZE; x++) {
+	for (x = 0; x < size; x++) {
 		if (pvt->blah < 2) {
 			pvt->blah++;
 
@@ -117,7 +117,7 @@
 
 static int __init mod_init(void)
 {
-	if (dahdi_register_echocan(&my_factory)) {
+	if (dahdi_register_echocan_factory(&my_factory)) {
 		module_printk(KERN_ERR, "could not register with DAHDI core\n");
 
 		return -EPERM;
@@ -130,7 +130,7 @@
 
 static void __exit mod_exit(void)
 {
-	dahdi_unregister_echocan(&my_factory);
+	dahdi_unregister_echocan_factory(&my_factory);
 }
 
 module_param(debug, int, S_IRUGO | S_IWUSR);

Modified: linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_kb1.c
URL: http://svn.digium.com/svn-view/dahdi/linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_kb1.c?view=diff&rev=6360&r1=6359&r2=6360
==============================================================================
--- linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_kb1.c (original)
+++ linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_kb1.c Tue Apr 14 11:35:23 2009
@@ -145,7 +145,7 @@
 static int echo_can_create(struct dahdi_echocanparams *ecp, struct dahdi_echocanparam *p,
 			   struct dahdi_echocan_state **ec);
 static void echo_can_free(struct dahdi_echocan_state *ec);
-static void echo_can_array_update(struct dahdi_echocan_state *ec, short *isig, short *iref);
+static void echo_can_array_update(struct dahdi_echocan_state *ec, short *isig, const short *iref, __u32 size);
 static int echo_can_traintap(struct dahdi_echocan_state *ec, int pos, short val);
 
 static const struct dahdi_echocan_factory my_factory = {
@@ -154,7 +154,7 @@
 	.echocan_create = echo_can_create,
 };
 
-static const struct dahdi_echocan me = {
+static const struct dahdi_echocan_ops me = {
 	.echocan_free = echo_can_free,
 	.echocan_array_update = echo_can_array_update,
 	.echocan_traintap = echo_can_traintap,
@@ -605,13 +605,13 @@
 	return u;
 }
 
-static void echo_can_array_update(struct dahdi_echocan_state *ec, short *isig, short *iref)
+static void echo_can_array_update(struct dahdi_echocan_state *ec, short *isig, const short *iref, __u32 size)
 {
 	struct ec_pvt *pvt = dahdi_to_pvt(ec);
-	unsigned int x;
+	__u32 x;
 	short result;
 
-	for (x = 0; x < DAHDI_CHUNKSIZE; x++) {
+	for (x = 0; x < size; x++) {
 		result = sample_update(pvt, *iref, *isig);
 		*isig++ = result;
 		++iref;
@@ -696,7 +696,7 @@
 
 static int __init mod_init(void)
 {
-	if (dahdi_register_echocan(&my_factory)) {
+	if (dahdi_register_echocan_factory(&my_factory)) {
 		module_printk(KERN_ERR, "could not register with DAHDI core\n");
 
 		return -EPERM;
@@ -709,7 +709,7 @@
 
 static void __exit mod_exit(void)
 {
-	dahdi_unregister_echocan(&my_factory);
+	dahdi_unregister_echocan_factory(&my_factory);
 }
 
 module_param(debug, int, S_IRUGO | S_IWUSR);

Modified: linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_mg2.c
URL: http://svn.digium.com/svn-view/dahdi/linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_mg2.c?view=diff&rev=6360&r1=6359&r2=6360
==============================================================================
--- linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_mg2.c (original)
+++ linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_mg2.c Tue Apr 14 11:35:23 2009
@@ -177,7 +177,7 @@
 static int echo_can_create(struct dahdi_echocanparams *ecp, struct dahdi_echocanparam *p,
 			   struct dahdi_echocan_state **ec);
 static void echo_can_free(struct dahdi_echocan_state *ec);
-static void echo_can_array_update(struct dahdi_echocan_state *ec, short *isig, short *iref);
+static void echo_can_array_update(struct dahdi_echocan_state *ec, short *isig, const short *iref, __u32 size);
 static int echo_can_traintap(struct dahdi_echocan_state *ec, int pos, short val);
 
 static const struct dahdi_echocan_factory my_factory = {
@@ -186,7 +186,7 @@
 	.echocan_create = echo_can_create,
 };
 
-static const struct dahdi_echocan me = {
+static const struct dahdi_echocan_ops me = {
 	.echocan_free = echo_can_free,
 	.echocan_array_update = echo_can_array_update,
 	.echocan_traintap = echo_can_traintap,
@@ -745,13 +745,13 @@
 	return u;
 }
 
-static void echo_can_array_update(struct dahdi_echocan_state *ec, short *isig, short *iref)
+static void echo_can_array_update(struct dahdi_echocan_state *ec, short *isig, const short *iref, __u32 size)
 {
 	struct ec_pvt *pvt = dahdi_to_pvt(ec);
-	unsigned int x;
+	__u32 x;
 	short result;
 
-	for (x = 0; x < DAHDI_CHUNKSIZE; x++) {
+	for (x = 0; x < size; x++) {
 		result = sample_update(pvt, *iref, *isig);
 		*isig++ = result;
 		++iref;
@@ -842,7 +842,7 @@
 
 static int __init mod_init(void)
 {
-	if (dahdi_register_echocan(&my_factory)) {
+	if (dahdi_register_echocan_factory(&my_factory)) {
 		module_printk(KERN_ERR, "could not register with DAHDI core\n");
 
 		return -EPERM;
@@ -855,7 +855,7 @@
 
 static void __exit mod_exit(void)
 {
-	dahdi_unregister_echocan(&my_factory);
+	dahdi_unregister_echocan_factory(&my_factory);
 }
 
 module_param(debug, int, S_IRUGO | S_IWUSR);

Modified: linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_oslec.c
URL: http://svn.digium.com/svn-view/dahdi/linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_oslec.c?view=diff&rev=6360&r1=6359&r2=6360
==============================================================================
--- linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_oslec.c (original)
+++ linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_oslec.c Tue Apr 14 11:35:23 2009
@@ -40,7 +40,7 @@
 static int echo_can_create(struct dahdi_echocanparams *ecp, struct dahdi_echocanparam *p,
 			   struct dahdi_echocan_state **ec);
 static void echo_can_free(struct dahdi_echocan_state *ec);
-static void echo_can_array_update(struct dahdi_echocan_state *ec, short *isig, short *iref);
+static void echo_can_array_update(struct dahdi_echocan_state *ec, short *isig, const short *iref, __u32 size);
 static int echo_can_traintap(struct dahdi_echocan_state *ec, int pos, short val);
 
 static const struct dahdi_echocan_factory my_factory = {
@@ -49,13 +49,7 @@
 	.echocan_create = echo_can_create,
 };
 
-static const struct dahdi_echocan_features oslec_features = {
-	.NLP_automatic = 1,
-	.CED_tx_detect = 1,
-	.CED_rx_detect = 1,
-};
-
-static const struct dahdi_echocan me = {
+static const struct dahdi_echocan_ops me = {
 	.echocan_free = echo_can_free,
 	.echocan_array_update = echo_can_array_update,
 	.echocan_traintap = echo_can_traintap,
@@ -76,12 +70,12 @@
 	kfree(pvt);
 }
 
-static void echo_can_array_update(struct dahdi_echocan_state *ec, short *isig, short *iref)
+static void echo_can_array_update(struct dahdi_echocan_state *ec, short *isig, const short *iref, __u32 size)
 {
 	struct ec_pvt *pvt = dahdi_to_pvt(ec);
-	unsigned int SampleNum;
+	__u32 SampleNum;
 
-	for (SampleNum = 0; SampleNum < DAHDI_CHUNKSIZE; SampleNum++, iref++) {
+	for (SampleNum = 0; SampleNum < size; SampleNum++, iref++) {
 		short iCleanSample;
 
 		iCleanSample = oslec_update(pvt->oslec, *iref, *isig);
@@ -104,7 +98,6 @@
 	}
 
 	pvt->dahdi.owner = &me;
-	pvt->dahdi.features = oslec_features;
 
 	pvt->oslec = oslec_create(ecp->tap_length, ECHO_CAN_USE_ADAPTION | ECHO_CAN_USE_NLP | ECHO_CAN_USE_CLIP | ECHO_CAN_USE_TX_HPF | ECHO_CAN_USE_RX_HPF);
 
@@ -126,7 +119,7 @@
 
 static int __init mod_init(void)
 {
-	if (dahdi_register_echocan(&my_factory)) {
+	if (dahdi_register_echocan_factory(&my_factory)) {
 		module_printk(KERN_ERR, "could not register with DAHDI core\n");
 
 		return -EPERM;
@@ -139,7 +132,7 @@
 
 static void __exit mod_exit(void)
 {
-	dahdi_unregister_echocan(&my_factory);
+	dahdi_unregister_echocan_factory(&my_factory);
 }
 
 MODULE_DESCRIPTION("DAHDI OSLEC wrapper");

Modified: linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_sec.c
URL: http://svn.digium.com/svn-view/dahdi/linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_sec.c?view=diff&rev=6360&r1=6359&r2=6360
==============================================================================
--- linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_sec.c (original)
+++ linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_sec.c Tue Apr 14 11:35:23 2009
@@ -83,7 +83,7 @@
 static int echo_can_create(struct dahdi_echocanparams *ecp, struct dahdi_echocanparam *p,
 			   struct dahdi_echocan_state **ec);
 static void echo_can_free(struct dahdi_echocan_state *ec);
-static void echo_can_array_update(struct dahdi_echocan_state *ec, short *isig, short *iref);
+static void echo_can_array_update(struct dahdi_echocan_state *ec, short *isig, const short *iref, __u32 size);
 static int echo_can_traintap(struct dahdi_echocan_state *ec, int pos, short val);
 static void echocan_NLP_toggle(struct dahdi_echocan_state *ec, unsigned int enable);
 
@@ -97,7 +97,7 @@
 	.NLP_toggle = 1,
 };
 
-static const struct dahdi_echocan me = {
+static const struct dahdi_echocan_ops me = {
 	.echocan_free = echo_can_free,
 	.echocan_array_update = echo_can_array_update,
 	.echocan_traintap = echo_can_traintap,
@@ -291,13 +291,13 @@
 	return clean_rx;
 }
 
-static void echo_can_array_update(struct dahdi_echocan_state *ec, short *isig, short *iref)
+static void echo_can_array_update(struct dahdi_echocan_state *ec, short *isig, const short *iref, __u32 size)
 {
 	struct ec_pvt *pvt = dahdi_to_pvt(ec);
-	unsigned int x;
+	__u32 x;
 	short result;
 
-	for (x = 0; x < DAHDI_CHUNKSIZE; x++) {
+	for (x = 0; x < size; x++) {
 		result = sample_update(pvt, *iref, *isig);
 		*isig++ = result;
 		++iref;
@@ -331,7 +331,7 @@
 
 static int __init mod_init(void)
 {
-	if (dahdi_register_echocan(&my_factory)) {
+	if (dahdi_register_echocan_factory(&my_factory)) {
 		module_printk(KERN_ERR, "could not register with DAHDI core\n");
 
 		return -EPERM;
@@ -344,7 +344,7 @@
 
 static void __exit mod_exit(void)
 {
-	dahdi_unregister_echocan(&my_factory);
+	dahdi_unregister_echocan_factory(&my_factory);
 }
 
 module_param(debug, int, S_IRUGO | S_IWUSR);

Modified: linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_sec2.c
URL: http://svn.digium.com/svn-view/dahdi/linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_sec2.c?view=diff&rev=6360&r1=6359&r2=6360
==============================================================================
--- linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_sec2.c (original)
+++ linux/team/kpfleming/echocan_work/drivers/dahdi/dahdi_echocan_sec2.c Tue Apr 14 11:35:23 2009
@@ -79,7 +79,7 @@
 static int echo_can_create(struct dahdi_echocanparams *ecp, struct dahdi_echocanparam *p,
 			   struct dahdi_echocan_state **ec);
 static void echo_can_free(struct dahdi_echocan_state *ec);
-static void echo_can_array_update(struct dahdi_echocan_state *ec, short *isig, short *iref);
+static void echo_can_array_update(struct dahdi_echocan_state *ec, short *isig, const short *iref, __u32 size);
 static int echo_can_traintap(struct dahdi_echocan_state *ec, int pos, short val);
 
 static const struct dahdi_echocan_factory my_factory = {
@@ -88,7 +88,7 @@
 	.echocan_create = echo_can_create,
 };
 
-static const struct dahdi_echocan me = {
+static const struct dahdi_echocan_ops me = {
 	.echocan_free = echo_can_free,
 	.echocan_array_update = echo_can_array_update,
 	.echocan_traintap = echo_can_traintap,
@@ -292,13 +292,13 @@
 	return clean_rx;
 }
 
-static void echo_can_array_update(struct dahdi_echocan_state *ec, short *isig, short *iref)
+static void echo_can_array_update(struct dahdi_echocan_state *ec, short *isig, const short *iref, __u32 size)
 {
 	struct ec_pvt *pvt = dahdi_to_pvt(ec);
-	unsigned int x;
+	__u32 x;
 	short result;
 
-	for (x = 0; x < DAHDI_CHUNKSIZE; x++) {
+	for (x = 0; x < size; x++) {
 		result = sample_update(pvt, *iref, *isig);
 		*isig++ = result;
 		++iref;
@@ -324,7 +324,7 @@
 
 static int __init mod_init(void)
 {
-	if (dahdi_register_echocan(&my_factory)) {
+	if (dahdi_register_echocan_factory(&my_factory)) {
 		module_printk(KERN_ERR, "could not register with DAHDI core\n");
 
 		return -EPERM;
@@ -337,7 +337,7 @@
 
 static void __exit mod_exit(void)
 {
-	dahdi_unregister_echocan(&my_factory);
+	dahdi_unregister_echocan_factory(&my_factory);
 }
 
 module_param(debug, int, S_IRUGO | S_IWUSR);

Modified: linux/team/kpfleming/echocan_work/drivers/dahdi/hpec/dahdi_echocan_hpec.c
URL: http://svn.digium.com/svn-view/dahdi/linux/team/kpfleming/echocan_work/drivers/dahdi/hpec/dahdi_echocan_hpec.c?view=diff&rev=6360&r1=6359&r2=6360
==============================================================================
--- linux/team/kpfleming/echocan_work/drivers/dahdi/hpec/dahdi_echocan_hpec.c (original)
+++ linux/team/kpfleming/echocan_work/drivers/dahdi/hpec/dahdi_echocan_hpec.c Tue Apr 14 11:35:23 2009
@@ -39,7 +39,7 @@
 static int echo_can_create(struct dahdi_echocanparams *ecp, struct dahdi_echocanparam *p,
 			   struct dahdi_echocan_state **ec);
 static void echo_can_free(struct dahdi_echocan_state *ec);
-static void echo_can_array_update(struct dahdi_echocan_state *ec, short *isig, short *iref);
+static void echo_can_array_update(struct dahdi_echocan_state *ec, short *isig, const short *iref, __u32 size);
 static int echo_can_traintap(struct dahdi_echocan_state *ec, int pos, short val);
 
 static const struct dahdi_echocan_factory my_factory = {
@@ -54,7 +54,7 @@
 	.CED_rx_detect = 1,
 };
 
-static const struct dahdi_echocan me = {
+static const struct dahdi_echocan_ops me = {
 	.echocan_free = echo_can_free,
 	.echocan_array_update = echo_can_array_update,
 	.echocan_traintap = echo_can_traintap,
@@ -106,7 +106,7 @@
 	kfree(pvt);
 }
 
-static void echo_can_array_update(struct dahdi_echocan_state *ec, short *isig, short *iref)
+static void echo_can_array_update(struct dahdi_echocan_state *ec, short *isig, const short *iref, __u32 size)
 {
 	struct ec_pvt *pvt = dahdi_to_pvt(ec);
 
@@ -190,7 +190,7 @@
 
 static int __init mod_init(void)
 {
-	if (dahdi_register_echocan(&my_factory)) {
+	if (dahdi_register_echocan_factory(&my_factory)) {
 		module_printk(KERN_ERR, "could not register with DAHDI core\n");
 
 		return -EPERM;
@@ -207,7 +207,7 @@
 
 static void __exit mod_exit(void)
 {
-	dahdi_unregister_echocan(&my_factory);
+	dahdi_unregister_echocan_factory(&my_factory);
 
 	dahdi_set_hpec_ioctl(NULL);
 

Modified: linux/team/kpfleming/echocan_work/drivers/dahdi/hpec/hpec.h
URL: http://svn.digium.com/svn-view/dahdi/linux/team/kpfleming/echocan_work/drivers/dahdi/hpec/hpec.h?view=diff&rev=6360&r1=6359&r2=6360
==============================================================================
--- linux/team/kpfleming/echocan_work/drivers/dahdi/hpec/hpec.h (original)
+++ linux/team/kpfleming/echocan_work/drivers/dahdi/hpec/hpec.h Tue Apr 14 11:35:23 2009
@@ -40,7 +40,7 @@
 
 void __attribute__((regparm(0))) hpec_channel_free(struct hpec_state *channel);
 
-void __attribute__((regparm(0))) hpec_channel_update(struct hpec_state *channel, short *isig, short *iref);
+void __attribute__((regparm(0))) hpec_channel_update(struct hpec_state *channel, short *isig, const short *iref);
 
 #endif /* !defined(_HPEC_H) */
 

Modified: linux/team/kpfleming/echocan_work/include/dahdi/kernel.h
URL: http://svn.digium.com/svn-view/dahdi/linux/team/kpfleming/echocan_work/include/dahdi/kernel.h?view=diff&rev=6360&r1=6359&r2=6360
==============================================================================
--- linux/team/kpfleming/echocan_work/include/dahdi/kernel.h (original)
+++ linux/team/kpfleming/echocan_work/include/dahdi/kernel.h Tue Apr 14 11:35:23 2009
@@ -150,24 +150,101 @@
 
 struct dahdi_echocan_state;
 
+/*! Features a DAHDI echo canceler (software or hardware) can provide to the DAHDI core */
 struct dahdi_echocan_features {
+
+	/*! Able to detect CED tone (2100 Hz with phase reversals) in the transmit direction.
+	 * If the echocan can detect this tone, it may report it it as an event (see
+	 * the events.CED_tx_detected field of dahdi_echocan_state), and if it will automatically
+	 * disable itself or its non-linear processor, then the NLP_automatic feature flag should also
+	 * be set so that the DAHDI core doesn't bother trying to do so.
+	*/
 	__u32 CED_tx_detect:1;
+
+	/*! Able to detect CED tone (2100 Hz with phase reversals) in the receive direction.
+	 * If the echocan can detect this tone, it may report it it as an event (see
+	 * the events.CED_rx_detected field of dahdi_echocan_state), and if it will automatically
+	 * disable itself or its non-linear processor, then the NLP_automatic flag feature should also
+	 * be set so that the DAHDI core doesn't bother trying to do so.
+	*/
 	__u32 CED_rx_detect:1;
+
+	/*! Able to detect CNG tone (1100 Hz) in the transmit direction. */
 	__u32 CNG_tx_detect:1;
+
+	/*! Able to detect CNG tone (1100 Hz) in the receive direction. */
 	__u32 CNG_rx_detect:1;
+
+	/*! If the echocan's NLP can be enabled and disabled without requiring destruction
+	 * and recreation of the state structure, this feature flag should be set and the
+	 * echocan_NLP_toggle field of the dahdi_echocan_ops structure should be filled with a
+	 * pointer to the function to perform that operation.
+	 */
 	__u32 NLP_toggle:1;
+
+	/*! If the echocan will automatically disable itself (or even just its NLP) based on
+	 * detection of a CED tone in either direction, this feature flag should be set (along
+	 * with the tone detection feature flags). When the disable/enable occurs, the
+	 * status.NLP_enabled field of the dahdi_echocan_state structure should be updated.
+	 */
 	__u32 NLP_automatic:1;
 };
 
-struct dahdi_echocan {
+/*! Operations (methods) that can be performed on a DAHDI echo canceler instance (state
+ * structure) after it has been created, by either a software or hardware echo canceller.
+ * The echo canceler must populate the owner field of the dahdi_echocan_state structure
+ * with a pointer to the relevant operations structure for that instance.
+ */
+struct dahdi_echocan_ops {
+
+	/*! \brief Free an echocan state structure.
+	 * \param[in,out] ec Pointer to the state structure to free.
+	 *
+	 * \return Nothing.
+	 */
 	void (*echocan_free)(struct dahdi_echocan_state *ec);
-	void (*echocan_array_update)(struct dahdi_echocan_state *ec, short *isig, short *iref);
+
+	/*! \brief Process an array of audio samples through the echocan.
+	 * \param[in,out] ec Pointer to the state structure.
+	 * \param[in,out] isig The receive direction data (will be modified).
+	 * \param[in] iref The transmit direction data.
+	 * \param[in] size The number of elements in the isig and iref arrays.
+	 *
+	 * \return Nothing.
+	 */
+	void (*echocan_array_update)(struct dahdi_echocan_state *ec, short *isig, const short *iref, __u32 size);
+
+	/*! \brief Feed a sample (and its position) for echocan training.
+	 * \param[in,out] ec Pointer to the state structure.
+	 * \param[in] pos The tap position to be 'trained'.
+	 * \param[in] val The receive direction sample for the specified tap position.
+	 *
+	 * \retval zero if training should continue
+	 * \retval non-zero if training is complete
+	 */
 	int (*echocan_traintap)(struct dahdi_echocan_state *ec, int pos, short val);
+
+	/*! \brief Enable or disable non-linear processing (NLP) in the echocan.
+	 * \param[in,out] ec Pointer to the state structure.
+	 * \param[in] enable Zero to disable, non-zero to enable.
+	 *
+	 * \return Nothing.
+	 */
 	void (*echocan_NLP_toggle)(struct dahdi_echocan_state *ec, unsigned int enable);
 };
 
+struct dahdi_echocan_factory {
+	const char *name;
+	struct module *owner;
+	int (*echocan_create)(struct dahdi_echocanparams *ecp, struct dahdi_echocanparam *p, struct dahdi_echocan_state **ec);
+};
+
+int dahdi_register_echocan_factory(const struct dahdi_echocan_factory *ec);
+
+void dahdi_unregister_echocan_factory(const struct dahdi_echocan_factory *ec);
+
 struct dahdi_echocan_state {
-	const struct dahdi_echocan *owner;
+	const struct dahdi_echocan_ops *owner;
 	echo_can_disable_detector_state_t txecdis;
 	echo_can_disable_detector_state_t rxecdis;
 	struct dahdi_echocan_features features;
@@ -186,17 +263,6 @@
 		};
 	} events;
 };
-
-/* Echo cancellation factories (modules) */
-
-struct dahdi_echocan_factory {
-	const char *name;
-	struct module *owner;
-	int (*echocan_create)(struct dahdi_echocanparams *ecp, struct dahdi_echocanparam *p, struct dahdi_echocan_state **ec);
-};
-
-int dahdi_register_echocan(const struct dahdi_echocan_factory *ec);
-void dahdi_unregister_echocan(const struct dahdi_echocan_factory *ec);
 
 struct dahdi_chan {
 #ifdef CONFIG_DAHDI_NET




More information about the svn-commits mailing list