Lines Matching refs:tty
52 static int ircomm_tty_open(struct tty_struct *tty, struct file *filp);
53 static void ircomm_tty_close(struct tty_struct * tty, struct file *filp);
54 static int ircomm_tty_write(struct tty_struct * tty,
56 static int ircomm_tty_write_room(struct tty_struct *tty);
57 static void ircomm_tty_throttle(struct tty_struct *tty);
58 static void ircomm_tty_unthrottle(struct tty_struct *tty);
59 static int ircomm_tty_chars_in_buffer(struct tty_struct *tty);
60 static void ircomm_tty_flush_buffer(struct tty_struct *tty);
61 static void ircomm_tty_send_xchar(struct tty_struct *tty, char ch);
62 static void ircomm_tty_wait_until_sent(struct tty_struct *tty, int timeout);
63 static void ircomm_tty_hangup(struct tty_struct *tty);
66 static void ircomm_tty_stop(struct tty_struct *tty);
250 struct tty_struct *tty; in ircomm_tty_block_til_ready() local
254 tty = self->tty; in ircomm_tty_block_til_ready()
260 if (filp->f_flags & O_NONBLOCK || tty->flags & (1 << TTY_IO_ERROR)){ in ircomm_tty_block_til_ready()
267 if (tty->termios->c_cflag & CLOCAL) { in ircomm_tty_block_til_ready()
283 __FILE__,__LINE__, tty->driver->name, self->open_count ); in ircomm_tty_block_til_ready()
295 if (tty->termios->c_cflag & CBAUD) { in ircomm_tty_block_til_ready()
332 __FILE__,__LINE__, tty->driver->name, self->open_count ); in ircomm_tty_block_til_ready()
349 __FILE__,__LINE__, tty->driver->name, self->open_count); in ircomm_tty_block_til_ready()
364 static int ircomm_tty_open(struct tty_struct *tty, struct file *filp) in ircomm_tty_open() argument
373 line = tty->index; in ircomm_tty_open()
410 tty->termios->c_iflag = 0; in ircomm_tty_open()
411 tty->termios->c_oflag = 0; in ircomm_tty_open()
420 tty->driver_data = self; in ircomm_tty_open()
421 self->tty = tty; in ircomm_tty_open()
424 IRDA_DEBUG(1, "%s(), %s%d, count = %d\n", __func__ , tty->driver->name, in ircomm_tty_open()
428 self->tty->low_latency = (self->flags & ASYNC_LOW_LATENCY) ? 1 : 0; in ircomm_tty_open()
492 static void ircomm_tty_close(struct tty_struct *tty, struct file *filp) in ircomm_tty_close() argument
494 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_close()
499 if (!tty) in ircomm_tty_close()
514 if ((tty->count == 1) && (self->open_count != 1)) { in ircomm_tty_close()
553 tty->closing = 1; in ircomm_tty_close()
555 tty_wait_until_sent(tty, self->closing_wait); in ircomm_tty_close()
559 tty_driver_flush_buffer(tty); in ircomm_tty_close()
560 tty_ldisc_flush(tty); in ircomm_tty_close()
562 tty->closing = 0; in ircomm_tty_close()
563 self->tty = NULL; in ircomm_tty_close()
581 static void ircomm_tty_flush_buffer(struct tty_struct *tty) in ircomm_tty_flush_buffer() argument
583 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_flush_buffer()
606 struct tty_struct *tty; in ircomm_tty_do_softint() local
615 tty = self->tty; in ircomm_tty_do_softint()
616 if (!tty) in ircomm_tty_do_softint()
635 if (tty->hw_stopped) in ircomm_tty_do_softint()
654 tty_wakeup(tty); in ircomm_tty_do_softint()
665 static int ircomm_tty_write(struct tty_struct *tty, in ircomm_tty_write() argument
668 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_write()
676 tty->hw_stopped); in ircomm_tty_write()
798 static int ircomm_tty_write_room(struct tty_struct *tty) in ircomm_tty_write_room() argument
800 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_write_room()
817 if (tty->hw_stopped) in ircomm_tty_write_room()
838 static void ircomm_tty_wait_until_sent(struct tty_struct *tty, int timeout) in ircomm_tty_wait_until_sent() argument
840 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_wait_until_sent()
875 static void ircomm_tty_throttle(struct tty_struct *tty) in ircomm_tty_throttle() argument
877 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_throttle()
885 if (I_IXOFF(tty)) in ircomm_tty_throttle()
886 ircomm_tty_send_xchar(tty, STOP_CHAR(tty)); in ircomm_tty_throttle()
889 if (tty->termios->c_cflag & CRTSCTS) { in ircomm_tty_throttle()
906 static void ircomm_tty_unthrottle(struct tty_struct *tty) in ircomm_tty_unthrottle() argument
908 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_unthrottle()
916 if (I_IXOFF(tty)) { in ircomm_tty_unthrottle()
917 ircomm_tty_send_xchar(tty, START_CHAR(tty)); in ircomm_tty_unthrottle()
921 if (tty->termios->c_cflag & CRTSCTS) { in ircomm_tty_unthrottle()
936 static int ircomm_tty_chars_in_buffer(struct tty_struct *tty) in ircomm_tty_chars_in_buffer() argument
938 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_chars_in_buffer()
1000 static void ircomm_tty_hangup(struct tty_struct *tty) in ircomm_tty_hangup() argument
1002 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_hangup()
1010 if (!tty) in ircomm_tty_hangup()
1019 self->tty = NULL; in ircomm_tty_hangup()
1032 static void ircomm_tty_send_xchar(struct tty_struct *tty, char ch) in ircomm_tty_send_xchar() argument
1043 void ircomm_tty_start(struct tty_struct *tty) in ircomm_tty_start() argument
1045 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_start()
1056 static void ircomm_tty_stop(struct tty_struct *tty) in ircomm_tty_stop() argument
1058 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; in ircomm_tty_stop()
1075 struct tty_struct *tty; in ircomm_tty_check_modem_status() local
1083 tty = self->tty; in ircomm_tty_check_modem_status()
1100 if (tty) in ircomm_tty_check_modem_status()
1101 tty_hangup(tty); in ircomm_tty_check_modem_status()
1108 if (tty->hw_stopped) { in ircomm_tty_check_modem_status()
1112 tty->hw_stopped = 0; in ircomm_tty_check_modem_status()
1124 tty->hw_stopped = 1; in ircomm_tty_check_modem_status()
1148 if (!self->tty) { in ircomm_tty_data_indication()
1159 if (self->tty->hw_stopped && (self->flow == FLOW_START)) { in ircomm_tty_data_indication()
1174 ld = tty_ldisc_ref(self->tty); in ircomm_tty_data_indication()
1176 ld->ops->receive_buf(self->tty, skb->data, NULL, skb->len); in ircomm_tty_data_indication()
1223 struct tty_struct *tty; in ircomm_tty_flow_indication() local
1228 tty = self->tty; in ircomm_tty_flow_indication()
1233 tty->hw_stopped = 0; in ircomm_tty_flow_indication()
1241 tty->hw_stopped = 1; in ircomm_tty_flow_indication()
1342 if (self->tty) in ircomm_tty_line_info()
1344 self->tty->hw_stopped ? "Stopped" : "Running"); in ircomm_tty_line_info()