Lines Matching refs:tty

159 static void flush_rx_queue(struct tty_struct *tty)  in flush_rx_queue()  argument
161 struct n_hdlc *n_hdlc = tty->disc_data; in flush_rx_queue()
168 static void flush_tx_queue(struct tty_struct *tty) in flush_tx_queue() argument
170 struct n_hdlc *n_hdlc = tty->disc_data; in flush_tx_queue()
194 static void n_hdlc_tty_close(struct tty_struct *tty) in n_hdlc_tty_close() argument
196 struct n_hdlc *n_hdlc = tty->disc_data; in n_hdlc_tty_close()
199 clear_bit(TTY_NO_WRITE_SPLIT, &tty->flags); in n_hdlc_tty_close()
201 tty->disc_data = NULL; in n_hdlc_tty_close()
204 wake_up_interruptible(&tty->read_wait); in n_hdlc_tty_close()
205 wake_up_interruptible(&tty->write_wait); in n_hdlc_tty_close()
222 static int n_hdlc_tty_open(struct tty_struct *tty) in n_hdlc_tty_open() argument
224 struct n_hdlc *n_hdlc = tty->disc_data; in n_hdlc_tty_open()
226 pr_debug("%s() called (device=%s)\n", __func__, tty->name); in n_hdlc_tty_open()
241 n_hdlc->tty_for_write_work = tty; in n_hdlc_tty_open()
242 tty->disc_data = n_hdlc; in n_hdlc_tty_open()
243 tty->receive_room = 65536; in n_hdlc_tty_open()
246 set_bit(TTY_NO_WRITE_SPLIT, &tty->flags); in n_hdlc_tty_open()
249 tty_driver_flush_buffer(tty); in n_hdlc_tty_open()
264 static void n_hdlc_send_frames(struct n_hdlc *n_hdlc, struct tty_struct *tty) in n_hdlc_send_frames() argument
287 set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); in n_hdlc_send_frames()
288 actual = tty->ops->write(tty, tbuf->buf, tbuf->count); in n_hdlc_send_frames()
307 wake_up_interruptible(&tty->write_wait); in n_hdlc_send_frames()
324 clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); in n_hdlc_send_frames()
344 struct tty_struct *tty = n_hdlc->tty_for_write_work; in n_hdlc_tty_write_work() local
346 n_hdlc_send_frames(n_hdlc, tty); in n_hdlc_tty_write_work()
355 static void n_hdlc_tty_wakeup(struct tty_struct *tty) in n_hdlc_tty_wakeup() argument
357 struct n_hdlc *n_hdlc = tty->disc_data; in n_hdlc_tty_wakeup()
372 static void n_hdlc_tty_receive(struct tty_struct *tty, const u8 *data, in n_hdlc_tty_receive() argument
375 register struct n_hdlc *n_hdlc = tty->disc_data; in n_hdlc_tty_receive()
410 wake_up_interruptible(&tty->read_wait); in n_hdlc_tty_receive()
411 if (tty->fasync != NULL) in n_hdlc_tty_receive()
412 kill_fasync(&tty->fasync, SIGIO, POLL_IN); in n_hdlc_tty_receive()
427 static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file, in n_hdlc_tty_read() argument
431 struct n_hdlc *n_hdlc = tty->disc_data; in n_hdlc_tty_read()
441 add_wait_queue(&tty->read_wait, &wait); in n_hdlc_tty_read()
444 if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) { in n_hdlc_tty_read()
458 if (tty_io_nonblock(tty, file)) { in n_hdlc_tty_read()
471 remove_wait_queue(&tty->read_wait, &wait); in n_hdlc_tty_read()
520 static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file, in n_hdlc_tty_write() argument
523 struct n_hdlc *n_hdlc = tty->disc_data; in n_hdlc_tty_write()
537 add_wait_queue(&tty->write_wait, &wait); in n_hdlc_tty_write()
546 if (tty_io_nonblock(tty, file)) { in n_hdlc_tty_write()
559 remove_wait_queue(&tty->write_wait, &wait); in n_hdlc_tty_write()
568 n_hdlc_send_frames(n_hdlc, tty); in n_hdlc_tty_write()
583 static int n_hdlc_tty_ioctl(struct tty_struct *tty, unsigned int cmd, in n_hdlc_tty_ioctl() argument
586 struct n_hdlc *n_hdlc = tty->disc_data; in n_hdlc_tty_ioctl()
611 count = tty_chars_in_buffer(tty); in n_hdlc_tty_ioctl()
626 flush_tx_queue(tty); in n_hdlc_tty_ioctl()
631 error = n_tty_ioctl_helper(tty, cmd, arg); in n_hdlc_tty_ioctl()
648 static __poll_t n_hdlc_tty_poll(struct tty_struct *tty, struct file *filp, in n_hdlc_tty_poll() argument
651 struct n_hdlc *n_hdlc = tty->disc_data; in n_hdlc_tty_poll()
658 poll_wait(filp, &tty->read_wait, wait); in n_hdlc_tty_poll()
659 poll_wait(filp, &tty->write_wait, wait); in n_hdlc_tty_poll()
664 if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) in n_hdlc_tty_poll()
668 if (!tty_is_writelocked(tty) && in n_hdlc_tty_poll()