Lines Matching refs:termios
216 struct ktermios *termios = &tty->termios; in unset_locked_termios() local
222 NOSET_MASK(termios->c_iflag, old->c_iflag, locked->c_iflag); in unset_locked_termios()
223 NOSET_MASK(termios->c_oflag, old->c_oflag, locked->c_oflag); in unset_locked_termios()
224 NOSET_MASK(termios->c_cflag, old->c_cflag, locked->c_cflag); in unset_locked_termios()
225 NOSET_MASK(termios->c_lflag, old->c_lflag, locked->c_lflag); in unset_locked_termios()
226 termios->c_line = locked->c_line ? old->c_line : termios->c_line; in unset_locked_termios()
228 termios->c_cc[i] = locked->c_cc[i] ? in unset_locked_termios()
229 old->c_cc[i] : termios->c_cc[i]; in unset_locked_termios()
347 old_termios = tty->termios; in tty_set_termios()
348 tty->termios = *new_termios; in tty_set_termios()
351 tty->termios.c_cflag ^= (tty->termios.c_cflag ^ old_termios.c_cflag) & ADDRB; in tty_set_termios()
356 tty_termios_copy_hw(&tty->termios, &old_termios); in tty_set_termios()
373 __weak int user_termio_to_kernel_termios(struct ktermios *termios, in user_termio_to_kernel_termios() argument
381 termios->c_iflag = (0xffff0000 & termios->c_iflag) | v.c_iflag; in user_termio_to_kernel_termios()
382 termios->c_oflag = (0xffff0000 & termios->c_oflag) | v.c_oflag; in user_termio_to_kernel_termios()
383 termios->c_cflag = (0xffff0000 & termios->c_cflag) | v.c_cflag; in user_termio_to_kernel_termios()
384 termios->c_lflag = (0xffff0000 & termios->c_lflag) | v.c_lflag; in user_termio_to_kernel_termios()
385 termios->c_line = (0xffff0000 & termios->c_lflag) | v.c_line; in user_termio_to_kernel_termios()
386 memcpy(termios->c_cc, v.c_cc, NCC); in user_termio_to_kernel_termios()
394 struct ktermios *termios) in kernel_termios_to_user_termio() argument
398 v.c_iflag = termios->c_iflag; in kernel_termios_to_user_termio()
399 v.c_oflag = termios->c_oflag; in kernel_termios_to_user_termio()
400 v.c_cflag = termios->c_cflag; in kernel_termios_to_user_termio()
401 v.c_lflag = termios->c_lflag; in kernel_termios_to_user_termio()
402 v.c_line = termios->c_line; in kernel_termios_to_user_termio()
403 memcpy(v.c_cc, termios->c_cc, NCC); in kernel_termios_to_user_termio()
419 struct termios __user *u) in user_termios_to_kernel_termios_1()
421 return copy_from_user(k, u, sizeof(struct termios)); in user_termios_to_kernel_termios_1()
423 __weak int kernel_termios_to_user_termios_1(struct termios __user *u, in kernel_termios_to_user_termios_1()
426 return copy_to_user(u, k, sizeof(struct termios)); in kernel_termios_to_user_termios_1()
432 struct termios __user *u) in user_termios_to_kernel_termios()
434 return copy_from_user(k, u, sizeof(struct termios)); in user_termios_to_kernel_termios()
436 __weak int kernel_termios_to_user_termios(struct termios __user *u, in kernel_termios_to_user_termios()
439 return copy_to_user(u, k, sizeof(struct termios)); in kernel_termios_to_user_termios()
466 tmp_termios = tty->termios; in set_termios()
476 (struct termios __user *)arg)) in set_termios()
485 (struct termios __user *)arg))
541 *kterm = tty->termios; in copy_termios()
590 tmp.sg_ispeed = tty->termios.c_ispeed; in get_sgttyb()
591 tmp.sg_ospeed = tty->termios.c_ospeed; in get_sgttyb()
592 tmp.sg_erase = tty->termios.c_cc[VERASE]; in get_sgttyb()
593 tmp.sg_kill = tty->termios.c_cc[VKILL]; in get_sgttyb()
600 static void set_sgflags(struct ktermios *termios, int flags) in set_sgflags() argument
602 termios->c_iflag = ICRNL | IXON; in set_sgflags()
603 termios->c_oflag = 0; in set_sgflags()
604 termios->c_lflag = ISIG | ICANON; in set_sgflags()
606 termios->c_iflag = 0; in set_sgflags()
607 termios->c_lflag &= ~ICANON; in set_sgflags()
610 termios->c_lflag |= ECHO | ECHOE | ECHOK | in set_sgflags()
614 termios->c_oflag |= OPOST | ONLCR; in set_sgflags()
617 termios->c_iflag = 0; in set_sgflags()
618 termios->c_lflag &= ~(ISIG | ICANON); in set_sgflags()
620 if (!(termios->c_lflag & ICANON)) { in set_sgflags()
621 termios->c_cc[VMIN] = 1; in set_sgflags()
622 termios->c_cc[VTIME] = 0; in set_sgflags()
641 struct ktermios termios; in set_sgttyb() local
651 termios = tty->termios; in set_sgttyb()
652 termios.c_cc[VERASE] = tmp.sg_erase; in set_sgttyb()
653 termios.c_cc[VKILL] = tmp.sg_kill; in set_sgttyb()
654 set_sgflags(&termios, tmp.sg_flags); in set_sgttyb()
656 tty_termios_encode_baud_rate(&termios, termios.c_ispeed, in set_sgttyb()
657 termios.c_ospeed); in set_sgttyb()
659 tty_set_termios(tty, &termios); in set_sgttyb()
670 tmp.t_intrc = tty->termios.c_cc[VINTR]; in get_tchars()
671 tmp.t_quitc = tty->termios.c_cc[VQUIT]; in get_tchars()
672 tmp.t_startc = tty->termios.c_cc[VSTART]; in get_tchars()
673 tmp.t_stopc = tty->termios.c_cc[VSTOP]; in get_tchars()
674 tmp.t_eofc = tty->termios.c_cc[VEOF]; in get_tchars()
675 tmp.t_brkc = tty->termios.c_cc[VEOL2]; /* what is brkc anyway? */ in get_tchars()
687 tty->termios.c_cc[VINTR] = tmp.t_intrc; in set_tchars()
688 tty->termios.c_cc[VQUIT] = tmp.t_quitc; in set_tchars()
689 tty->termios.c_cc[VSTART] = tmp.t_startc; in set_tchars()
690 tty->termios.c_cc[VSTOP] = tmp.t_stopc; in set_tchars()
691 tty->termios.c_cc[VEOF] = tmp.t_eofc; in set_tchars()
692 tty->termios.c_cc[VEOL2] = tmp.t_brkc; /* what is brkc anyway? */ in set_tchars()
704 tmp.t_suspc = tty->termios.c_cc[VSUSP]; in get_ltchars()
706 tmp.t_dsuspc = tty->termios.c_cc[VSUSP]; in get_ltchars()
707 tmp.t_rprntc = tty->termios.c_cc[VREPRINT]; in get_ltchars()
709 tmp.t_flushc = tty->termios.c_cc[VEOL2]; in get_ltchars()
710 tmp.t_werasc = tty->termios.c_cc[VWERASE]; in get_ltchars()
711 tmp.t_lnextc = tty->termios.c_cc[VLNEXT]; in get_ltchars()
724 tty->termios.c_cc[VSUSP] = tmp.t_suspc; in set_ltchars()
726 tty->termios.c_cc[VEOL2] = tmp.t_dsuspc; in set_ltchars()
727 tty->termios.c_cc[VREPRINT] = tmp.t_rprntc; in set_ltchars()
729 tty->termios.c_cc[VEOL2] = tmp.t_flushc; in set_ltchars()
730 tty->termios.c_cc[VWERASE] = tmp.t_werasc; in set_ltchars()
731 tty->termios.c_cc[VLNEXT] = tmp.t_lnextc; in set_ltchars()
753 old = tty->termios; in tty_change_softcar()
754 tty->termios.c_cflag &= ~CLOCAL; in tty_change_softcar()
755 tty->termios.c_cflag |= bit; in tty_change_softcar()
817 if (kernel_termios_to_user_termios((struct termios __user *)arg, &kterm)) in tty_mode_ioctl()
823 if (kernel_termios_to_user_termios_1((struct termios __user *)arg, &kterm)) in tty_mode_ioctl()
849 if (kernel_termios_to_user_termios((struct termios __user *)arg, &kterm)) in tty_mode_ioctl()
857 (struct termios __user *) arg)) in tty_mode_ioctl()
866 if (kernel_termios_to_user_termios_1((struct termios __user *)arg, &kterm)) in tty_mode_ioctl()
874 (struct termios __user *) arg)) in tty_mode_ioctl()