Lines Matching refs:tty

90 static void cy_send_xchar(struct tty_struct *tty, char ch);
486 struct tty_struct *tty = in cyy_chip_rx() local
488 if (tty) { in cyy_chip_rx()
489 do_SAK(tty); in cyy_chip_rx()
490 tty_kref_put(tty); in cyy_chip_rx()
572 struct tty_struct *tty; in cyy_chip_tx() local
590 tty = tty_port_tty_get(&info->port); in cyy_chip_tx()
591 if (tty == NULL) { in cyy_chip_tx()
638 if (tty->stopped || tty->hw_stopped) { in cyy_chip_tx()
673 tty_wakeup(tty); in cyy_chip_tx()
674 tty_kref_put(tty); in cyy_chip_tx()
685 struct tty_struct *tty; in cyy_chip_modem() local
699 tty = tty_port_tty_get(&info->port); in cyy_chip_modem()
700 if (!tty) in cyy_chip_modem()
721 tty_hangup(tty); in cyy_chip_modem()
724 if (tty->hw_stopped) { in cyy_chip_modem()
728 tty->hw_stopped = 0; in cyy_chip_modem()
731 tty_wakeup(tty); in cyy_chip_modem()
737 tty->hw_stopped = 1; in cyy_chip_modem()
747 tty_kref_put(tty); in cyy_chip_modem()
1013 struct tty_struct *tty; in cyz_handle_tx() local
1036 tty = tty_port_tty_get(&info->port); in cyz_handle_tx()
1037 if (tty == NULL) in cyz_handle_tx()
1080 tty_wakeup(tty); in cyz_handle_tx()
1081 tty_kref_put(tty); in cyz_handle_tx()
1265 static int cy_startup(struct cyclades_port *info, struct tty_struct *tty) in cy_startup() argument
1286 set_bit(TTY_IO_ERROR, &tty->flags); in cy_startup()
1297 cy_set_line_char(info, tty); in cy_startup()
1369 clear_bit(TTY_IO_ERROR, &tty->flags); in cy_startup()
1422 static void cy_shutdown(struct cyclades_port *info, struct tty_struct *tty) in cy_shutdown() argument
1443 if (tty->termios.c_cflag & HUPCL) in cy_shutdown()
1450 set_bit(TTY_IO_ERROR, &tty->flags); in cy_shutdown()
1472 if (tty->termios.c_cflag & HUPCL) in cy_shutdown()
1475 set_bit(TTY_IO_ERROR, &tty->flags); in cy_shutdown()
1496 static int cy_open(struct tty_struct *tty, struct file *filp) in cy_open() argument
1499 unsigned int i, line = tty->index; in cy_open()
1565 tty->driver_data = info; in cy_open()
1566 if (serial_paranoia_check(info, tty->name, "cy_open")) in cy_open()
1583 wait_event_interruptible_tty(tty, info->port.close_wait, in cy_open()
1591 retval = cy_startup(info, tty); in cy_open()
1595 retval = tty_port_block_til_ready(&info->port, tty, filp); in cy_open()
1605 tty_port_tty_set(&info->port, tty); in cy_open()
1616 static void cy_wait_until_sent(struct tty_struct *tty, int timeout) in cy_wait_until_sent() argument
1619 struct cyclades_port *info = tty->driver_data; in cy_wait_until_sent()
1623 if (serial_paranoia_check(info, tty->name, "cy_wait_until_sent")) in cy_wait_until_sent()
1672 static void cy_flush_buffer(struct tty_struct *tty) in cy_flush_buffer() argument
1674 struct cyclades_port *info = tty->driver_data; in cy_flush_buffer()
1683 if (serial_paranoia_check(info, tty->name, "cy_flush_buffer")) in cy_flush_buffer()
1703 tty_wakeup(tty); in cy_flush_buffer()
1727 cy_wait_until_sent(port->tty, info->timeout); in cy_do_close()
1750 cy_shutdown(info, port->tty); in cy_do_close()
1756 static void cy_close(struct tty_struct *tty, struct file *filp) in cy_close() argument
1758 struct cyclades_port *info = tty->driver_data; in cy_close()
1759 if (!info || serial_paranoia_check(info, tty->name, "cy_close")) in cy_close()
1761 tty_port_close(&info->port, tty, filp); in cy_close()
1777 static int cy_write(struct tty_struct *tty, const unsigned char *buf, int count) in cy_write() argument
1779 struct cyclades_port *info = tty->driver_data; in cy_write()
1787 if (serial_paranoia_check(info, tty->name, "cy_write")) in cy_write()
1814 if (info->xmit_cnt && !tty->stopped && !tty->hw_stopped) in cy_write()
1827 static int cy_put_char(struct tty_struct *tty, unsigned char ch) in cy_put_char() argument
1829 struct cyclades_port *info = tty->driver_data; in cy_put_char()
1836 if (serial_paranoia_check(info, tty->name, "cy_put_char")) in cy_put_char()
1861 static void cy_flush_chars(struct tty_struct *tty) in cy_flush_chars() argument
1863 struct cyclades_port *info = tty->driver_data; in cy_flush_chars()
1869 if (serial_paranoia_check(info, tty->name, "cy_flush_chars")) in cy_flush_chars()
1872 if (info->xmit_cnt <= 0 || tty->stopped || tty->hw_stopped || in cy_flush_chars()
1885 static int cy_write_room(struct tty_struct *tty) in cy_write_room() argument
1887 struct cyclades_port *info = tty->driver_data; in cy_write_room()
1894 if (serial_paranoia_check(info, tty->name, "cy_write_room")) in cy_write_room()
1902 static int cy_chars_in_buffer(struct tty_struct *tty) in cy_chars_in_buffer() argument
1904 struct cyclades_port *info = tty->driver_data; in cy_chars_in_buffer()
1906 if (serial_paranoia_check(info, tty->name, "cy_chars_in_buffer")) in cy_chars_in_buffer()
1974 static void cy_set_line_char(struct cyclades_port *info, struct tty_struct *tty) in cy_set_line_char() argument
1986 cflag = tty->termios.c_cflag; in cy_set_line_char()
1987 iflag = tty->termios.c_iflag; in cy_set_line_char()
1993 tty->alt_speed = 57600; in cy_set_line_char()
1995 tty->alt_speed = 115200; in cy_set_line_char()
1997 tty->alt_speed = 230400; in cy_set_line_char()
1999 tty->alt_speed = 460800; in cy_set_line_char()
2008 baud = tty_get_baud_rate(tty); in cy_set_line_char()
2131 cyy_writeb(info, CySCHR1, START_CHAR(tty)); in cy_set_line_char()
2132 cyy_writeb(info, CySCHR2, STOP_CHAR(tty)); in cy_set_line_char()
2149 if (!C_CLOCAL(tty)) in cy_set_line_char()
2166 clear_bit(TTY_IO_ERROR, &tty->flags); in cy_set_line_char()
2178 baud = tty_get_baud_rate(tty); in cy_set_line_char()
2289 clear_bit(TTY_IO_ERROR, &tty->flags); in cy_set_line_char()
2314 cy_set_serial_info(struct cyclades_port *info, struct tty_struct *tty, in cy_set_serial_info() argument
2355 cy_set_line_char(info, tty); in cy_set_serial_info()
2358 ret = cy_startup(info, tty); in cy_set_serial_info()
2393 static int cy_tiocmget(struct tty_struct *tty) in cy_tiocmget() argument
2395 struct cyclades_port *info = tty->driver_data; in cy_tiocmget()
2399 if (serial_paranoia_check(info, tty->name, __func__)) in cy_tiocmget()
2447 cy_tiocmset(struct tty_struct *tty, in cy_tiocmset() argument
2450 struct cyclades_port *info = tty->driver_data; in cy_tiocmset()
2454 if (serial_paranoia_check(info, tty->name, __func__)) in cy_tiocmset()
2503 static int cy_break(struct tty_struct *tty, int break_state) in cy_break() argument
2505 struct cyclades_port *info = tty->driver_data; in cy_break()
2510 if (serial_paranoia_check(info, tty->name, "cy_break")) in cy_break()
2644 cy_ioctl(struct tty_struct *tty, in cy_ioctl() argument
2647 struct cyclades_port *info = tty->driver_data; in cy_ioctl()
2653 if (serial_paranoia_check(info, tty->name, "cy_ioctl")) in cy_ioctl()
2730 ret_val = cy_set_serial_info(info, tty, argp); in cy_ioctl()
2766 static int cy_get_icount(struct tty_struct *tty, in cy_get_icount() argument
2769 struct cyclades_port *info = tty->driver_data; in cy_get_icount()
2797 static void cy_set_termios(struct tty_struct *tty, struct ktermios *old_termios) in cy_set_termios() argument
2799 struct cyclades_port *info = tty->driver_data; in cy_set_termios()
2805 cy_set_line_char(info, tty); in cy_set_termios()
2808 !(tty->termios.c_cflag & CRTSCTS)) { in cy_set_termios()
2809 tty->hw_stopped = 0; in cy_set_termios()
2810 cy_start(tty); in cy_set_termios()
2820 (tty->termios.c_cflag & CLOCAL)) in cy_set_termios()
2828 static void cy_send_xchar(struct tty_struct *tty, char ch) in cy_send_xchar() argument
2830 struct cyclades_port *info = tty->driver_data; in cy_send_xchar()
2834 if (serial_paranoia_check(info, tty->name, "cy_send_xchar")) in cy_send_xchar()
2840 cy_start(tty); in cy_send_xchar()
2846 if (ch == STOP_CHAR(tty)) in cy_send_xchar()
2848 else if (ch == START_CHAR(tty)) in cy_send_xchar()
2857 static void cy_throttle(struct tty_struct *tty) in cy_throttle() argument
2859 struct cyclades_port *info = tty->driver_data; in cy_throttle()
2866 printk(KERN_DEBUG "cyc:throttle %s: %ld...ttyC%d\n", tty_name(tty, buf), in cy_throttle()
2867 tty->ldisc.chars_in_buffer(tty), info->line); in cy_throttle()
2870 if (serial_paranoia_check(info, tty->name, "cy_throttle")) in cy_throttle()
2875 if (I_IXOFF(tty)) { in cy_throttle()
2877 cy_send_xchar(tty, STOP_CHAR(tty)); in cy_throttle()
2882 if (tty->termios.c_cflag & CRTSCTS) { in cy_throttle()
2898 static void cy_unthrottle(struct tty_struct *tty) in cy_unthrottle() argument
2900 struct cyclades_port *info = tty->driver_data; in cy_unthrottle()
2908 tty_name(tty, buf), tty_chars_in_buffer(tty), info->line); in cy_unthrottle()
2911 if (serial_paranoia_check(info, tty->name, "cy_unthrottle")) in cy_unthrottle()
2914 if (I_IXOFF(tty)) { in cy_unthrottle()
2918 cy_send_xchar(tty, START_CHAR(tty)); in cy_unthrottle()
2921 if (tty->termios.c_cflag & CRTSCTS) { in cy_unthrottle()
2936 static void cy_stop(struct tty_struct *tty) in cy_stop() argument
2939 struct cyclades_port *info = tty->driver_data; in cy_stop()
2947 if (serial_paranoia_check(info, tty->name, "cy_stop")) in cy_stop()
2960 static void cy_start(struct tty_struct *tty) in cy_start() argument
2963 struct cyclades_port *info = tty->driver_data; in cy_start()
2971 if (serial_paranoia_check(info, tty->name, "cy_start")) in cy_start()
2987 static void cy_hangup(struct tty_struct *tty) in cy_hangup() argument
2989 struct cyclades_port *info = tty->driver_data; in cy_hangup()
2995 if (serial_paranoia_check(info, tty->name, "cy_hangup")) in cy_hangup()
2998 cy_flush_buffer(tty); in cy_hangup()
2999 cy_shutdown(info, tty); in cy_hangup()
3979 struct tty_struct *tty; in cyclades_proc_show() local
3982 tty = tty_port_tty_get(&info->port); in cyclades_proc_show()
3983 if (tty) { in cyclades_proc_show()
3984 ld = tty_ldisc_ref(tty); in cyclades_proc_show()
3989 tty_kref_put(tty); in cyclades_proc_show()