Lines Matching refs:tty
83 struct tty_struct *tty; /* ptr to TTY structure */ member
305 set_bit(TTY_DO_WRITE_WAKEUP, &sl->tty->flags); in slc_encaps()
306 actual = sl->tty->ops->write(sl->tty, sl->xbuff, pos - sl->xbuff); in slc_encaps()
320 if (!sl->tty || sl->magic != SLCAN_MAGIC || !netif_running(sl->dev)) { in slcan_transmit()
329 clear_bit(TTY_DO_WRITE_WAKEUP, &sl->tty->flags); in slcan_transmit()
335 actual = sl->tty->ops->write(sl->tty, sl->xhead, sl->xleft); in slcan_transmit()
345 static void slcan_write_wakeup(struct tty_struct *tty) in slcan_write_wakeup() argument
347 struct slcan *sl = tty->disc_data; in slcan_write_wakeup()
366 if (sl->tty == NULL) { in slc_xmit()
391 if (sl->tty) { in slc_close()
393 clear_bit(TTY_DO_WRITE_WAKEUP, &sl->tty->flags); in slc_close()
408 if (sl->tty == NULL) in slc_open()
466 static void slcan_receive_buf(struct tty_struct *tty, in slcan_receive_buf() argument
469 struct slcan *sl = (struct slcan *) tty->disc_data; in slcan_receive_buf()
503 if (sl->tty) in slc_sync()
557 static int slcan_open(struct tty_struct *tty) in slcan_open() argument
565 if (tty->ops->write == NULL) in slcan_open()
577 sl = tty->disc_data; in slcan_open()
586 sl = slc_alloc(tty_devnum(tty)); in slcan_open()
590 sl->tty = tty; in slcan_open()
591 tty->disc_data = sl; in slcan_open()
607 tty->receive_room = 65536; /* We don't flow control */ in slcan_open()
613 sl->tty = NULL; in slcan_open()
614 tty->disc_data = NULL; in slcan_open()
632 static void slcan_close(struct tty_struct *tty) in slcan_close() argument
634 struct slcan *sl = (struct slcan *) tty->disc_data; in slcan_close()
637 if (!sl || sl->magic != SLCAN_MAGIC || sl->tty != tty) in slcan_close()
641 tty->disc_data = NULL; in slcan_close()
642 sl->tty = NULL; in slcan_close()
652 static int slcan_hangup(struct tty_struct *tty) in slcan_hangup() argument
654 slcan_close(tty); in slcan_hangup()
659 static int slcan_ioctl(struct tty_struct *tty, struct file *file, in slcan_ioctl() argument
662 struct slcan *sl = (struct slcan *) tty->disc_data; in slcan_ioctl()
680 return tty_mode_ioctl(tty, file, cmd, arg); in slcan_ioctl()
743 if (sl->tty) { in slcan_exit()
745 tty_hangup(sl->tty); in slcan_exit()
761 if (sl->tty) { in slcan_exit()