• Home
  • Raw
  • Download

Lines Matching refs:tty

27 	struct tty_struct *tty;  in tty_port_default_receive_buf()  local
30 tty = READ_ONCE(port->itty); in tty_port_default_receive_buf()
31 if (!tty) in tty_port_default_receive_buf()
34 disc = tty_ldisc_ref(tty); in tty_port_default_receive_buf()
47 struct tty_struct *tty = tty_port_tty_get(port); in tty_port_default_wakeup() local
49 if (tty) { in tty_port_default_wakeup()
50 tty_wakeup(tty); in tty_port_default_wakeup()
51 tty_kref_put(tty); in tty_port_default_wakeup()
285 struct tty_struct *tty; in tty_port_tty_get() local
288 tty = tty_kref_get(port->tty); in tty_port_tty_get()
290 return tty; in tty_port_tty_get()
302 void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty) in tty_port_tty_set() argument
307 tty_kref_put(port->tty); in tty_port_tty_set()
308 port->tty = tty_kref_get(tty); in tty_port_tty_set()
313 static void tty_port_shutdown(struct tty_port *port, struct tty_struct *tty) in tty_port_shutdown() argument
325 if (tty && C_HUPCL(tty)) in tty_port_shutdown()
346 struct tty_struct *tty; in tty_port_hangup() local
351 tty = port->tty; in tty_port_hangup()
352 if (tty) in tty_port_hangup()
353 set_bit(TTY_IO_ERROR, &tty->flags); in tty_port_hangup()
354 port->tty = NULL; in tty_port_hangup()
357 tty_port_shutdown(port, tty); in tty_port_hangup()
358 tty_kref_put(tty); in tty_port_hangup()
372 struct tty_struct *tty = tty_port_tty_get(port); in tty_port_tty_hangup() local
374 if (tty && (!check_clocal || !C_CLOCAL(tty))) in tty_port_tty_hangup()
375 tty_hangup(tty); in tty_port_tty_hangup()
376 tty_kref_put(tty); in tty_port_tty_hangup()
462 struct tty_struct *tty, struct file *filp) in tty_port_block_til_ready() argument
470 if (tty_io_error(tty)) { in tty_port_block_til_ready()
476 if (C_BAUD(tty)) in tty_port_block_til_ready()
482 if (C_CLOCAL(tty)) in tty_port_block_til_ready()
499 if (C_BAUD(tty) && tty_port_initialized(port)) in tty_port_block_til_ready()
524 tty_unlock(tty); in tty_port_block_til_ready()
526 tty_lock(tty); in tty_port_block_til_ready()
543 static void tty_port_drain_delay(struct tty_port *port, struct tty_struct *tty) in tty_port_drain_delay() argument
545 unsigned int bps = tty_get_baud_rate(tty); in tty_port_drain_delay()
559 struct tty_struct *tty, struct file *filp) in tty_port_close_start() argument
567 if (tty->count == 1 && port->count != 1) { in tty_port_close_start()
568 tty_warn(tty, "%s: tty->count = 1 port count = %d\n", __func__, in tty_port_close_start()
573 tty_warn(tty, "%s: bad port count (%d)\n", __func__, in tty_port_close_start()
584 tty->closing = 1; in tty_port_close_start()
588 if (tty->flow_stopped) in tty_port_close_start()
589 tty_driver_flush_buffer(tty); in tty_port_close_start()
591 tty_wait_until_sent(tty, port->closing_wait); in tty_port_close_start()
593 tty_port_drain_delay(port, tty); in tty_port_close_start()
596 tty_ldisc_flush(tty); in tty_port_close_start()
604 void tty_port_close_end(struct tty_port *port, struct tty_struct *tty) in tty_port_close_end() argument
608 tty_ldisc_flush(tty); in tty_port_close_end()
609 tty->closing = 0; in tty_port_close_end()
630 void tty_port_close(struct tty_port *port, struct tty_struct *tty, in tty_port_close() argument
633 if (tty_port_close_start(port, tty, filp) == 0) in tty_port_close()
635 tty_port_shutdown(port, tty); in tty_port_close()
637 set_bit(TTY_IO_ERROR, &tty->flags); in tty_port_close()
638 tty_port_close_end(port, tty); in tty_port_close()
654 struct tty_struct *tty) in tty_port_install() argument
656 tty->port = port; in tty_port_install()
657 return tty_standard_install(driver, tty); in tty_port_install()
669 int tty_port_open(struct tty_port *port, struct tty_struct *tty, in tty_port_open() argument
675 tty_port_tty_set(port, tty); in tty_port_open()
686 clear_bit(TTY_IO_ERROR, &tty->flags); in tty_port_open()
688 int retval = port->ops->activate(port, tty); in tty_port_open()
697 return tty_port_block_til_ready(port, tty, filp); in tty_port_open()