summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-12-19 06:45:52 +0000
committerkpfleming <kpfleming@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2007-12-19 06:45:52 +0000
commit3277b9af1137aca9f05a324f957c1e32bcba7d1b (patch)
tree26ca1acbf8eea489e106e091d799339bc2ff15a7
parent4a8f1fb6fa4e4ad06f171c30d129dfeef6d07867 (diff)
eliminate a compiler warning and restore the ability to use HPEC (without parameters for now)
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@3526 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rw-r--r--hpec/hpec_zaptel.h14
-rw-r--r--zaptel-base.c2
2 files changed, 10 insertions, 6 deletions
diff --git a/hpec/hpec_zaptel.h b/hpec/hpec_zaptel.h
index 80004da..2fb5a14 100644
--- a/hpec/hpec_zaptel.h
+++ b/hpec/hpec_zaptel.h
@@ -87,18 +87,22 @@ static inline void echo_can_array_update(struct echo_can_state *ec, short *iref,
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)
diff --git a/zaptel-base.c b/zaptel-base.c
index e200d12..b90eb42 100644
--- a/zaptel-base.c
+++ b/zaptel-base.c
@@ -4306,7 +4306,7 @@ static void do_ppp_calls(unsigned long data)
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;