diff options
-rw-r--r-- | kernel/zaptel-base.c | 10 |
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); |