[zaptel-commits] kpfleming: branch 1.4 r3672 - in /branches/1.4/wctdm24xxp: base.c wctdm24xxp.h

SVN commits to the Zaptel project zaptel-commits at lists.digium.com
Fri Jan 11 16:39:55 CST 2008


Author: kpfleming
Date: Fri Jan 11 16:39:54 2008
New Revision: 3672

URL: http://svn.digium.com/view/zaptel?view=rev&rev=3672
Log:
finish updating to support echocan params ioctl, even though the parameters are currently ignored

Modified:
    branches/1.4/wctdm24xxp/base.c
    branches/1.4/wctdm24xxp/wctdm24xxp.h

Modified: branches/1.4/wctdm24xxp/base.c
URL: http://svn.digium.com/view/zaptel/branches/1.4/wctdm24xxp/base.c?view=diff&rev=3672&r1=3671&r2=3672
==============================================================================
--- branches/1.4/wctdm24xxp/base.c (original)
+++ branches/1.4/wctdm24xxp/base.c Fri Jan 11 16:39:54 2008
@@ -1549,17 +1549,19 @@
 		return 0;
 #ifdef VPM150M_SUPPORT
 	} else if (wc->vpm150m) {
+		struct adt_lec_params params;
 		struct vpm150m *vpm150m = wc->vpm150m;
-
-		if (ecp->tap_length) {
-			set_bit(chan->chanpos - 1, &vpm150m->desiredecstate);
-			if (test_bit(VPM150M_ACTIVE, &vpm150m->control))
-				queue_work(vpm150m->wq, &vpm150m->work);
-		} else {
-			clear_bit(chan->chanpos - 1, &vpm150m->desiredecstate);
-			if (test_bit(VPM150M_ACTIVE, &vpm150m->control))
-				queue_work(vpm150m->wq, &vpm150m->work);
-		}
+		unsigned int ret;
+
+		adt_lec_init_defaults(&params, 32);
+
+		if ((ret = adt_lec_parse_params(&params, ecp, p)))
+			return ret;
+
+		vpm150m->desiredecstate[chan->chanpos - 1] = params;
+		if (test_bit(VPM150M_ACTIVE, &vpm150m->control))
+			queue_work(vpm150m->wq, &vpm150m->work);
+
 		return 0;
 #endif
 	} else
@@ -3360,33 +3362,24 @@
 	}
 	
 	for (i = 0; i < wc->type; i++) {
-		int enable = -1;
-		if (test_bit(i, &vpm150m->desiredecstate)) {
-			if (!test_bit(i, &vpm150m->curecstate)) {
-				enable = 1;
-			}
+		unsigned int start = wc->intcount;
+		GPAK_AlgControlStat_t pstatus;
+		int res;
+
+		if (!memcmp(&vpm150m->curecstate[i], &vpm150m->desiredecstate[i], sizeof(vpm150m->curecstate)))
+			continue;
+
+		if (vpm150m->desiredecstate[i].tap_length) {
+			res = gpakAlgControl(vpm150m->dspid, i, EnableEcanA, &pstatus);
+			if (debug & DEBUG_ECHOCAN)
+				printk("Echocan enable took %d ms\n", wc->intcount - start);
 		} else {
-			if (test_bit(i, &vpm150m->curecstate)) {
-				enable = 0;
-			}
-		}
-		if (enable > -1) {
-			unsigned int start = wc->intcount;
-			GPAK_AlgControlStat_t pstatus;
-			int res;
-
-			if (enable) {
-				res = gpakAlgControl(vpm150m->dspid, i, EnableEcanA, &pstatus);
-				if (debug & DEBUG_ECHOCAN)
-					printk("Echocan enable took %d ms\n", wc->intcount - start);
-			} else {
-				res = gpakAlgControl(vpm150m->dspid, i, BypassEcanA, &pstatus);
-				if (debug & DEBUG_ECHOCAN)
-					printk("Echocan disable took %d ms\n", wc->intcount - start);
-			}
-			if (!res)
-				change_bit(i, &vpm150m->curecstate);
-		}
+			res = gpakAlgControl(vpm150m->dspid, i, BypassEcanA, &pstatus);
+			if (debug & DEBUG_ECHOCAN)
+				printk("Echocan disable took %d ms\n", wc->intcount - start);
+		}
+		if (!res)
+			vpm150m->curecstate[i] = vpm150m->desiredecstate[i];
 	}
 			
 	return;

Modified: branches/1.4/wctdm24xxp/wctdm24xxp.h
URL: http://svn.digium.com/view/zaptel/branches/1.4/wctdm24xxp/wctdm24xxp.h?view=diff&rev=3672&r1=3671&r2=3672
==============================================================================
--- branches/1.4/wctdm24xxp/wctdm24xxp.h (original)
+++ branches/1.4/wctdm24xxp/wctdm24xxp.h Fri Jan 11 16:39:54 2008
@@ -132,6 +132,10 @@
 
 #endif
 
+#ifdef VPM150M_SUPPORT
+#include "adt_lec.h"
+#endif
+
 struct vpm150m_cmd {
 	unsigned int addr;
 	unsigned char datalen;
@@ -152,8 +156,8 @@
 	unsigned long control;
 	unsigned char curpage;
 	unsigned short version;
-	unsigned long curecstate;
-	unsigned long desiredecstate;
+	struct adt_lec_params curecstate[24];
+	struct adt_lec_params desiredecstate[24];
 	unsigned long curdtmfmutestate;
 	unsigned long desireddtmfmutestate;
 	struct vpm150m_cmd cmdq[VPM150M_MAX_COMMANDS];




More information about the zaptel-commits mailing list