Lines Matching refs:messages
542 line6->messages.active = 1; in line6_hwdep_open()
543 line6->messages.nonblock = file->f_flags & O_NONBLOCK ? 1 : 0; in line6_hwdep_open()
553 line6->messages.active = 0; in line6_hwdep_release()
567 if (mutex_lock_interruptible(&line6->messages.read_lock)) in line6_hwdep_read()
570 while (kfifo_len(&line6->messages.fifo) == 0) { in line6_hwdep_read()
571 mutex_unlock(&line6->messages.read_lock); in line6_hwdep_read()
573 if (line6->messages.nonblock) in line6_hwdep_read()
577 line6->messages.wait_queue, in line6_hwdep_read()
578 kfifo_len(&line6->messages.fifo) != 0); in line6_hwdep_read()
582 if (mutex_lock_interruptible(&line6->messages.read_lock)) in line6_hwdep_read()
586 if (kfifo_peek_len(&line6->messages.fifo) > count) { in line6_hwdep_read()
590 rv = kfifo_to_user(&line6->messages.fifo, buf, count, &out_count); in line6_hwdep_read()
595 mutex_unlock(&line6->messages.read_lock); in line6_hwdep_read()
629 poll_wait(file, &line6->messages.wait_queue, wait); in line6_hwdep_poll()
631 mutex_lock(&line6->messages.read_lock); in line6_hwdep_poll()
632 rv = kfifo_len(&line6->messages.fifo) == 0 ? 0 : EPOLLIN | EPOLLRDNORM; in line6_hwdep_poll()
633 mutex_unlock(&line6->messages.read_lock); in line6_hwdep_poll()
649 if (!line6->messages.active) in line6_hwdep_push_message()
652 if (kfifo_avail(&line6->messages.fifo) >= line6->message_length) { in line6_hwdep_push_message()
654 kfifo_in(&line6->messages.fifo, in line6_hwdep_push_message()
658 wake_up_interruptible(&line6->messages.wait_queue); in line6_hwdep_push_message()
668 line6->messages.active = 0; in line6_hwdep_init()
669 init_waitqueue_head(&line6->messages.wait_queue); in line6_hwdep_init()
670 mutex_init(&line6->messages.read_lock); in line6_hwdep_init()
671 INIT_KFIFO(line6->messages.fifo); in line6_hwdep_init()