Lines Matching refs:tty

141 static void change_speed(struct m68k_serial *info, struct tty_struct *tty);
212 static void rs_stop(struct tty_struct *tty) in rs_stop() argument
214 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data; in rs_stop()
218 if (serial_paranoia_check(info, tty->name, "rs_stop")) in rs_stop()
244 static void rs_start(struct tty_struct *tty) in rs_start() argument
246 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data; in rs_start()
250 if (serial_paranoia_check(info, tty->name, "rs_start")) in rs_start()
311 static void transmit_chars(struct m68k_serial *info, struct tty_struct *tty) in transmit_chars() argument
322 if ((info->xmit_cnt <= 0) || !tty || tty->stopped) { in transmit_chars()
350 struct tty_struct *tty = tty_port_tty_get(&info->tport); in rs_interrupt() local
364 transmit_chars(info, tty); in rs_interrupt()
368 tty_kref_put(tty); in rs_interrupt()
373 static int startup(struct m68k_serial *info, struct tty_struct *tty) in startup() argument
408 if (tty) in startup()
409 clear_bit(TTY_IO_ERROR, &tty->flags); in startup()
416 change_speed(info, tty); in startup()
427 static void shutdown(struct m68k_serial *info, struct tty_struct *tty) in shutdown() argument
443 if (tty) in shutdown()
444 set_bit(TTY_IO_ERROR, &tty->flags); in shutdown()
502 static void change_speed(struct m68k_serial *info, struct tty_struct *tty) in change_speed() argument
510 cflag = tty->termios.c_cflag; in change_speed()
606 static void rs_set_ldisc(struct tty_struct *tty) in rs_set_ldisc() argument
608 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data; in rs_set_ldisc()
610 if (serial_paranoia_check(info, tty->name, "rs_set_ldisc")) in rs_set_ldisc()
613 info->is_cons = (tty->termios.c_line == N_TTY); in rs_set_ldisc()
618 static void rs_flush_chars(struct tty_struct *tty) argument
620 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
624 if (serial_paranoia_check(info, tty->name, "rs_flush_chars"))
633 if (info->xmit_cnt <= 0 || tty->stopped || !info->xmit_buf) {
664 static int rs_write(struct tty_struct * tty, argument
668 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
672 if (serial_paranoia_check(info, tty->name, "rs_write"))
675 if (!tty || !info->xmit_buf)
699 if (info->xmit_cnt && !tty->stopped) {
727 static int rs_write_room(struct tty_struct *tty) argument
729 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
732 if (serial_paranoia_check(info, tty->name, "rs_write_room"))
740 static int rs_chars_in_buffer(struct tty_struct *tty) argument
742 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
744 if (serial_paranoia_check(info, tty->name, "rs_chars_in_buffer"))
749 static void rs_flush_buffer(struct tty_struct *tty) argument
751 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
754 if (serial_paranoia_check(info, tty->name, "rs_flush_buffer"))
759 tty_wakeup(tty);
770 static void rs_throttle(struct tty_struct * tty) argument
772 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
774 if (serial_paranoia_check(info, tty->name, "rs_throttle"))
777 if (I_IXOFF(tty))
778 info->x_char = STOP_CHAR(tty);
783 static void rs_unthrottle(struct tty_struct * tty) argument
785 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
787 if (serial_paranoia_check(info, tty->name, "rs_unthrottle"))
790 if (I_IXOFF(tty)) {
794 info->x_char = START_CHAR(tty);
829 static int set_serial_info(struct m68k_serial *info, struct tty_struct *tty, argument
872 retval = startup(info, tty);
922 static int rs_ioctl(struct tty_struct *tty, argument
925 struct m68k_serial * info = (struct m68k_serial *)tty->driver_data;
928 if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
934 if (tty->flags & (1 << TTY_IO_ERROR))
940 retval = tty_check_change(tty);
943 tty_wait_until_sent(tty, 0);
948 retval = tty_check_change(tty);
951 tty_wait_until_sent(tty, 0);
958 return set_serial_info(info, tty,
973 static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios) argument
975 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
977 change_speed(info, tty);
980 !(tty->termios.c_cflag & CRTSCTS))
981 rs_start(tty);
995 static void rs_close(struct tty_struct *tty, struct file * filp) argument
997 struct m68k_serial * info = (struct m68k_serial *)tty->driver_data;
1002 if (serial_paranoia_check(info, tty->name, "rs_close"))
1012 if ((tty->count == 1) && (port->count != 1)) {
1038 tty->closing = 1;
1040 tty_wait_until_sent(tty, port->closing_wait);
1051 shutdown(info, tty);
1052 rs_flush_buffer(tty);
1054 tty_ldisc_flush(tty);
1055 tty->closing = 0;
1059 if (tty->ldisc.num != ldiscs[N_TTY].num) {
1060 if (tty->ldisc.close)
1061 (tty->ldisc.close)(tty);
1062 tty->ldisc = ldiscs[N_TTY];
1063 tty->termios.c_line = N_TTY;
1064 if (tty->ldisc.open)
1065 (tty->ldisc.open)(tty);
1080 void rs_hangup(struct tty_struct *tty) argument
1082 struct m68k_serial * info = (struct m68k_serial *)tty->driver_data;
1084 if (serial_paranoia_check(info, tty->name, "rs_hangup"))
1087 rs_flush_buffer(tty);
1088 shutdown(info, tty);
1101 int rs_open(struct tty_struct *tty, struct file * filp) argument
1106 info = &m68k_soft[tty->index];
1108 if (serial_paranoia_check(info, tty->name, "rs_open"))
1112 tty->driver_data = info;
1113 tty_port_tty_set(&info->tport, tty);
1118 retval = startup(info, tty);
1122 return tty_port_block_til_ready(&info->tport, tty, filp);