• Home
  • Raw
  • Download

Lines Matching refs:tty

151 	struct tty_struct	*tty;  member
183 static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file,
185 static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file,
187 static int n_hdlc_tty_ioctl(struct tty_struct *tty, struct file *file,
189 static unsigned int n_hdlc_tty_poll(struct tty_struct *tty, struct file *filp,
191 static int n_hdlc_tty_open(struct tty_struct *tty);
192 static void n_hdlc_tty_close(struct tty_struct *tty);
193 static void n_hdlc_tty_receive(struct tty_struct *tty, const __u8 *cp,
195 static void n_hdlc_tty_wakeup(struct tty_struct *tty);
199 #define tty2n_hdlc(tty) ((struct n_hdlc *) ((tty)->disc_data)) argument
200 #define n_hdlc2tty(n_hdlc) ((n_hdlc)->tty)
222 struct tty_struct *tty = n_hdlc2tty (n_hdlc); in n_hdlc_release() local
229 wake_up_interruptible (&tty->read_wait); in n_hdlc_release()
230 wake_up_interruptible (&tty->write_wait); in n_hdlc_release()
232 if (tty->disc_data == n_hdlc) in n_hdlc_release()
233 tty->disc_data = NULL; /* Break the tty->n_hdlc link */ in n_hdlc_release()
276 static void n_hdlc_tty_close(struct tty_struct *tty) in n_hdlc_tty_close() argument
278 struct n_hdlc *n_hdlc = tty2n_hdlc (tty); in n_hdlc_tty_close()
289 clear_bit(TTY_NO_WRITE_SPLIT,&tty->flags); in n_hdlc_tty_close()
291 tty->disc_data = NULL; in n_hdlc_tty_close()
292 if (tty == n_hdlc->backup_tty) in n_hdlc_tty_close()
294 if (tty != n_hdlc->tty) in n_hdlc_tty_close()
297 n_hdlc->tty = n_hdlc->backup_tty; in n_hdlc_tty_close()
314 static int n_hdlc_tty_open (struct tty_struct *tty) in n_hdlc_tty_open() argument
316 struct n_hdlc *n_hdlc = tty2n_hdlc (tty); in n_hdlc_tty_open()
321 tty->name); in n_hdlc_tty_open()
335 tty->disc_data = n_hdlc; in n_hdlc_tty_open()
336 n_hdlc->tty = tty; in n_hdlc_tty_open()
337 tty->receive_room = 65536; in n_hdlc_tty_open()
341 set_bit(TTY_NO_WRITE_SPLIT,&tty->flags); in n_hdlc_tty_open()
345 if (tty->ldisc.ops->flush_buffer) in n_hdlc_tty_open()
346 tty->ldisc.ops->flush_buffer(tty); in n_hdlc_tty_open()
348 tty_driver_flush_buffer(tty); in n_hdlc_tty_open()
366 static void n_hdlc_send_frames(struct n_hdlc *n_hdlc, struct tty_struct *tty) in n_hdlc_send_frames() argument
399 tty->flags |= (1 << TTY_DO_WRITE_WAKEUP); in n_hdlc_send_frames()
400 actual = tty->ops->write(tty, tbuf->buf, tbuf->count); in n_hdlc_send_frames()
424 wake_up_interruptible(&tty->write_wait); in n_hdlc_send_frames()
441 tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP); in n_hdlc_send_frames()
462 static void n_hdlc_tty_wakeup(struct tty_struct *tty) in n_hdlc_tty_wakeup() argument
464 struct n_hdlc *n_hdlc = tty2n_hdlc(tty); in n_hdlc_tty_wakeup()
472 if (tty != n_hdlc->tty) { in n_hdlc_tty_wakeup()
473 tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP); in n_hdlc_tty_wakeup()
477 n_hdlc_send_frames (n_hdlc, tty); in n_hdlc_tty_wakeup()
491 static void n_hdlc_tty_receive(struct tty_struct *tty, const __u8 *data, in n_hdlc_tty_receive() argument
494 register struct n_hdlc *n_hdlc = tty2n_hdlc (tty); in n_hdlc_tty_receive()
502 if (!n_hdlc || tty != n_hdlc->tty) in n_hdlc_tty_receive()
543 wake_up_interruptible (&tty->read_wait); in n_hdlc_tty_receive()
544 if (n_hdlc->tty->fasync != NULL) in n_hdlc_tty_receive()
545 kill_fasync (&n_hdlc->tty->fasync, SIGIO, POLL_IN); in n_hdlc_tty_receive()
558 static ssize_t n_hdlc_tty_read(struct tty_struct *tty, struct file *file, in n_hdlc_tty_read() argument
561 struct n_hdlc *n_hdlc = tty2n_hdlc(tty); in n_hdlc_tty_read()
582 if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) { in n_hdlc_tty_read()
587 n_hdlc = tty2n_hdlc (tty); in n_hdlc_tty_read()
589 tty != n_hdlc->tty) { in n_hdlc_tty_read()
604 interruptible_sleep_on (&tty->read_wait); in n_hdlc_tty_read()
643 static ssize_t n_hdlc_tty_write(struct tty_struct *tty, struct file *file, in n_hdlc_tty_write() argument
646 struct n_hdlc *n_hdlc = tty2n_hdlc (tty); in n_hdlc_tty_write()
674 add_wait_queue(&tty->write_wait, &wait); in n_hdlc_tty_write()
686 n_hdlc = tty2n_hdlc (tty); in n_hdlc_tty_write()
688 tty != n_hdlc->tty) { in n_hdlc_tty_write()
701 remove_wait_queue(&tty->write_wait, &wait); in n_hdlc_tty_write()
710 n_hdlc_send_frames(n_hdlc,tty); in n_hdlc_tty_write()
726 static int n_hdlc_tty_ioctl(struct tty_struct *tty, struct file *file, in n_hdlc_tty_ioctl() argument
729 struct n_hdlc *n_hdlc = tty2n_hdlc (tty); in n_hdlc_tty_ioctl()
757 count = tty_chars_in_buffer(tty); in n_hdlc_tty_ioctl()
767 error = n_tty_ioctl_helper(tty, file, cmd, arg); in n_hdlc_tty_ioctl()
784 static unsigned int n_hdlc_tty_poll(struct tty_struct *tty, struct file *filp, in n_hdlc_tty_poll() argument
787 struct n_hdlc *n_hdlc = tty2n_hdlc (tty); in n_hdlc_tty_poll()
793 if (n_hdlc && n_hdlc->magic == HDLC_MAGIC && tty == n_hdlc->tty) { in n_hdlc_tty_poll()
797 poll_wait(filp, &tty->read_wait, wait); in n_hdlc_tty_poll()
798 poll_wait(filp, &tty->write_wait, wait); in n_hdlc_tty_poll()
803 if (test_bit(TTY_OTHER_CLOSED, &tty->flags)) in n_hdlc_tty_poll()
807 if (!tty_is_writelocked(tty) && in n_hdlc_tty_poll()