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()
693 if (port->tty) in vcc_remove()
694 tty_vhangup(port->tty); in vcc_remove()
710 if (port->tty) { in vcc_remove()
739 static int vcc_open(struct tty_struct *tty, struct file *vcc_file) in vcc_open() argument
743 if (unlikely(!tty)) { in vcc_open()
748 if (tty->count > 1) in vcc_open()
751 port = vcc_get_ne(tty->index); in vcc_open()
766 if (unlikely(!tty->port)) { in vcc_open()
771 if (unlikely(!tty->port->ops)) { in vcc_open()
776 return tty_port_open(tty->port, tty, vcc_file); in vcc_open()
779 static void vcc_close(struct tty_struct *tty, struct file *vcc_file) in vcc_close() argument
781 if (unlikely(!tty)) { in vcc_close()
786 if (unlikely(tty->count > 1)) in vcc_close()
789 if (unlikely(!tty->port)) { in vcc_close()
794 tty_port_close(tty->port, tty, vcc_file); in vcc_close()
809 static void vcc_hangup(struct tty_struct *tty) in vcc_hangup() argument
813 if (unlikely(!tty)) { in vcc_hangup()
818 port = vcc_get_ne(tty->index); in vcc_hangup()
824 if (unlikely(!tty->port)) { in vcc_hangup()
834 tty_port_hangup(tty->port); in vcc_hangup()
837 static int vcc_write(struct tty_struct *tty, const unsigned char *buf, in vcc_write() argument
847 if (unlikely(!tty)) { in vcc_write()
852 port = vcc_get_ne(tty->index); in vcc_write()
907 static int vcc_write_room(struct tty_struct *tty) in vcc_write_room() argument
912 if (unlikely(!tty)) { in vcc_write_room()
917 port = vcc_get_ne(tty->index); in vcc_write_room()
930 static int vcc_chars_in_buffer(struct tty_struct *tty) in vcc_chars_in_buffer() argument
935 if (unlikely(!tty)) { in vcc_chars_in_buffer()
940 port = vcc_get_ne(tty->index); in vcc_chars_in_buffer()
953 static int vcc_break_ctl(struct tty_struct *tty, int state) in vcc_break_ctl() argument
958 if (unlikely(!tty)) { in vcc_break_ctl()
963 port = vcc_get_ne(tty->index); in vcc_break_ctl()
987 static int vcc_install(struct tty_driver *driver, struct tty_struct *tty) in vcc_install() argument
993 if (unlikely(!tty)) { in vcc_install()
998 if (tty->index >= VCC_MAX_PORTS) in vcc_install()
1001 ret = tty_standard_install(driver, tty); in vcc_install()
1009 port_vcc = vcc_get(tty->index, true); in vcc_install()
1012 tty->port = NULL; in vcc_install()
1019 tty->port = port_tty; in vcc_install()
1021 port_vcc->tty = tty; in vcc_install()
1028 static void vcc_cleanup(struct tty_struct *tty) in vcc_cleanup() argument
1032 if (unlikely(!tty)) { in vcc_cleanup()
1037 port = vcc_get(tty->index, true); in vcc_cleanup()
1039 port->tty = NULL; in vcc_cleanup()
1042 vcc_table_remove(tty->index); in vcc_cleanup()
1051 tty_port_destroy(tty->port); in vcc_cleanup()
1052 kfree(tty->port); in vcc_cleanup()
1053 tty->port = NULL; in vcc_cleanup()