Lines Matching refs:tty
50 tty->name, (info->flags), serial_driver->refcount,info->count,tty->count,s)
108 static void rs_wait_until_sent(struct tty_struct *tty, int timeout);
171 static void rs_stop(struct tty_struct *tty) in rs_stop() argument
173 struct async_struct *info = tty->driver_data; in rs_stop()
176 if (serial_paranoia_check(info, tty->name, "rs_stop")) in rs_stop()
191 static void rs_start(struct tty_struct *tty) in rs_start() argument
193 struct async_struct *info = tty->driver_data; in rs_start()
196 if (serial_paranoia_check(info, tty->name, "rs_start")) in rs_start()
249 struct tty_struct *tty = info->tty; in receive_chars() local
312 do_SAK(tty); in receive_chars()
326 tty_insert_flip_char(tty, ch, flag); in receive_chars()
328 tty_insert_flip_char(tty, 0, TTY_OVERRUN); in receive_chars()
329 tty_flip_buffer_push(tty); in receive_chars()
346 || info->tty->stopped in transmit_chars()
347 || info->tty->hw_stopped) { in transmit_chars()
413 if (info->tty) in check_modem_status()
414 tty_hangup(info->tty); in check_modem_status()
418 if (info->tty->hw_stopped) { in check_modem_status()
423 info->tty->hw_stopped = 0; in check_modem_status()
438 info->tty->hw_stopped = 1; in check_modem_status()
472 if (!info || !info->tty) in ser_rx_int()
493 if (!info || !info->tty) in ser_tx_int()
524 struct tty_struct *tty; in do_softint() local
526 tty = info->tty; in do_softint()
527 if (!tty) in do_softint()
531 tty_wakeup(tty); in do_softint()
577 if (info->tty) in startup()
579 &info->tty->flags); in startup()
596 if (info->tty->termios->c_cflag & CBAUD) in startup()
600 if (info->tty) in startup()
601 clear_bit(TTY_IO_ERROR, &info->tty->flags); in startup()
607 if (info->tty) { in startup()
609 info->tty->alt_speed = 57600; in startup()
611 info->tty->alt_speed = 115200; in startup()
613 info->tty->alt_speed = 230400; in startup()
615 info->tty->alt_speed = 460800; in startup()
678 if (!info->tty || (info->tty->termios->c_cflag & HUPCL)) in shutdown()
682 if (info->tty) in shutdown()
683 set_bit(TTY_IO_ERROR, &info->tty->flags); in shutdown()
702 if (!info->tty || !info->tty->termios) in change_speed()
704 cflag = info->tty->termios->c_cflag; in change_speed()
725 baud = tty_get_baud_rate(info->tty); in change_speed()
742 info->tty->termios->c_cflag &= ~CBAUD; in change_speed()
743 info->tty->termios->c_cflag |= (old_termios->c_cflag & CBAUD); in change_speed()
744 baud = tty_get_baud_rate(info->tty); in change_speed()
789 if (I_INPCK(info->tty)) in change_speed()
791 if (I_BRKINT(info->tty) || I_PARMRK(info->tty)) in change_speed()
798 if (I_IGNPAR(info->tty)) in change_speed()
800 if (I_IGNBRK(info->tty)) { in change_speed()
806 if (I_IGNPAR(info->tty)) in change_speed()
835 static int rs_put_char(struct tty_struct *tty, unsigned char ch) in rs_put_char() argument
840 info = tty->driver_data; in rs_put_char()
842 if (serial_paranoia_check(info, tty->name, "rs_put_char")) in rs_put_char()
862 static void rs_flush_chars(struct tty_struct *tty) in rs_flush_chars() argument
864 struct async_struct *info = tty->driver_data; in rs_flush_chars()
867 if (serial_paranoia_check(info, tty->name, "rs_flush_chars")) in rs_flush_chars()
871 || tty->stopped in rs_flush_chars()
872 || tty->hw_stopped in rs_flush_chars()
886 static int rs_write(struct tty_struct * tty, const unsigned char *buf, int count) in rs_write() argument
892 info = tty->driver_data; in rs_write()
894 if (serial_paranoia_check(info, tty->name, "rs_write")) in rs_write()
920 && !tty->stopped in rs_write()
921 && !tty->hw_stopped in rs_write()
935 static int rs_write_room(struct tty_struct *tty) in rs_write_room() argument
937 struct async_struct *info = tty->driver_data; in rs_write_room()
939 if (serial_paranoia_check(info, tty->name, "rs_write_room")) in rs_write_room()
944 static int rs_chars_in_buffer(struct tty_struct *tty) in rs_chars_in_buffer() argument
946 struct async_struct *info = tty->driver_data; in rs_chars_in_buffer()
948 if (serial_paranoia_check(info, tty->name, "rs_chars_in_buffer")) in rs_chars_in_buffer()
953 static void rs_flush_buffer(struct tty_struct *tty) in rs_flush_buffer() argument
955 struct async_struct *info = tty->driver_data; in rs_flush_buffer()
958 if (serial_paranoia_check(info, tty->name, "rs_flush_buffer")) in rs_flush_buffer()
963 tty_wakeup(tty); in rs_flush_buffer()
970 static void rs_send_xchar(struct tty_struct *tty, char ch) in rs_send_xchar() argument
972 struct async_struct *info = tty->driver_data; in rs_send_xchar()
975 if (serial_paranoia_check(info, tty->name, "rs_send_char")) in rs_send_xchar()
1005 static void rs_throttle(struct tty_struct * tty) in rs_throttle() argument
1007 struct async_struct *info = tty->driver_data; in rs_throttle()
1012 printk("throttle %s: %d....\n", tty_name(tty, buf), in rs_throttle()
1013 tty->ldisc.chars_in_buffer(tty)); in rs_throttle()
1016 if (serial_paranoia_check(info, tty->name, "rs_throttle")) in rs_throttle()
1019 if (I_IXOFF(tty)) in rs_throttle()
1020 rs_send_xchar(tty, STOP_CHAR(tty)); in rs_throttle()
1022 if (tty->termios->c_cflag & CRTSCTS) in rs_throttle()
1030 static void rs_unthrottle(struct tty_struct * tty) in rs_unthrottle() argument
1032 struct async_struct *info = tty->driver_data; in rs_unthrottle()
1037 printk("unthrottle %s: %d....\n", tty_name(tty, buf), in rs_unthrottle()
1038 tty->ldisc.chars_in_buffer(tty)); in rs_unthrottle()
1041 if (serial_paranoia_check(info, tty->name, "rs_unthrottle")) in rs_unthrottle()
1044 if (I_IXOFF(tty)) { in rs_unthrottle()
1048 rs_send_xchar(tty, START_CHAR(tty)); in rs_unthrottle()
1050 if (tty->termios->c_cflag & CRTSCTS) in rs_unthrottle()
1144 info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0; in set_serial_info()
1152 info->tty->alt_speed = 57600; in set_serial_info()
1154 info->tty->alt_speed = 115200; in set_serial_info()
1156 info->tty->alt_speed = 230400; in set_serial_info()
1158 info->tty->alt_speed = 460800; in set_serial_info()
1195 static int rs_tiocmget(struct tty_struct *tty, struct file *file) in rs_tiocmget() argument
1197 struct async_struct * info = tty->driver_data; in rs_tiocmget()
1201 if (serial_paranoia_check(info, tty->name, "rs_ioctl")) in rs_tiocmget()
1203 if (tty->flags & (1 << TTY_IO_ERROR)) in rs_tiocmget()
1217 static int rs_tiocmset(struct tty_struct *tty, struct file *file, in rs_tiocmset() argument
1220 struct async_struct * info = tty->driver_data; in rs_tiocmset()
1223 if (serial_paranoia_check(info, tty->name, "rs_ioctl")) in rs_tiocmset()
1225 if (tty->flags & (1 << TTY_IO_ERROR)) in rs_tiocmset()
1245 static int rs_break(struct tty_struct *tty, int break_state) in rs_break() argument
1247 struct async_struct * info = tty->driver_data; in rs_break()
1250 if (serial_paranoia_check(info, tty->name, "rs_break")) in rs_break()
1264 static int rs_ioctl(struct tty_struct *tty, struct file * file, in rs_ioctl() argument
1267 struct async_struct * info = tty->driver_data; in rs_ioctl()
1273 if (serial_paranoia_check(info, tty->name, "rs_ioctl")) in rs_ioctl()
1279 if (tty->flags & (1 << TTY_IO_ERROR)) in rs_ioctl()
1369 static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios) in rs_set_termios() argument
1371 struct async_struct *info = tty->driver_data; in rs_set_termios()
1373 unsigned int cflag = tty->termios->c_cflag; in rs_set_termios()
1390 if (!(tty->termios->c_cflag & CRTSCTS) || in rs_set_termios()
1391 !test_bit(TTY_THROTTLED, &tty->flags)) { in rs_set_termios()
1401 !(tty->termios->c_cflag & CRTSCTS)) { in rs_set_termios()
1402 tty->hw_stopped = 0; in rs_set_termios()
1403 rs_start(tty); in rs_set_termios()
1414 (tty->termios->c_cflag & CLOCAL)) in rs_set_termios()
1429 static void rs_close(struct tty_struct *tty, struct file * filp) in rs_close() argument
1431 struct async_struct * info = tty->driver_data; in rs_close()
1435 if (!info || serial_paranoia_check(info, tty->name, "rs_close")) in rs_close()
1451 if ((tty->count == 1) && (state->count != 1)) { in rs_close()
1478 tty->closing = 1; in rs_close()
1480 tty_wait_until_sent(tty, info->closing_wait); in rs_close()
1501 rs_wait_until_sent(tty, info->timeout); in rs_close()
1504 rs_flush_buffer(tty); in rs_close()
1506 tty_ldisc_flush(tty); in rs_close()
1507 tty->closing = 0; in rs_close()
1509 info->tty = NULL; in rs_close()
1524 static void rs_wait_until_sent(struct tty_struct *tty, int timeout) in rs_wait_until_sent() argument
1526 struct async_struct * info = tty->driver_data; in rs_wait_until_sent()
1530 if (serial_paranoia_check(info, tty->name, "rs_wait_until_sent")) in rs_wait_until_sent()
1588 static void rs_hangup(struct tty_struct *tty) in rs_hangup() argument
1590 struct async_struct * info = tty->driver_data; in rs_hangup()
1593 if (serial_paranoia_check(info, tty->name, "rs_hangup")) in rs_hangup()
1598 rs_flush_buffer(tty); in rs_hangup()
1603 info->tty = NULL; in rs_hangup()
1612 static int block_til_ready(struct tty_struct *tty, struct file * filp, in block_til_ready() argument
1646 (tty->flags & (1 << TTY_IO_ERROR))) { in block_til_ready()
1651 if (tty->termios->c_cflag & CLOCAL) in block_til_ready()
1676 if (tty->termios->c_cflag & CBAUD) in block_til_ready()
1763 static int rs_open(struct tty_struct *tty, struct file * filp) in rs_open() argument
1768 line = tty->index; in rs_open()
1776 tty->driver_data = info; in rs_open()
1777 info->tty = tty; in rs_open()
1778 if (serial_paranoia_check(info, tty->name, "rs_open")) in rs_open()
1782 printk("rs_open %s, count = %d\n", tty->name, info->state->count); in rs_open()
1784 info->tty->low_latency = (info->flags & ASYNC_LOW_LATENCY) ? 1 : 0; in rs_open()
1809 retval = block_til_ready(tty, filp, info); in rs_open()
1819 printk("rs_open %s successful...", tty->name); in rs_open()
1846 info->tty = NULL; in line_info()