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()
605 static void rs_set_ldisc(struct tty_struct *tty) in rs_set_ldisc() argument
607 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data; in rs_set_ldisc()
609 if (serial_paranoia_check(info, tty->name, "rs_set_ldisc")) in rs_set_ldisc()
612 info->is_cons = (tty->termios.c_line == N_TTY); in rs_set_ldisc()
617 static void rs_flush_chars(struct tty_struct *tty) argument
619 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
623 if (serial_paranoia_check(info, tty->name, "rs_flush_chars"))
632 if (info->xmit_cnt <= 0 || tty->stopped || !info->xmit_buf) {
663 static int rs_write(struct tty_struct * tty, argument
667 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
671 if (serial_paranoia_check(info, tty->name, "rs_write"))
674 if (!tty || !info->xmit_buf)
698 if (info->xmit_cnt && !tty->stopped) {
726 static int rs_write_room(struct tty_struct *tty) argument
728 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
731 if (serial_paranoia_check(info, tty->name, "rs_write_room"))
739 static int rs_chars_in_buffer(struct tty_struct *tty) argument
741 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
743 if (serial_paranoia_check(info, tty->name, "rs_chars_in_buffer"))
748 static void rs_flush_buffer(struct tty_struct *tty) argument
750 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
753 if (serial_paranoia_check(info, tty->name, "rs_flush_buffer"))
758 tty_wakeup(tty);
769 static void rs_throttle(struct tty_struct * tty) argument
771 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
773 if (serial_paranoia_check(info, tty->name, "rs_throttle"))
776 if (I_IXOFF(tty))
777 info->x_char = STOP_CHAR(tty);
782 static void rs_unthrottle(struct tty_struct * tty) argument
784 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
786 if (serial_paranoia_check(info, tty->name, "rs_unthrottle"))
789 if (I_IXOFF(tty)) {
793 info->x_char = START_CHAR(tty);
828 static int set_serial_info(struct m68k_serial *info, struct tty_struct *tty, argument
871 retval = startup(info, tty);
921 static int rs_ioctl(struct tty_struct *tty, argument
924 struct m68k_serial * info = (struct m68k_serial *)tty->driver_data;
927 if (serial_paranoia_check(info, tty->name, "rs_ioctl"))
933 if (tty->flags & (1 << TTY_IO_ERROR))
939 retval = tty_check_change(tty);
942 tty_wait_until_sent(tty, 0);
947 retval = tty_check_change(tty);
950 tty_wait_until_sent(tty, 0);
957 return set_serial_info(info, tty,
972 static void rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios) argument
974 struct m68k_serial *info = (struct m68k_serial *)tty->driver_data;
976 change_speed(info, tty);
979 !(tty->termios.c_cflag & CRTSCTS))
980 rs_start(tty);
994 static void rs_close(struct tty_struct *tty, struct file * filp) argument
996 struct m68k_serial * info = (struct m68k_serial *)tty->driver_data;
1001 if (serial_paranoia_check(info, tty->name, "rs_close"))
1011 if ((tty->count == 1) && (port->count != 1)) {
1037 tty->closing = 1;
1039 tty_wait_until_sent(tty, port->closing_wait);
1050 shutdown(info, tty);
1051 rs_flush_buffer(tty);
1053 tty_ldisc_flush(tty);
1054 tty->closing = 0;
1058 if (tty->ldisc.num != ldiscs[N_TTY].num) {
1059 if (tty->ldisc.close)
1060 (tty->ldisc.close)(tty);
1061 tty->ldisc = ldiscs[N_TTY];
1062 tty->termios.c_line = N_TTY;
1063 if (tty->ldisc.open)
1064 (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);