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

SVN commits to the Zaptel project zaptel-commits at lists.digium.com
Wed Dec 19 00:45:53 CST 2007


Author: kpfleming
Date: Wed Dec 19 00:45:52 2007
New Revision: 3526

URL: http://svn.digium.com/view/zaptel?view=rev&rev=3526
Log:
eliminate a compiler warning and restore the ability to use HPEC (without parameters for now)

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

Modified: branches/1.4/hpec/hpec_zaptel.h
URL: http://svn.digium.com/view/zaptel/branches/1.4/hpec/hpec_zaptel.h?view=diff&rev=3526&r1=3525&r2=3526
==============================================================================
--- branches/1.4/hpec/hpec_zaptel.h (original)
+++ branches/1.4/hpec/hpec_zaptel.h Wed Dec 19 00:45:52 2007
@@ -87,18 +87,22 @@
 
 DECLARE_MUTEX(alloc_lock);
 
-static inline struct echo_can_state *echo_can_create(int len, int adaption_mode)
+static int echo_can_create(struct zt_echocanparams *ecp, struct zt_echocanparam *p,
+			   struct echo_can_state **ec)
 {
-	struct echo_can_state *result = NULL;
+	if (ecp->param_count > 0) {
+		printk(KERN_WARNING "HPEC does not support parameters; failing request\n");
+		return -EINVAL;
+	}
 
 	if (down_interruptible(&alloc_lock))
-		return NULL;
+		return -ENOTTY;
 
-	result = hpec_channel_alloc(len);
+	*ec = hpec_channel_alloc(ecp->tap_length);
 
 	up(&alloc_lock);
 
-	return result;
+	return *ec ? 0 : -ENOTTY;
 }
 
 static inline int echo_can_traintap(struct echo_can_state *ec, int pos, short val)

Modified: branches/1.4/zaptel-base.c
URL: http://svn.digium.com/view/zaptel/branches/1.4/zaptel-base.c?view=diff&rev=3526&r1=3525&r2=3526
==============================================================================
--- branches/1.4/zaptel-base.c (original)
+++ branches/1.4/zaptel-base.c Wed Dec 19 00:45:52 2007
@@ -4306,7 +4306,7 @@
 
 static int ioctl_echocancel(struct zt_chan *chan, struct zt_echocanparams *ecp, void *data)
 {
-	struct echo_can_state *ec, *tec;
+	struct echo_can_state *ec = NULL, *tec;
 	struct zt_echocanparam params[MAX_ECHOCANPARAMS];
 	int ret;
 	unsigned long flags;




More information about the zaptel-commits mailing list