From 4b10b26bbb06009e98fdef38de583a1e303a1d4b Mon Sep 17 00:00:00 2001 From: sruffell Date: Wed, 15 Oct 2008 18:57:01 +0000 Subject: 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 --- kernel/zaptel-base.c | 10 ++++++++-- 1 file 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); -- cgit v1.2.3