summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xzaptel.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/zaptel.c b/zaptel.c
index fa988a7..3fb9c6a 100755
--- a/zaptel.c
+++ b/zaptel.c
@@ -3076,11 +3076,11 @@ static int zt_chanandpseudo_ioctl(struct inode *inode, struct file *file, unsign
/* initialize read buffers and pointers */
chan->inreadbuf = 0;
chan->outreadbuf = -1;
-#if 0
- /* Do we need this? */
- chan->readn[0] = chan->readn[1] = 0;
- chan->readidx[0] = chan->readidx[1] = 0;
-#endif
+ for (j=0;j<chan->numbufs;j++) {
+ /* Do we need this? */
+ chan->readn[j] = 0;
+ chan->readidx[j] = 0;
+ }
wake_up_interruptible(&chan->readbufq); /* wake_up_interruptible waiting on read */
wake_up_interruptible(&chan->sel); /* wake_up_interruptible waiting on select */
}
@@ -3089,11 +3089,11 @@ static int zt_chanandpseudo_ioctl(struct inode *inode, struct file *file, unsign
/* initialize write buffers and pointers */
chan->outwritebuf = -1;
chan->inwritebuf = 0;
-#if 0
- /* Do we ned this? */
- chan->writen[0] = chan->writen[1] = 0;
- chan->writeidx[0] = chan->writeidx[1] = 0;
-#endif
+ for (j=0;j<chan->numbufs;j++) {
+ /* Do we need this? */
+ chan->writen[j] = 0;
+ chan->writeidx[j] = 0;
+ }
wake_up_interruptible(&chan->writebufq); /* wake_up_interruptible waiting on write */
wake_up_interruptible(&chan->sel); /* wake_up_interruptible waiting on select */
/* if IO MUX wait on write empty, well, this