summaryrefslogtreecommitdiff
path: root/xpp/xpp_zap.c
diff options
context:
space:
mode:
Diffstat (limited to 'xpp/xpp_zap.c')
-rw-r--r--xpp/xpp_zap.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/xpp/xpp_zap.c b/xpp/xpp_zap.c
index db63095..edaedf9 100644
--- a/xpp/xpp_zap.c
+++ b/xpp/xpp_zap.c
@@ -152,8 +152,7 @@ static void xpd_free(xpd_t *xpd)
if(xpd->xproto)
xproto_put(xpd->xproto);
xpd->xproto = NULL;
- memset(xpd, 0, sizeof(*xpd));
- kfree(xpd);
+ KZFREE(xpd);
}
@@ -277,8 +276,7 @@ void card_detected(struct card_desc_struct *card_desc)
if(zap_autoreg)
zaptel_register_xpd(xpd);
out:
- memset(card_desc, 0, sizeof(struct card_desc_struct));
- kfree(card_desc);
+ KZFREE(card_desc);
return;
err:
xpd_free(xpd);
@@ -436,14 +434,12 @@ xpd_t *xpd_alloc(size_t privsize, const xproto_table_t *proto_table, int channel
goto err;
}
- if((xpd = kmalloc(alloc_size, GFP_KERNEL)) == NULL) {
+ if((xpd = KZALLOC(alloc_size, GFP_KERNEL)) == NULL) {
ERR("%s: type=%d: Unable to allocate memory\n",
__FUNCTION__, type);
goto err;
}
- memset(xpd, 0, alloc_size);
xpd->priv = (byte *)xpd + sizeof(xpd_t);
-
spin_lock_init(&xpd->lock);
xpd->xbus = NULL;
xpd->xbus_idx = -1;
@@ -553,6 +549,14 @@ void update_line_status(xpd_t *xpd, int pos, bool to_offhook)
BIT_CLR(xpd->offhook, pos);
BIT_CLR(xpd->cid_on, pos);
rxsig = ZT_RXSIG_ONHOOK;
+ /*
+ * To prevent latest PCM to stay in buffers
+ * indefinitely, mark this channel for a
+ * single silence transmittion.
+ *
+ * This bit will be cleared on the next tick.
+ */
+ BIT_SET(xpd->silence_pcm, pos);
}
/*
* We should not spinlock before calling zt_hooksig() as
@@ -993,9 +997,6 @@ int __init xpp_zap_init(void)
#else
INFO("FEATURE: without BRISTUFF support\n");
#endif
-#ifdef OPTIMIZE_CHANMUTE
- INFO("FEATURE: with CHANMUTE optimization\n");
-#endif
#ifdef CONFIG_PROC_FS
xpp_proc_toplevel = proc_mkdir(PROC_DIR, NULL);
if(!xpp_proc_toplevel) {