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()
351 __FILE__, __LINE__, tty->driver->name, port->count); in ircomm_tty_block_til_ready()
366 __FILE__, __LINE__, tty->driver->name, port->count); in ircomm_tty_block_til_ready()
375 static int ircomm_tty_install(struct tty_driver *driver, struct tty_struct *tty) in ircomm_tty_install() argument
378 unsigned int line = tty->index; in ircomm_tty_install()
409 tty->termios.c_iflag = 0; in ircomm_tty_install()
410 tty->termios.c_oflag = 0; in ircomm_tty_install()
416 tty->driver_data = self; in ircomm_tty_install()
418 return tty_port_install(&self->port, driver, tty); in ircomm_tty_install()
428 static int ircomm_tty_open(struct tty_struct *tty, struct file *filp) in ircomm_tty_open() argument
430 struct ircomm_tty_cb *self = tty->driver_data; in ircomm_tty_open()
438 tty_port_tty_set(&self->port, tty); in ircomm_tty_open()
440 pr_debug("%s(), %s%d, count = %d\n", __func__ , tty->driver->name, in ircomm_tty_open()
491 ret = ircomm_tty_block_til_ready(self, tty, filp); in ircomm_tty_open()
507 static void ircomm_tty_close(struct tty_struct *tty, struct file *filp) in ircomm_tty_close() argument
509 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_close()
515 if (tty_port_close_start(port, tty, filp) == 0) in ircomm_tty_close()
520 tty_driver_flush_buffer(tty); in ircomm_tty_close()
522 tty_port_close_end(port, tty); in ircomm_tty_close()
532 static void ircomm_tty_flush_buffer(struct tty_struct *tty) in ircomm_tty_flush_buffer() argument
534 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_flush_buffer()
557 struct tty_struct *tty; in ircomm_tty_do_softint() local
564 tty = tty_port_tty_get(&self->port); in ircomm_tty_do_softint()
565 if (!tty) in ircomm_tty_do_softint()
584 if (tty->hw_stopped) in ircomm_tty_do_softint()
603 tty_wakeup(tty); in ircomm_tty_do_softint()
605 tty_kref_put(tty); in ircomm_tty_do_softint()
616 static int ircomm_tty_write(struct tty_struct *tty, in ircomm_tty_write() argument
619 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_write()
627 tty->hw_stopped); in ircomm_tty_write()
749 static int ircomm_tty_write_room(struct tty_struct *tty) in ircomm_tty_write_room() argument
751 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_write_room()
768 if (tty->hw_stopped) in ircomm_tty_write_room()
789 static void ircomm_tty_wait_until_sent(struct tty_struct *tty, int timeout) in ircomm_tty_wait_until_sent() argument
791 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_wait_until_sent()
826 static void ircomm_tty_throttle(struct tty_struct *tty) in ircomm_tty_throttle() argument
828 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_throttle()
834 if (I_IXOFF(tty)) in ircomm_tty_throttle()
835 ircomm_tty_send_xchar(tty, STOP_CHAR(tty)); in ircomm_tty_throttle()
838 if (tty->termios.c_cflag & CRTSCTS) { in ircomm_tty_throttle()
855 static void ircomm_tty_unthrottle(struct tty_struct *tty) in ircomm_tty_unthrottle() argument
857 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_unthrottle()
863 if (I_IXOFF(tty)) { in ircomm_tty_unthrottle()
864 ircomm_tty_send_xchar(tty, START_CHAR(tty)); in ircomm_tty_unthrottle()
868 if (tty->termios.c_cflag & CRTSCTS) { in ircomm_tty_unthrottle()
883 static int ircomm_tty_chars_in_buffer(struct tty_struct *tty) in ircomm_tty_chars_in_buffer() argument
885 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_chars_in_buffer()
945 static void ircomm_tty_hangup(struct tty_struct *tty) in ircomm_tty_hangup() argument
947 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_hangup()
959 if (port->tty) { in ircomm_tty_hangup()
960 set_bit(TTY_IO_ERROR, &port->tty->flags); in ircomm_tty_hangup()
961 tty_kref_put(port->tty); in ircomm_tty_hangup()
963 port->tty = NULL; in ircomm_tty_hangup()
976 static void ircomm_tty_send_xchar(struct tty_struct *tty, char ch) in ircomm_tty_send_xchar() argument
987 void ircomm_tty_start(struct tty_struct *tty) in ircomm_tty_start() argument
989 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_start()
1000 static void ircomm_tty_stop(struct tty_struct *tty) in ircomm_tty_stop() argument
1002 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_stop()
1019 struct tty_struct *tty; in ircomm_tty_check_modem_status() local
1025 tty = tty_port_tty_get(&self->port); in ircomm_tty_check_modem_status()
1040 if (tty) in ircomm_tty_check_modem_status()
1041 tty_hangup(tty); in ircomm_tty_check_modem_status()
1047 if (tty && tty_port_cts_enabled(&self->port)) { in ircomm_tty_check_modem_status()
1048 if (tty->hw_stopped) { in ircomm_tty_check_modem_status()
1051 tty->hw_stopped = 0; in ircomm_tty_check_modem_status()
1062 tty->hw_stopped = 1; in ircomm_tty_check_modem_status()
1067 tty_kref_put(tty); in ircomm_tty_check_modem_status()
1080 struct tty_struct *tty; in ircomm_tty_data_indication() local
1086 tty = tty_port_tty_get(&self->port); in ircomm_tty_data_indication()
1087 if (!tty) { in ircomm_tty_data_indication()
1098 if (tty->hw_stopped && (self->flow == FLOW_START)) { in ircomm_tty_data_indication()
1106 tty_kref_put(tty); in ircomm_tty_data_indication()
1157 struct tty_struct *tty; in ircomm_tty_flow_indication() local
1162 tty = tty_port_tty_get(&self->port); in ircomm_tty_flow_indication()
1167 if (tty) in ircomm_tty_flow_indication()
1168 tty->hw_stopped = 0; in ircomm_tty_flow_indication()
1176 if (tty) in ircomm_tty_flow_indication()
1177 tty->hw_stopped = 1; in ircomm_tty_flow_indication()
1181 tty_kref_put(tty); in ircomm_tty_flow_indication()
1188 struct tty_struct *tty; in ircomm_tty_line_info() local
1315 tty = tty_port_tty_get(&self->port); in ircomm_tty_line_info()
1316 if (tty) { in ircomm_tty_line_info()
1318 tty->hw_stopped ? "Stopped" : "Running"); in ircomm_tty_line_info()
1319 tty_kref_put(tty); in ircomm_tty_line_info()