[zaptel-commits] kpfleming: trunk r1439 - in /trunk: ./ wct4xxp/base.c wct4xxp/vpm450m.c

zaptel-commits at lists.digium.com zaptel-commits at lists.digium.com
Fri Sep 8 09:13:13 MST 2006


Author: kpfleming
Date: Fri Sep  8 11:13:13 2006
New Revision: 1439

URL: http://svn.digium.com/view/zaptel?rev=1439&view=rev
Log:
Merged revisions 1436-1438 via svnmerge from 
https://origsvn.digium.com/svn/zaptel/branches/1.2

........
r1436 | kpfleming | 2006-09-08 11:02:43 -0500 (Fri, 08 Sep 2006) | 3 lines

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

........
r1437 | kpfleming | 2006-09-08 11:06:21 -0500 (Fri, 08 Sep 2006) | 2 lines

fix spacing in log message

........
r1438 | kpfleming | 2006-09-08 11:11:38 -0500 (Fri, 08 Sep 2006) | 2 lines

gotta pay closer attention before i commit this stuff...

........

Modified:
    trunk/   (props changed)
    trunk/wct4xxp/base.c
    trunk/wct4xxp/vpm450m.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.2-merged' - no diff available.

Modified: trunk/wct4xxp/base.c
URL: http://svn.digium.com/view/zaptel/trunk/wct4xxp/base.c?rev=1439&r1=1438&r2=1439&view=diff
==============================================================================
--- trunk/wct4xxp/base.c (original)
+++ trunk/wct4xxp/base.c Fri Sep  8 11:13:13 2006
@@ -187,7 +187,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;
@@ -1164,7 +1165,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));
@@ -2999,7 +3000,7 @@
 	}
 	spin_unlock_irqrestore(&wc->reglock, flags);
 
-	if (needcheckvpm450 && vpmdtmfsupport) {
+	if (needcheckvpm450 && (vpmdtmfsupport == 1)) {
 		t4_check_vpm450(wc);
 		needcheckvpm450 = 0;
 	}
@@ -3148,6 +3149,10 @@
 #ifdef HOTPLUG_FIRMWARE
 	release_firmware(firmware);
 #endif
+	if (vpmdtmfsupport == -1) {
+		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);
 		
@@ -3285,6 +3290,10 @@
 			t4_vpm_out(wc, x, i, (x < 4) ? 0x55 : 0xAA);
 
 	} 
+	if (vpmdtmfsupport == -1) {
+		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: trunk/wct4xxp/vpm450m.c
URL: http://svn.digium.com/view/zaptel/trunk/wct4xxp/vpm450m.c?rev=1439&r1=1438&r2=1439&view=diff
==============================================================================
--- trunk/wct4xxp/vpm450m.c (original)
+++ trunk/wct4xxp/vpm450m.c Fri Sep  8 11:13:13 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 zaptel-commits mailing list