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()
914 tty->driver_data = info; in rp_open()
915 tty_port_tty_set(port, tty); in rp_open()
962 tty->alt_speed = 57600; in rp_open()
964 tty->alt_speed = 115200; in rp_open()
966 tty->alt_speed = 230400; in rp_open()
968 tty->alt_speed = 460800; in rp_open()
970 configure_r_port(tty, info, NULL); in rp_open()
971 if (tty->termios.c_cflag & CBAUD) { in rp_open()
979 retval = tty_port_block_til_ready(port, tty, filp); in rp_open()
992 static void rp_close(struct tty_struct *tty, struct file *filp) in rp_close() argument
994 struct r_port *info = tty->driver_data; in rp_close()
1006 if (tty_port_close_start(port, tty, filp) == 0) in rp_close()
1019 rp_wait_until_sent(tty, timeout); in rp_close()
1030 if (C_HUPCL(tty)) in rp_close()
1033 rp_flush_buffer(tty); in rp_close()
1035 tty_ldisc_flush(tty); in rp_close()
1055 tty->closing = 0; in rp_close()
1072 static void rp_set_termios(struct tty_struct *tty, in rp_set_termios() argument
1075 struct r_port *info = tty->driver_data; in rp_set_termios()
1082 cflag = tty->termios.c_cflag; in rp_set_termios()
1088 tty->termios.c_cflag = in rp_set_termios()
1091 tty->termios.c_cflag &= ~CMSPAR; in rp_set_termios()
1093 configure_r_port(tty, info, old_termios); in rp_set_termios()
1098 if ((old_termios->c_cflag & CBAUD) && !(tty->termios.c_cflag & CBAUD)) { in rp_set_termios()
1104 if (!(old_termios->c_cflag & CBAUD) && (tty->termios.c_cflag & CBAUD)) { in rp_set_termios()
1109 if ((old_termios->c_cflag & CRTSCTS) && !(tty->termios.c_cflag & CRTSCTS)) in rp_set_termios()
1110 rp_start(tty); in rp_set_termios()
1113 static int rp_break(struct tty_struct *tty, int break_state) in rp_break() argument
1115 struct r_port *info = tty->driver_data; in rp_break()
1159 static int rp_tiocmget(struct tty_struct *tty) in rp_tiocmget() argument
1161 struct r_port *info = tty->driver_data; in rp_tiocmget()
1179 static int rp_tiocmset(struct tty_struct *tty, in rp_tiocmset() argument
1182 struct r_port *info = tty->driver_data; in rp_tiocmset()
1217 static int set_config(struct tty_struct *tty, struct r_port *info, in set_config() argument
1233 configure_r_port(tty, info, NULL); in set_config()
1243 tty->alt_speed = 57600; in set_config()
1245 tty->alt_speed = 115200; in set_config()
1247 tty->alt_speed = 230400; in set_config()
1249 tty->alt_speed = 460800; in set_config()
1252 configure_r_port(tty, info, NULL); in set_config()
1316 static int rp_ioctl(struct tty_struct *tty, in rp_ioctl() argument
1319 struct r_port *info = tty->driver_data; in rp_ioctl()
1335 ret = set_config(tty, info, argp); in rp_ioctl()
1352 static void rp_send_xchar(struct tty_struct *tty, char ch) in rp_send_xchar() argument
1354 struct r_port *info = tty->driver_data; in rp_send_xchar()
1367 static void rp_throttle(struct tty_struct *tty) in rp_throttle() argument
1369 struct r_port *info = tty->driver_data; in rp_throttle()
1372 printk(KERN_INFO "throttle %s: %d....\n", tty->name, in rp_throttle()
1373 tty->ldisc.chars_in_buffer(tty)); in rp_throttle()
1379 if (I_IXOFF(tty)) in rp_throttle()
1380 rp_send_xchar(tty, STOP_CHAR(tty)); in rp_throttle()
1385 static void rp_unthrottle(struct tty_struct *tty) in rp_unthrottle() argument
1387 struct r_port *info = tty->driver_data; in rp_unthrottle()
1389 printk(KERN_INFO "unthrottle %s: %d....\n", tty->name, in rp_unthrottle()
1390 tty->ldisc.chars_in_buffer(tty)); in rp_unthrottle()
1396 if (I_IXOFF(tty)) in rp_unthrottle()
1397 rp_send_xchar(tty, START_CHAR(tty)); in rp_unthrottle()
1410 static void rp_stop(struct tty_struct *tty) in rp_stop() argument
1412 struct r_port *info = tty->driver_data; in rp_stop()
1415 printk(KERN_INFO "stop %s: %d %d....\n", tty->name, in rp_stop()
1426 static void rp_start(struct tty_struct *tty) in rp_start() argument
1428 struct r_port *info = tty->driver_data; in rp_start()
1431 printk(KERN_INFO "start %s: %d %d....\n", tty->name, in rp_start()
1446 static void rp_wait_until_sent(struct tty_struct *tty, int timeout) in rp_wait_until_sent() argument
1448 struct r_port *info = tty->driver_data; in rp_wait_until_sent()
1500 static void rp_hangup(struct tty_struct *tty) in rp_hangup() argument
1503 struct r_port *info = tty->driver_data; in rp_hangup()
1512 rp_flush_buffer(tty); in rp_hangup()
1544 static int rp_put_char(struct tty_struct *tty, unsigned char ch) in rp_put_char() argument
1546 struct r_port *info = tty->driver_data; in rp_put_char()
1566 if (!tty->stopped && info->xmit_fifo_room == 0) in rp_put_char()
1569 if (tty->stopped || info->xmit_fifo_room == 0 || info->xmit_cnt != 0) { in rp_put_char()
1590 static int rp_write(struct tty_struct *tty, in rp_write() argument
1593 struct r_port *info = tty->driver_data; in rp_write()
1610 if (!tty->stopped && info->xmit_fifo_room < count) in rp_write()
1617 if (!tty->stopped && info->xmit_cnt == 0 && info->xmit_fifo_room > 0) { in rp_write()
1665 if ((retval > 0) && !tty->stopped) in rp_write()
1670 tty_wakeup(tty); in rp_write()
1672 wake_up_interruptible(&tty->poll_wait); in rp_write()
1684 static int rp_write_room(struct tty_struct *tty) in rp_write_room() argument
1686 struct r_port *info = tty->driver_data; in rp_write_room()
1705 static int rp_chars_in_buffer(struct tty_struct *tty) in rp_chars_in_buffer() argument
1707 struct r_port *info = tty->driver_data; in rp_chars_in_buffer()
1723 static void rp_flush_buffer(struct tty_struct *tty) in rp_flush_buffer() argument
1725 struct r_port *info = tty->driver_data; in rp_flush_buffer()
1737 wake_up_interruptible(&tty->poll_wait); in rp_flush_buffer()
1739 tty_wakeup(tty); in rp_flush_buffer()