Lines Matching refs:tty

31  *      Dmitry Gorodchanin      :       Code cleanup. Reduce tty driver
59 * Vitaly E. Lavrov : Sane behaviour on tty hangup.
60 * Alexey Kuznetsov : Cleanup interfaces to tty & netdevice
76 #include <linux/tty.h>
172 if (sl->tty == NULL) {
261 if (sl->tty == NULL)
408 set_bit(TTY_DO_WRITE_WAKEUP, &sl->tty->flags);
409 actual = sl->tty->ops->write(sl->tty, sl->xbuff, count);
421 /* Write out any remaining transmit buffer. Scheduled when tty is writable */
429 if (!sl->tty || sl->magic != SLIP_MAGIC || !netif_running(sl->dev)) {
438 clear_bit(TTY_DO_WRITE_WAKEUP, &sl->tty->flags);
444 actual = sl->tty->ops->write(sl->tty, sl->xhead, sl->xleft);
454 static void slip_write_wakeup(struct tty_struct *tty)
459 sl = rcu_dereference(tty->disc_data);
472 if (!netif_running(dev) || !sl->tty)
485 (tty_chars_in_buffer(sl->tty) || sl->xleft) ?
488 clear_bit(TTY_DO_WRITE_WAKEUP, &sl->tty->flags);
510 if (sl->tty == NULL) {
538 if (sl->tty)
540 clear_bit(TTY_DO_WRITE_WAKEUP, &sl->tty->flags);
555 if (sl->tty == NULL)
688 static void slip_receive_buf(struct tty_struct *tty, const u8 *cp, const u8 *fp,
691 struct slip *sl = tty->disc_data;
730 if (sl->tty || sl->leased)
738 /* Find a free SLIP channel, and link in this `tty' line. */
782 * sure the tty line exists, we only have to link it to
788 static int slip_open(struct tty_struct *tty)
796 if (tty->ops->write == NULL)
808 sl = tty->disc_data;
821 sl->tty = tty;
822 tty->disc_data = sl;
851 tty->receive_room = 65536; /* We don't flow control */
860 sl->tty = NULL;
861 tty->disc_data = NULL;
884 static void slip_close(struct tty_struct *tty)
886 struct slip *sl = tty->disc_data;
889 if (!sl || sl->magic != SLIP_MAGIC || sl->tty != tty)
893 rcu_assign_pointer(tty->disc_data, NULL);
894 sl->tty = NULL;
910 static void slip_hangup(struct tty_struct *tty)
912 slip_close(tty);
1075 static int slip_ioctl(struct tty_struct *tty, unsigned int cmd,
1078 struct slip *sl = tty->disc_data;
1130 if (!sl->tty) {
1155 if (!sl->tty) {
1176 return tty_mode_ioctl(tty, cmd, arg);
1200 if (!sl->tty) {
1249 if (sl->tty != current->signal->tty &&
1338 if (sl->tty) {
1340 tty_hangup(sl->tty);
1356 if (sl->tty) {
1357 printk(KERN_ERR "%s: tty discipline still running\n",
1385 if (sl->tty == NULL)
1396 /* put END into tty queue. Is it right ??? */
1399 sl->tty->ops->write(sl->tty, &s, 1);
1416 if (sl->tty == NULL)
1426 /* this must hangup tty & close slip */
1427 tty_hangup(sl->tty);