Lines Matching refs:tty
86 struct tty_struct *tty = nu->tty; in nci_uart_write_work() local
98 set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); in nci_uart_write_work()
99 len = tty->ops->write(tty, skb->data, skb->len); in nci_uart_write_work()
117 static int nci_uart_set_driver(struct tty_struct *tty, unsigned int driver) in nci_uart_set_driver() argument
133 nu->tty = tty; in nci_uart_set_driver()
134 tty->disc_data = nu; in nci_uart_set_driver()
141 tty->disc_data = NULL; in nci_uart_set_driver()
145 tty->disc_data = NULL; in nci_uart_set_driver()
163 static int nci_uart_tty_open(struct tty_struct *tty) in nci_uart_tty_open() argument
168 if (!tty->ops->write) in nci_uart_tty_open()
171 tty->disc_data = NULL; in nci_uart_tty_open()
172 tty->receive_room = 65536; in nci_uart_tty_open()
175 tty_driver_flush_buffer(tty); in nci_uart_tty_open()
185 static void nci_uart_tty_close(struct tty_struct *tty) in nci_uart_tty_close() argument
187 struct nci_uart *nu = (void *)tty->disc_data; in nci_uart_tty_close()
190 tty->disc_data = NULL; in nci_uart_tty_close()
201 nu->tty = NULL; in nci_uart_tty_close()
217 static void nci_uart_tty_wakeup(struct tty_struct *tty) in nci_uart_tty_wakeup() argument
219 struct nci_uart *nu = (void *)tty->disc_data; in nci_uart_tty_wakeup()
224 clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); in nci_uart_tty_wakeup()
226 if (tty != nu->tty) in nci_uart_tty_wakeup()
244 static void nci_uart_tty_receive(struct tty_struct *tty, const u8 *data, in nci_uart_tty_receive() argument
247 struct nci_uart *nu = (void *)tty->disc_data; in nci_uart_tty_receive()
249 if (!nu || tty != nu->tty) in nci_uart_tty_receive()
256 tty_unthrottle(tty); in nci_uart_tty_receive()
272 static int nci_uart_tty_ioctl(struct tty_struct *tty, struct file *file, in nci_uart_tty_ioctl() argument
275 struct nci_uart *nu = (void *)tty->disc_data; in nci_uart_tty_ioctl()
281 return nci_uart_set_driver(tty, (unsigned int)arg); in nci_uart_tty_ioctl()
286 err = n_tty_ioctl_helper(tty, file, cmd, arg); in nci_uart_tty_ioctl()
294 static ssize_t nci_uart_tty_read(struct tty_struct *tty, struct file *file, in nci_uart_tty_read() argument
301 static ssize_t nci_uart_tty_write(struct tty_struct *tty, struct file *file, in nci_uart_tty_write() argument
307 static __poll_t nci_uart_tty_poll(struct tty_struct *tty, in nci_uart_tty_poll() argument
336 nfc_err(nu->tty->dev, in nci_uart_default_recv_buf()
381 nfc_err(nu->tty->dev, "corrupted RX packet\n"); in nci_uart_default_recv_buf()
438 if (!nu->tty) in nci_uart_set_config()
441 down_read(&nu->tty->termios_rwsem); in nci_uart_set_config()
442 new_termios = nu->tty->termios; in nci_uart_set_config()
443 up_read(&nu->tty->termios_rwsem); in nci_uart_set_config()
451 tty_set_termios(nu->tty, &new_termios); in nci_uart_set_config()