Lines Matching defs:tty

23 #include <linux/tty.h>
74 struct tty_struct *tty = nu->tty;
86 set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
87 len = tty->ops->write(tty, skb->data, skb->len);
105 static int nci_uart_set_driver(struct tty_struct *tty, unsigned int driver)
121 nu->tty = tty;
135 tty->disc_data = nu;
147 * tty pointer to tty info structure
151 static int nci_uart_tty_open(struct tty_struct *tty)
153 /* Error if the tty has no write op instead of leaving an exploitable
156 if (!tty->ops->write)
159 tty->disc_data = NULL;
160 tty->receive_room = 65536;
163 tty_driver_flush_buffer(tty);
171 * else, the tty is closed, or the tty detects a hangup.
173 static void nci_uart_tty_close(struct tty_struct *tty)
175 struct nci_uart *nu = tty->disc_data;
177 /* Detach from the tty */
178 tty->disc_data = NULL;
189 nu->tty = NULL;
202 * Arguments: tty pointer to associated tty instance data
205 static void nci_uart_tty_wakeup(struct tty_struct *tty)
207 struct nci_uart *nu = tty->disc_data;
212 clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
214 if (tty != nu->tty)
232 nfc_err(nu->tty->dev,
233 "receive data from tty but no NCI dev is attached yet, drop buffer\n");
277 nfc_err(nu->tty->dev, "corrupted RX packet\n");
288 * Called by tty low level driver when receive data is
291 * Arguments: tty pointer to tty instance data
298 static void nci_uart_tty_receive(struct tty_struct *tty, const u8 *data,
301 struct nci_uart *nu = tty->disc_data;
303 if (!nu || tty != nu->tty)
310 tty_unthrottle(tty);
315 * Process IOCTL system call for the tty device.
319 * tty pointer to tty instance data
325 static int nci_uart_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
328 struct nci_uart *nu = tty->disc_data;
334 return nci_uart_set_driver(tty, (unsigned int)arg);
339 err = n_tty_ioctl_helper(tty, cmd, arg);
347 static ssize_t nci_uart_tty_read(struct tty_struct *tty, struct file *file,
354 static ssize_t nci_uart_tty_write(struct tty_struct *tty, struct file *file,
407 if (!nu->tty)
410 down_read(&nu->tty->termios_rwsem);
411 new_termios = nu->tty->termios;
412 up_read(&nu->tty->termios_rwsem);
420 tty_set_termios(nu->tty, &new_termios);