[zaptel-commits] mattf: branch 1.4 r3727 - /branches/1.4/wctdm24xxp/base.c

SVN commits to the Zaptel project zaptel-commits at lists.digium.com
Wed Jan 23 10:39:43 CST 2008


Author: mattf
Date: Wed Jan 23 10:39:43 2008
New Revision: 3727

URL: http://svn.digium.com/view/zaptel?view=rev&rev=3727
Log:
Revert part of previous commit which wasn't supposed to be merged yet

Modified:
    branches/1.4/wctdm24xxp/base.c

Change Statistics:
 0 files changed

Modified: branches/1.4/wctdm24xxp/base.c
URL: http://svn.digium.com/view/zaptel/branches/1.4/wctdm24xxp/base.c?view=diff&rev=3727&r1=3726&r2=3727
==============================================================================
--- branches/1.4/wctdm24xxp/base.c (original)
+++ branches/1.4/wctdm24xxp/base.c Wed Jan 23 10:39:43 2008
@@ -3296,68 +3296,6 @@
 
 #ifdef VPM150M_SUPPORT
 
-void vpm150m_set_chanconfig_from_state(int channum, struct adt_lec_params * parms, GpakChannelConfig_t *chanconfig)
-{
-	chanconfig->PcmInPortA = 3;
-	chanconfig->PcmInSlotA = channum;
-	chanconfig->PcmOutPortA = SerialPortNull;
-	chanconfig->PcmOutSlotA = channum;
-	chanconfig->PcmInPortB = 2;
-	chanconfig->PcmInSlotB = channum;
-	chanconfig->PcmOutPortB = 3;
-	chanconfig->PcmOutSlotB = channum;
-	if (vpmdtmfsupport) {
-		chanconfig->ToneTypesA = DTMF_tone;
-		chanconfig->MuteToneA = Enabled;
-		chanconfig->FaxCngDetA = Enabled;
-	} else {
-		chanconfig->ToneTypesA = Null_tone;
-		chanconfig->MuteToneA = Disabled;
-		chanconfig->FaxCngDetA = Disabled;
-	}
-	chanconfig->ToneTypesB = Null_tone;
-	chanconfig->EcanEnableA = Enabled;
-	chanconfig->EcanEnableB = Disabled;
-	chanconfig->MuteToneB = Disabled;
-	chanconfig->FaxCngDetB = Disabled;
-
-	if (alawoverride)
-		chanconfig->SoftwareCompand = cmpPCMA;
-	else
-		chanconfig->SoftwareCompand = cmpPCMU;
-
-	chanconfig->FrameRate = rate2ms;
-	chanconfig->EcanParametersA.EcanTapLength = 1024;
-	chanconfig->EcanParametersA.EcanNlpType = parms->nlp_type;
-	chanconfig->EcanParametersA.EcanAdaptEnable = 1;
-	chanconfig->EcanParametersA.EcanG165DetEnable = 1;
-	chanconfig->EcanParametersA.EcanDblTalkThresh = 6;
-	chanconfig->EcanParametersA.EcanNlpThreshold = parms->nlp_threshold;
-	chanconfig->EcanParametersA.EcanNlpConv = 0;
-	chanconfig->EcanParametersA.EcanNlpUnConv = 0;
-	chanconfig->EcanParametersA.EcanNlpMaxSuppress = parms->nlp_max_suppress;
-	chanconfig->EcanParametersA.EcanCngThreshold = 43;
-	chanconfig->EcanParametersA.EcanAdaptLimit = 50;
-	chanconfig->EcanParametersA.EcanCrossCorrLimit = 15;
-	chanconfig->EcanParametersA.EcanNumFirSegments = 3;
-	chanconfig->EcanParametersA.EcanFirSegmentLen = 64;
-
-	chanconfig->EcanParametersB.EcanTapLength = 1024;
-	chanconfig->EcanParametersB.EcanNlpType = parms->nlp_type;
-	chanconfig->EcanParametersB.EcanAdaptEnable = 1;
-	chanconfig->EcanParametersB.EcanG165DetEnable = 1;
-	chanconfig->EcanParametersB.EcanDblTalkThresh = 6;
-	chanconfig->EcanParametersB.EcanNlpThreshold = parms->nlp_threshold;
-	chanconfig->EcanParametersB.EcanNlpConv = 0;
-	chanconfig->EcanParametersB.EcanNlpUnConv = 0;
-	chanconfig->EcanParametersB.EcanNlpMaxSuppress = parms->nlp_max_suppress;
-	chanconfig->EcanParametersB.EcanCngThreshold = 43;
-	chanconfig->EcanParametersB.EcanAdaptLimit = 50;
-	chanconfig->EcanParametersB.EcanCrossCorrLimit = 15;
-	chanconfig->EcanParametersB.EcanNumFirSegments = 3;
-	chanconfig->EcanParametersB.EcanFirSegmentLen = 64;
-}
-
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20)
 static void vpm150m_bh(void *data)
 {
@@ -3405,13 +3343,17 @@
 		GpakAsyncEventCode_t eventcode;
 		GpakAsyncEventData_t eventdata;
 		gpakReadEventFIFOMessageStat_t  res;
+#if 1
 		unsigned int start = wc->intcount;
+#endif
 
 		do {
 			res = gpakReadEventFIFOMessage(vpm150m->dspid, &channel, &eventcode, &eventdata);
 
+#if 1
 			if (debug & DEBUG_ECHOCAN)
 				printk("ReadEventFIFOMessage took %d ms\n", wc->intcount - start);
+#endif
 
 			if (res == RefInvalidEvent || res == RefDspCommFailure) {
 				printk("Uh oh (%d)\n", res);
@@ -3466,47 +3408,25 @@
 		GPAK_AlgControlStat_t pstatus;
 		int res;
 
-		if ((vpm150m->desiredecstate[i].nlp_type != vpm150m->curecstate[i].nlp_type)
-			|| (vpm150m->desiredecstate[i].nlp_threshold != vpm150m->curecstate[i].nlp_threshold)
-			|| (vpm150m->desiredecstate[i].nlp_max_suppress != vpm150m->curecstate[i].nlp_max_suppress)) {
-
-			GPAK_ChannelConfigStat_t cstatus;
-			GPAK_TearDownChanStat_t tstatus;
-			GpakChannelConfig_t chanconfig;
-
-
-			vpm150m_set_chanconfig_from_state(i, &vpm150m->desiredecstate[i], &chanconfig);
-
-			if ((res = gpakTearDownChannel(vpm150m->dspid, i, &tstatus)))
-				goto vpm_bh_out;
-
-			if ((res = gpakConfigureChannel(vpm150m->dspid, i, tdmToTdm, &chanconfig, &cstatus)))
-				goto vpm_bh_out;
-
-			if (!vpm150m->desiredecstate[i].tap_length)
-				res = gpakAlgControl(vpm150m->dspid, i, BypassEcanA, &pstatus);
-
+		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 (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 {
-				res = gpakAlgControl(vpm150m->dspid, i, BypassEcanA, &pstatus);
-				if (debug & DEBUG_ECHOCAN)
-					printk("Echocan disable took %d ms\n", wc->intcount - start);
-			}
-		}
-
-vpm_bh_out:
+			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;
 }
-	
+
 static int vpm150m_config_hw(struct wctdm *wc)
 {
 	struct vpm150m *vpm150m = wc->vpm150m;
@@ -3601,17 +3521,66 @@
 	}
 
 	for (i = 0; i < wc->type; i++) {
-		vpm150m->curecstate[i].tap_length = 0;
-		vpm150m->curecstate[i].nlp_type = ADT_LEC_NLP_MUTE;
-		vpm150m->curecstate[i].nlp_threshold = 24;
-		vpm150m->curecstate[i].nlp_max_suppress = 0;
-	
-		vpm150m->desiredecstate[i].tap_length = 0;
-		vpm150m->desiredecstate[i].nlp_type = ADT_LEC_NLP_MUTE;
-		vpm150m->desiredecstate[i].nlp_threshold = 24;
-		vpm150m->desiredecstate[i].nlp_max_suppress = 0;
-	
-		vpm150m_set_chanconfig_from_state(i, &vpm150m->curecstate[i], &chanconfig);
+		/* Let's configure a channel */
+		chanconfig.PcmInPortA = 3;
+		chanconfig.PcmInSlotA = i;
+		chanconfig.PcmOutPortA = SerialPortNull;
+		chanconfig.PcmOutSlotA = i;
+		chanconfig.PcmInPortB = 2;
+		chanconfig.PcmInSlotB = i;
+		chanconfig.PcmOutPortB = 3;
+		chanconfig.PcmOutSlotB = i;
+		if (vpmdtmfsupport) {
+			chanconfig.ToneTypesA = DTMF_tone;
+			chanconfig.MuteToneA = Enabled;
+			chanconfig.FaxCngDetA = Enabled;
+		} else {
+			chanconfig.ToneTypesA = Null_tone;
+			chanconfig.MuteToneA = Disabled;
+			chanconfig.FaxCngDetA = Disabled;
+		}
+		chanconfig.ToneTypesB = Null_tone;
+		chanconfig.EcanEnableA = Enabled;
+		chanconfig.EcanEnableB = Disabled;
+		chanconfig.MuteToneB = Disabled;
+		chanconfig.FaxCngDetB = Disabled;
+
+		if (alawoverride)
+			chanconfig.SoftwareCompand = cmpPCMA;
+		else
+			chanconfig.SoftwareCompand = cmpPCMU;
+
+		chanconfig.FrameRate = rate2ms;
+	
+		chanconfig.EcanParametersA.EcanTapLength = 1024;
+		chanconfig.EcanParametersA.EcanNlpType = 1;
+		chanconfig.EcanParametersA.EcanAdaptEnable = 1;
+		chanconfig.EcanParametersA.EcanG165DetEnable = 1;
+		chanconfig.EcanParametersA.EcanDblTalkThresh = 6;
+		chanconfig.EcanParametersA.EcanNlpThreshold = 24;
+		chanconfig.EcanParametersA.EcanNlpConv = 0;
+		chanconfig.EcanParametersA.EcanNlpUnConv = 0;
+		chanconfig.EcanParametersA.EcanNlpMaxSuppress = 0;
+		chanconfig.EcanParametersA.EcanCngThreshold = 43;
+		chanconfig.EcanParametersA.EcanAdaptLimit = 50;
+		chanconfig.EcanParametersA.EcanCrossCorrLimit = 15;
+		chanconfig.EcanParametersA.EcanNumFirSegments = 3;
+		chanconfig.EcanParametersA.EcanFirSegmentLen = 64;
+	
+		chanconfig.EcanParametersB.EcanTapLength = 1024;
+		chanconfig.EcanParametersB.EcanNlpType = 1;
+		chanconfig.EcanParametersB.EcanAdaptEnable = 1;
+		chanconfig.EcanParametersB.EcanG165DetEnable = 1;
+		chanconfig.EcanParametersB.EcanDblTalkThresh = 6;
+		chanconfig.EcanParametersB.EcanNlpThreshold = 24;
+		chanconfig.EcanParametersB.EcanNlpConv = 0;
+		chanconfig.EcanParametersB.EcanNlpUnConv = 0;
+		chanconfig.EcanParametersB.EcanNlpMaxSuppress = 0;
+		chanconfig.EcanParametersB.EcanCngThreshold = 43;
+		chanconfig.EcanParametersB.EcanAdaptLimit = 50;
+		chanconfig.EcanParametersB.EcanCrossCorrLimit = 15;
+		chanconfig.EcanParametersB.EcanNumFirSegments = 3;
+		chanconfig.EcanParametersB.EcanFirSegmentLen = 64;
 	
 		if ((res = gpakConfigureChannel(vpm150m->dspid, i, tdmToTdm, &chanconfig, &cstatus))) {
 			printk("Unable to configure channel (%d)\n", res);




More information about the zaptel-commits mailing list