Lines Matching refs:tty

822 static int tiocmget(struct tty_struct *tty);
823 static int tiocmset(struct tty_struct *tty,
910 static void mgsl_wait_until_sent(struct tty_struct *tty, int timeout);
956 static void ldisc_receive_buf(struct tty_struct *tty, in ldisc_receive_buf() argument
960 if (!tty) in ldisc_receive_buf()
962 ld = tty_ldisc_ref(tty); in ldisc_receive_buf()
965 ld->ops->receive_buf(tty, data, flags, count); in ldisc_receive_buf()
975 static void mgsl_stop(struct tty_struct *tty) in mgsl_stop() argument
977 struct mgsl_struct *info = tty->driver_data; in mgsl_stop()
980 if (mgsl_paranoia_check(info, tty->name, "mgsl_stop")) in mgsl_stop()
998 static void mgsl_start(struct tty_struct *tty) in mgsl_start() argument
1000 struct mgsl_struct *info = tty->driver_data; in mgsl_start()
1003 if (mgsl_paranoia_check(info, tty->name, "mgsl_start")) in mgsl_start()
1120 struct tty_struct *tty = info->port.tty; in mgsl_bh_transmit() local
1127 if (tty) in mgsl_bh_transmit()
1128 tty_wakeup(tty); in mgsl_bh_transmit()
1262 if (info->port.tty->stopped || info->port.tty->hw_stopped) { in mgsl_isr_transmit_status()
1353 if (info->port.tty) in mgsl_isr_io_pin()
1354 tty_hangup(info->port.tty); in mgsl_isr_io_pin()
1360 if (info->port.tty->hw_stopped) { in mgsl_isr_io_pin()
1364 if (info->port.tty) in mgsl_isr_io_pin()
1365 info->port.tty->hw_stopped = 0; in mgsl_isr_io_pin()
1374 if (info->port.tty) in mgsl_isr_io_pin()
1375 info->port.tty->hw_stopped = 1; in mgsl_isr_io_pin()
1409 if (info->port.tty->stopped || info->port.tty->hw_stopped) { in mgsl_isr_transmit_data()
1500 do_SAK(info->port.tty); in mgsl_isr_receive_data()
1783 if (capable(CAP_SYS_ADMIN) && info->port.tty) in startup()
1784 set_bit(TTY_IO_ERROR, &info->port.tty->flags); in startup()
1792 if (info->port.tty) in startup()
1793 clear_bit(TTY_IO_ERROR, &info->port.tty->flags); in startup()
1849 if (!info->port.tty || info->port.tty->termios.c_cflag & HUPCL) { in shutdown()
1858 if (info->port.tty) in shutdown()
1859 set_bit(TTY_IO_ERROR, &info->port.tty->flags); in shutdown()
1893 if (info->netcount || info->port.tty->termios.c_cflag & CREAD) in mgsl_program_hw()
1906 if (!info->port.tty) in mgsl_change_params()
1913 cflag = info->port.tty->termios.c_cflag; in mgsl_change_params()
1961 info->params.data_rate = tty_get_baud_rate(info->port.tty); in mgsl_change_params()
1982 if (I_INPCK(info->port.tty)) in mgsl_change_params()
1984 if (I_BRKINT(info->port.tty) || I_PARMRK(info->port.tty)) in mgsl_change_params()
1987 if (I_IGNPAR(info->port.tty)) in mgsl_change_params()
1989 if (I_IGNBRK(info->port.tty)) { in mgsl_change_params()
1994 if (I_IGNPAR(info->port.tty)) in mgsl_change_params()
2011 static int mgsl_put_char(struct tty_struct *tty, unsigned char ch) in mgsl_put_char() argument
2013 struct mgsl_struct *info = tty->driver_data; in mgsl_put_char()
2022 if (mgsl_paranoia_check(info, tty->name, "mgsl_put_char")) in mgsl_put_char()
2051 static void mgsl_flush_chars(struct tty_struct *tty) in mgsl_flush_chars() argument
2053 struct mgsl_struct *info = tty->driver_data; in mgsl_flush_chars()
2060 if (mgsl_paranoia_check(info, tty->name, "mgsl_flush_chars")) in mgsl_flush_chars()
2063 if (info->xmit_cnt <= 0 || tty->stopped || tty->hw_stopped || in mgsl_flush_chars()
2101 static int mgsl_write(struct tty_struct * tty, in mgsl_write() argument
2105 struct mgsl_struct *info = tty->driver_data; in mgsl_write()
2112 if (mgsl_paranoia_check(info, tty->name, "mgsl_write")) in mgsl_write()
2203 if (info->xmit_cnt && !tty->stopped && !tty->hw_stopped) { in mgsl_write()
2225 static int mgsl_write_room(struct tty_struct *tty) in mgsl_write_room() argument
2227 struct mgsl_struct *info = tty->driver_data; in mgsl_write_room()
2230 if (mgsl_paranoia_check(info, tty->name, "mgsl_write_room")) in mgsl_write_room()
2260 static int mgsl_chars_in_buffer(struct tty_struct *tty) in mgsl_chars_in_buffer() argument
2262 struct mgsl_struct *info = tty->driver_data; in mgsl_chars_in_buffer()
2268 if (mgsl_paranoia_check(info, tty->name, "mgsl_chars_in_buffer")) in mgsl_chars_in_buffer()
2294 static void mgsl_flush_buffer(struct tty_struct *tty) in mgsl_flush_buffer() argument
2296 struct mgsl_struct *info = tty->driver_data; in mgsl_flush_buffer()
2303 if (mgsl_paranoia_check(info, tty->name, "mgsl_flush_buffer")) in mgsl_flush_buffer()
2311 tty_wakeup(tty); in mgsl_flush_buffer()
2322 static void mgsl_send_xchar(struct tty_struct *tty, char ch) in mgsl_send_xchar() argument
2324 struct mgsl_struct *info = tty->driver_data; in mgsl_send_xchar()
2331 if (mgsl_paranoia_check(info, tty->name, "mgsl_send_xchar")) in mgsl_send_xchar()
2351 static void mgsl_throttle(struct tty_struct * tty) in mgsl_throttle() argument
2353 struct mgsl_struct *info = tty->driver_data; in mgsl_throttle()
2360 if (mgsl_paranoia_check(info, tty->name, "mgsl_throttle")) in mgsl_throttle()
2363 if (I_IXOFF(tty)) in mgsl_throttle()
2364 mgsl_send_xchar(tty, STOP_CHAR(tty)); in mgsl_throttle()
2366 if (tty->termios.c_cflag & CRTSCTS) { in mgsl_throttle()
2381 static void mgsl_unthrottle(struct tty_struct * tty) in mgsl_unthrottle() argument
2383 struct mgsl_struct *info = tty->driver_data; in mgsl_unthrottle()
2390 if (mgsl_paranoia_check(info, tty->name, "mgsl_unthrottle")) in mgsl_unthrottle()
2393 if (I_IXOFF(tty)) { in mgsl_unthrottle()
2397 mgsl_send_xchar(tty, START_CHAR(tty)); in mgsl_unthrottle()
2400 if (tty->termios.c_cflag & CRTSCTS) { in mgsl_unthrottle()
2840 static int tiocmget(struct tty_struct *tty) in tiocmget() argument
2842 struct mgsl_struct *info = tty->driver_data; in tiocmget()
2865 static int tiocmset(struct tty_struct *tty, in tiocmset() argument
2868 struct mgsl_struct *info = tty->driver_data; in tiocmset()
2897 static int mgsl_break(struct tty_struct *tty, int break_state) in mgsl_break() argument
2899 struct mgsl_struct * info = tty->driver_data; in mgsl_break()
2906 if (mgsl_paranoia_check(info, tty->name, "mgsl_break")) in mgsl_break()
2925 static int msgl_get_icount(struct tty_struct *tty, in msgl_get_icount() argument
2929 struct mgsl_struct * info = tty->driver_data; in msgl_get_icount()
2961 static int mgsl_ioctl(struct tty_struct *tty, in mgsl_ioctl() argument
2964 struct mgsl_struct * info = tty->driver_data; in mgsl_ioctl()
2970 if (mgsl_paranoia_check(info, tty->name, "mgsl_ioctl")) in mgsl_ioctl()
2975 if (tty->flags & (1 << TTY_IO_ERROR)) in mgsl_ioctl()
3030 static void mgsl_set_termios(struct tty_struct *tty, struct ktermios *old_termios) in mgsl_set_termios() argument
3032 struct mgsl_struct *info = tty->driver_data; in mgsl_set_termios()
3037 tty->driver->name ); in mgsl_set_termios()
3043 !(tty->termios.c_cflag & CBAUD)) { in mgsl_set_termios()
3052 tty->termios.c_cflag & CBAUD) { in mgsl_set_termios()
3054 if (!(tty->termios.c_cflag & CRTSCTS) || in mgsl_set_termios()
3055 !test_bit(TTY_THROTTLED, &tty->flags)) { in mgsl_set_termios()
3065 !(tty->termios.c_cflag & CRTSCTS)) { in mgsl_set_termios()
3066 tty->hw_stopped = 0; in mgsl_set_termios()
3067 mgsl_start(tty); in mgsl_set_termios()
3084 static void mgsl_close(struct tty_struct *tty, struct file * filp) in mgsl_close() argument
3086 struct mgsl_struct * info = tty->driver_data; in mgsl_close()
3088 if (mgsl_paranoia_check(info, tty->name, "mgsl_close")) in mgsl_close()
3095 if (tty_port_close_start(&info->port, tty, filp) == 0) in mgsl_close()
3100 mgsl_wait_until_sent(tty, info->timeout); in mgsl_close()
3101 mgsl_flush_buffer(tty); in mgsl_close()
3102 tty_ldisc_flush(tty); in mgsl_close()
3106 tty_port_close_end(&info->port, tty); in mgsl_close()
3107 info->port.tty = NULL; in mgsl_close()
3111 tty->driver->name, info->port.count); in mgsl_close()
3126 static void mgsl_wait_until_sent(struct tty_struct *tty, int timeout) in mgsl_wait_until_sent() argument
3128 struct mgsl_struct * info = tty->driver_data; in mgsl_wait_until_sent()
3138 if (mgsl_paranoia_check(info, tty->name, "mgsl_wait_until_sent")) in mgsl_wait_until_sent()
3197 static void mgsl_hangup(struct tty_struct *tty) in mgsl_hangup() argument
3199 struct mgsl_struct * info = tty->driver_data; in mgsl_hangup()
3205 if (mgsl_paranoia_check(info, tty->name, "mgsl_hangup")) in mgsl_hangup()
3208 mgsl_flush_buffer(tty); in mgsl_hangup()
3213 info->port.tty = NULL; in mgsl_hangup()
3264 static int block_til_ready(struct tty_struct *tty, struct file * filp, in block_til_ready() argument
3276 __FILE__,__LINE__, tty->driver->name ); in block_til_ready()
3278 if (filp->f_flags & O_NONBLOCK || tty->flags & (1 << TTY_IO_ERROR)){ in block_til_ready()
3284 if (tty->termios.c_cflag & CLOCAL) in block_til_ready()
3299 __FILE__,__LINE__, tty->driver->name, port->count ); in block_til_ready()
3307 if (C_BAUD(tty) && test_bit(ASYNCB_INITIALIZED, &port->flags)) in block_til_ready()
3330 __FILE__,__LINE__, tty->driver->name, port->count ); in block_til_ready()
3332 tty_unlock(tty); in block_til_ready()
3334 tty_lock(tty); in block_til_ready()
3347 __FILE__,__LINE__, tty->driver->name, port->count ); in block_til_ready()
3356 static int mgsl_install(struct tty_driver *driver, struct tty_struct *tty) in mgsl_install() argument
3359 int line = tty->index; in mgsl_install()
3372 if (mgsl_paranoia_check(info, tty->name, "mgsl_open")) in mgsl_install()
3374 tty->driver_data = info; in mgsl_install()
3376 return tty_port_install(&info->port, driver, tty); in mgsl_install()
3389 static int mgsl_open(struct tty_struct *tty, struct file * filp) in mgsl_open() argument
3391 struct mgsl_struct *info = tty->driver_data; in mgsl_open()
3395 info->port.tty = tty; in mgsl_open()
3399 __FILE__,__LINE__,tty->driver->name, info->port.count); in mgsl_open()
3403 wait_event_interruptible_tty(tty, info->port.close_wait, in mgsl_open()
3428 retval = block_til_ready(tty, filp, info); in mgsl_open()
3443 if (tty->count == 1) in mgsl_open()
3444 info->port.tty = NULL; /* tty layer will release tty struct */ in mgsl_open()
6529 struct tty_struct *tty = info->port.tty; in mgsl_get_rx_frame() local
6672 ldisc_receive_buf(tty, info->intermediate_rxbuffer, info->flag_buf, framesize); in mgsl_get_rx_frame()
6727 struct tty_struct *tty = info->port.tty; in mgsl_get_raw_rx_frame() local
6844 ldisc_receive_buf(tty, info->intermediate_rxbuffer, info->flag_buf, framesize); in mgsl_get_raw_rx_frame()