[Asterisk-cvs] zaptel fxotune.c, 1.11, 1.12 wctdm.c, 1.102, 1.103 wctdm.h, 1.7, 1.8

mattf at lists.digium.com mattf at lists.digium.com
Mon Jan 17 11:17:15 CST 2005


Update of /usr/cvsroot/zaptel
In directory mongoose.digium.com:/tmp/cvs-serv28681

Modified Files:
	fxotune.c wctdm.c wctdm.h 
Log Message:
Working out a few bugs.  Should be usable now.


Index: fxotune.c
===================================================================
RCS file: /usr/cvsroot/zaptel/fxotune.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- fxotune.c	17 Jan 2005 15:53:17 -0000	1.11
+++ fxotune.c	17 Jan 2005 17:20:33 -0000	1.12
@@ -226,13 +226,15 @@
 	}
 
 	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 @@
 				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 @@
 		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;
 		}
 

Index: wctdm.c
===================================================================
RCS file: /usr/cvsroot/zaptel/wctdm.c,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -d -r1.102 -r1.103
--- wctdm.c	15 Jan 2005 22:59:18 -0000	1.102
+++ wctdm.c	17 Jan 2005 17:20:33 -0000	1.103
@@ -1594,6 +1594,7 @@
 	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 @@
 		}
 		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 @@
 			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:

Index: wctdm.h
===================================================================
RCS file: /usr/cvsroot/zaptel/wctdm.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- wctdm.h	8 Jan 2005 00:05:24 -0000	1.7
+++ wctdm.h	17 Jan 2005 17:20:33 -0000	1.8
@@ -63,7 +63,7 @@
 #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 */




More information about the svn-commits mailing list