Lines Matching refs:tty
506 static int open(struct tty_struct *tty, struct file * filp);
507 static void close(struct tty_struct *tty, struct file * filp);
508 static void hangup(struct tty_struct *tty);
509 static void set_termios(struct tty_struct *tty, struct ktermios *old_termios);
511 static int write(struct tty_struct *tty, const unsigned char *buf, int count);
512 static int put_char(struct tty_struct *tty, unsigned char ch);
513 static void send_xchar(struct tty_struct *tty, char ch);
514 static void wait_until_sent(struct tty_struct *tty, int timeout);
515 static int write_room(struct tty_struct *tty);
516 static void flush_chars(struct tty_struct *tty);
517 static void flush_buffer(struct tty_struct *tty);
518 static void tx_hold(struct tty_struct *tty);
519 static void tx_release(struct tty_struct *tty);
521 static int ioctl(struct tty_struct *tty, unsigned int cmd, unsigned long arg);
522 static int chars_in_buffer(struct tty_struct *tty);
523 static void throttle(struct tty_struct * tty);
524 static void unthrottle(struct tty_struct * tty);
525 static int set_break(struct tty_struct *tty, int break_state);
547 static int tiocmget(struct tty_struct *tty);
548 static int tiocmset(struct tty_struct *tty,
550 static int set_break(struct tty_struct *tty, int break_state);
558 static int block_til_ready(struct tty_struct *tty, struct file * filp,SLMP_INFO *info);
697 static void ldisc_receive_buf(struct tty_struct *tty, in ldisc_receive_buf() argument
701 if (!tty) in ldisc_receive_buf()
703 ld = tty_ldisc_ref(tty); in ldisc_receive_buf()
706 ld->ops->receive_buf(tty, data, flags, count); in ldisc_receive_buf()
713 static int install(struct tty_driver *driver, struct tty_struct *tty) in install() argument
716 int line = tty->index; in install()
727 if (sanity_check(info, tty->name, "open")) in install()
736 tty->driver_data = info; in install()
738 return tty_port_install(&info->port, driver, tty); in install()
743 static int open(struct tty_struct *tty, struct file *filp) in open() argument
745 SLMP_INFO *info = tty->driver_data; in open()
749 info->port.tty = tty; in open()
753 __FILE__,__LINE__,tty->driver->name, info->port.count); in open()
757 wait_event_interruptible_tty(tty, info->port.close_wait, in open()
782 retval = block_til_ready(tty, filp, info); in open()
797 if (tty->count == 1) in open()
798 info->port.tty = NULL; /* tty layer will release tty struct */ in open()
809 static void close(struct tty_struct *tty, struct file *filp) in close() argument
811 SLMP_INFO * info = tty->driver_data; in close()
813 if (sanity_check(info, tty->name, "close")) in close()
820 if (tty_port_close_start(&info->port, tty, filp) == 0) in close()
825 wait_until_sent(tty, info->timeout); in close()
827 flush_buffer(tty); in close()
828 tty_ldisc_flush(tty); in close()
832 tty_port_close_end(&info->port, tty); in close()
833 info->port.tty = NULL; in close()
837 tty->driver->name, info->port.count); in close()
843 static void hangup(struct tty_struct *tty) in hangup() argument
845 SLMP_INFO *info = tty->driver_data; in hangup()
852 if (sanity_check(info, tty->name, "hangup")) in hangup()
856 flush_buffer(tty); in hangup()
862 info->port.tty = NULL; in hangup()
871 static void set_termios(struct tty_struct *tty, struct ktermios *old_termios) in set_termios() argument
873 SLMP_INFO *info = tty->driver_data; in set_termios()
878 tty->driver->name ); in set_termios()
884 !(tty->termios.c_cflag & CBAUD)) { in set_termios()
893 tty->termios.c_cflag & CBAUD) { in set_termios()
895 if (!(tty->termios.c_cflag & CRTSCTS) || in set_termios()
896 !test_bit(TTY_THROTTLED, &tty->flags)) { in set_termios()
906 !(tty->termios.c_cflag & CRTSCTS)) { in set_termios()
907 tty->hw_stopped = 0; in set_termios()
908 tx_release(tty); in set_termios()
922 static int write(struct tty_struct *tty, in write() argument
926 SLMP_INFO *info = tty->driver_data; in write()
933 if (sanity_check(info, tty->name, "write")) in write()
986 if (info->tx_count && !tty->stopped && !tty->hw_stopped) { in write()
1002 static int put_char(struct tty_struct *tty, unsigned char ch) in put_char() argument
1004 SLMP_INFO *info = tty->driver_data; in put_char()
1013 if (sanity_check(info, tty->name, "put_char")) in put_char()
1039 static void send_xchar(struct tty_struct *tty, char ch) in send_xchar() argument
1041 SLMP_INFO *info = tty->driver_data; in send_xchar()
1048 if (sanity_check(info, tty->name, "send_xchar")) in send_xchar()
1063 static void wait_until_sent(struct tty_struct *tty, int timeout) in wait_until_sent() argument
1065 SLMP_INFO * info = tty->driver_data; in wait_until_sent()
1075 if (sanity_check(info, tty->name, "wait_until_sent")) in wait_until_sent()
1129 static int write_room(struct tty_struct *tty) in write_room() argument
1131 SLMP_INFO *info = tty->driver_data; in write_room()
1134 if (sanity_check(info, tty->name, "write_room")) in write_room()
1154 static void flush_chars(struct tty_struct *tty) in flush_chars() argument
1156 SLMP_INFO *info = tty->driver_data; in flush_chars()
1163 if (sanity_check(info, tty->name, "flush_chars")) in flush_chars()
1166 if (info->tx_count <= 0 || tty->stopped || tty->hw_stopped || in flush_chars()
1193 static void flush_buffer(struct tty_struct *tty) in flush_buffer() argument
1195 SLMP_INFO *info = tty->driver_data; in flush_buffer()
1202 if (sanity_check(info, tty->name, "flush_buffer")) in flush_buffer()
1210 tty_wakeup(tty); in flush_buffer()
1215 static void tx_hold(struct tty_struct *tty) in tx_hold() argument
1217 SLMP_INFO *info = tty->driver_data; in tx_hold()
1220 if (sanity_check(info, tty->name, "tx_hold")) in tx_hold()
1235 static void tx_release(struct tty_struct *tty) in tx_release() argument
1237 SLMP_INFO *info = tty->driver_data; in tx_release()
1240 if (sanity_check(info, tty->name, "tx_release")) in tx_release()
1263 static int ioctl(struct tty_struct *tty, in ioctl() argument
1266 SLMP_INFO *info = tty->driver_data; in ioctl()
1273 if (sanity_check(info, tty->name, "ioctl")) in ioctl()
1278 if (tty->flags & (1 << TTY_IO_ERROR)) in ioctl()
1321 static int get_icount(struct tty_struct *tty, in get_icount() argument
1324 SLMP_INFO *info = tty->driver_data; in get_icount()
1453 static int chars_in_buffer(struct tty_struct *tty) in chars_in_buffer() argument
1455 SLMP_INFO *info = tty->driver_data; in chars_in_buffer()
1457 if (sanity_check(info, tty->name, "chars_in_buffer")) in chars_in_buffer()
1469 static void throttle(struct tty_struct * tty) in throttle() argument
1471 SLMP_INFO *info = tty->driver_data; in throttle()
1478 if (sanity_check(info, tty->name, "throttle")) in throttle()
1481 if (I_IXOFF(tty)) in throttle()
1482 send_xchar(tty, STOP_CHAR(tty)); in throttle()
1484 if (tty->termios.c_cflag & CRTSCTS) { in throttle()
1494 static void unthrottle(struct tty_struct * tty) in unthrottle() argument
1496 SLMP_INFO *info = tty->driver_data; in unthrottle()
1503 if (sanity_check(info, tty->name, "unthrottle")) in unthrottle()
1506 if (I_IXOFF(tty)) { in unthrottle()
1510 send_xchar(tty, START_CHAR(tty)); in unthrottle()
1513 if (tty->termios.c_cflag & CRTSCTS) { in unthrottle()
1524 static int set_break(struct tty_struct *tty, int break_state) in set_break() argument
1527 SLMP_INFO * info = tty->driver_data; in set_break()
1534 if (sanity_check(info, tty->name, "set_break")) in set_break()
2059 struct tty_struct *tty = info->port.tty; in bh_transmit() local
2065 if (tty) in bh_transmit()
2066 tty_wakeup(tty); in bh_transmit()
2109 struct tty_struct *tty = info->port.tty; in isr_rxint() local
2135 if (tty && (info->port.flags & ASYNC_SAK)) in isr_rxint()
2136 do_SAK(tty); in isr_rxint()
2275 if (info->port.tty && (info->port.tty->stopped || info->port.tty->hw_stopped)) { in isr_txeom()
2330 if (info->port.tty && (info->port.tty->stopped || info->port.tty->hw_stopped)) { in isr_txrdy()
2487 if (info->port.tty) in isr_io_pin()
2488 tty_hangup(info->port.tty); in isr_io_pin()
2494 if ( info->port.tty ) { in isr_io_pin()
2495 if (info->port.tty->hw_stopped) { in isr_io_pin()
2499 info->port.tty->hw_stopped = 0; in isr_io_pin()
2508 info->port.tty->hw_stopped = 1; in isr_io_pin()
2673 if (info->port.tty) in startup()
2674 clear_bit(TTY_IO_ERROR, &info->port.tty->flags); in startup()
2709 if (!info->port.tty || info->port.tty->termios.c_cflag & HUPCL) { in shutdown()
2716 if (info->port.tty) in shutdown()
2717 set_bit(TTY_IO_ERROR, &info->port.tty->flags); in shutdown()
2750 if (info->netcount || (info->port.tty && info->port.tty->termios.c_cflag & CREAD) ) in program_hw()
2763 if (!info->port.tty) in change_params()
2770 cflag = info->port.tty->termios.c_cflag; in change_params()
2818 info->params.data_rate = tty_get_baud_rate(info->port.tty); in change_params()
2840 if (I_INPCK(info->port.tty)) in change_params()
2842 if (I_BRKINT(info->port.tty) || I_PARMRK(info->port.tty)) in change_params()
2844 if (I_IGNPAR(info->port.tty)) in change_params()
2846 if (I_IGNBRK(info->port.tty)) { in change_params()
2851 if (I_IGNPAR(info->port.tty)) in change_params()
3206 static int tiocmget(struct tty_struct *tty) in tiocmget() argument
3208 SLMP_INFO *info = tty->driver_data; in tiocmget()
3231 static int tiocmset(struct tty_struct *tty, in tiocmset() argument
3234 SLMP_INFO *info = tty->driver_data; in tiocmset()
3285 static int block_til_ready(struct tty_struct *tty, struct file *filp, in block_til_ready() argument
3297 __FILE__,__LINE__, tty->driver->name ); in block_til_ready()
3299 if (filp->f_flags & O_NONBLOCK || tty->flags & (1 << TTY_IO_ERROR)){ in block_til_ready()
3306 if (tty->termios.c_cflag & CLOCAL) in block_til_ready()
3321 __FILE__,__LINE__, tty->driver->name, port->count ); in block_til_ready()
3329 if (C_BAUD(tty) && test_bit(ASYNCB_INITIALIZED, &port->flags)) in block_til_ready()
3352 __FILE__,__LINE__, tty->driver->name, port->count ); in block_til_ready()
3354 tty_unlock(tty); in block_til_ready()
3356 tty_lock(tty); in block_til_ready()
3367 __FILE__,__LINE__, tty->driver->name, port->count ); in block_til_ready()
4847 struct tty_struct *tty = info->port.tty; in rx_get_frame() local
4988 ldisc_receive_buf(tty,info->tmp_rx_buf, in rx_get_frame()
5254 struct tty_struct *oldtty = info->port.tty; in loopback_test()
5258 info->port.tty = NULL; in loopback_test()
5302 info->port.tty = oldtty; in loopback_test()