• Home
  • Raw
  • Download

Lines Matching refs:tty

572 static int mxser_set_baud(struct tty_struct *tty, long newspd)  in mxser_set_baud()  argument
574 struct mxser_port *info = tty->driver_data; in mxser_set_baud()
586 tty_encode_baud_rate(tty, 134, 134); in mxser_set_baud()
592 tty_encode_baud_rate(tty, baud, baud); in mxser_set_baud()
618 if (C_BAUD(tty) == BOTHER) { in mxser_set_baud()
639 static int mxser_change_speed(struct tty_struct *tty, in mxser_change_speed() argument
642 struct mxser_port *info = tty->driver_data; in mxser_change_speed()
647 cflag = tty->termios.c_cflag; in mxser_change_speed()
651 if (mxser_set_baud_method[tty->index] == 0) in mxser_change_speed()
652 mxser_set_baud(tty, tty_get_baud_rate(tty)); in mxser_change_speed()
721 if (tty->hw_stopped) { in mxser_change_speed()
723 tty->hw_stopped = 0; in mxser_change_speed()
733 tty_wakeup(tty); in mxser_change_speed()
737 tty->hw_stopped = 1; in mxser_change_speed()
758 if (I_INPCK(tty)) in mxser_change_speed()
760 if (I_BRKINT(tty) || I_PARMRK(tty)) in mxser_change_speed()
765 if (I_IGNBRK(tty)) { in mxser_change_speed()
772 if (I_IGNPAR(tty)) { in mxser_change_speed()
784 mxser_set_must_xon1_value(info->ioaddr, START_CHAR(tty)); in mxser_change_speed()
785 mxser_set_must_xoff1_value(info->ioaddr, STOP_CHAR(tty)); in mxser_change_speed()
786 if (I_IXON(tty)) { in mxser_change_speed()
793 if (I_IXOFF(tty)) { in mxser_change_speed()
809 static void mxser_check_modem_status(struct tty_struct *tty, in mxser_check_modem_status() argument
830 if (tty->hw_stopped) { in mxser_check_modem_status()
832 tty->hw_stopped = 0; in mxser_check_modem_status()
842 tty_wakeup(tty); in mxser_check_modem_status()
846 tty->hw_stopped = 1; in mxser_check_modem_status()
858 static int mxser_activate(struct tty_port *port, struct tty_struct *tty) in mxser_activate() argument
871 set_bit(TTY_IO_ERROR, &tty->flags); in mxser_activate()
898 set_bit(TTY_IO_ERROR, &tty->flags); in mxser_activate()
936 clear_bit(TTY_IO_ERROR, &tty->flags); in mxser_activate()
942 mxser_change_speed(tty, NULL); in mxser_activate()
1000 static int mxser_open(struct tty_struct *tty, struct file *filp) in mxser_open() argument
1005 line = tty->index; in mxser_open()
1012 tty->driver_data = info; in mxser_open()
1013 return tty_port_open(&info->port, tty, filp); in mxser_open()
1016 static void mxser_flush_buffer(struct tty_struct *tty) in mxser_flush_buffer() argument
1018 struct mxser_port *info = tty->driver_data; in mxser_flush_buffer()
1033 tty_wakeup(tty); in mxser_flush_buffer()
1071 static void mxser_close(struct tty_struct *tty, struct file *filp) in mxser_close() argument
1073 struct mxser_port *info = tty->driver_data; in mxser_close()
1076 if (tty->index == MXSER_PORTS || info == NULL) in mxser_close()
1078 if (tty_port_close_start(port, tty, filp) == 0) in mxser_close()
1083 mxser_flush_buffer(tty); in mxser_close()
1084 if (tty_port_initialized(port) && C_HUPCL(tty)) in mxser_close()
1092 tty_port_close_end(port, tty); in mxser_close()
1096 static int mxser_write(struct tty_struct *tty, const unsigned char *buf, int count) in mxser_write() argument
1099 struct mxser_port *info = tty->driver_data; in mxser_write()
1123 if (info->xmit_cnt && !tty->stopped) { in mxser_write()
1124 if (!tty->hw_stopped || in mxser_write()
1138 static int mxser_put_char(struct tty_struct *tty, unsigned char ch) in mxser_put_char() argument
1140 struct mxser_port *info = tty->driver_data; in mxser_put_char()
1154 if (!tty->stopped) { in mxser_put_char()
1155 if (!tty->hw_stopped || in mxser_put_char()
1169 static void mxser_flush_chars(struct tty_struct *tty) in mxser_flush_chars() argument
1171 struct mxser_port *info = tty->driver_data; in mxser_flush_chars()
1174 if (info->xmit_cnt <= 0 || tty->stopped || !info->port.xmit_buf || in mxser_flush_chars()
1175 (tty->hw_stopped && info->type != PORT_16550A && in mxser_flush_chars()
1188 static int mxser_write_room(struct tty_struct *tty) in mxser_write_room() argument
1190 struct mxser_port *info = tty->driver_data; in mxser_write_room()
1197 static int mxser_chars_in_buffer(struct tty_struct *tty) in mxser_chars_in_buffer() argument
1199 struct mxser_port *info = tty->driver_data; in mxser_chars_in_buffer()
1208 static int mxser_get_serial_info(struct tty_struct *tty, in mxser_get_serial_info() argument
1211 struct mxser_port *info = tty->driver_data; in mxser_get_serial_info()
1214 .line = tty->index, in mxser_get_serial_info()
1228 static int mxser_set_serial_info(struct tty_struct *tty, in mxser_set_serial_info() argument
1231 struct mxser_port *info = tty->driver_data; in mxser_set_serial_info()
1274 tty_encode_baud_rate(tty, baud, baud); in mxser_set_serial_info()
1285 mxser_change_speed(tty, NULL); in mxser_set_serial_info()
1289 retval = mxser_activate(port, tty); in mxser_set_serial_info()
1320 static int mxser_tiocmget(struct tty_struct *tty) in mxser_tiocmget() argument
1322 struct mxser_port *info = tty->driver_data; in mxser_tiocmget()
1327 if (tty->index == MXSER_PORTS) in mxser_tiocmget()
1329 if (tty_io_error(tty)) in mxser_tiocmget()
1337 mxser_check_modem_status(tty, info, status); in mxser_tiocmget()
1347 static int mxser_tiocmset(struct tty_struct *tty, in mxser_tiocmset() argument
1350 struct mxser_port *info = tty->driver_data; in mxser_tiocmset()
1354 if (tty->index == MXSER_PORTS) in mxser_tiocmset()
1356 if (tty_io_error(tty)) in mxser_tiocmset()
1483 struct tty_struct *tty; in mxser_ioctl_special() local
1520 tty = tty_port_tty_get(port); in mxser_ioctl_special()
1522 if (!tty) in mxser_ioctl_special()
1525 ms.cflag = tty->termios.c_cflag; in mxser_ioctl_special()
1526 tty_kref_put(tty); in mxser_ioctl_special()
1589 tty = tty_port_tty_get(&ip->port); in mxser_ioctl_special()
1591 if (!tty) { in mxser_ioctl_special()
1596 cflag = tty->termios.c_cflag; in mxser_ioctl_special()
1597 iflag = tty->termios.c_iflag; in mxser_ioctl_special()
1598 me->baudrate[p] = tty_get_baud_rate(tty); in mxser_ioctl_special()
1600 tty_kref_put(tty); in mxser_ioctl_special()
1658 static int mxser_ioctl(struct tty_struct *tty, in mxser_ioctl() argument
1661 struct mxser_port *info = tty->driver_data; in mxser_ioctl()
1668 if (tty->index == MXSER_PORTS) in mxser_ioctl()
1681 p = tty->index % 4; in mxser_ioctl()
1710 if (cmd != TIOCGSERIAL && cmd != TIOCMIWAIT && tty_io_error(tty)) in mxser_ioctl()
1716 retval = mxser_get_serial_info(tty, argp); in mxser_ioctl()
1721 retval = mxser_set_serial_info(tty, argp); in mxser_ioctl()
1751 len = mxser_chars_in_buffer(tty); in mxser_ioctl()
1763 status = mxser_get_msr(info->ioaddr, 1, tty->index); in mxser_ioctl()
1764 mxser_check_modem_status(tty, info, status); in mxser_ioctl()
1779 if (tty->hw_stopped) in mxser_ioctl()
1802 mxser_set_baud_method[tty->index] = method; in mxser_ioctl()
1818 static int mxser_get_icount(struct tty_struct *tty, in mxser_get_icount() argument
1822 struct mxser_port *info = tty->driver_data; in mxser_get_icount()
1844 static void mxser_stoprx(struct tty_struct *tty) in mxser_stoprx() argument
1846 struct mxser_port *info = tty->driver_data; in mxser_stoprx()
1849 if (I_IXOFF(tty)) { in mxser_stoprx()
1854 info->x_char = STOP_CHAR(tty); in mxser_stoprx()
1861 if (C_CRTSCTS(tty)) { in mxser_stoprx()
1871 static void mxser_throttle(struct tty_struct *tty) in mxser_throttle() argument
1873 mxser_stoprx(tty); in mxser_throttle()
1876 static void mxser_unthrottle(struct tty_struct *tty) in mxser_unthrottle() argument
1878 struct mxser_port *info = tty->driver_data; in mxser_unthrottle()
1882 if (I_IXOFF(tty)) { in mxser_unthrottle()
1890 info->x_char = START_CHAR(tty); in mxser_unthrottle()
1898 if (C_CRTSCTS(tty)) { in mxser_unthrottle()
1910 static void mxser_stop(struct tty_struct *tty) in mxser_stop() argument
1912 struct mxser_port *info = tty->driver_data; in mxser_stop()
1923 static void mxser_start(struct tty_struct *tty) in mxser_start() argument
1925 struct mxser_port *info = tty->driver_data; in mxser_start()
1937 static void mxser_set_termios(struct tty_struct *tty, struct ktermios *old_termios) in mxser_set_termios() argument
1939 struct mxser_port *info = tty->driver_data; in mxser_set_termios()
1943 mxser_change_speed(tty, old_termios); in mxser_set_termios()
1946 if ((old_termios->c_cflag & CRTSCTS) && !C_CRTSCTS(tty)) { in mxser_set_termios()
1947 tty->hw_stopped = 0; in mxser_set_termios()
1948 mxser_start(tty); in mxser_set_termios()
1952 if ((old_termios->c_iflag & IXON) && !I_IXON(tty)) { in mxser_set_termios()
1953 tty->stopped = 0; in mxser_set_termios()
1962 mxser_start(tty); in mxser_set_termios()
1969 static void mxser_wait_until_sent(struct tty_struct *tty, int timeout) in mxser_wait_until_sent() argument
1971 struct mxser_port *info = tty->driver_data; in mxser_wait_until_sent()
2026 static void mxser_hangup(struct tty_struct *tty) in mxser_hangup() argument
2028 struct mxser_port *info = tty->driver_data; in mxser_hangup()
2030 mxser_flush_buffer(tty); in mxser_hangup()
2037 static int mxser_rs_break(struct tty_struct *tty, int break_state) in mxser_rs_break() argument
2039 struct mxser_port *info = tty->driver_data; in mxser_rs_break()
2053 static void mxser_receive_chars(struct tty_struct *tty, in mxser_receive_chars() argument
2062 recv_room = tty->receive_room; in mxser_receive_chars()
2064 mxser_stoprx(tty); in mxser_receive_chars()
2081 mxser_stoprx(tty); in mxser_receive_chars()
2111 do_SAK(tty); in mxser_receive_chars()
2128 mxser_stoprx(tty); in mxser_receive_chars()
2141 mxvar_log.rxcnt[tty->index] += cnt; in mxser_receive_chars()
2155 static void mxser_transmit_chars(struct tty_struct *tty, struct mxser_port *port) in mxser_transmit_chars() argument
2162 mxvar_log.txcnt[tty->index]++; in mxser_transmit_chars()
2172 if (port->xmit_cnt <= 0 || tty->stopped || in mxser_transmit_chars()
2173 (tty->hw_stopped && in mxser_transmit_chars()
2190 mxvar_log.txcnt[tty->index] += (cnt - port->xmit_cnt); in mxser_transmit_chars()
2197 tty_wakeup(tty); in mxser_transmit_chars()
2216 struct tty_struct *tty; in mxser_interrupt() local
2249 tty = tty_port_tty_get(&port->port); in mxser_interrupt()
2250 if (!tty || port->closing || in mxser_interrupt()
2255 tty_kref_put(tty); in mxser_interrupt()
2276 mxser_receive_chars(tty, port, in mxser_interrupt()
2282 mxser_receive_chars(tty, port, in mxser_interrupt()
2287 mxser_check_modem_status(tty, port, msr); in mxser_interrupt()
2292 mxser_transmit_chars(tty, port); in mxser_interrupt()
2295 mxser_transmit_chars(tty, port); in mxser_interrupt()
2297 tty_kref_put(tty); in mxser_interrupt()