Lines Matching refs:tty

156 static void rs_throttle(struct tty_struct * tty);
157 static void rs_wait_until_sent(struct tty_struct *tty, int timeout);
158 static int rs_write(struct tty_struct *tty,
161 static int e100_write_rs485(struct tty_struct *tty,
920 tcflag_t cflags = info->port.tty->termios.c_cflag; in update_char_time()
1332 e100_enable_rs485(struct tty_struct *tty, struct serial_rs485 *r) in e100_enable_rs485() argument
1334 struct e100_serial * info = (struct e100_serial *)tty->driver_data; in e100_enable_rs485()
1356 e100_write_rs485(struct tty_struct *tty, in e100_write_rs485() argument
1359 struct e100_serial * info = (struct e100_serial *)tty->driver_data; in e100_write_rs485()
1369 count = rs_write(tty, buf, count); in e100_write_rs485()
1401 rs_stop(struct tty_struct *tty) in rs_stop() argument
1403 struct e100_serial *info = (struct e100_serial *)tty->driver_data; in rs_stop()
1414 STOP_CHAR(info->port.tty)); in rs_stop()
1416 if (tty->termios.c_iflag & IXON ) { in rs_stop()
1426 rs_start(struct tty_struct *tty) in rs_start() argument
1428 struct e100_serial *info = (struct e100_serial *)tty->driver_data; in rs_start()
1437 xoff = IO_FIELD(R_SERIAL0_XOFF, xoff_char, STOP_CHAR(tty)); in rs_start()
1439 if (tty->termios.c_iflag & IXON ) { in rs_start()
1753 if (info->port.tty->stopped) { in handle_all_descr_data()
1772 struct tty_struct *tty; in receive_chars_dma() local
1780 tty = info->port.tty; in receive_chars_dma()
1781 if (!tty) /* Something wrong... */ in receive_chars_dma()
2403 if (info->port.tty->stopped) in handle_ser_tx_interrupt()
2404 rs_stop(info->port.tty); in handle_ser_tx_interrupt()
2417 || info->port.tty->stopped) { in handle_ser_tx_interrupt()
2419 info->port.tty->stopped)); in handle_ser_tx_interrupt()
2577 struct tty_struct *tty; in do_softint() local
2581 tty = info->port.tty; in do_softint()
2582 if (!tty) in do_softint()
2586 tty_wakeup(tty); in do_softint()
2662 if (info->port.tty) in startup()
2663 clear_bit(TTY_IO_ERROR, &info->port.tty->flags); in startup()
2772 if (!info->port.tty || (info->port.tty->termios.c_cflag & HUPCL)) { in shutdown()
2778 if (info->port.tty) in shutdown()
2779 set_bit(TTY_IO_ERROR, &info->port.tty->flags); in shutdown()
2796 if (!info->port.tty) in change_speed()
2801 cflag = info->port.tty->termios.c_cflag; in change_speed()
2911 xoff = IO_FIELD(R_SERIAL0_XOFF, xoff_char, STOP_CHAR(info->port.tty)); in change_speed()
2913 if (info->port.tty->termios.c_iflag & IXON ) { in change_speed()
2915 STOP_CHAR(info->port.tty))); in change_speed()
2929 rs_flush_chars(struct tty_struct *tty) in rs_flush_chars() argument
2931 struct e100_serial *info = (struct e100_serial *)tty->driver_data; in rs_flush_chars()
2936 tty->stopped || in rs_flush_chars()
2951 static int rs_raw_write(struct tty_struct *tty, in rs_raw_write() argument
2955 struct e100_serial *info = (struct e100_serial *)tty->driver_data; in rs_raw_write()
2971 DFLOW(DEBUG_LOG(info->line, "ldisc %i\n", tty->ldisc.chars_in_buffer(tty))); in rs_raw_write()
3008 !tty->stopped && in rs_raw_write()
3017 rs_write(struct tty_struct *tty, in rs_write() argument
3021 struct e100_serial *info = (struct e100_serial *)tty->driver_data; in rs_write()
3043 count = rs_raw_write(tty, buf, count); in rs_write()
3057 tty_wait_until_sent(tty, 0); in rs_write()
3083 rs_write_room(struct tty_struct *tty) in rs_write_room() argument
3085 struct e100_serial *info = (struct e100_serial *)tty->driver_data; in rs_write_room()
3096 rs_chars_in_buffer(struct tty_struct *tty) in rs_chars_in_buffer() argument
3098 struct e100_serial *info = (struct e100_serial *)tty->driver_data; in rs_chars_in_buffer()
3106 rs_flush_buffer(struct tty_struct *tty) in rs_flush_buffer() argument
3108 struct e100_serial *info = (struct e100_serial *)tty->driver_data; in rs_flush_buffer()
3115 tty_wakeup(tty); in rs_flush_buffer()
3127 static void rs_send_xchar(struct tty_struct *tty, char ch) in rs_send_xchar() argument
3129 struct e100_serial *info = (struct e100_serial *)tty->driver_data; in rs_send_xchar()
3141 if (tty->stopped) in rs_send_xchar()
3142 rs_start(tty); in rs_send_xchar()
3160 rs_throttle(struct tty_struct * tty) in rs_throttle() argument
3162 struct e100_serial *info = (struct e100_serial *)tty->driver_data; in rs_throttle()
3164 printk("throttle %s: %lu....\n", tty_name(tty), in rs_throttle()
3165 (unsigned long)tty->ldisc.chars_in_buffer(tty)); in rs_throttle()
3167 DFLOW(DEBUG_LOG(info->line,"rs_throttle %lu\n", tty->ldisc.chars_in_buffer(tty))); in rs_throttle()
3170 if (tty->termios.c_cflag & CRTSCTS) { in rs_throttle()
3174 if (I_IXOFF(tty)) in rs_throttle()
3175 rs_send_xchar(tty, STOP_CHAR(tty)); in rs_throttle()
3180 rs_unthrottle(struct tty_struct * tty) in rs_unthrottle() argument
3182 struct e100_serial *info = (struct e100_serial *)tty->driver_data; in rs_unthrottle()
3184 printk("unthrottle %s: %lu....\n", tty_name(tty), in rs_unthrottle()
3185 (unsigned long)tty->ldisc.chars_in_buffer(tty)); in rs_unthrottle()
3187 DFLOW(DEBUG_LOG(info->line,"rs_unthrottle ldisc %d\n", tty->ldisc.chars_in_buffer(tty))); in rs_unthrottle()
3188 DFLOW(DEBUG_LOG(info->line,"rs_unthrottle flip.count: %i\n", tty->flip.count)); in rs_unthrottle()
3190 if (tty->termios.c_cflag & CRTSCTS) { in rs_unthrottle()
3195 if (I_IXOFF(tty)) { in rs_unthrottle()
3199 rs_send_xchar(tty, START_CHAR(tty)); in rs_unthrottle()
3355 rs_break(struct tty_struct *tty, int break_state) in rs_break() argument
3357 struct e100_serial *info = (struct e100_serial *)tty->driver_data; in rs_break()
3378 rs_tiocmset(struct tty_struct *tty, unsigned int set, unsigned int clear) in rs_tiocmset() argument
3380 struct e100_serial *info = (struct e100_serial *)tty->driver_data; in rs_tiocmset()
3410 rs_tiocmget(struct tty_struct *tty) in rs_tiocmget() argument
3412 struct e100_serial *info = (struct e100_serial *)tty->driver_data; in rs_tiocmget()
3444 rs_ioctl(struct tty_struct *tty, in rs_ioctl() argument
3447 struct e100_serial * info = (struct e100_serial *)tty->driver_data; in rs_ioctl()
3452 if (tty->flags & (1 << TTY_IO_ERROR)) in rs_ioctl()
3506 return e100_enable_rs485(tty, &rs485data); in rs_ioctl()
3518 return e100_enable_rs485(tty, &rs485data); in rs_ioctl()
3524 &(((struct e100_serial *)tty->driver_data)->rs485); in rs_ioctl()
3540 return e100_write_rs485(tty, rs485wr.outc, rs485wr.outc_size); in rs_ioctl()
3551 rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios) in rs_set_termios() argument
3553 struct e100_serial *info = (struct e100_serial *)tty->driver_data; in rs_set_termios()
3559 !(tty->termios.c_cflag & CRTSCTS)) in rs_set_termios()
3560 rs_start(tty); in rs_set_termios()
3575 rs_close(struct tty_struct *tty, struct file * filp) in rs_close() argument
3577 struct e100_serial * info = (struct e100_serial *)tty->driver_data; in rs_close()
3596 if ((tty->count == 1) && (info->port.count != 1)) { in rs_close()
3623 tty->closing = 1; in rs_close()
3625 tty_wait_until_sent(tty, info->port.closing_wait); in rs_close()
3643 rs_wait_until_sent(tty, HZ); in rs_close()
3647 rs_flush_buffer(tty); in rs_close()
3648 tty_ldisc_flush(tty); in rs_close()
3649 tty->closing = 0; in rs_close()
3651 info->port.tty = NULL; in rs_close()
3697 static void rs_wait_until_sent(struct tty_struct *tty, int timeout) in rs_wait_until_sent() argument
3700 struct e100_serial *info = (struct e100_serial *)tty->driver_data; in rs_wait_until_sent()
3733 rs_hangup(struct tty_struct *tty) in rs_hangup() argument
3735 struct e100_serial * info = (struct e100_serial *)tty->driver_data; in rs_hangup()
3737 rs_flush_buffer(tty); in rs_hangup()
3742 info->port.tty = NULL; in rs_hangup()
3752 block_til_ready(struct tty_struct *tty, struct file * filp, in block_til_ready() argument
3765 (tty->flags & (1 << TTY_IO_ERROR))) { in block_til_ready()
3770 if (tty->termios.c_cflag & CLOCAL) { in block_til_ready()
3821 tty_unlock(tty); in block_til_ready()
3823 tty_lock(tty); in block_til_ready()
3858 rs_open(struct tty_struct *tty, struct file * filp) in rs_open() argument
3864 info = rs_table + tty->index; in rs_open()
3869 printk("[%d] rs_open %s, count = %d\n", current->pid, tty->name, in rs_open()
3874 tty->driver_data = info; in rs_open()
3875 info->port.tty = tty; in rs_open()
3960 retval = block_til_ready(tty, filp, info); in rs_open()
4016 if (info->port.tty) { in seq_line_info()
4017 if (info->port.tty->stopped) in seq_line_info()
4019 (int)info->port.tty->stopped); in seq_line_info()
4201 info->port.tty = NULL; in rs_init()