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()
1582 retval = cy_startup(info, tty); in cy_open()
1586 retval = tty_port_block_til_ready(&info->port, tty, filp); in cy_open()
1596 tty_port_tty_set(&info->port, tty); in cy_open()
1607 static void cy_wait_until_sent(struct tty_struct *tty, int timeout) in cy_wait_until_sent() argument
1610 struct cyclades_port *info = tty->driver_data; in cy_wait_until_sent()
1614 if (serial_paranoia_check(info, tty->name, "cy_wait_until_sent")) in cy_wait_until_sent()
1663 static void cy_flush_buffer(struct tty_struct *tty) in cy_flush_buffer() argument
1665 struct cyclades_port *info = tty->driver_data; in cy_flush_buffer()
1674 if (serial_paranoia_check(info, tty->name, "cy_flush_buffer")) in cy_flush_buffer()
1694 tty_wakeup(tty); in cy_flush_buffer()
1718 cy_wait_until_sent(port->tty, info->timeout); in cy_do_close()
1741 cy_shutdown(info, port->tty); in cy_do_close()
1747 static void cy_close(struct tty_struct *tty, struct file *filp) in cy_close() argument
1749 struct cyclades_port *info = tty->driver_data; in cy_close()
1750 if (!info || serial_paranoia_check(info, tty->name, "cy_close")) in cy_close()
1752 tty_port_close(&info->port, tty, filp); in cy_close()
1768 static int cy_write(struct tty_struct *tty, const unsigned char *buf, int count) in cy_write() argument
1770 struct cyclades_port *info = tty->driver_data; in cy_write()
1778 if (serial_paranoia_check(info, tty->name, "cy_write")) in cy_write()
1805 if (info->xmit_cnt && !tty->stopped && !tty->hw_stopped) in cy_write()
1818 static int cy_put_char(struct tty_struct *tty, unsigned char ch) in cy_put_char() argument
1820 struct cyclades_port *info = tty->driver_data; in cy_put_char()
1827 if (serial_paranoia_check(info, tty->name, "cy_put_char")) in cy_put_char()
1852 static void cy_flush_chars(struct tty_struct *tty) in cy_flush_chars() argument
1854 struct cyclades_port *info = tty->driver_data; in cy_flush_chars()
1860 if (serial_paranoia_check(info, tty->name, "cy_flush_chars")) in cy_flush_chars()
1863 if (info->xmit_cnt <= 0 || tty->stopped || tty->hw_stopped || in cy_flush_chars()
1876 static int cy_write_room(struct tty_struct *tty) in cy_write_room() argument
1878 struct cyclades_port *info = tty->driver_data; in cy_write_room()
1885 if (serial_paranoia_check(info, tty->name, "cy_write_room")) in cy_write_room()
1893 static int cy_chars_in_buffer(struct tty_struct *tty) in cy_chars_in_buffer() argument
1895 struct cyclades_port *info = tty->driver_data; in cy_chars_in_buffer()
1897 if (serial_paranoia_check(info, tty->name, "cy_chars_in_buffer")) in cy_chars_in_buffer()
1965 static void cy_set_line_char(struct cyclades_port *info, struct tty_struct *tty) in cy_set_line_char() argument
1977 cflag = tty->termios.c_cflag; in cy_set_line_char()
1978 iflag = tty->termios.c_iflag; in cy_set_line_char()
1984 tty->alt_speed = 57600; in cy_set_line_char()
1986 tty->alt_speed = 115200; in cy_set_line_char()
1988 tty->alt_speed = 230400; in cy_set_line_char()
1990 tty->alt_speed = 460800; in cy_set_line_char()
1999 baud = tty_get_baud_rate(tty); in cy_set_line_char()
2122 cyy_writeb(info, CySCHR1, START_CHAR(tty)); in cy_set_line_char()
2123 cyy_writeb(info, CySCHR2, STOP_CHAR(tty)); in cy_set_line_char()
2140 if (!C_CLOCAL(tty)) in cy_set_line_char()
2157 clear_bit(TTY_IO_ERROR, &tty->flags); in cy_set_line_char()
2169 baud = tty_get_baud_rate(tty); in cy_set_line_char()
2280 clear_bit(TTY_IO_ERROR, &tty->flags); in cy_set_line_char()
2305 cy_set_serial_info(struct cyclades_port *info, struct tty_struct *tty, in cy_set_serial_info() argument
2346 cy_set_line_char(info, tty); in cy_set_serial_info()
2349 ret = cy_startup(info, tty); in cy_set_serial_info()
2384 static int cy_tiocmget(struct tty_struct *tty) in cy_tiocmget() argument
2386 struct cyclades_port *info = tty->driver_data; in cy_tiocmget()
2390 if (serial_paranoia_check(info, tty->name, __func__)) in cy_tiocmget()
2438 cy_tiocmset(struct tty_struct *tty, in cy_tiocmset() argument
2441 struct cyclades_port *info = tty->driver_data; in cy_tiocmset()
2445 if (serial_paranoia_check(info, tty->name, __func__)) in cy_tiocmset()
2494 static int cy_break(struct tty_struct *tty, int break_state) in cy_break() argument
2496 struct cyclades_port *info = tty->driver_data; in cy_break()
2501 if (serial_paranoia_check(info, tty->name, "cy_break")) in cy_break()
2635 cy_ioctl(struct tty_struct *tty, in cy_ioctl() argument
2638 struct cyclades_port *info = tty->driver_data; in cy_ioctl()
2644 if (serial_paranoia_check(info, tty->name, "cy_ioctl")) in cy_ioctl()
2721 ret_val = cy_set_serial_info(info, tty, argp); in cy_ioctl()
2757 static int cy_get_icount(struct tty_struct *tty, in cy_get_icount() argument
2760 struct cyclades_port *info = tty->driver_data; in cy_get_icount()
2788 static void cy_set_termios(struct tty_struct *tty, struct ktermios *old_termios) in cy_set_termios() argument
2790 struct cyclades_port *info = tty->driver_data; in cy_set_termios()
2796 cy_set_line_char(info, tty); in cy_set_termios()
2799 !(tty->termios.c_cflag & CRTSCTS)) { in cy_set_termios()
2800 tty->hw_stopped = 0; in cy_set_termios()
2801 cy_start(tty); in cy_set_termios()
2811 (tty->termios.c_cflag & CLOCAL)) in cy_set_termios()
2819 static void cy_send_xchar(struct tty_struct *tty, char ch) in cy_send_xchar() argument
2821 struct cyclades_port *info = tty->driver_data; in cy_send_xchar()
2825 if (serial_paranoia_check(info, tty->name, "cy_send_xchar")) in cy_send_xchar()
2831 cy_start(tty); in cy_send_xchar()
2837 if (ch == STOP_CHAR(tty)) in cy_send_xchar()
2839 else if (ch == START_CHAR(tty)) in cy_send_xchar()
2848 static void cy_throttle(struct tty_struct *tty) in cy_throttle() argument
2850 struct cyclades_port *info = tty->driver_data; in cy_throttle()
2855 printk(KERN_DEBUG "cyc:throttle %s: %ld...ttyC%d\n", tty_name(tty), in cy_throttle()
2856 tty->ldisc.chars_in_buffer(tty), info->line); in cy_throttle()
2859 if (serial_paranoia_check(info, tty->name, "cy_throttle")) in cy_throttle()
2864 if (I_IXOFF(tty)) { in cy_throttle()
2866 cy_send_xchar(tty, STOP_CHAR(tty)); in cy_throttle()
2871 if (tty->termios.c_cflag & CRTSCTS) { in cy_throttle()
2887 static void cy_unthrottle(struct tty_struct *tty) in cy_unthrottle() argument
2889 struct cyclades_port *info = tty->driver_data; in cy_unthrottle()
2895 tty_name(tty), tty_chars_in_buffer(tty), info->line); in cy_unthrottle()
2898 if (serial_paranoia_check(info, tty->name, "cy_unthrottle")) in cy_unthrottle()
2901 if (I_IXOFF(tty)) { in cy_unthrottle()
2905 cy_send_xchar(tty, START_CHAR(tty)); in cy_unthrottle()
2908 if (tty->termios.c_cflag & CRTSCTS) { in cy_unthrottle()
2923 static void cy_stop(struct tty_struct *tty) in cy_stop() argument
2926 struct cyclades_port *info = tty->driver_data; in cy_stop()
2934 if (serial_paranoia_check(info, tty->name, "cy_stop")) in cy_stop()
2947 static void cy_start(struct tty_struct *tty) in cy_start() argument
2950 struct cyclades_port *info = tty->driver_data; in cy_start()
2958 if (serial_paranoia_check(info, tty->name, "cy_start")) in cy_start()
2974 static void cy_hangup(struct tty_struct *tty) in cy_hangup() argument
2976 struct cyclades_port *info = tty->driver_data; in cy_hangup()
2982 if (serial_paranoia_check(info, tty->name, "cy_hangup")) in cy_hangup()
2985 cy_flush_buffer(tty); in cy_hangup()
2986 cy_shutdown(info, tty); in cy_hangup()
3966 struct tty_struct *tty; in cyclades_proc_show() local
3969 tty = tty_port_tty_get(&info->port); in cyclades_proc_show()
3970 if (tty) { in cyclades_proc_show()
3971 ld = tty_ldisc_ref(tty); in cyclades_proc_show()
3976 tty_kref_put(tty); in cyclades_proc_show()