diff options
author | kpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2006-09-08 16:13:13 +0000 |
---|---|---|
committer | kpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2006-09-08 16:13:13 +0000 |
commit | 7714951569543658b31c0ed23f80296fa848c82d (patch) | |
tree | f63198eb3b67718c69763e215391f7f42148f623 /wct4xxp | |
parent | 49b8bd978bf1fb6f12a123681fbb6027878db615 (diff) |
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...
........
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@1439 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'wct4xxp')
-rw-r--r-- | wct4xxp/base.c | 15 | ||||
-rw-r--r-- | wct4xxp/vpm450m.c | 5 |
2 files changed, 16 insertions, 4 deletions
diff --git a/wct4xxp/base.c b/wct4xxp/base.c index f1a4e14..341e443 100644 --- a/wct4xxp/base.c +++ b/wct4xxp/base.c @@ -187,7 +187,8 @@ static int loopback = 0; 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 @@ static int t4_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long data) 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 @@ static void t4_interrupt_gen2(int irq, void *dev_id, struct pt_regs *regs) } spin_unlock_irqrestore(&wc->reglock, flags); - if (needcheckvpm450 && vpmdtmfsupport) { + if (needcheckvpm450 && (vpmdtmfsupport == 1)) { t4_check_vpm450(wc); needcheckvpm450 = 0; } @@ -3148,6 +3149,10 @@ static void t4_vpm450_init(struct t4 *wc) #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 @@ static void t4_vpm400_init(struct t4 *wc) 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; } diff --git a/wct4xxp/vpm450m.c b/wct4xxp/vpm450m.c index d423c12..5e52b79 100644 --- a/wct4xxp/vpm450m.c +++ b/wct4xxp/vpm450m.c @@ -442,7 +442,10 @@ struct vpm450m *init_vpm450m(void *wc, int *isalaw) 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; |