Lines Matching refs:tty

54 		struct tty_struct *tty);
55 static int ircomm_tty_open(struct tty_struct *tty, struct file *filp);
56 static void ircomm_tty_close(struct tty_struct * tty, struct file *filp);
57 static int ircomm_tty_write(struct tty_struct * tty,
59 static int ircomm_tty_write_room(struct tty_struct *tty);
60 static void ircomm_tty_throttle(struct tty_struct *tty);
61 static void ircomm_tty_unthrottle(struct tty_struct *tty);
62 static int ircomm_tty_chars_in_buffer(struct tty_struct *tty);
63 static void ircomm_tty_flush_buffer(struct tty_struct *tty);
64 static void ircomm_tty_send_xchar(struct tty_struct *tty, char ch);
65 static void ircomm_tty_wait_until_sent(struct tty_struct *tty, int timeout);
66 static void ircomm_tty_hangup(struct tty_struct *tty);
69 static void ircomm_tty_stop(struct tty_struct *tty);
271 struct tty_struct *tty, struct file *filp) in ircomm_tty_block_til_ready() argument
283 if (test_bit(TTY_IO_ERROR, &tty->flags)) { in ircomm_tty_block_til_ready()
290 if (tty->termios.c_cflag & CBAUD) in ircomm_tty_block_til_ready()
297 if (tty->termios.c_cflag & CLOCAL) { in ircomm_tty_block_til_ready()
313 __FILE__, __LINE__, tty->driver->name, port->count); in ircomm_tty_block_til_ready()
321 if (C_BAUD(tty) && test_bit(ASYNCB_INITIALIZED, &port->flags)) in ircomm_tty_block_til_ready()
350 __FILE__, __LINE__, tty->driver->name, port->count); in ircomm_tty_block_til_ready()
365 __FILE__, __LINE__, tty->driver->name, port->count); in ircomm_tty_block_til_ready()
374 static int ircomm_tty_install(struct tty_driver *driver, struct tty_struct *tty) in ircomm_tty_install() argument
377 unsigned int line = tty->index; in ircomm_tty_install()
408 tty->termios.c_iflag = 0; in ircomm_tty_install()
409 tty->termios.c_oflag = 0; in ircomm_tty_install()
415 tty->driver_data = self; in ircomm_tty_install()
417 return tty_port_install(&self->port, driver, tty); in ircomm_tty_install()
427 static int ircomm_tty_open(struct tty_struct *tty, struct file *filp) in ircomm_tty_open() argument
429 struct ircomm_tty_cb *self = tty->driver_data; in ircomm_tty_open()
437 tty_port_tty_set(&self->port, tty); in ircomm_tty_open()
439 pr_debug("%s(), %s%d, count = %d\n", __func__ , tty->driver->name, in ircomm_tty_open()
462 ret = ircomm_tty_block_til_ready(self, tty, filp); in ircomm_tty_open()
478 static void ircomm_tty_close(struct tty_struct *tty, struct file *filp) in ircomm_tty_close() argument
480 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_close()
486 if (tty_port_close_start(port, tty, filp) == 0) in ircomm_tty_close()
491 tty_driver_flush_buffer(tty); in ircomm_tty_close()
493 tty_port_close_end(port, tty); in ircomm_tty_close()
503 static void ircomm_tty_flush_buffer(struct tty_struct *tty) in ircomm_tty_flush_buffer() argument
505 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_flush_buffer()
528 struct tty_struct *tty; in ircomm_tty_do_softint() local
535 tty = tty_port_tty_get(&self->port); in ircomm_tty_do_softint()
536 if (!tty) in ircomm_tty_do_softint()
555 if (tty->hw_stopped) in ircomm_tty_do_softint()
574 tty_wakeup(tty); in ircomm_tty_do_softint()
576 tty_kref_put(tty); in ircomm_tty_do_softint()
587 static int ircomm_tty_write(struct tty_struct *tty, in ircomm_tty_write() argument
590 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_write()
598 tty->hw_stopped); in ircomm_tty_write()
720 static int ircomm_tty_write_room(struct tty_struct *tty) in ircomm_tty_write_room() argument
722 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_write_room()
739 if (tty->hw_stopped) in ircomm_tty_write_room()
760 static void ircomm_tty_wait_until_sent(struct tty_struct *tty, int timeout) in ircomm_tty_wait_until_sent() argument
762 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_wait_until_sent()
797 static void ircomm_tty_throttle(struct tty_struct *tty) in ircomm_tty_throttle() argument
799 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_throttle()
805 if (I_IXOFF(tty)) in ircomm_tty_throttle()
806 ircomm_tty_send_xchar(tty, STOP_CHAR(tty)); in ircomm_tty_throttle()
809 if (tty->termios.c_cflag & CRTSCTS) { in ircomm_tty_throttle()
826 static void ircomm_tty_unthrottle(struct tty_struct *tty) in ircomm_tty_unthrottle() argument
828 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_unthrottle()
834 if (I_IXOFF(tty)) { in ircomm_tty_unthrottle()
835 ircomm_tty_send_xchar(tty, START_CHAR(tty)); in ircomm_tty_unthrottle()
839 if (tty->termios.c_cflag & CRTSCTS) { in ircomm_tty_unthrottle()
854 static int ircomm_tty_chars_in_buffer(struct tty_struct *tty) in ircomm_tty_chars_in_buffer() argument
856 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_chars_in_buffer()
916 static void ircomm_tty_hangup(struct tty_struct *tty) in ircomm_tty_hangup() argument
918 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_hangup()
930 if (port->tty) { in ircomm_tty_hangup()
931 set_bit(TTY_IO_ERROR, &port->tty->flags); in ircomm_tty_hangup()
932 tty_kref_put(port->tty); in ircomm_tty_hangup()
934 port->tty = NULL; in ircomm_tty_hangup()
947 static void ircomm_tty_send_xchar(struct tty_struct *tty, char ch) in ircomm_tty_send_xchar() argument
958 void ircomm_tty_start(struct tty_struct *tty) in ircomm_tty_start() argument
960 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_start()
971 static void ircomm_tty_stop(struct tty_struct *tty) in ircomm_tty_stop() argument
973 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_stop()
990 struct tty_struct *tty; in ircomm_tty_check_modem_status() local
996 tty = tty_port_tty_get(&self->port); in ircomm_tty_check_modem_status()
1011 if (tty) in ircomm_tty_check_modem_status()
1012 tty_hangup(tty); in ircomm_tty_check_modem_status()
1018 if (tty && tty_port_cts_enabled(&self->port)) { in ircomm_tty_check_modem_status()
1019 if (tty->hw_stopped) { in ircomm_tty_check_modem_status()
1022 tty->hw_stopped = 0; in ircomm_tty_check_modem_status()
1033 tty->hw_stopped = 1; in ircomm_tty_check_modem_status()
1038 tty_kref_put(tty); in ircomm_tty_check_modem_status()
1051 struct tty_struct *tty; in ircomm_tty_data_indication() local
1057 tty = tty_port_tty_get(&self->port); in ircomm_tty_data_indication()
1058 if (!tty) { in ircomm_tty_data_indication()
1069 if (tty->hw_stopped && (self->flow == FLOW_START)) { in ircomm_tty_data_indication()
1077 tty_kref_put(tty); in ircomm_tty_data_indication()
1128 struct tty_struct *tty; in ircomm_tty_flow_indication() local
1133 tty = tty_port_tty_get(&self->port); in ircomm_tty_flow_indication()
1138 if (tty) in ircomm_tty_flow_indication()
1139 tty->hw_stopped = 0; in ircomm_tty_flow_indication()
1147 if (tty) in ircomm_tty_flow_indication()
1148 tty->hw_stopped = 1; in ircomm_tty_flow_indication()
1152 tty_kref_put(tty); in ircomm_tty_flow_indication()
1159 struct tty_struct *tty; in ircomm_tty_line_info() local
1286 tty = tty_port_tty_get(&self->port); in ircomm_tty_line_info()
1287 if (tty) { in ircomm_tty_line_info()
1289 tty->hw_stopped ? "Stopped" : "Running"); in ircomm_tty_line_info()
1290 tty_kref_put(tty); in ircomm_tty_line_info()