Lines Matching refs:tty
26 struct tty_struct *tty; /* only populated while dev is open */ member
276 static int vcc_rx_check(struct tty_struct *tty, int size) in vcc_rx_check() argument
278 if (WARN_ON(!tty || !tty->port)) in vcc_rx_check()
284 if (test_bit(TTY_THROTTLED, &tty->flags) || in vcc_rx_check()
285 (tty_buffer_request_room(tty->port, VCC_BUFF_LEN) < VCC_BUFF_LEN)) in vcc_rx_check()
291 static int vcc_rx(struct tty_struct *tty, char *buf, int size) in vcc_rx() argument
295 if (WARN_ON(!tty || !tty->port)) in vcc_rx()
298 len = tty_insert_flip_string(tty->port, buf, size); in vcc_rx()
300 tty_flip_buffer_push(tty->port); in vcc_rx()
308 struct tty_struct *tty; in vcc_ldc_read() local
312 tty = port->tty; in vcc_ldc_read()
313 if (!tty) { in vcc_ldc_read()
321 if (!vcc_rx_check(tty, VIO_VCC_MTU_SIZE)) { in vcc_ldc_read()
340 vcc_rx(tty, pkt.data, pkt.tag.stype); in vcc_ldc_read()
370 if (!port->tty || port->removed) in vcc_rx_timer()
393 if (!port->tty || port->removed) in vcc_tx_timer()
412 struct tty_struct *tty = port->tty; in vcc_tx_timer() local
415 if (tty) in vcc_tx_timer()
416 tty_wakeup(tty); in vcc_tx_timer()
682 if (port->tty) in vcc_remove()
683 tty_vhangup(port->tty); in vcc_remove()
696 if (port->tty) { in vcc_remove()
723 static int vcc_open(struct tty_struct *tty, struct file *vcc_file) in vcc_open() argument
727 if (tty->count > 1) in vcc_open()
730 port = vcc_get_ne(tty->index); in vcc_open()
745 if (unlikely(!tty->port)) { in vcc_open()
750 if (unlikely(!tty->port->ops)) { in vcc_open()
755 return tty_port_open(tty->port, tty, vcc_file); in vcc_open()
758 static void vcc_close(struct tty_struct *tty, struct file *vcc_file) in vcc_close() argument
760 if (unlikely(tty->count > 1)) in vcc_close()
763 if (unlikely(!tty->port)) { in vcc_close()
768 tty_port_close(tty->port, tty, vcc_file); in vcc_close()
783 static void vcc_hangup(struct tty_struct *tty) in vcc_hangup() argument
787 port = vcc_get_ne(tty->index); in vcc_hangup()
793 if (unlikely(!tty->port)) { in vcc_hangup()
803 tty_port_hangup(tty->port); in vcc_hangup()
806 static int vcc_write(struct tty_struct *tty, const unsigned char *buf, in vcc_write() argument
816 port = vcc_get_ne(tty->index); in vcc_write()
871 static unsigned int vcc_write_room(struct tty_struct *tty) in vcc_write_room() argument
876 port = vcc_get_ne(tty->index); in vcc_write_room()
889 static unsigned int vcc_chars_in_buffer(struct tty_struct *tty) in vcc_chars_in_buffer() argument
894 port = vcc_get_ne(tty->index); in vcc_chars_in_buffer()
907 static int vcc_break_ctl(struct tty_struct *tty, int state) in vcc_break_ctl() argument
912 port = vcc_get_ne(tty->index); in vcc_break_ctl()
936 static int vcc_install(struct tty_driver *driver, struct tty_struct *tty) in vcc_install() argument
942 if (tty->index >= VCC_MAX_PORTS) in vcc_install()
945 ret = tty_standard_install(driver, tty); in vcc_install()
953 port_vcc = vcc_get(tty->index, true); in vcc_install()
956 tty->port = NULL; in vcc_install()
963 tty->port = port_tty; in vcc_install()
965 port_vcc->tty = tty; in vcc_install()
972 static void vcc_cleanup(struct tty_struct *tty) in vcc_cleanup() argument
976 port = vcc_get(tty->index, true); in vcc_cleanup()
978 port->tty = NULL; in vcc_cleanup()
981 vcc_table_remove(tty->index); in vcc_cleanup()
990 tty_port_destroy(tty->port); in vcc_cleanup()
991 kfree(tty->port); in vcc_cleanup()
992 tty->port = NULL; in vcc_cleanup()