Lines Matching refs:tty
160 static void rs_throttle(struct tty_struct * tty);
161 static void rs_wait_until_sent(struct tty_struct *tty, int timeout);
162 static int rs_write(struct tty_struct *tty,
165 static int e100_write_rs485(struct tty_struct *tty,
951 tcflag_t cflags = info->port.tty->termios.c_cflag; in update_char_time()
1363 e100_enable_rs485(struct tty_struct *tty, struct serial_rs485 *r) in e100_enable_rs485() argument
1365 struct e100_serial * info = (struct e100_serial *)tty->driver_data; in e100_enable_rs485()
1397 e100_write_rs485(struct tty_struct *tty, in e100_write_rs485() argument
1400 struct e100_serial * info = (struct e100_serial *)tty->driver_data; in e100_write_rs485()
1410 count = rs_write(tty, buf, count); in e100_write_rs485()
1442 rs_stop(struct tty_struct *tty) in rs_stop() argument
1444 struct e100_serial *info = (struct e100_serial *)tty->driver_data; in rs_stop()
1455 STOP_CHAR(info->port.tty)); in rs_stop()
1457 if (tty->termios.c_iflag & IXON ) { in rs_stop()
1467 rs_start(struct tty_struct *tty) in rs_start() argument
1469 struct e100_serial *info = (struct e100_serial *)tty->driver_data; in rs_start()
1478 xoff = IO_FIELD(R_SERIAL0_XOFF, xoff_char, STOP_CHAR(tty)); in rs_start()
1480 if (tty->termios.c_iflag & IXON ) { in rs_start()
1791 if (info->port.tty->stopped) { in handle_all_descr_data()
1810 struct tty_struct *tty; in receive_chars_dma() local
1818 tty = info->port.tty; in receive_chars_dma()
1819 if (!tty) /* Something wrong... */ in receive_chars_dma()
2445 if (info->port.tty->stopped) in handle_ser_tx_interrupt()
2446 rs_stop(info->port.tty); in handle_ser_tx_interrupt()
2459 || info->port.tty->stopped) { in handle_ser_tx_interrupt()
2461 info->port.tty->stopped)); in handle_ser_tx_interrupt()
2619 struct tty_struct *tty; in do_softint() local
2623 tty = info->port.tty; in do_softint()
2624 if (!tty) in do_softint()
2628 tty_wakeup(tty); in do_softint()
2704 if (info->port.tty) in startup()
2705 clear_bit(TTY_IO_ERROR, &info->port.tty->flags); in startup()
2814 if (!info->port.tty || (info->port.tty->termios.c_cflag & HUPCL)) { in shutdown()
2820 if (info->port.tty) in shutdown()
2821 set_bit(TTY_IO_ERROR, &info->port.tty->flags); in shutdown()
2838 if (!info->port.tty) in change_speed()
2843 cflag = info->port.tty->termios.c_cflag; in change_speed()
2966 xoff = IO_FIELD(R_SERIAL0_XOFF, xoff_char, STOP_CHAR(info->port.tty)); in change_speed()
2968 if (info->port.tty->termios.c_iflag & IXON ) { in change_speed()
2970 STOP_CHAR(info->port.tty))); in change_speed()
2984 rs_flush_chars(struct tty_struct *tty) in rs_flush_chars() argument
2986 struct e100_serial *info = (struct e100_serial *)tty->driver_data; in rs_flush_chars()
2991 tty->stopped || in rs_flush_chars()
3006 static int rs_raw_write(struct tty_struct *tty, in rs_raw_write() argument
3010 struct e100_serial *info = (struct e100_serial *)tty->driver_data; in rs_raw_write()
3026 DFLOW(DEBUG_LOG(info->line, "ldisc %i\n", tty->ldisc.chars_in_buffer(tty))); in rs_raw_write()
3063 !tty->stopped && in rs_raw_write()
3072 rs_write(struct tty_struct *tty, in rs_write() argument
3076 struct e100_serial *info = (struct e100_serial *)tty->driver_data; in rs_write()
3098 count = rs_raw_write(tty, buf, count); in rs_write()
3112 tty_wait_until_sent(tty, 0); in rs_write()
3138 rs_write_room(struct tty_struct *tty) in rs_write_room() argument
3140 struct e100_serial *info = (struct e100_serial *)tty->driver_data; in rs_write_room()
3151 rs_chars_in_buffer(struct tty_struct *tty) in rs_chars_in_buffer() argument
3153 struct e100_serial *info = (struct e100_serial *)tty->driver_data; in rs_chars_in_buffer()
3161 rs_flush_buffer(struct tty_struct *tty) in rs_flush_buffer() argument
3163 struct e100_serial *info = (struct e100_serial *)tty->driver_data; in rs_flush_buffer()
3170 tty_wakeup(tty); in rs_flush_buffer()
3182 static void rs_send_xchar(struct tty_struct *tty, char ch) in rs_send_xchar() argument
3184 struct e100_serial *info = (struct e100_serial *)tty->driver_data; in rs_send_xchar()
3196 if (tty->stopped) in rs_send_xchar()
3197 rs_start(tty); in rs_send_xchar()
3215 rs_throttle(struct tty_struct * tty) in rs_throttle() argument
3217 struct e100_serial *info = (struct e100_serial *)tty->driver_data; in rs_throttle()
3221 printk("throttle %s: %lu....\n", tty_name(tty, buf), in rs_throttle()
3222 (unsigned long)tty->ldisc.chars_in_buffer(tty)); in rs_throttle()
3224 DFLOW(DEBUG_LOG(info->line,"rs_throttle %lu\n", tty->ldisc.chars_in_buffer(tty))); in rs_throttle()
3227 if (tty->termios.c_cflag & CRTSCTS) { in rs_throttle()
3231 if (I_IXOFF(tty)) in rs_throttle()
3232 rs_send_xchar(tty, STOP_CHAR(tty)); in rs_throttle()
3237 rs_unthrottle(struct tty_struct * tty) in rs_unthrottle() argument
3239 struct e100_serial *info = (struct e100_serial *)tty->driver_data; in rs_unthrottle()
3243 printk("unthrottle %s: %lu....\n", tty_name(tty, buf), in rs_unthrottle()
3244 (unsigned long)tty->ldisc.chars_in_buffer(tty)); in rs_unthrottle()
3246 DFLOW(DEBUG_LOG(info->line,"rs_unthrottle ldisc %d\n", tty->ldisc.chars_in_buffer(tty))); in rs_unthrottle()
3247 DFLOW(DEBUG_LOG(info->line,"rs_unthrottle flip.count: %i\n", tty->flip.count)); in rs_unthrottle()
3249 if (tty->termios.c_cflag & CRTSCTS) { in rs_unthrottle()
3254 if (I_IXOFF(tty)) { in rs_unthrottle()
3258 rs_send_xchar(tty, START_CHAR(tty)); in rs_unthrottle()
3414 rs_break(struct tty_struct *tty, int break_state) in rs_break() argument
3416 struct e100_serial *info = (struct e100_serial *)tty->driver_data; in rs_break()
3437 rs_tiocmset(struct tty_struct *tty, unsigned int set, unsigned int clear) in rs_tiocmset() argument
3439 struct e100_serial *info = (struct e100_serial *)tty->driver_data; in rs_tiocmset()
3469 rs_tiocmget(struct tty_struct *tty) in rs_tiocmget() argument
3471 struct e100_serial *info = (struct e100_serial *)tty->driver_data; in rs_tiocmget()
3503 rs_ioctl(struct tty_struct *tty, in rs_ioctl() argument
3506 struct e100_serial * info = (struct e100_serial *)tty->driver_data; in rs_ioctl()
3511 if (tty->flags & (1 << TTY_IO_ERROR)) in rs_ioctl()
3565 return e100_enable_rs485(tty, &rs485data); in rs_ioctl()
3577 return e100_enable_rs485(tty, &rs485data); in rs_ioctl()
3583 &(((struct e100_serial *)tty->driver_data)->rs485); in rs_ioctl()
3599 return e100_write_rs485(tty, rs485wr.outc, rs485wr.outc_size); in rs_ioctl()
3610 rs_set_termios(struct tty_struct *tty, struct ktermios *old_termios) in rs_set_termios() argument
3612 struct e100_serial *info = (struct e100_serial *)tty->driver_data; in rs_set_termios()
3618 !(tty->termios.c_cflag & CRTSCTS)) in rs_set_termios()
3619 rs_start(tty); in rs_set_termios()
3634 rs_close(struct tty_struct *tty, struct file * filp) in rs_close() argument
3636 struct e100_serial * info = (struct e100_serial *)tty->driver_data; in rs_close()
3655 if ((tty->count == 1) && (info->port.count != 1)) { in rs_close()
3682 tty->closing = 1; in rs_close()
3684 tty_wait_until_sent(tty, info->port.closing_wait); in rs_close()
3702 rs_wait_until_sent(tty, HZ); in rs_close()
3706 rs_flush_buffer(tty); in rs_close()
3707 tty_ldisc_flush(tty); in rs_close()
3708 tty->closing = 0; in rs_close()
3710 info->port.tty = NULL; in rs_close()
3767 static void rs_wait_until_sent(struct tty_struct *tty, int timeout) in rs_wait_until_sent() argument
3770 struct e100_serial *info = (struct e100_serial *)tty->driver_data; in rs_wait_until_sent()
3803 rs_hangup(struct tty_struct *tty) in rs_hangup() argument
3805 struct e100_serial * info = (struct e100_serial *)tty->driver_data; in rs_hangup()
3807 rs_flush_buffer(tty); in rs_hangup()
3812 info->port.tty = NULL; in rs_hangup()
3822 block_til_ready(struct tty_struct *tty, struct file * filp, in block_til_ready() argument
3835 wait_event_interruptible_tty(tty, info->port.close_wait, in block_til_ready()
3852 (tty->flags & (1 << TTY_IO_ERROR))) { in block_til_ready()
3857 if (tty->termios.c_cflag & CLOCAL) { in block_til_ready()
3908 tty_unlock(tty); in block_til_ready()
3910 tty_lock(tty); in block_til_ready()
3945 rs_open(struct tty_struct *tty, struct file * filp) in rs_open() argument
3951 info = rs_table + tty->index; in rs_open()
3956 printk("[%d] rs_open %s, count = %d\n", current->pid, tty->name, in rs_open()
3961 tty->driver_data = info; in rs_open()
3962 info->port.tty = tty; in rs_open()
3970 wait_event_interruptible_tty(tty, info->port.close_wait, in rs_open()
4061 retval = block_til_ready(tty, filp, info); in rs_open()
4117 if (info->port.tty) { in seq_line_info()
4118 if (info->port.tty->stopped) in seq_line_info()
4120 (int)info->port.tty->stopped); in seq_line_info()
4311 info->port.tty = NULL; in rs_init()