[zaptel-commits] tzafrir: branch 1.2 r1668 - in /branches/1.2/xpp: ./ xpd.h xpp_zap.c

zaptel-commits at lists.digium.com zaptel-commits at lists.digium.com
Thu Nov 30 14:48:25 MST 2006


Author: tzafrir
Date: Thu Nov 30 15:48:25 2006
New Revision: 1668

URL: http://svn.digium.com/view/zaptel?view=rev&rev=1668
Log:
 r2832 at boole:  tzafrir | 2006-11-29 11:06:06 +0200
 Add parameter xpp_ec to the module xpp (xpp_zap.c). Defaults to 1. 
 If 0, module will use Zaptel echo canceller even with XPP_EC_CHUNK.
 Parameter is read-only for now: cannot be set through /sys/modules.
 (Merge of changeset:2830)
 

Modified:
    branches/1.2/xpp/   (props changed)
    branches/1.2/xpp/xpd.h
    branches/1.2/xpp/xpp_zap.c

Propchange: branches/1.2/xpp/
------------------------------------------------------------------------------
--- svk:merge (original)
+++ svk:merge Thu Nov 30 15:48:25 2006
@@ -1,4 +1,4 @@
-283159da-0705-0410-b60c-f2062b4bb6ad:/components/xpp-zaptel/branches/RELEASE-1.2.0/xpp:2831
+283159da-0705-0410-b60c-f2062b4bb6ad:/components/xpp-zaptel/branches/RELEASE-1.2.0/xpp:2832
 283159da-0705-0410-b60c-f2062b4bb6ad:/components/xpp-zaptel/trunk/xpp:2600
 f558416c-6c06-0410-9f27-dde2687782d0:/branches/1.4/xpp:1623
 f558416c-6c06-0410-9f27-dde2687782d0:/team/tzafrir/xpp_1.2/xpp:1554

Modified: branches/1.2/xpp/xpd.h
URL: http://svn.digium.com/view/zaptel/branches/1.2/xpp/xpd.h?view=diff&rev=1668&r1=1667&r2=1668
==============================================================================
--- branches/1.2/xpp/xpd.h (original)
+++ branches/1.2/xpp/xpd.h Thu Nov 30 15:48:25 2006
@@ -43,6 +43,10 @@
 #define	DEF_PARM(type,name,init,desc)	\
 	type name = init;	\
 	module_param(name, type, 0600);		\
+	MODULE_PARM_DESC(name, desc)
+#define	DEF_PARM_RO(type,name,init,desc)	\
+	type name = init;	\
+	module_param(name, type, 0400);		\
 	MODULE_PARM_DESC(name, desc)
 
 #if	LINUX_VERSION_CODE	< KERNEL_VERSION(2,6,10)

Modified: branches/1.2/xpp/xpp_zap.c
URL: http://svn.digium.com/view/zaptel/branches/1.2/xpp/xpp_zap.c?view=diff&rev=1668&r1=1667&r2=1668
==============================================================================
--- branches/1.2/xpp/xpp_zap.c (original)
+++ branches/1.2/xpp/xpp_zap.c Thu Nov 30 15:48:25 2006
@@ -66,6 +66,11 @@
 DEF_PARM(int, print_dbg, 0, "Print DBG statements");
 DEF_PARM(bool, zap_autoreg, 1, "Register spans automatically (1) or not (0)");
 DEF_PARM(bool, prefmaster, 1, "Do we want to be zaptel preferred sync master");
+#ifdef	XPP_EC_CHUNK
+DEF_PARM_RO(bool, xpp_ec, 1, "Do we use our own (1) or Zaptel's (0) echo canceller");
+#else
+static int xpp_ec = 0;
+#endif
 // DEF_ARRAY(int, pcmtx, 4, 0, "Forced PCM values to transmit");
 
 #include "zap_debug.h"
@@ -1042,11 +1047,13 @@
 	for (i = 0;i < xpd->span.channels; i++) {
 		if(IS_SET(xpd->digital_signalling, i))	/* Don't echo cancel PRI/BRI D-chans */
 			continue;
-#ifdef XPP_EC_CHUNK
-		xpp_ec_chunk(&chans[i], chans[i].readchunk, xpd->ec_chunk2[i]);
-#else
-		zt_ec_chunk(&chans[i], chans[i].readchunk, xpd->ec_chunk2[i]);
-#endif
+#ifdef XPP_EC_CHUNK 
+		/* even if defined, parameterr xpp_ec can override at run-time */
+		if (xpp_ec)
+			xpp_ec_chunk(&chans[i], chans[i].readchunk, xpd->ec_chunk2[i]);
+		else
+#endif
+			zt_ec_chunk(&chans[i], chans[i].readchunk, xpd->ec_chunk2[i]);
 		memcpy(xpd->ec_chunk2[i], xpd->ec_chunk1[i], ZT_CHUNKSIZE);
 		memcpy(xpd->ec_chunk1[i], chans[i].writechunk, ZT_CHUNKSIZE);
 	}
@@ -1270,9 +1277,9 @@
 int (*sethook)(struct zt_chan *chan, int hookstate);
 #endif
 
+static int xpp_echocan(struct zt_chan *chan, int len)
+{
 #ifdef	XPP_EC_CHUNK
-static int xpp_echocan(struct zt_chan *chan, int len)
-{
 	if(len == 0) {	/* shut down */
 		/* zaptel calls this also during channel initialization */
 		if(chan->ec) {
@@ -1289,9 +1296,9 @@
 		ERR("%s: Failed creating xpp EC (len=%d)\n", __FUNCTION__, len);
 		return -EINVAL;
 	}
+#endif
 	return 0;
 }
-#endif
 
 #ifdef	CONFIG_ZAPTEL_WATCHDOG
 /*
@@ -1389,9 +1396,8 @@
 	span->hooksig = xpp_hooksig;	/* Only with RBS bits */
 	span->ioctl = xpp_ioctl;
 	span->maint = xpp_maint;
-#ifdef	XPP_EC_CHUNK
-	span->echocan = xpp_echocan;
-#endif
+	if (xpp_ec)
+		span->echocan = xpp_echocan;
 #ifdef	CONFIG_ZAPTEL_WATCHDOG
 	span->watchdog = xpp_watchdog;
 #endif
@@ -1449,11 +1455,10 @@
 #else
 	INFO("FEATURE: %s (without ECHO_SUPPRESSION)\n", THIS_MODULE->name);
 #endif
-#ifdef XPP_EC_CHUNK
-	INFO("FEATURE: %s (with XPP_EC_CHUNK)\n", THIS_MODULE->name);
-#else
-	INFO("FEATURE: %s (without XPP_EC_CHUNK)\n", THIS_MODULE->name);
-#endif
+	if (xpp_ec)
+		INFO("FEATURE: %s (with XPP_EC_CHUNK)\n", THIS_MODULE->name);
+	else
+		INFO("FEATURE: %s (without XPP_EC_CHUNK)\n", THIS_MODULE->name);
 #ifdef CONFIG_ZAPATA_BRI_DCHANS
 	INFO("FEATURE: %s (with BRISTUFF support)\n", THIS_MODULE->name);
 #else



More information about the zaptel-commits mailing list