Lines Matching refs:termios
204 struct ktermios *termios = &tty->termios; in unset_locked_termios() local
210 NOSET_MASK(termios->c_iflag, old->c_iflag, locked->c_iflag); in unset_locked_termios()
211 NOSET_MASK(termios->c_oflag, old->c_oflag, locked->c_oflag); in unset_locked_termios()
212 NOSET_MASK(termios->c_cflag, old->c_cflag, locked->c_cflag); in unset_locked_termios()
213 NOSET_MASK(termios->c_lflag, old->c_lflag, locked->c_lflag); in unset_locked_termios()
214 termios->c_line = locked->c_line ? old->c_line : termios->c_line; in unset_locked_termios()
216 termios->c_cc[i] = locked->c_cc[i] ? in unset_locked_termios()
217 old->c_cc[i] : termios->c_cc[i]; in unset_locked_termios()
334 old_termios = tty->termios; in tty_set_termios()
335 tty->termios = *new_termios; in tty_set_termios()
338 tty->termios.c_cflag ^= (tty->termios.c_cflag ^ old_termios.c_cflag) & ADDRB; in tty_set_termios()
343 tty_termios_copy_hw(&tty->termios, &old_termios); in tty_set_termios()
360 __weak int user_termio_to_kernel_termios(struct ktermios *termios, in user_termio_to_kernel_termios() argument
368 termios->c_iflag = (0xffff0000 & termios->c_iflag) | v.c_iflag; in user_termio_to_kernel_termios()
369 termios->c_oflag = (0xffff0000 & termios->c_oflag) | v.c_oflag; in user_termio_to_kernel_termios()
370 termios->c_cflag = (0xffff0000 & termios->c_cflag) | v.c_cflag; in user_termio_to_kernel_termios()
371 termios->c_lflag = (0xffff0000 & termios->c_lflag) | v.c_lflag; in user_termio_to_kernel_termios()
372 termios->c_line = (0xffff0000 & termios->c_lflag) | v.c_line; in user_termio_to_kernel_termios()
373 memcpy(termios->c_cc, v.c_cc, NCC); in user_termio_to_kernel_termios()
381 struct ktermios *termios) in kernel_termios_to_user_termio() argument
385 v.c_iflag = termios->c_iflag; in kernel_termios_to_user_termio()
386 v.c_oflag = termios->c_oflag; in kernel_termios_to_user_termio()
387 v.c_cflag = termios->c_cflag; in kernel_termios_to_user_termio()
388 v.c_lflag = termios->c_lflag; in kernel_termios_to_user_termio()
389 v.c_line = termios->c_line; in kernel_termios_to_user_termio()
390 memcpy(v.c_cc, termios->c_cc, NCC); in kernel_termios_to_user_termio()
406 struct termios __user *u) in user_termios_to_kernel_termios_1()
408 return copy_from_user(k, u, sizeof(struct termios)); in user_termios_to_kernel_termios_1()
410 __weak int kernel_termios_to_user_termios_1(struct termios __user *u, in kernel_termios_to_user_termios_1()
413 return copy_to_user(u, k, sizeof(struct termios)); in kernel_termios_to_user_termios_1()
419 struct termios __user *u) in user_termios_to_kernel_termios()
421 return copy_from_user(k, u, sizeof(struct termios)); in user_termios_to_kernel_termios()
423 __weak int kernel_termios_to_user_termios(struct termios __user *u, in kernel_termios_to_user_termios()
426 return copy_to_user(u, k, sizeof(struct termios)); in kernel_termios_to_user_termios()
454 tmp_termios = tty->termios; in set_termios()
464 (struct termios __user *)arg)) in set_termios()
473 (struct termios __user *)arg))
529 *kterm = tty->termios; in copy_termios()
578 tmp.sg_ispeed = tty->termios.c_ispeed; in get_sgttyb()
579 tmp.sg_ospeed = tty->termios.c_ospeed; in get_sgttyb()
580 tmp.sg_erase = tty->termios.c_cc[VERASE]; in get_sgttyb()
581 tmp.sg_kill = tty->termios.c_cc[VKILL]; in get_sgttyb()
588 static void set_sgflags(struct ktermios *termios, int flags) in set_sgflags() argument
590 termios->c_iflag = ICRNL | IXON; in set_sgflags()
591 termios->c_oflag = 0; in set_sgflags()
592 termios->c_lflag = ISIG | ICANON; in set_sgflags()
594 termios->c_iflag = 0; in set_sgflags()
595 termios->c_lflag &= ~ICANON; in set_sgflags()
598 termios->c_lflag |= ECHO | ECHOE | ECHOK | in set_sgflags()
602 termios->c_oflag |= OPOST | ONLCR; in set_sgflags()
605 termios->c_iflag = 0; in set_sgflags()
606 termios->c_lflag &= ~(ISIG | ICANON); in set_sgflags()
608 if (!(termios->c_lflag & ICANON)) { in set_sgflags()
609 termios->c_cc[VMIN] = 1; in set_sgflags()
610 termios->c_cc[VTIME] = 0; in set_sgflags()
629 struct ktermios termios; in set_sgttyb() local
639 termios = tty->termios; in set_sgttyb()
640 termios.c_cc[VERASE] = tmp.sg_erase; in set_sgttyb()
641 termios.c_cc[VKILL] = tmp.sg_kill; in set_sgttyb()
642 set_sgflags(&termios, tmp.sg_flags); in set_sgttyb()
644 tty_termios_encode_baud_rate(&termios, termios.c_ispeed, in set_sgttyb()
645 termios.c_ospeed); in set_sgttyb()
647 tty_set_termios(tty, &termios); in set_sgttyb()
658 tmp.t_intrc = tty->termios.c_cc[VINTR]; in get_tchars()
659 tmp.t_quitc = tty->termios.c_cc[VQUIT]; in get_tchars()
660 tmp.t_startc = tty->termios.c_cc[VSTART]; in get_tchars()
661 tmp.t_stopc = tty->termios.c_cc[VSTOP]; in get_tchars()
662 tmp.t_eofc = tty->termios.c_cc[VEOF]; in get_tchars()
663 tmp.t_brkc = tty->termios.c_cc[VEOL2]; /* what is brkc anyway? */ in get_tchars()
675 tty->termios.c_cc[VINTR] = tmp.t_intrc; in set_tchars()
676 tty->termios.c_cc[VQUIT] = tmp.t_quitc; in set_tchars()
677 tty->termios.c_cc[VSTART] = tmp.t_startc; in set_tchars()
678 tty->termios.c_cc[VSTOP] = tmp.t_stopc; in set_tchars()
679 tty->termios.c_cc[VEOF] = tmp.t_eofc; in set_tchars()
680 tty->termios.c_cc[VEOL2] = tmp.t_brkc; /* what is brkc anyway? */ in set_tchars()
692 tmp.t_suspc = tty->termios.c_cc[VSUSP]; in get_ltchars()
694 tmp.t_dsuspc = tty->termios.c_cc[VSUSP]; in get_ltchars()
695 tmp.t_rprntc = tty->termios.c_cc[VREPRINT]; in get_ltchars()
697 tmp.t_flushc = tty->termios.c_cc[VEOL2]; in get_ltchars()
698 tmp.t_werasc = tty->termios.c_cc[VWERASE]; in get_ltchars()
699 tmp.t_lnextc = tty->termios.c_cc[VLNEXT]; in get_ltchars()
712 tty->termios.c_cc[VSUSP] = tmp.t_suspc; in set_ltchars()
714 tty->termios.c_cc[VEOL2] = tmp.t_dsuspc; in set_ltchars()
715 tty->termios.c_cc[VREPRINT] = tmp.t_rprntc; in set_ltchars()
717 tty->termios.c_cc[VEOL2] = tmp.t_flushc; in set_ltchars()
718 tty->termios.c_cc[VWERASE] = tmp.t_werasc; in set_ltchars()
719 tty->termios.c_cc[VLNEXT] = tmp.t_lnextc; in set_ltchars()
744 old = tty->termios; in tty_change_softcar()
745 tty->termios.c_cflag &= ~CLOCAL; in tty_change_softcar()
746 tty->termios.c_cflag |= bit; in tty_change_softcar()
807 if (kernel_termios_to_user_termios((struct termios __user *)arg, &kterm)) in tty_mode_ioctl()
813 if (kernel_termios_to_user_termios_1((struct termios __user *)arg, &kterm)) in tty_mode_ioctl()
839 if (kernel_termios_to_user_termios((struct termios __user *)arg, &kterm)) in tty_mode_ioctl()
847 (struct termios __user *) arg)) in tty_mode_ioctl()
856 if (kernel_termios_to_user_termios_1((struct termios __user *)arg, &kterm)) in tty_mode_ioctl()
864 (struct termios __user *) arg)) in tty_mode_ioctl()