[svn-commits] kpfleming: branch 1.2 r1436 - in /branches/1.2/wct4xxp: base.c vpm450m.c

svn-commits at lists.digium.com svn-commits at lists.digium.com
Fri Sep 8 09:02:44 MST 2006


Author: kpfleming
Date: Fri Sep  8 11:02:43 2006
New Revision: 1436

URL: http://svn.digium.com/view/zaptel?rev=1436&view=rev
Log:
fix problem with VPM450M/VPMOCT when T1 and E1 are both used on the card
make hardware DTMF detection default based on whether the module is a VPM400M or a VPM450M/VPMOCT

Modified:
    branches/1.2/wct4xxp/base.c
    branches/1.2/wct4xxp/vpm450m.c

Modified: branches/1.2/wct4xxp/base.c
URL: http://svn.digium.com/view/zaptel/branches/1.2/wct4xxp/base.c?rev=1436&r1=1435&r2=1436&view=diff
==============================================================================
--- branches/1.2/wct4xxp/base.c (original)
+++ branches/1.2/wct4xxp/base.c Fri Sep  8 11:02:43 2006
@@ -184,7 +184,8 @@
 static int alarmdebounce = 0;
 #ifdef VPM_SUPPORT
 static int vpmsupport = 1;
-static int vpmdtmfsupport = 0;
+/* If set to auto, vpmdtmfsupport is enabled for VPM400M and disabled for VPM450M */
+static int vpmdtmfsupport = -1; /* -1=auto, 0=disabled, 1=enabled*/
 static int vpmspans = 4;
 #define VPM_DEFAULT_DTMFTHRESHOLD 1000
 static int dtmfthreshold = VPM_DEFAULT_DTMFTHRESHOLD;
@@ -1039,7 +1040,7 @@
 			return -EFAULT;
 		if (!wc->vpm)
 			return -ENOSYS;
-		if (j && !vpmdtmfsupport)
+		if (j && (vpmdtmfsupport == 0))
 			return -ENOSYS;
 		if (j & ZT_TONEDETECT_ON)
 			ts->dtmfmask |= (1 << (chan->chanpos - 1));
@@ -2576,7 +2577,7 @@
 	}
 	spin_unlock_irqrestore(&wc->reglock, flags);
 	
-	if (needcheckvpm450 && vpmdtmfsupport) {
+	if (needcheckvpm450 && (vpmdtmfsupport == 1)) {
 		t4_check_vpm450(wc);
 		needcheckvpm450 = 0;
 	}
@@ -2725,6 +2726,10 @@
 #ifdef HOTPLUG_FIRMWARE
 	release_firmware(firmware);
 #endif
+	if (vpmdtmfsupport<0){
+		printk("VPM450: hardware DTMF disabled.\n");
+		vpmdtmfsupport = 0;
+	}
 	wc->vpm = T4_VPM_PRESENT;
 	printk("VPM450: Present and operational servicing %d span(s)\n", wc->numspans);
 }
@@ -2861,6 +2866,10 @@
 			t4_vpm_out(wc, x, i, (x < 4) ? 0x55 : 0xAA);
 
 	} 
+	if (vpmdtmfsupport<0){
+		printk("VPM400: hardware DTMF enabled.\n");
+		vpmdtmfsupport = 1;
+	}
 	printk("VPM400%s: Present and operational servicing %d span(s)\n", (gen2vpm ? "(2nd Gen)" : ""), wc->numspans);
 	wc->vpm = T4_VPM_PRESENT;
 }

Modified: branches/1.2/wct4xxp/vpm450m.c
URL: http://svn.digium.com/view/zaptel/branches/1.2/wct4xxp/vpm450m.c?rev=1436&r1=1435&r2=1436&view=diff
==============================================================================
--- branches/1.2/wct4xxp/vpm450m.c (original)
+++ branches/1.2/wct4xxp/vpm450m.c Fri Sep  8 11:02:43 2006
@@ -442,7 +442,10 @@
 		return NULL;
 	}
 	for (x=0;x<128;x++) {
-		if (isalaw[x >> 5])
+		/* span timeslots are interleaved 12341234... 
+		 * therefore, the lower 2 bits tell us which span this timeslot/channel
+		 */
+		if (isalaw[x & 0x03]) 
 			law = cOCT6100_PCM_A_LAW;
 		else
 			law = cOCT6100_PCM_U_LAW;



More information about the svn-commits mailing list