Lines Matching refs:termios

225 	struct ktermios *termios = &tty->termios;  in unset_locked_termios()  local
231 NOSET_MASK(termios->c_iflag, old->c_iflag, locked->c_iflag); in unset_locked_termios()
232 NOSET_MASK(termios->c_oflag, old->c_oflag, locked->c_oflag); in unset_locked_termios()
233 NOSET_MASK(termios->c_cflag, old->c_cflag, locked->c_cflag); in unset_locked_termios()
234 NOSET_MASK(termios->c_lflag, old->c_lflag, locked->c_lflag); in unset_locked_termios()
235 termios->c_line = locked->c_line ? old->c_line : termios->c_line; in unset_locked_termios()
237 termios->c_cc[i] = locked->c_cc[i] ? in unset_locked_termios()
238 old->c_cc[i] : termios->c_cc[i]; in unset_locked_termios()
356 old_termios = tty->termios; in tty_set_termios()
357 tty->termios = *new_termios; in tty_set_termios()
360 tty->termios.c_cflag ^= (tty->termios.c_cflag ^ old_termios.c_cflag) & ADDRB; in tty_set_termios()
365 tty_termios_copy_hw(&tty->termios, &old_termios); in tty_set_termios()
382 __weak int user_termio_to_kernel_termios(struct ktermios *termios, in user_termio_to_kernel_termios() argument
390 termios->c_iflag = (0xffff0000 & termios->c_iflag) | v.c_iflag; in user_termio_to_kernel_termios()
391 termios->c_oflag = (0xffff0000 & termios->c_oflag) | v.c_oflag; in user_termio_to_kernel_termios()
392 termios->c_cflag = (0xffff0000 & termios->c_cflag) | v.c_cflag; in user_termio_to_kernel_termios()
393 termios->c_lflag = (0xffff0000 & termios->c_lflag) | v.c_lflag; in user_termio_to_kernel_termios()
394 termios->c_line = (0xffff0000 & termios->c_lflag) | v.c_line; in user_termio_to_kernel_termios()
395 memcpy(termios->c_cc, v.c_cc, NCC); in user_termio_to_kernel_termios()
403 struct ktermios *termios) in kernel_termios_to_user_termio() argument
407 v.c_iflag = termios->c_iflag; in kernel_termios_to_user_termio()
408 v.c_oflag = termios->c_oflag; in kernel_termios_to_user_termio()
409 v.c_cflag = termios->c_cflag; in kernel_termios_to_user_termio()
410 v.c_lflag = termios->c_lflag; in kernel_termios_to_user_termio()
411 v.c_line = termios->c_line; in kernel_termios_to_user_termio()
412 memcpy(v.c_cc, termios->c_cc, NCC); in kernel_termios_to_user_termio()
428 struct termios __user *u) in user_termios_to_kernel_termios_1()
430 return copy_from_user(k, u, sizeof(struct termios)); in user_termios_to_kernel_termios_1()
432 __weak int kernel_termios_to_user_termios_1(struct termios __user *u, in kernel_termios_to_user_termios_1()
435 return copy_to_user(u, k, sizeof(struct termios)); in kernel_termios_to_user_termios_1()
441 struct termios __user *u) in user_termios_to_kernel_termios()
443 return copy_from_user(k, u, sizeof(struct termios)); in user_termios_to_kernel_termios()
445 __weak int kernel_termios_to_user_termios(struct termios __user *u, in kernel_termios_to_user_termios()
448 return copy_to_user(u, k, sizeof(struct termios)); in kernel_termios_to_user_termios()
475 tmp_termios = tty->termios; in set_termios()
485 (struct termios __user *)arg)) in set_termios()
494 (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()
741 old = tty->termios; in tty_change_softcar()
742 tty->termios.c_cflag &= ~CLOCAL; in tty_change_softcar()
743 tty->termios.c_cflag |= bit; in tty_change_softcar()
805 if (kernel_termios_to_user_termios((struct termios __user *)arg, &kterm)) in tty_mode_ioctl()
811 if (kernel_termios_to_user_termios_1((struct termios __user *)arg, &kterm)) in tty_mode_ioctl()
837 if (kernel_termios_to_user_termios((struct termios __user *)arg, &kterm)) in tty_mode_ioctl()
845 (struct termios __user *) arg)) in tty_mode_ioctl()
854 if (kernel_termios_to_user_termios_1((struct termios __user *)arg, &kterm)) in tty_mode_ioctl()
862 (struct termios __user *) arg)) in tty_mode_ioctl()