Lines Matching refs:tty

164 static void flush_rx_queue(struct tty_struct *tty)  in flush_rx_queue()  argument
166 struct n_hdlc *n_hdlc = tty->disc_data; in flush_rx_queue()
173 static void flush_tx_queue(struct tty_struct *tty) in flush_tx_queue() argument
175 struct n_hdlc *n_hdlc = tty->disc_data; in flush_tx_queue()
199 static void n_hdlc_tty_close(struct tty_struct *tty) in n_hdlc_tty_close() argument
201 struct n_hdlc *n_hdlc = tty->disc_data; in n_hdlc_tty_close()
208 clear_bit(TTY_NO_WRITE_SPLIT, &tty->flags); in n_hdlc_tty_close()
210 tty->disc_data = NULL; in n_hdlc_tty_close()
213 wake_up_interruptible(&tty->read_wait); in n_hdlc_tty_close()
214 wake_up_interruptible(&tty->write_wait); in n_hdlc_tty_close()
231 static int n_hdlc_tty_open(struct tty_struct *tty) in n_hdlc_tty_open() argument
233 struct n_hdlc *n_hdlc = tty->disc_data; in n_hdlc_tty_open()
235 pr_debug("%s() called (device=%s)\n", __func__, tty->name); in n_hdlc_tty_open()
250 n_hdlc->tty_for_write_work = tty; in n_hdlc_tty_open()
251 tty->disc_data = n_hdlc; in n_hdlc_tty_open()
252 tty->receive_room = 65536; in n_hdlc_tty_open()
255 set_bit(TTY_NO_WRITE_SPLIT, &tty->flags); in n_hdlc_tty_open()
258 tty_driver_flush_buffer(tty); in n_hdlc_tty_open()
273 static void n_hdlc_send_frames(struct n_hdlc *n_hdlc, struct tty_struct *tty) in n_hdlc_send_frames() argument
296 set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); in n_hdlc_send_frames()
297 actual = tty->ops->write(tty, tbuf->buf, tbuf->count); in n_hdlc_send_frames()
316 wake_up_interruptible(&tty->write_wait); in n_hdlc_send_frames()
333 clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); in n_hdlc_send_frames()
353 struct tty_struct *tty = n_hdlc->tty_for_write_work; in n_hdlc_tty_write_work() local
355 n_hdlc_send_frames(n_hdlc, tty); in n_hdlc_tty_write_work()
364 static void n_hdlc_tty_wakeup(struct tty_struct *tty) in n_hdlc_tty_wakeup() argument
366 struct n_hdlc *n_hdlc = tty->disc_data; in n_hdlc_tty_wakeup()
381 static void n_hdlc_tty_receive(struct tty_struct *tty, const __u8 *data, in n_hdlc_tty_receive() argument
384 register struct n_hdlc *n_hdlc = tty->disc_data; in n_hdlc_tty_receive()
425 wake_up_interruptible(&tty->read_wait); in n_hdlc_tty_receive()
426 if (tty->fasync != NULL) in n_hdlc_tty_receive()
427 kill_fasync(&tty->fasync, SIGIO, POLL_IN); in n_hdlc_tty_receive()
442 static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file, in n_hdlc_tty_read() argument
446 struct n_hdlc *n_hdlc = tty->disc_data; in n_hdlc_tty_read()
456 add_wait_queue(&tty->read_wait, &wait); in n_hdlc_tty_read()
459 if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) { in n_hdlc_tty_read()
473 if (tty_io_nonblock(tty, file)) { in n_hdlc_tty_read()
486 remove_wait_queue(&tty->read_wait, &wait); in n_hdlc_tty_read()
535 static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file, in n_hdlc_tty_write() argument
538 struct n_hdlc *n_hdlc = tty->disc_data; in n_hdlc_tty_write()
555 add_wait_queue(&tty->write_wait, &wait); in n_hdlc_tty_write()
564 if (tty_io_nonblock(tty, file)) { in n_hdlc_tty_write()
577 remove_wait_queue(&tty->write_wait, &wait); in n_hdlc_tty_write()
586 n_hdlc_send_frames(n_hdlc, tty); in n_hdlc_tty_write()
602 static int n_hdlc_tty_ioctl(struct tty_struct *tty, struct file *file, in n_hdlc_tty_ioctl() argument
605 struct n_hdlc *n_hdlc = tty->disc_data; in n_hdlc_tty_ioctl()
634 count = tty_chars_in_buffer(tty); in n_hdlc_tty_ioctl()
649 flush_tx_queue(tty); in n_hdlc_tty_ioctl()
654 error = n_tty_ioctl_helper(tty, cmd, arg); in n_hdlc_tty_ioctl()
671 static __poll_t n_hdlc_tty_poll(struct tty_struct *tty, struct file *filp, in n_hdlc_tty_poll() argument
674 struct n_hdlc *n_hdlc = tty->disc_data; in n_hdlc_tty_poll()
684 poll_wait(filp, &tty->read_wait, wait); in n_hdlc_tty_poll()
685 poll_wait(filp, &tty->write_wait, wait); in n_hdlc_tty_poll()
690 if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) in n_hdlc_tty_poll()
694 if (!tty_is_writelocked(tty) && in n_hdlc_tty_poll()