Lines Matching full:tty

22 #include <linux/tty.h>
121 * tty is being closed because that is the only time the write lock is in hci_uart_tx_wakeup()
150 struct tty_struct *tty = hu->tty; in hci_uart_write_work() local
164 set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); in hci_uart_write_work()
165 len = tty->ops->write(tty, skb->data, skb->len); in hci_uart_write_work()
230 struct tty_struct *tty = hu->tty; in hci_uart_flush() local
232 BT_DBG("hdev %p tty %p", hdev, tty); in hci_uart_flush()
239 tty_ldisc_flush(tty); in hci_uart_flush()
240 tty_driver_flush_buffer(tty); in hci_uart_flush()
297 /* Check the underlying device or tty has flow control support */
304 if (hu->tty->driver->ops->tiocmget && hu->tty->driver->ops->tiocmset) in hci_uart_has_flow_control()
313 struct tty_struct *tty = hu->tty; in hci_uart_set_flow_control() local
327 ktermios = tty->termios; in hci_uart_set_flow_control()
329 tty_set_termios(tty, &ktermios); in hci_uart_set_flow_control()
331 (tty->termios.c_cflag & CRTSCTS) ? "failed" : "success"); in hci_uart_set_flow_control()
335 status = tty->driver->ops->tiocmget(tty); in hci_uart_set_flow_control()
344 status = tty->driver->ops->tiocmset(tty, set, clear); in hci_uart_set_flow_control()
348 status = tty->driver->ops->tiocmget(tty); in hci_uart_set_flow_control()
357 status = tty->driver->ops->tiocmset(tty, set, clear); in hci_uart_set_flow_control()
361 ktermios = tty->termios; in hci_uart_set_flow_control()
363 tty_set_termios(tty, &ktermios); in hci_uart_set_flow_control()
365 !(tty->termios.c_cflag & CRTSCTS) ? "failed" : "success"); in hci_uart_set_flow_control()
378 struct tty_struct *tty = hu->tty; in hci_uart_set_baudrate() local
381 ktermios = tty->termios; in hci_uart_set_baudrate()
386 tty_set_termios(tty, &ktermios); in hci_uart_set_baudrate()
388 BT_DBG("%s: New tty speeds: %d/%d", hu->hdev->name, in hci_uart_set_baudrate()
389 tty->termios.c_ispeed, tty->termios.c_ospeed); in hci_uart_set_baudrate()
475 * tty pointer to tty info structure
479 static int hci_uart_tty_open(struct tty_struct *tty) in hci_uart_tty_open() argument
483 BT_DBG("tty %p", tty); in hci_uart_tty_open()
488 /* Error if the tty has no write op instead of leaving an exploitable in hci_uart_tty_open()
491 if (tty->ops->write == NULL) in hci_uart_tty_open()
505 tty->disc_data = hu; in hci_uart_tty_open()
506 hu->tty = tty; in hci_uart_tty_open()
507 tty->receive_room = 65536; in hci_uart_tty_open()
514 hu->oper_speed = tty->termios.c_ospeed; in hci_uart_tty_open()
520 tty_driver_flush_buffer(tty); in hci_uart_tty_open()
528 * else, the tty is closed, or the tty detects a hangup.
530 static void hci_uart_tty_close(struct tty_struct *tty) in hci_uart_tty_close() argument
532 struct hci_uart *hu = tty->disc_data; in hci_uart_tty_close()
535 BT_DBG("tty %p", tty); in hci_uart_tty_close()
537 /* Detach from the tty */ in hci_uart_tty_close()
538 tty->disc_data = NULL; in hci_uart_tty_close()
574 * Arguments: tty pointer to associated tty instance data
577 static void hci_uart_tty_wakeup(struct tty_struct *tty) in hci_uart_tty_wakeup() argument
579 struct hci_uart *hu = tty->disc_data; in hci_uart_tty_wakeup()
586 clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); in hci_uart_tty_wakeup()
588 if (tty != hu->tty) in hci_uart_tty_wakeup()
598 * Called by tty low level driver when receive data is
601 * Arguments: tty pointer to tty instance data
608 static void hci_uart_tty_receive(struct tty_struct *tty, const u8 *data, in hci_uart_tty_receive() argument
611 struct hci_uart *hu = tty->disc_data; in hci_uart_tty_receive()
613 if (!hu || tty != hu->tty) in hci_uart_tty_receive()
625 * tty caller in hci_uart_tty_receive()
633 tty_unthrottle(tty); in hci_uart_tty_receive()
667 SET_HCIDEV_DEV(hdev, hu->tty->dev); in hci_uart_register_dev()
746 * Process IOCTL system call for the tty device.
750 * tty pointer to tty instance data
756 static int hci_uart_tty_ioctl(struct tty_struct *tty, unsigned int cmd, in hci_uart_tty_ioctl() argument
759 struct hci_uart *hu = tty->disc_data; in hci_uart_tty_ioctl()
805 err = n_tty_ioctl_helper(tty, cmd, arg); in hci_uart_tty_ioctl()
815 static ssize_t hci_uart_tty_read(struct tty_struct *tty, struct file *file, in hci_uart_tty_read() argument
822 static ssize_t hci_uart_tty_write(struct tty_struct *tty, struct file *file, in hci_uart_tty_write() argument
848 /* Register the tty discipline */ in hci_uart_init()