Lines Matching refs:tty
33 struct tty_struct *tty; /* only populated while dev is open */ member
285 static int vcc_rx_check(struct tty_struct *tty, int size) in vcc_rx_check() argument
287 if (WARN_ON(!tty || !tty->port)) in vcc_rx_check()
293 if (test_bit(TTY_THROTTLED, &tty->flags) || in vcc_rx_check()
294 (tty_buffer_request_room(tty->port, VCC_BUFF_LEN) < VCC_BUFF_LEN)) in vcc_rx_check()
300 static int vcc_rx(struct tty_struct *tty, char *buf, int size) in vcc_rx() argument
304 if (WARN_ON(!tty || !tty->port)) in vcc_rx()
307 len = tty_insert_flip_string(tty->port, buf, size); in vcc_rx()
309 tty_flip_buffer_push(tty->port); in vcc_rx()
317 struct tty_struct *tty; in vcc_ldc_read() local
321 tty = port->tty; in vcc_ldc_read()
322 if (!tty) { in vcc_ldc_read()
330 if (!vcc_rx_check(tty, VIO_VCC_MTU_SIZE)) { in vcc_ldc_read()
349 vcc_rx(tty, pkt.data, pkt.tag.stype); in vcc_ldc_read()
379 if (!port->tty || port->removed) in vcc_rx_timer()
402 if (!port->tty || port->removed) in vcc_tx_timer()
421 struct tty_struct *tty = port->tty; in vcc_tx_timer() local
424 if (tty) in vcc_tx_timer()
425 tty_wakeup(tty); in vcc_tx_timer()
694 if (port->tty) in vcc_remove()
695 tty_vhangup(port->tty); in vcc_remove()
711 if (port->tty) { in vcc_remove()
740 static int vcc_open(struct tty_struct *tty, struct file *vcc_file) in vcc_open() argument
744 if (unlikely(!tty)) { in vcc_open()
749 if (tty->count > 1) in vcc_open()
752 port = vcc_get_ne(tty->index); in vcc_open()
767 if (unlikely(!tty->port)) { in vcc_open()
772 if (unlikely(!tty->port->ops)) { in vcc_open()
777 return tty_port_open(tty->port, tty, vcc_file); in vcc_open()
780 static void vcc_close(struct tty_struct *tty, struct file *vcc_file) in vcc_close() argument
782 if (unlikely(!tty)) { in vcc_close()
787 if (unlikely(tty->count > 1)) in vcc_close()
790 if (unlikely(!tty->port)) { in vcc_close()
795 tty_port_close(tty->port, tty, vcc_file); in vcc_close()
810 static void vcc_hangup(struct tty_struct *tty) in vcc_hangup() argument
814 if (unlikely(!tty)) { in vcc_hangup()
819 port = vcc_get_ne(tty->index); in vcc_hangup()
825 if (unlikely(!tty->port)) { in vcc_hangup()
835 tty_port_hangup(tty->port); in vcc_hangup()
838 static int vcc_write(struct tty_struct *tty, const unsigned char *buf, in vcc_write() argument
848 if (unlikely(!tty)) { in vcc_write()
853 port = vcc_get_ne(tty->index); in vcc_write()
908 static int vcc_write_room(struct tty_struct *tty) in vcc_write_room() argument
913 if (unlikely(!tty)) { in vcc_write_room()
918 port = vcc_get_ne(tty->index); in vcc_write_room()
931 static int vcc_chars_in_buffer(struct tty_struct *tty) in vcc_chars_in_buffer() argument
936 if (unlikely(!tty)) { in vcc_chars_in_buffer()
941 port = vcc_get_ne(tty->index); in vcc_chars_in_buffer()
954 static int vcc_break_ctl(struct tty_struct *tty, int state) in vcc_break_ctl() argument
959 if (unlikely(!tty)) { in vcc_break_ctl()
964 port = vcc_get_ne(tty->index); in vcc_break_ctl()
988 static int vcc_install(struct tty_driver *driver, struct tty_struct *tty) in vcc_install() argument
994 if (unlikely(!tty)) { in vcc_install()
999 if (tty->index >= VCC_MAX_PORTS) in vcc_install()
1002 ret = tty_standard_install(driver, tty); in vcc_install()
1010 port_vcc = vcc_get(tty->index, true); in vcc_install()
1013 tty->port = NULL; in vcc_install()
1020 tty->port = port_tty; in vcc_install()
1022 port_vcc->tty = tty; in vcc_install()
1029 static void vcc_cleanup(struct tty_struct *tty) in vcc_cleanup() argument
1033 if (unlikely(!tty)) { in vcc_cleanup()
1038 port = vcc_get(tty->index, true); in vcc_cleanup()
1040 port->tty = NULL; in vcc_cleanup()
1043 vcc_table_remove(tty->index); in vcc_cleanup()
1052 tty_port_destroy(tty->port); in vcc_cleanup()
1053 kfree(tty->port); in vcc_cleanup()
1054 tty->port = NULL; in vcc_cleanup()