summaryrefslogtreecommitdiff
path: root/wctdm24xxp/base.c
diff options
context:
space:
mode:
authorkpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-01-11 22:39:54 +0000
committerkpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-01-11 22:39:54 +0000
commit82006e400dded9c66d9dbcd187b5d6573af0095f (patch)
tree3e663e5aec9a52418d89dabf039e18ca9e76bcc6 /wctdm24xxp/base.c
parent9b802f9e0ab907abcd80ad9db8f9d76ee6c061ed (diff)
finish updating to support echocan params ioctl, even though the parameters are currently ignored
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@3672 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'wctdm24xxp/base.c')
-rw-r--r--wctdm24xxp/base.c61
1 files changed, 27 insertions, 34 deletions
diff --git a/wctdm24xxp/base.c b/wctdm24xxp/base.c
index 9256ef9..32b4230 100644
--- a/wctdm24xxp/base.c
+++ b/wctdm24xxp/base.c
@@ -1549,17 +1549,19 @@ static int wctdm_echocan_with_params(struct zt_chan *chan, struct zt_echocanpara
return 0;
#ifdef VPM150M_SUPPORT
} else if (wc->vpm150m) {
+ struct adt_lec_params params;
struct vpm150m *vpm150m = wc->vpm150m;
+ 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);
- 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);
- }
return 0;
#endif
} else
@@ -3360,33 +3362,24 @@ static void vpm150m_bh(struct work_struct *data)
}
for (i = 0; i < wc->type; i++) {
- int enable = -1;
- if (test_bit(i, &vpm150m->desiredecstate)) {
- if (!test_bit(i, &vpm150m->curecstate)) {
- enable = 1;
- }
- } else {
- if (test_bit(i, &vpm150m->curecstate)) {
- enable = 0;
- }
- }
- if (enable > -1) {
- unsigned int start = wc->intcount;
- GPAK_AlgControlStat_t pstatus;
- int res;
+ 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);
+ 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 {
+ 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;