Lines Matching refs:tty
230 static void rp_wait_until_sent(struct tty_struct *tty, int timeout);
231 static void rp_flush_buffer(struct tty_struct *tty);
234 static void rp_start(struct tty_struct *tty);
427 struct tty_struct *tty; in rp_do_transmit() local
435 tty = tty_port_tty_get(&info->port); in rp_do_transmit()
437 if (tty == NULL) { in rp_do_transmit()
448 if (tty->stopped) in rp_do_transmit()
470 tty_wakeup(tty); in rp_do_transmit()
472 wake_up_interruptible(&tty->poll_wait); in rp_do_transmit()
477 tty_kref_put(tty); in rp_do_transmit()
705 static void configure_r_port(struct tty_struct *tty, struct r_port *info, in configure_r_port() argument
713 struct ktermios *t = &tty->termios; in configure_r_port()
746 baud = tty_get_baud_rate(tty); in configure_r_port()
764 tty_encode_baud_rate(tty, baud, baud); in configure_r_port()
789 if (I_IXON(tty)) { in configure_r_port()
791 if (I_IXANY(tty)) { in configure_r_port()
796 sSetTxXONChar(cp, START_CHAR(tty)); in configure_r_port()
797 sSetTxXOFFChar(cp, STOP_CHAR(tty)); in configure_r_port()
809 if (I_INPCK(tty)) in configure_r_port()
811 if (I_BRKINT(tty) || I_PARMRK(tty)) in configure_r_port()
818 if (I_IGNPAR(tty)) in configure_r_port()
820 if (I_IGNBRK(tty)) { in configure_r_port()
826 if (I_IGNPAR(tty)) in configure_r_port()
881 static int rp_open(struct tty_struct *tty, struct file *filp) in rp_open() argument
889 info = rp_table[tty->index]; in rp_open()
906 tty->driver_data = info; in rp_open()
907 tty_port_tty_set(port, tty); in rp_open()
954 tty->alt_speed = 57600; in rp_open()
956 tty->alt_speed = 115200; in rp_open()
958 tty->alt_speed = 230400; in rp_open()
960 tty->alt_speed = 460800; in rp_open()
962 configure_r_port(tty, info, NULL); in rp_open()
963 if (tty->termios.c_cflag & CBAUD) { in rp_open()
971 retval = tty_port_block_til_ready(port, tty, filp); in rp_open()
984 static void rp_close(struct tty_struct *tty, struct file *filp) in rp_close() argument
986 struct r_port *info = tty->driver_data; in rp_close()
998 if (tty_port_close_start(port, tty, filp) == 0) in rp_close()
1011 rp_wait_until_sent(tty, timeout); in rp_close()
1022 if (C_HUPCL(tty)) in rp_close()
1025 rp_flush_buffer(tty); in rp_close()
1027 tty_ldisc_flush(tty); in rp_close()
1047 tty->closing = 0; in rp_close()
1063 static void rp_set_termios(struct tty_struct *tty, in rp_set_termios() argument
1066 struct r_port *info = tty->driver_data; in rp_set_termios()
1073 cflag = tty->termios.c_cflag; in rp_set_termios()
1079 tty->termios.c_cflag = in rp_set_termios()
1082 tty->termios.c_cflag &= ~CMSPAR; in rp_set_termios()
1084 configure_r_port(tty, info, old_termios); in rp_set_termios()
1089 if ((old_termios->c_cflag & CBAUD) && !(tty->termios.c_cflag & CBAUD)) { in rp_set_termios()
1095 if (!(old_termios->c_cflag & CBAUD) && (tty->termios.c_cflag & CBAUD)) { in rp_set_termios()
1100 if ((old_termios->c_cflag & CRTSCTS) && !(tty->termios.c_cflag & CRTSCTS)) in rp_set_termios()
1101 rp_start(tty); in rp_set_termios()
1104 static int rp_break(struct tty_struct *tty, int break_state) in rp_break() argument
1106 struct r_port *info = tty->driver_data; in rp_break()
1150 static int rp_tiocmget(struct tty_struct *tty) in rp_tiocmget() argument
1152 struct r_port *info = tty->driver_data; in rp_tiocmget()
1170 static int rp_tiocmset(struct tty_struct *tty, in rp_tiocmset() argument
1173 struct r_port *info = tty->driver_data; in rp_tiocmset()
1208 static int set_config(struct tty_struct *tty, struct r_port *info, in set_config() argument
1224 configure_r_port(tty, info, NULL); in set_config()
1234 tty->alt_speed = 57600; in set_config()
1236 tty->alt_speed = 115200; in set_config()
1238 tty->alt_speed = 230400; in set_config()
1240 tty->alt_speed = 460800; in set_config()
1243 configure_r_port(tty, info, NULL); in set_config()
1307 static int rp_ioctl(struct tty_struct *tty, in rp_ioctl() argument
1310 struct r_port *info = tty->driver_data; in rp_ioctl()
1326 ret = set_config(tty, info, argp); in rp_ioctl()
1343 static void rp_send_xchar(struct tty_struct *tty, char ch) in rp_send_xchar() argument
1345 struct r_port *info = tty->driver_data; in rp_send_xchar()
1358 static void rp_throttle(struct tty_struct *tty) in rp_throttle() argument
1360 struct r_port *info = tty->driver_data; in rp_throttle()
1363 printk(KERN_INFO "throttle %s: %d....\n", tty->name, in rp_throttle()
1364 tty->ldisc.chars_in_buffer(tty)); in rp_throttle()
1370 if (I_IXOFF(tty)) in rp_throttle()
1371 rp_send_xchar(tty, STOP_CHAR(tty)); in rp_throttle()
1376 static void rp_unthrottle(struct tty_struct *tty) in rp_unthrottle() argument
1378 struct r_port *info = tty->driver_data; in rp_unthrottle()
1380 printk(KERN_INFO "unthrottle %s: %d....\n", tty->name, in rp_unthrottle()
1381 tty->ldisc.chars_in_buffer(tty)); in rp_unthrottle()
1387 if (I_IXOFF(tty)) in rp_unthrottle()
1388 rp_send_xchar(tty, START_CHAR(tty)); in rp_unthrottle()
1401 static void rp_stop(struct tty_struct *tty) in rp_stop() argument
1403 struct r_port *info = tty->driver_data; in rp_stop()
1406 printk(KERN_INFO "stop %s: %d %d....\n", tty->name, in rp_stop()
1417 static void rp_start(struct tty_struct *tty) in rp_start() argument
1419 struct r_port *info = tty->driver_data; in rp_start()
1422 printk(KERN_INFO "start %s: %d %d....\n", tty->name, in rp_start()
1437 static void rp_wait_until_sent(struct tty_struct *tty, int timeout) in rp_wait_until_sent() argument
1439 struct r_port *info = tty->driver_data; in rp_wait_until_sent()
1491 static void rp_hangup(struct tty_struct *tty) in rp_hangup() argument
1494 struct r_port *info = tty->driver_data; in rp_hangup()
1503 rp_flush_buffer(tty); in rp_hangup()
1531 static int rp_put_char(struct tty_struct *tty, unsigned char ch) in rp_put_char() argument
1533 struct r_port *info = tty->driver_data; in rp_put_char()
1553 if (!tty->stopped && info->xmit_fifo_room == 0) in rp_put_char()
1556 if (tty->stopped || info->xmit_fifo_room == 0 || info->xmit_cnt != 0) { in rp_put_char()
1577 static int rp_write(struct tty_struct *tty, in rp_write() argument
1580 struct r_port *info = tty->driver_data; in rp_write()
1597 if (!tty->stopped && info->xmit_fifo_room < count) in rp_write()
1604 if (!tty->stopped && info->xmit_cnt == 0 && info->xmit_fifo_room > 0) { in rp_write()
1652 if ((retval > 0) && !tty->stopped) in rp_write()
1657 tty_wakeup(tty); in rp_write()
1659 wake_up_interruptible(&tty->poll_wait); in rp_write()
1671 static int rp_write_room(struct tty_struct *tty) in rp_write_room() argument
1673 struct r_port *info = tty->driver_data; in rp_write_room()
1692 static int rp_chars_in_buffer(struct tty_struct *tty) in rp_chars_in_buffer() argument
1694 struct r_port *info = tty->driver_data; in rp_chars_in_buffer()
1710 static void rp_flush_buffer(struct tty_struct *tty) in rp_flush_buffer() argument
1712 struct r_port *info = tty->driver_data; in rp_flush_buffer()
1724 wake_up_interruptible(&tty->poll_wait); in rp_flush_buffer()
1726 tty_wakeup(tty); in rp_flush_buffer()