[zaptel-commits] kpfleming: branch 1.4 r3600 - in /branches/1.4: zaptel-base.c zaptel.h

SVN commits to the Zaptel project zaptel-commits at lists.digium.com
Thu Jan 3 10:52:45 CST 2008


Author: kpfleming
Date: Thu Jan  3 10:52:45 2008
New Revision: 3600

URL: http://svn.digium.com/view/zaptel?view=rev&rev=3600
Log:
a little bit of code cleanup and use explicit-size types for new ioctl structures

Modified:
    branches/1.4/zaptel-base.c
    branches/1.4/zaptel.h

Modified: branches/1.4/zaptel-base.c
URL: http://svn.digium.com/view/zaptel/branches/1.4/zaptel-base.c?view=diff&rev=3600&r1=3599&r2=3600
==============================================================================
--- branches/1.4/zaptel-base.c (original)
+++ branches/1.4/zaptel-base.c Thu Jan  3 10:52:45 2008
@@ -4346,6 +4346,9 @@
 	chan->ec = NULL;
 	spin_unlock_irqrestore(&chan->lock, flags);
 	
+	if (tec)
+		echo_can_free(tec);
+
 	ret = -ENOTTY;
 	
 	/* attempt to use the span's echo canceler; fall back to built-in
@@ -4366,11 +4369,8 @@
 			ecp->tap_length = deftaps;
 		}
 		
-		if ((ret = echo_can_create(ecp, params, &ec))) {
-			if (tec)
-				echo_can_free(tec);
+		if ((ret = echo_can_create(ecp, params, &ec)))
 			return ret;
-		}
 		
 		spin_lock_irqsave(&chan->lock, flags);
 		chan->echocancel = ecp->tap_length;
@@ -4382,9 +4382,6 @@
 		echo_can_disable_detector_init(&chan->rxecdis);
 		spin_unlock_irqrestore(&chan->lock, flags);
 	}
-
-	if (tec)
-		echo_can_free(tec);
 
 	return ret;
 }

Modified: branches/1.4/zaptel.h
URL: http://svn.digium.com/view/zaptel/branches/1.4/zaptel.h?view=diff&rev=3600&r1=3599&r2=3600
==============================================================================
--- branches/1.4/zaptel.h (original)
+++ branches/1.4/zaptel.h Thu Jan  3 10:52:45 2008
@@ -89,6 +89,8 @@
 #endif
 #endif /* CONFIG_DEVFS_FS */
 #endif /* __KERNEL__ */
+
+#include <linux/types.h>
 
 #ifndef ELAST
 #define ELAST 500
@@ -387,8 +389,8 @@
 };
 
 struct zt_hwgain{
-	int newgain; /* desired gain in dB but x10.  -3.5dB would be -35 */
-	int tx:1; /* 0=rx; 1=tx */
+	__s32 newgain;	/* desired gain in dB but x10.  -3.5dB would be -35 */
+	__u32 tx:1;	/* 0=rx; 1=tx */
 };
 
 
@@ -879,12 +881,12 @@
 
 struct zt_echocanparam {
 	char name[16];
-	unsigned int value;
+        __u32 value;
 };
 
 struct zt_echocanparams {
-	unsigned int tap_length;		/* 8 taps per millisecond */
-	unsigned int param_count;		/* number of parameters supplied */
+	__u32 tap_length;		/* 8 taps per millisecond */
+	__u32 param_count;		/* number of parameters supplied */
 	/* immediately follow this structure with zt_echocanparam structures */
 };
 
@@ -1149,7 +1151,6 @@
 
 #ifdef __KERNEL__
 
-#include <linux/types.h>
 #include <linux/poll.h>
 
 #define	ZT_MAX_EVENTSIZE	64	/* 64 events max in buffer */
@@ -1360,8 +1361,8 @@
 	echo_can_disable_detector_state_t txecdis;
 	echo_can_disable_detector_state_t rxecdis;
 	
-	int 	echostate;		/* State of echo canceller */
-	int		echolastupdate;	/* Last echo can update pos */
+	int		echostate;		/* State of echo canceller */
+	int		echolastupdate;		/* Last echo can update pos */
 	int		echotimer;		/* Timer for echo update */
 
 	/* RBS timings  */




More information about the zaptel-commits mailing list