[svn-commits] sruffell: branch linux/sruffell/improved_ecreference r7031 - /linux/team/sruf...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon Aug 17 15:41:43 CDT 2009


Author: sruffell
Date: Mon Aug 17 15:41:40 2009
New Revision: 7031

URL: http://svn.asterisk.org/svn-view/dahdi?view=rev&rev=7031
Log:
wctdm24xxp-wip: Improve sw echocan reference signal.

This brings in the changes from the wcte12xp driver.  Allows the software
echocan reference signal to more closely match with the received signal when
using large latency values.

Modified:
    linux/team/sruffell/improved_ecreference/drivers/dahdi/wctdm24xxp/base.c
    linux/team/sruffell/improved_ecreference/drivers/dahdi/wctdm24xxp/wctdm24xxp.h

Modified: linux/team/sruffell/improved_ecreference/drivers/dahdi/wctdm24xxp/base.c
URL: http://svn.asterisk.org/svn-view/dahdi/linux/team/sruffell/improved_ecreference/drivers/dahdi/wctdm24xxp/base.c?view=diff&rev=7031&r1=7030&r2=7031
==============================================================================
--- linux/team/sruffell/improved_ecreference/drivers/dahdi/wctdm24xxp/base.c (original)
+++ linux/team/sruffell/improved_ecreference/drivers/dahdi/wctdm24xxp/base.c Mon Aug 17 15:41:40 2009
@@ -45,6 +45,7 @@
 #include <linux/workqueue.h>
 #include <linux/delay.h>
 #include <linux/moduleparam.h>
+#include <linux/kfifo.h>
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
 #include <linux/semaphore.h>
 #else
@@ -841,6 +842,13 @@
 		dahdi_transmit(&wc->span);
 	}
 
+	for (x = 0; x < wc->cards; x++) {
+		if (wc->cardflag & (1 << x)) {
+			__kfifo_put(wc->ec_reference[x],
+				    wc->chans[x]->writechunk, DAHDI_CHUNKSIZE);
+		}
+	}
+
 	for (x=0;x<DAHDI_CHUNKSIZE;x++) {
 		/* Send a sample, as a 32-bit word */
 		for (y=0;y < wc->cards;y++) {
@@ -1046,9 +1054,15 @@
 	}
 	/* XXX We're wasting 8 taps.  We should get closer :( */
 	if (likely(wc->initialized)) {
+		unsigned char buffer[DAHDI_CHUNKSIZE];
 		for (x = 0; x < wc->desc->ports; x++) {
-			if (wc->cardflag & (1 << x))
-				dahdi_ec_chunk(wc->chans[x], wc->chans[x]->readchunk, wc->chans[x]->writechunk);
+			if (wc->cardflag & (1 << x)) {
+				__kfifo_get(wc->ec_reference[x], buffer,
+					    ARRAY_SIZE(buffer));
+				dahdi_ec_chunk(wc->chans[x],
+					       wc->chans[x]->readchunk,
+					       buffer);
+			}
 		}
 		dahdi_receive(&wc->span);
 	}
@@ -3710,6 +3724,12 @@
 		if (wc->ec[x])
 			kfree(wc->ec[x]);
 	}
+
+	for (x = 0; x < ARRAY_SIZE(wc->ec_reference); ++x) {
+		if (wc->ec_reference[x])
+			kfifo_free(wc->ec_reference[x]);
+	}
+
 	kfree(wc);
 }
 
@@ -3739,6 +3759,7 @@
 	}
 	spin_unlock(&ifacelock);
 
+
 	snprintf(wc->board_name, sizeof(wc->board_name)-1, "%s%d",
 		 wctdm_driver.name, i);
 	ret = voicebus_init(pdev, SFRAME_SIZE, wc->board_name,
@@ -3775,6 +3796,18 @@
 			return -ENOMEM;
 		}
 		memset(wc->ec[i], 0, sizeof(*wc->ec[i]));
+
+		wc->ec_reference[i] = kfifo_alloc(DAHDI_CHUNKSIZE *
+						  VOICEBUS_MAX_LATENCY,
+						  GFP_KERNEL, &wc->reglock);
+
+		if (IS_ERR(wc->ec_reference[i])) {
+			ret = PTR_ERR(wc->ec_reference[i]);
+			wc->ec_reference[i] = NULL;
+			free_wc(wc);
+			return ret;
+		}
+
 	}
 
 

Modified: linux/team/sruffell/improved_ecreference/drivers/dahdi/wctdm24xxp/wctdm24xxp.h
URL: http://svn.asterisk.org/svn-view/dahdi/linux/team/sruffell/improved_ecreference/drivers/dahdi/wctdm24xxp/wctdm24xxp.h?view=diff&rev=7031&r1=7030&r2=7031
==============================================================================
--- linux/team/sruffell/improved_ecreference/drivers/dahdi/wctdm24xxp/wctdm24xxp.h (original)
+++ linux/team/sruffell/improved_ecreference/drivers/dahdi/wctdm24xxp/wctdm24xxp.h Mon Aug 17 15:41:40 2009
@@ -220,6 +220,7 @@
 	struct voicebus *vb;
 	struct dahdi_chan *chans[NUM_CARDS];
 	struct dahdi_echocan_state *ec[NUM_CARDS];
+	struct kfifo *ec_reference[NUM_CARDS];
 	int initialized;
 };
 




More information about the svn-commits mailing list