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()
180 if (tty->ldisc->ops->flush_buffer) in nci_uart_tty_open()
181 tty->ldisc->ops->flush_buffer(tty); in nci_uart_tty_open()
182 tty_driver_flush_buffer(tty); in nci_uart_tty_open()
192 static void nci_uart_tty_close(struct tty_struct *tty) in nci_uart_tty_close() argument
194 struct nci_uart *nu = (void *)tty->disc_data; in nci_uart_tty_close()
197 tty->disc_data = NULL; in nci_uart_tty_close()
210 nu->tty = NULL; in nci_uart_tty_close()
226 static void nci_uart_tty_wakeup(struct tty_struct *tty) in nci_uart_tty_wakeup() argument
228 struct nci_uart *nu = (void *)tty->disc_data; in nci_uart_tty_wakeup()
233 clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); in nci_uart_tty_wakeup()
235 if (tty != nu->tty) in nci_uart_tty_wakeup()
253 static void nci_uart_tty_receive(struct tty_struct *tty, const u8 *data, in nci_uart_tty_receive() argument
256 struct nci_uart *nu = (void *)tty->disc_data; in nci_uart_tty_receive()
258 if (!nu || tty != nu->tty) in nci_uart_tty_receive()
265 tty_unthrottle(tty); in nci_uart_tty_receive()
281 static int nci_uart_tty_ioctl(struct tty_struct *tty, struct file *file, in nci_uart_tty_ioctl() argument
284 struct nci_uart *nu = (void *)tty->disc_data; in nci_uart_tty_ioctl()
290 return nci_uart_set_driver(tty, (unsigned int)arg); in nci_uart_tty_ioctl()
295 err = n_tty_ioctl_helper(tty, file, cmd, arg); in nci_uart_tty_ioctl()
303 static ssize_t nci_uart_tty_read(struct tty_struct *tty, struct file *file, in nci_uart_tty_read() argument
309 static ssize_t nci_uart_tty_write(struct tty_struct *tty, struct file *file, in nci_uart_tty_write() argument
315 static unsigned int nci_uart_tty_poll(struct tty_struct *tty, in nci_uart_tty_poll() argument
344 nfc_err(nu->tty->dev, in nci_uart_default_recv_buf()
389 nfc_err(nu->tty->dev, "corrupted RX packet\n"); in nci_uart_default_recv_buf()
446 if (!nu->tty) in nci_uart_set_config()
449 down_read(&nu->tty->termios_rwsem); in nci_uart_set_config()
450 new_termios = nu->tty->termios; in nci_uart_set_config()
451 up_read(&nu->tty->termios_rwsem); in nci_uart_set_config()
459 tty_set_termios(nu->tty, &new_termios); in nci_uart_set_config()