summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsruffell <sruffell@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-10-15 18:57:01 +0000
committersruffell <sruffell@5390a7c7-147a-4af0-8ec9-7488f05a26cb>2008-10-15 18:57:01 +0000
commit4b10b26bbb06009e98fdef38de583a1e303a1d4b (patch)
treef5d717f525e763e02b78379b538190190b174fab
parent1224ef0741b8a5a78f8efd526f7b77f4ea91d523 (diff)
Zaptel should always notify user mode whenever it has received buffers to
process. git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@4567 5390a7c7-147a-4af0-8ec9-7488f05a26cb
-rw-r--r--kernel/zaptel-base.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/kernel/zaptel-base.c b/kernel/zaptel-base.c
index dedf4c4..f9e1325 100644
--- a/kernel/zaptel-base.c
+++ b/kernel/zaptel-base.c
@@ -886,7 +886,7 @@ static int zt_reallocbufs(struct zt_chan *ss, int j, int numbufs)
else
ss->txdisable = 0;
- if (ss->rxbufpolicy == ZT_POLICY_WHEN_FULL)
+ if (ss->rebufpolicy == ZT_POLICY_WHEN_FULL)
ss->rxdisable = 1;
else
ss->rxdisable = 0;
@@ -4186,7 +4186,13 @@ static int zt_chanandpseudo_ioctl(struct inode *inode, struct file *file, unsign
return -EINVAL;
if (stack.bi.bufsize * stack.bi.numbufs > ZT_MAX_BUF_SPACE)
return -EINVAL;
- chan->rxbufpolicy = stack.bi.rxbufpolicy & 0x1;
+
+ /* It does not make sense to allow user mode to change the
+ * receive buffering policy. Zaptel always provides received
+ * buffers to upper layers immediately. Transmission is
+ * different since we might want to allow the kernel to build
+ * up a bufer in order to prevent underruns from interrupt
+ * context. */
chan->txbufpolicy = stack.bi.txbufpolicy & 0x1;
if ((rv = zt_reallocbufs(chan, stack.bi.bufsize, stack.bi.numbufs)))
return (rv);