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()
773 retval = block_til_ready(tty, filp, info); in open()
788 if (tty->count == 1) in open()
789 info->port.tty = NULL; /* tty layer will release tty struct */ in open()
800 static void close(struct tty_struct *tty, struct file *filp) in close() argument
802 SLMP_INFO * info = tty->driver_data; in close()
804 if (sanity_check(info, tty->name, "close")) in close()
811 if (tty_port_close_start(&info->port, tty, filp) == 0) in close()
816 wait_until_sent(tty, info->timeout); in close()
818 flush_buffer(tty); in close()
819 tty_ldisc_flush(tty); in close()
823 tty_port_close_end(&info->port, tty); in close()
824 info->port.tty = NULL; in close()
828 tty->driver->name, info->port.count); in close()
834 static void hangup(struct tty_struct *tty) in hangup() argument
836 SLMP_INFO *info = tty->driver_data; in hangup()
843 if (sanity_check(info, tty->name, "hangup")) in hangup()
847 flush_buffer(tty); in hangup()
853 info->port.tty = NULL; in hangup()
862 static void set_termios(struct tty_struct *tty, struct ktermios *old_termios) in set_termios() argument
864 SLMP_INFO *info = tty->driver_data; in set_termios()
869 tty->driver->name ); in set_termios()
875 !(tty->termios.c_cflag & CBAUD)) { in set_termios()
884 tty->termios.c_cflag & CBAUD) { in set_termios()
886 if (!(tty->termios.c_cflag & CRTSCTS) || in set_termios()
887 !test_bit(TTY_THROTTLED, &tty->flags)) { in set_termios()
897 !(tty->termios.c_cflag & CRTSCTS)) { in set_termios()
898 tty->hw_stopped = 0; in set_termios()
899 tx_release(tty); in set_termios()
913 static int write(struct tty_struct *tty, in write() argument
917 SLMP_INFO *info = tty->driver_data; in write()
924 if (sanity_check(info, tty->name, "write")) in write()
977 if (info->tx_count && !tty->stopped && !tty->hw_stopped) { in write()
993 static int put_char(struct tty_struct *tty, unsigned char ch) in put_char() argument
995 SLMP_INFO *info = tty->driver_data; in put_char()
1004 if (sanity_check(info, tty->name, "put_char")) in put_char()
1030 static void send_xchar(struct tty_struct *tty, char ch) in send_xchar() argument
1032 SLMP_INFO *info = tty->driver_data; in send_xchar()
1039 if (sanity_check(info, tty->name, "send_xchar")) in send_xchar()
1054 static void wait_until_sent(struct tty_struct *tty, int timeout) in wait_until_sent() argument
1056 SLMP_INFO * info = tty->driver_data; in wait_until_sent()
1066 if (sanity_check(info, tty->name, "wait_until_sent")) in wait_until_sent()
1120 static int write_room(struct tty_struct *tty) in write_room() argument
1122 SLMP_INFO *info = tty->driver_data; in write_room()
1125 if (sanity_check(info, tty->name, "write_room")) in write_room()
1145 static void flush_chars(struct tty_struct *tty) in flush_chars() argument
1147 SLMP_INFO *info = tty->driver_data; in flush_chars()
1154 if (sanity_check(info, tty->name, "flush_chars")) in flush_chars()
1157 if (info->tx_count <= 0 || tty->stopped || tty->hw_stopped || in flush_chars()
1184 static void flush_buffer(struct tty_struct *tty) in flush_buffer() argument
1186 SLMP_INFO *info = tty->driver_data; in flush_buffer()
1193 if (sanity_check(info, tty->name, "flush_buffer")) in flush_buffer()
1201 tty_wakeup(tty); in flush_buffer()
1206 static void tx_hold(struct tty_struct *tty) in tx_hold() argument
1208 SLMP_INFO *info = tty->driver_data; in tx_hold()
1211 if (sanity_check(info, tty->name, "tx_hold")) in tx_hold()
1226 static void tx_release(struct tty_struct *tty) in tx_release() argument
1228 SLMP_INFO *info = tty->driver_data; in tx_release()
1231 if (sanity_check(info, tty->name, "tx_release")) in tx_release()
1254 static int ioctl(struct tty_struct *tty, in ioctl() argument
1257 SLMP_INFO *info = tty->driver_data; in ioctl()
1264 if (sanity_check(info, tty->name, "ioctl")) in ioctl()
1269 if (tty->flags & (1 << TTY_IO_ERROR)) in ioctl()
1312 static int get_icount(struct tty_struct *tty, in get_icount() argument
1315 SLMP_INFO *info = tty->driver_data; in get_icount()
1444 static int chars_in_buffer(struct tty_struct *tty) in chars_in_buffer() argument
1446 SLMP_INFO *info = tty->driver_data; in chars_in_buffer()
1448 if (sanity_check(info, tty->name, "chars_in_buffer")) in chars_in_buffer()
1460 static void throttle(struct tty_struct * tty) in throttle() argument
1462 SLMP_INFO *info = tty->driver_data; in throttle()
1469 if (sanity_check(info, tty->name, "throttle")) in throttle()
1472 if (I_IXOFF(tty)) in throttle()
1473 send_xchar(tty, STOP_CHAR(tty)); in throttle()
1475 if (tty->termios.c_cflag & CRTSCTS) { in throttle()
1485 static void unthrottle(struct tty_struct * tty) in unthrottle() argument
1487 SLMP_INFO *info = tty->driver_data; in unthrottle()
1494 if (sanity_check(info, tty->name, "unthrottle")) in unthrottle()
1497 if (I_IXOFF(tty)) { in unthrottle()
1501 send_xchar(tty, START_CHAR(tty)); in unthrottle()
1504 if (tty->termios.c_cflag & CRTSCTS) { in unthrottle()
1515 static int set_break(struct tty_struct *tty, int break_state) in set_break() argument
1518 SLMP_INFO * info = tty->driver_data; in set_break()
1525 if (sanity_check(info, tty->name, "set_break")) in set_break()
2053 struct tty_struct *tty = info->port.tty; in bh_transmit() local
2059 if (tty) in bh_transmit()
2060 tty_wakeup(tty); in bh_transmit()
2103 struct tty_struct *tty = info->port.tty; in isr_rxint() local
2129 if (tty && (info->port.flags & ASYNC_SAK)) in isr_rxint()
2130 do_SAK(tty); in isr_rxint()
2269 if (info->port.tty && (info->port.tty->stopped || info->port.tty->hw_stopped)) { in isr_txeom()
2324 if (info->port.tty && (info->port.tty->stopped || info->port.tty->hw_stopped)) { in isr_txrdy()
2481 if (info->port.tty) in isr_io_pin()
2482 tty_hangup(info->port.tty); in isr_io_pin()
2488 if ( info->port.tty ) { in isr_io_pin()
2489 if (info->port.tty->hw_stopped) { in isr_io_pin()
2493 info->port.tty->hw_stopped = 0; in isr_io_pin()
2502 info->port.tty->hw_stopped = 1; in isr_io_pin()
2667 if (info->port.tty) in startup()
2668 clear_bit(TTY_IO_ERROR, &info->port.tty->flags); in startup()
2703 if (!info->port.tty || info->port.tty->termios.c_cflag & HUPCL) { in shutdown()
2710 if (info->port.tty) in shutdown()
2711 set_bit(TTY_IO_ERROR, &info->port.tty->flags); in shutdown()
2744 if (info->netcount || (info->port.tty && info->port.tty->termios.c_cflag & CREAD) ) in program_hw()
2757 if (!info->port.tty) in change_params()
2764 cflag = info->port.tty->termios.c_cflag; in change_params()
2812 info->params.data_rate = tty_get_baud_rate(info->port.tty); in change_params()
2834 if (I_INPCK(info->port.tty)) in change_params()
2836 if (I_BRKINT(info->port.tty) || I_PARMRK(info->port.tty)) in change_params()
2838 if (I_IGNPAR(info->port.tty)) in change_params()
2840 if (I_IGNBRK(info->port.tty)) { in change_params()
2845 if (I_IGNPAR(info->port.tty)) in change_params()
3200 static int tiocmget(struct tty_struct *tty) in tiocmget() argument
3202 SLMP_INFO *info = tty->driver_data; in tiocmget()
3225 static int tiocmset(struct tty_struct *tty, in tiocmset() argument
3228 SLMP_INFO *info = tty->driver_data; in tiocmset()
3279 static int block_til_ready(struct tty_struct *tty, struct file *filp, in block_til_ready() argument
3291 __FILE__,__LINE__, tty->driver->name ); in block_til_ready()
3293 if (filp->f_flags & O_NONBLOCK || tty->flags & (1 << TTY_IO_ERROR)){ in block_til_ready()
3300 if (tty->termios.c_cflag & CLOCAL) in block_til_ready()
3315 __FILE__,__LINE__, tty->driver->name, port->count ); in block_til_ready()
3323 if (C_BAUD(tty) && test_bit(ASYNCB_INITIALIZED, &port->flags)) in block_til_ready()
3345 __FILE__,__LINE__, tty->driver->name, port->count ); in block_til_ready()
3347 tty_unlock(tty); in block_til_ready()
3349 tty_lock(tty); in block_til_ready()
3360 __FILE__,__LINE__, tty->driver->name, port->count ); in block_til_ready()
4841 struct tty_struct *tty = info->port.tty; in rx_get_frame() local
4982 ldisc_receive_buf(tty,info->tmp_rx_buf, in rx_get_frame()
5248 struct tty_struct *oldtty = info->port.tty; in loopback_test()
5252 info->port.tty = NULL; in loopback_test()
5296 info->port.tty = oldtty; in loopback_test()