summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xfxotune.c13
-rwxr-xr-xwctdm.c5
-rwxr-xr-xwctdm.h2
3 files changed, 16 insertions, 4 deletions
diff --git a/fxotune.c b/fxotune.c
index 434d2d6..29eaa3b 100755
--- a/fxotune.c
+++ b/fxotune.c
@@ -226,13 +226,15 @@ int main (int argc , char **argv)
}
if (!strcasecmp(argv[1], "-s")) {
+ FILE *fp = NULL;
+
+ fp = fopen(configfile, "r");
+
for (i = 0;res != EOF; i++) {
struct wctdm_echo_coefs mycoefs;
char completezappath[56] = "";
int myzap,myacim,mycoef1,mycoef2,mycoef3,mycoef4,mycoef5,mycoef6,mycoef7,mycoef8;
- FILE *fp = NULL;
- fp = fopen(configfile, "r");
res = fscanf(fp, "%d=%d,%d,%d,%d,%d,%d,%d,%d,%d",&myzap,&myacim,&mycoef1,
&mycoef2,&mycoef3,&mycoef4,&mycoef5,&mycoef6,&mycoef7,
@@ -274,8 +276,13 @@ int main (int argc , char **argv)
fprintf(stdout, "%s: %s\n", completezappath, strerror(errno));
return -1;
}
+
+ close(fd);
}
+
+ fclose(fp);
+ fprintf(stdout, "fxotune: successfully set echo coeffecients on FXO modules\n");
return 0;
}
@@ -288,7 +295,7 @@ int main (int argc , char **argv)
configfd = open(configfile, O_CREAT|O_TRUNC|O_WRONLY);
if (configfd < 0) {
- fprintf(stdout, "open: %s\n", strerror(errno));
+ fprintf(stderr, "open: %s\n", strerror(errno));
return -1;
}
diff --git a/wctdm.c b/wctdm.c
index 663d631..fce4181 100755
--- a/wctdm.c
+++ b/wctdm.c
@@ -1594,6 +1594,7 @@ static int wctdm_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long dat
struct wctdm_echo_coefs echoregs;
struct wctdm *wc = chan->pvt;
int x;
+ printk("We hit our IOCTL\n");
switch (cmd) {
case ZT_ONHOOKTRANSFER:
if (wc->modtype[chan->chanpos - 1] != MOD_TYPE_FXS)
@@ -1651,6 +1652,7 @@ static int wctdm_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long dat
}
break;
case WCTDM_SET_ECHOTUNE:
+ printk("Setting echo registers: \n");
if (copy_from_user(&echoregs, (struct wctdm_echo_coefs*)data, sizeof(echoregs)))
return -EFAULT;
@@ -1668,9 +1670,12 @@ static int wctdm_ioctl(struct zt_chan *chan, unsigned int cmd, unsigned long dat
wctdm_setreg(wc, chan->chanpos - 1, 51, echoregs.coef7);
wctdm_setreg(wc, chan->chanpos - 1, 52, echoregs.coef8);
+ printk("-- Set echo registers successfully\n");
+
break;
} else {
return -EINVAL;
+
}
break;
default:
diff --git a/wctdm.h b/wctdm.h
index 93540d5..73703aa 100755
--- a/wctdm.h
+++ b/wctdm.h
@@ -63,7 +63,7 @@ struct wctdm_echo_coefs {
#define WCTDM_GET_STATS _IOR (ZT_CODE, 60, struct wctdm_stats)
#define WCTDM_GET_REGS _IOR (ZT_CODE, 61, struct wctdm_regs)
#define WCTDM_SET_REG _IOW (ZT_CODE, 62, struct wctdm_regop)
-#define WCTDM_SET_ECHOTUNE _IOW (ZT_CODE, 63, int)
+#define WCTDM_SET_ECHOTUNE _IOW (ZT_CODE, 63, struct wctdm_echo_coefs)
#endif /* _WCTDM_H */