Lines Matching refs:tty

2  * slcan.c - serial line CAN interface driver (using tty line discipline)
48 #include <linux/tty.h>
84 struct tty_struct *tty; /* ptr to TTY structure */
455 /* parse tty input stream */
536 set_bit(TTY_DO_WRITE_WAKEUP, &sl->tty->flags);
537 actual = sl->tty->ops->write(sl->tty, sl->xbuff, pos - sl->xbuff);
542 /* Write out any remaining transmit buffer. Scheduled when tty is writable */
559 clear_bit(TTY_DO_WRITE_WAKEUP, &sl->tty->flags);
569 clear_bit(TTY_DO_WRITE_WAKEUP, &sl->tty->flags);
575 actual = sl->tty->ops->write(sl->tty, sl->xhead, sl->xleft);
584 static void slcan_write_wakeup(struct tty_struct *tty)
586 struct slcan *sl = tty->disc_data;
606 if (!sl->tty) {
631 if (!sl->tty) {
637 set_bit(TTY_DO_WRITE_WAKEUP, &sl->tty->flags);
638 actual = sl->tty->ops->write(sl->tty, sl->xbuff, n);
671 clear_bit(TTY_DO_WRITE_WAKEUP, &sl->tty->flags);
777 static void slcan_receive_buf(struct tty_struct *tty, const u8 *cp,
780 struct slcan *sl = tty->disc_data;
803 static int slcan_open(struct tty_struct *tty)
812 if (!tty->ops->write)
822 tty->receive_room = 65536; /* We don't flow control */
840 sl->tty = tty;
841 tty->disc_data = sl;
850 netdev_info(dev, "slcan on %s.\n", tty->name);
862 static void slcan_close(struct tty_struct *tty)
864 struct slcan *sl = tty->disc_data;
876 tty->disc_data = NULL;
877 sl->tty = NULL;
880 netdev_info(sl->dev, "slcan off %s.\n", tty->name);
885 static int slcan_ioctl(struct tty_struct *tty, unsigned int cmd,
888 struct slcan *sl = tty->disc_data;
902 return tty_mode_ioctl(tty, cmd, arg);