Lines Matching refs:termios
208 struct ktermios *termios = &tty->termios; in unset_locked_termios() local
214 NOSET_MASK(termios->c_iflag, old->c_iflag, locked->c_iflag); in unset_locked_termios()
215 NOSET_MASK(termios->c_oflag, old->c_oflag, locked->c_oflag); in unset_locked_termios()
216 NOSET_MASK(termios->c_cflag, old->c_cflag, locked->c_cflag); in unset_locked_termios()
217 NOSET_MASK(termios->c_lflag, old->c_lflag, locked->c_lflag); in unset_locked_termios()
218 termios->c_line = locked->c_line ? old->c_line : termios->c_line; in unset_locked_termios()
220 termios->c_cc[i] = locked->c_cc[i] ? in unset_locked_termios()
221 old->c_cc[i] : termios->c_cc[i]; in unset_locked_termios()
338 old_termios = tty->termios; in tty_set_termios()
339 tty->termios = *new_termios; in tty_set_termios()
342 tty->termios.c_cflag ^= (tty->termios.c_cflag ^ old_termios.c_cflag) & ADDRB; in tty_set_termios()
347 tty_termios_copy_hw(&tty->termios, &old_termios); in tty_set_termios()
364 __weak int user_termio_to_kernel_termios(struct ktermios *termios, in user_termio_to_kernel_termios() argument
372 termios->c_iflag = (0xffff0000 & termios->c_iflag) | v.c_iflag; in user_termio_to_kernel_termios()
373 termios->c_oflag = (0xffff0000 & termios->c_oflag) | v.c_oflag; in user_termio_to_kernel_termios()
374 termios->c_cflag = (0xffff0000 & termios->c_cflag) | v.c_cflag; in user_termio_to_kernel_termios()
375 termios->c_lflag = (0xffff0000 & termios->c_lflag) | v.c_lflag; in user_termio_to_kernel_termios()
376 termios->c_line = (0xffff0000 & termios->c_lflag) | v.c_line; in user_termio_to_kernel_termios()
377 memcpy(termios->c_cc, v.c_cc, NCC); in user_termio_to_kernel_termios()
385 struct ktermios *termios) in kernel_termios_to_user_termio() argument
389 v.c_iflag = termios->c_iflag; in kernel_termios_to_user_termio()
390 v.c_oflag = termios->c_oflag; in kernel_termios_to_user_termio()
391 v.c_cflag = termios->c_cflag; in kernel_termios_to_user_termio()
392 v.c_lflag = termios->c_lflag; in kernel_termios_to_user_termio()
393 v.c_line = termios->c_line; in kernel_termios_to_user_termio()
394 memcpy(v.c_cc, termios->c_cc, NCC); in kernel_termios_to_user_termio()
410 struct termios __user *u) in user_termios_to_kernel_termios_1()
412 return copy_from_user(k, u, sizeof(struct termios)); in user_termios_to_kernel_termios_1()
414 __weak int kernel_termios_to_user_termios_1(struct termios __user *u, in kernel_termios_to_user_termios_1()
417 return copy_to_user(u, k, sizeof(struct termios)); in kernel_termios_to_user_termios_1()
423 struct termios __user *u) in user_termios_to_kernel_termios()
425 return copy_from_user(k, u, sizeof(struct termios)); in user_termios_to_kernel_termios()
427 __weak int kernel_termios_to_user_termios(struct termios __user *u, in kernel_termios_to_user_termios()
430 return copy_to_user(u, k, sizeof(struct termios)); in kernel_termios_to_user_termios()
458 tmp_termios = tty->termios; in set_termios()
468 (struct termios __user *)arg)) in set_termios()
477 (struct termios __user *)arg))
533 *kterm = tty->termios; in copy_termios()
582 tmp.sg_ispeed = tty->termios.c_ispeed; in get_sgttyb()
583 tmp.sg_ospeed = tty->termios.c_ospeed; in get_sgttyb()
584 tmp.sg_erase = tty->termios.c_cc[VERASE]; in get_sgttyb()
585 tmp.sg_kill = tty->termios.c_cc[VKILL]; in get_sgttyb()
592 static void set_sgflags(struct ktermios *termios, int flags) in set_sgflags() argument
594 termios->c_iflag = ICRNL | IXON; in set_sgflags()
595 termios->c_oflag = 0; in set_sgflags()
596 termios->c_lflag = ISIG | ICANON; in set_sgflags()
598 termios->c_iflag = 0; in set_sgflags()
599 termios->c_lflag &= ~ICANON; in set_sgflags()
602 termios->c_lflag |= ECHO | ECHOE | ECHOK | in set_sgflags()
606 termios->c_oflag |= OPOST | ONLCR; in set_sgflags()
609 termios->c_iflag = 0; in set_sgflags()
610 termios->c_lflag &= ~(ISIG | ICANON); in set_sgflags()
612 if (!(termios->c_lflag & ICANON)) { in set_sgflags()
613 termios->c_cc[VMIN] = 1; in set_sgflags()
614 termios->c_cc[VTIME] = 0; in set_sgflags()
633 struct ktermios termios; in set_sgttyb() local
643 termios = tty->termios; in set_sgttyb()
644 termios.c_cc[VERASE] = tmp.sg_erase; in set_sgttyb()
645 termios.c_cc[VKILL] = tmp.sg_kill; in set_sgttyb()
646 set_sgflags(&termios, tmp.sg_flags); in set_sgttyb()
648 tty_termios_encode_baud_rate(&termios, termios.c_ispeed, in set_sgttyb()
649 termios.c_ospeed); in set_sgttyb()
651 tty_set_termios(tty, &termios); in set_sgttyb()
662 tmp.t_intrc = tty->termios.c_cc[VINTR]; in get_tchars()
663 tmp.t_quitc = tty->termios.c_cc[VQUIT]; in get_tchars()
664 tmp.t_startc = tty->termios.c_cc[VSTART]; in get_tchars()
665 tmp.t_stopc = tty->termios.c_cc[VSTOP]; in get_tchars()
666 tmp.t_eofc = tty->termios.c_cc[VEOF]; in get_tchars()
667 tmp.t_brkc = tty->termios.c_cc[VEOL2]; /* what is brkc anyway? */ in get_tchars()
679 tty->termios.c_cc[VINTR] = tmp.t_intrc; in set_tchars()
680 tty->termios.c_cc[VQUIT] = tmp.t_quitc; in set_tchars()
681 tty->termios.c_cc[VSTART] = tmp.t_startc; in set_tchars()
682 tty->termios.c_cc[VSTOP] = tmp.t_stopc; in set_tchars()
683 tty->termios.c_cc[VEOF] = tmp.t_eofc; in set_tchars()
684 tty->termios.c_cc[VEOL2] = tmp.t_brkc; /* what is brkc anyway? */ in set_tchars()
696 tmp.t_suspc = tty->termios.c_cc[VSUSP]; in get_ltchars()
698 tmp.t_dsuspc = tty->termios.c_cc[VSUSP]; in get_ltchars()
699 tmp.t_rprntc = tty->termios.c_cc[VREPRINT]; in get_ltchars()
701 tmp.t_flushc = tty->termios.c_cc[VEOL2]; in get_ltchars()
702 tmp.t_werasc = tty->termios.c_cc[VWERASE]; in get_ltchars()
703 tmp.t_lnextc = tty->termios.c_cc[VLNEXT]; in get_ltchars()
716 tty->termios.c_cc[VSUSP] = tmp.t_suspc; in set_ltchars()
718 tty->termios.c_cc[VEOL2] = tmp.t_dsuspc; in set_ltchars()
719 tty->termios.c_cc[VREPRINT] = tmp.t_rprntc; in set_ltchars()
721 tty->termios.c_cc[VEOL2] = tmp.t_flushc; in set_ltchars()
722 tty->termios.c_cc[VWERASE] = tmp.t_werasc; in set_ltchars()
723 tty->termios.c_cc[VLNEXT] = tmp.t_lnextc; in set_ltchars()
748 old = tty->termios; in tty_change_softcar()
749 tty->termios.c_cflag &= ~CLOCAL; in tty_change_softcar()
750 tty->termios.c_cflag |= bit; in tty_change_softcar()
811 if (kernel_termios_to_user_termios((struct termios __user *)arg, &kterm)) in tty_mode_ioctl()
817 if (kernel_termios_to_user_termios_1((struct termios __user *)arg, &kterm)) in tty_mode_ioctl()
843 if (kernel_termios_to_user_termios((struct termios __user *)arg, &kterm)) in tty_mode_ioctl()
851 (struct termios __user *) arg)) in tty_mode_ioctl()
860 if (kernel_termios_to_user_termios_1((struct termios __user *)arg, &kterm)) in tty_mode_ioctl()
868 (struct termios __user *) arg)) in tty_mode_ioctl()