Lines Matching refs:tty
188 static void rs_stop(struct tty_struct *tty) in rs_stop() argument
190 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data; in rs_stop()
194 if (serial_paranoia_check(info, tty->name, "rs_stop")) in rs_stop()
219 static void rs_start(struct tty_struct *tty) in rs_start() argument
221 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data; in rs_start()
225 if (serial_paranoia_check(info, tty->name, "rs_start")) in rs_start()
251 if((info->port.tty->termios->c_cflag & CRTSCTS) && in status_handle()
276 struct tty_struct *tty = info->port.tty; in receive_chars() local
310 if(!tty) in receive_chars()
325 tty_insert_flip_char(tty, ch, flag); in receive_chars()
330 tty_schedule_flip(tty); in receive_chars()
347 if((info->xmit_cnt <= 0) || info->port.tty->stopped) { in transmit_chars()
399 struct tty_struct *tty; in do_softint() local
401 tty = info->port.tty; in do_softint()
402 if (!tty) in do_softint()
406 tty_wakeup(tty); in do_softint()
423 struct tty_struct *tty; in do_serial_hangup() local
425 tty = info->port.tty; in do_serial_hangup()
426 if (!tty) in do_serial_hangup()
429 tty_hangup(tty); in do_serial_hangup()
469 if (info->port.tty) in startup()
470 clear_bit(TTY_IO_ERROR, &info->port.tty->flags); in startup()
504 if (info->port.tty) in shutdown()
505 set_bit(TTY_IO_ERROR, &info->port.tty->flags); in shutdown()
571 if (!info->port.tty || !info->port.tty->termios) in change_speed()
573 cflag = info->port.tty->termios->c_cflag; in change_speed()
669 static void rs_set_ldisc(struct tty_struct *tty) in rs_set_ldisc() argument
671 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data; in rs_set_ldisc()
673 if (serial_paranoia_check(info, tty->name, "rs_set_ldisc")) in rs_set_ldisc()
676 info->is_cons = (tty->termios->c_line == N_TTY); in rs_set_ldisc()
681 static void rs_flush_chars(struct tty_struct *tty) argument
683 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
687 if (serial_paranoia_check(info, tty->name, "rs_flush_chars"))
696 if (info->xmit_cnt <= 0 || tty->stopped || tty->hw_stopped ||
728 static int rs_write(struct tty_struct * tty, argument
732 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
736 if (serial_paranoia_check(info, tty->name, "rs_write"))
739 if (!tty || !info->xmit_buf)
763 if (info->xmit_cnt && !tty->stopped && !tty->hw_stopped) {
791 static int rs_write_room(struct tty_struct *tty) argument
793 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
796 if (serial_paranoia_check(info, tty->name, "rs_write_room"))
804 static int rs_chars_in_buffer(struct tty_struct *tty) argument
806 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
808 if (serial_paranoia_check(info, tty->name, "rs_chars_in_buffer"))
813 static void rs_flush_buffer(struct tty_struct *tty) argument
815 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
818 if (serial_paranoia_check(info, tty->name, "rs_flush_buffer"))
823 tty_wakeup(tty);
834 static void rs_throttle(struct tty_struct * tty) argument
836 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
838 if (serial_paranoia_check(info, tty->name, "rs_throttle"))
841 if (I_IXOFF(tty))
842 info->x_char = STOP_CHAR(tty);
847 static void rs_unthrottle(struct tty_struct * tty) argument
849 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
851 if (serial_paranoia_check(info, tty->name, "rs_unthrottle"))
854 if (I_IXOFF(tty)) {
858 info->x_char = START_CHAR(tty);
983 static int rs_ioctl(struct tty_struct *tty, struct file * file, argument
987 struct m68k_serial * info = (struct m68k_serial *)tty->driver_data;
990 if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
996 if (tty->flags & (1 << TTY_IO_ERROR))
1002 retval = tty_check_change(tty);
1005 tty_wait_until_sent(tty, 0);
1010 retval = tty_check_change(tty);
1013 tty_wait_until_sent(tty, 0);
1044 static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios) argument
1046 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
1051 !(tty->termios->c_cflag & CRTSCTS)) {
1052 tty->hw_stopped = 0;
1053 rs_start(tty);
1068 static void rs_close(struct tty_struct *tty, struct file * filp) argument
1070 struct m68k_serial * info = (struct m68k_serial *)tty->driver_data;
1074 if (!info || serial_paranoia_check(info, tty->name, "rs_close"))
1084 if ((tty->count == 1) && (info->count != 1)) {
1110 tty->closing = 1;
1112 tty_wait_until_sent(tty, info->closing_wait);
1124 rs_flush_buffer(tty);
1126 tty_ldisc_flush(tty);
1127 tty->closing = 0;
1129 info->port.tty = NULL;
1132 if (tty->ldisc.num != ldiscs[N_TTY].num) {
1133 if (tty->ldisc.close)
1134 (tty->ldisc.close)(tty);
1135 tty->ldisc = ldiscs[N_TTY];
1136 tty->termios->c_line = N_TTY;
1137 if (tty->ldisc.open)
1138 (tty->ldisc.open)(tty);
1155 void rs_hangup(struct tty_struct *tty) argument
1157 struct m68k_serial * info = (struct m68k_serial *)tty->driver_data;
1159 if (serial_paranoia_check(info, tty->name, "rs_hangup"))
1162 rs_flush_buffer(tty);
1167 info->port.tty = NULL;
1176 static int block_til_ready(struct tty_struct *tty, struct file * filp, argument
1204 (tty->flags & (1 << TTY_IO_ERROR))) {
1209 if (tty->termios->c_cflag & CLOCAL)
1267 int rs_open(struct tty_struct *tty, struct file * filp) argument
1272 line = tty->index;
1279 if (serial_paranoia_check(info, tty->name, "rs_open"))
1283 tty->driver_data = info;
1284 info->port.tty = tty;
1293 return block_til_ready(tty, filp, info);
1361 info->port.tty = NULL;