Lines Matching refs:tty

161 static void flush_rx_queue(struct tty_struct *tty)  in flush_rx_queue()  argument
163 struct n_hdlc *n_hdlc = tty->disc_data; in flush_rx_queue()
170 static void flush_tx_queue(struct tty_struct *tty) in flush_tx_queue() argument
172 struct n_hdlc *n_hdlc = tty->disc_data; in flush_tx_queue()
196 static void n_hdlc_tty_close(struct tty_struct *tty) in n_hdlc_tty_close() argument
198 struct n_hdlc *n_hdlc = tty->disc_data; in n_hdlc_tty_close()
205 clear_bit(TTY_NO_WRITE_SPLIT, &tty->flags); in n_hdlc_tty_close()
207 tty->disc_data = NULL; in n_hdlc_tty_close()
210 wake_up_interruptible(&tty->read_wait); in n_hdlc_tty_close()
211 wake_up_interruptible(&tty->write_wait); in n_hdlc_tty_close()
226 static int n_hdlc_tty_open(struct tty_struct *tty) in n_hdlc_tty_open() argument
228 struct n_hdlc *n_hdlc = tty->disc_data; in n_hdlc_tty_open()
230 pr_debug("%s() called (device=%s)\n", __func__, tty->name); in n_hdlc_tty_open()
244 tty->disc_data = n_hdlc; in n_hdlc_tty_open()
245 tty->receive_room = 65536; in n_hdlc_tty_open()
248 set_bit(TTY_NO_WRITE_SPLIT, &tty->flags); in n_hdlc_tty_open()
251 tty_driver_flush_buffer(tty); in n_hdlc_tty_open()
266 static void n_hdlc_send_frames(struct n_hdlc *n_hdlc, struct tty_struct *tty) in n_hdlc_send_frames() argument
289 set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); in n_hdlc_send_frames()
290 actual = tty->ops->write(tty, tbuf->buf, tbuf->count); in n_hdlc_send_frames()
309 wake_up_interruptible(&tty->write_wait); in n_hdlc_send_frames()
326 clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); in n_hdlc_send_frames()
343 static void n_hdlc_tty_wakeup(struct tty_struct *tty) in n_hdlc_tty_wakeup() argument
345 struct n_hdlc *n_hdlc = tty->disc_data; in n_hdlc_tty_wakeup()
347 n_hdlc_send_frames(n_hdlc, tty); in n_hdlc_tty_wakeup()
360 static void n_hdlc_tty_receive(struct tty_struct *tty, const __u8 *data, in n_hdlc_tty_receive() argument
363 register struct n_hdlc *n_hdlc = tty->disc_data; in n_hdlc_tty_receive()
404 wake_up_interruptible(&tty->read_wait); in n_hdlc_tty_receive()
405 if (tty->fasync != NULL) in n_hdlc_tty_receive()
406 kill_fasync(&tty->fasync, SIGIO, POLL_IN); in n_hdlc_tty_receive()
421 static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file, in n_hdlc_tty_read() argument
425 struct n_hdlc *n_hdlc = tty->disc_data; in n_hdlc_tty_read()
435 add_wait_queue(&tty->read_wait, &wait); in n_hdlc_tty_read()
438 if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) { in n_hdlc_tty_read()
452 if (tty_io_nonblock(tty, file)) { in n_hdlc_tty_read()
465 remove_wait_queue(&tty->read_wait, &wait); in n_hdlc_tty_read()
514 static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file, in n_hdlc_tty_write() argument
517 struct n_hdlc *n_hdlc = tty->disc_data; in n_hdlc_tty_write()
534 add_wait_queue(&tty->write_wait, &wait); in n_hdlc_tty_write()
543 if (tty_io_nonblock(tty, file)) { in n_hdlc_tty_write()
556 remove_wait_queue(&tty->write_wait, &wait); in n_hdlc_tty_write()
565 n_hdlc_send_frames(n_hdlc, tty); in n_hdlc_tty_write()
581 static int n_hdlc_tty_ioctl(struct tty_struct *tty, struct file *file, in n_hdlc_tty_ioctl() argument
584 struct n_hdlc *n_hdlc = tty->disc_data; in n_hdlc_tty_ioctl()
613 count = tty_chars_in_buffer(tty); in n_hdlc_tty_ioctl()
628 flush_tx_queue(tty); in n_hdlc_tty_ioctl()
633 error = n_tty_ioctl_helper(tty, file, cmd, arg); in n_hdlc_tty_ioctl()
650 static __poll_t n_hdlc_tty_poll(struct tty_struct *tty, struct file *filp, in n_hdlc_tty_poll() argument
653 struct n_hdlc *n_hdlc = tty->disc_data; in n_hdlc_tty_poll()
663 poll_wait(filp, &tty->read_wait, wait); in n_hdlc_tty_poll()
664 poll_wait(filp, &tty->write_wait, wait); in n_hdlc_tty_poll()
669 if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) in n_hdlc_tty_poll()
673 if (!tty_is_writelocked(tty) && in n_hdlc_tty_poll()