Lines Matching refs:tty
74 struct tty_struct *tty = nu->tty; in nci_uart_write_work() local
86 set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); in nci_uart_write_work()
87 len = tty->ops->write(tty, skb->data, skb->len); in nci_uart_write_work()
105 static int nci_uart_set_driver(struct tty_struct *tty, unsigned int driver) in nci_uart_set_driver() argument
121 nu->tty = tty; in nci_uart_set_driver()
122 tty->disc_data = nu; in nci_uart_set_driver()
129 tty->disc_data = NULL; in nci_uart_set_driver()
133 tty->disc_data = NULL; in nci_uart_set_driver()
151 static int nci_uart_tty_open(struct tty_struct *tty) in nci_uart_tty_open() argument
156 if (!tty->ops->write) in nci_uart_tty_open()
159 tty->disc_data = NULL; in nci_uart_tty_open()
160 tty->receive_room = 65536; in nci_uart_tty_open()
163 tty_driver_flush_buffer(tty); in nci_uart_tty_open()
173 static void nci_uart_tty_close(struct tty_struct *tty) in nci_uart_tty_close() argument
175 struct nci_uart *nu = (void *)tty->disc_data; in nci_uart_tty_close()
178 tty->disc_data = NULL; in nci_uart_tty_close()
189 nu->tty = NULL; in nci_uart_tty_close()
205 static void nci_uart_tty_wakeup(struct tty_struct *tty) in nci_uart_tty_wakeup() argument
207 struct nci_uart *nu = (void *)tty->disc_data; in nci_uart_tty_wakeup()
212 clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); in nci_uart_tty_wakeup()
214 if (tty != nu->tty) in nci_uart_tty_wakeup()
232 nfc_err(nu->tty->dev, in nci_uart_default_recv_buf()
277 nfc_err(nu->tty->dev, "corrupted RX packet\n"); in nci_uart_default_recv_buf()
298 static void nci_uart_tty_receive(struct tty_struct *tty, const u8 *data, in nci_uart_tty_receive() argument
301 struct nci_uart *nu = (void *)tty->disc_data; in nci_uart_tty_receive()
303 if (!nu || tty != nu->tty) in nci_uart_tty_receive()
310 tty_unthrottle(tty); in nci_uart_tty_receive()
326 static int nci_uart_tty_ioctl(struct tty_struct *tty, struct file *file, in nci_uart_tty_ioctl() argument
329 struct nci_uart *nu = (void *)tty->disc_data; in nci_uart_tty_ioctl()
335 return nci_uart_set_driver(tty, (unsigned int)arg); in nci_uart_tty_ioctl()
340 err = n_tty_ioctl_helper(tty, cmd, arg); in nci_uart_tty_ioctl()
348 static ssize_t nci_uart_tty_read(struct tty_struct *tty, struct file *file, in nci_uart_tty_read() argument
355 static ssize_t nci_uart_tty_write(struct tty_struct *tty, struct file *file, in nci_uart_tty_write() argument
361 static __poll_t nci_uart_tty_poll(struct tty_struct *tty, in nci_uart_tty_poll() argument
414 if (!nu->tty) in nci_uart_set_config()
417 down_read(&nu->tty->termios_rwsem); in nci_uart_set_config()
418 new_termios = nu->tty->termios; in nci_uart_set_config()
419 up_read(&nu->tty->termios_rwsem); in nci_uart_set_config()
427 tty_set_termios(nu->tty, &new_termios); in nci_uart_set_config()