Lines Matching refs:termios

12 #include <linux/termios.h>
34 * Internal flag options for termios setting behavior
96 * its own termios data at this point when implementing software flow control.
208 struct ktermios *termios = &tty->termios;
214 NOSET_MASK(termios->c_iflag, old->c_iflag, locked->c_iflag);
215 NOSET_MASK(termios->c_oflag, old->c_oflag, locked->c_oflag);
216 NOSET_MASK(termios->c_cflag, old->c_cflag, locked->c_cflag);
217 NOSET_MASK(termios->c_lflag, old->c_lflag, locked->c_lflag);
218 termios->c_line = locked->c_line ? old->c_line : termios->c_line;
220 termios->c_cc[i] = locked->c_cc[i] ?
221 old->c_cc[i] : termios->c_cc[i];
227 * @new: new termios
228 * @old: old termios
230 * Propagate the hardware specific terminal setting bits from the @old termios
248 * @a: termios
249 * @b: termios to compare
252 * two termios structures, or a speed change is needed.
268 * @cflag: termios cflag value
290 * @cflag: termios cflag value
314 * tty_set_termios - update termios values
318 * Perform updates to the termios values set on this @tty. A master pty's
319 * termios should never be set.
331 * Perform the actual termios internal changes under lock.
338 old_termios = tty->termios;
339 tty->termios = *new_termios;
342 tty->termios.c_cflag ^= (tty->termios.c_cflag ^ old_termios.c_cflag) & ADDRB;
347 tty_termios_copy_hw(&tty->termios, &old_termios);
362 * Translate a "termio" structure into a "termios". Ugh.
364 __weak int user_termio_to_kernel_termios(struct ktermios *termios,
372 termios->c_iflag = (0xffff0000 & termios->c_iflag) | v.c_iflag;
373 termios->c_oflag = (0xffff0000 & termios->c_oflag) | v.c_oflag;
374 termios->c_cflag = (0xffff0000 & termios->c_cflag) | v.c_cflag;
375 termios->c_lflag = (0xffff0000 & termios->c_lflag) | v.c_lflag;
376 termios->c_line = (0xffff0000 & termios->c_lflag) | v.c_line;
377 memcpy(termios->c_cc, v.c_cc, NCC);
382 * Translate a "termios" structure into a "termio". Ugh.
385 struct ktermios *termios)
389 v.c_iflag = termios->c_iflag;
390 v.c_oflag = termios->c_oflag;
391 v.c_cflag = termios->c_cflag;
392 v.c_lflag = termios->c_lflag;
393 v.c_line = termios->c_line;
394 memcpy(v.c_cc, termios->c_cc, NCC);
410 struct termios __user *u)
412 return copy_from_user(k, u, sizeof(struct termios));
414 __weak int kernel_termios_to_user_termios_1(struct termios __user *u,
417 return copy_to_user(u, k, sizeof(struct termios));
423 struct termios __user *u)
425 return copy_from_user(k, u, sizeof(struct termios));
427 __weak int kernel_termios_to_user_termios(struct termios __user *u,
430 return copy_to_user(u, k, sizeof(struct termios));
435 * set_termios - set termios values for a tty
440 * Helper function to prepare termios data and run necessary other functions
458 tmp_termios = tty->termios;
468 (struct termios __user *)arg))
477 (struct termios __user *)arg))
523 /* FIXME: Arguably if tmp_termios == tty->termios AND the
524 actual requested termios was not tmp_termios then we may
533 *kterm = tty->termios;
582 tmp.sg_ispeed = tty->termios.c_ispeed;
583 tmp.sg_ospeed = tty->termios.c_ospeed;
584 tmp.sg_erase = tty->termios.c_cc[VERASE];
585 tmp.sg_kill = tty->termios.c_cc[VKILL];
592 static void set_sgflags(struct ktermios *termios, int flags)
594 termios->c_iflag = ICRNL | IXON;
595 termios->c_oflag = 0;
596 termios->c_lflag = ISIG | ICANON;
598 termios->c_iflag = 0;
599 termios->c_lflag &= ~ICANON;
602 termios->c_lflag |= ECHO | ECHOE | ECHOK |
606 termios->c_oflag |= OPOST | ONLCR;
609 termios->c_iflag = 0;
610 termios->c_lflag &= ~(ISIG | ICANON);
612 if (!(termios->c_lflag & ICANON)) {
613 termios->c_cc[VMIN] = 1;
614 termios->c_cc[VTIME] = 0;
633 struct ktermios termios;
643 termios = tty->termios;
644 termios.c_cc[VERASE] = tmp.sg_erase;
645 termios.c_cc[VKILL] = tmp.sg_kill;
646 set_sgflags(&termios, tmp.sg_flags);
648 tty_termios_encode_baud_rate(&termios, termios.c_ispeed,
649 termios.c_ospeed);
651 tty_set_termios(tty, &termios);
662 tmp.t_intrc = tty->termios.c_cc[VINTR];
663 tmp.t_quitc = tty->termios.c_cc[VQUIT];
664 tmp.t_startc = tty->termios.c_cc[VSTART];
665 tmp.t_stopc = tty->termios.c_cc[VSTOP];
666 tmp.t_eofc = tty->termios.c_cc[VEOF];
667 tmp.t_brkc = tty->termios.c_cc[VEOL2]; /* what is brkc anyway? */
679 tty->termios.c_cc[VINTR] = tmp.t_intrc;
680 tty->termios.c_cc[VQUIT] = tmp.t_quitc;
681 tty->termios.c_cc[VSTART] = tmp.t_startc;
682 tty->termios.c_cc[VSTOP] = tmp.t_stopc;
683 tty->termios.c_cc[VEOF] = tmp.t_eofc;
684 tty->termios.c_cc[VEOL2] = tmp.t_brkc; /* what is brkc anyway? */
696 tmp.t_suspc = tty->termios.c_cc[VSUSP];
698 tmp.t_dsuspc = tty->termios.c_cc[VSUSP];
699 tmp.t_rprntc = tty->termios.c_cc[VREPRINT];
701 tmp.t_flushc = tty->termios.c_cc[VEOL2];
702 tmp.t_werasc = tty->termios.c_cc[VWERASE];
703 tmp.t_lnextc = tty->termios.c_cc[VLNEXT];
716 tty->termios.c_cc[VSUSP] = tmp.t_suspc;
718 tty->termios.c_cc[VEOL2] = tmp.t_dsuspc;
719 tty->termios.c_cc[VREPRINT] = tmp.t_rprntc;
721 tty->termios.c_cc[VEOL2] = tmp.t_flushc;
722 tty->termios.c_cc[VWERASE] = tmp.t_werasc;
723 tty->termios.c_cc[VLNEXT] = tmp.t_lnextc;
748 old = tty->termios;
749 tty->termios.c_cflag &= ~CLOCAL;
750 tty->termios.c_cflag |= bit;
811 if (kernel_termios_to_user_termios((struct termios __user *)arg, &kterm))
817 if (kernel_termios_to_user_termios_1((struct termios __user *)arg, &kterm))
843 if (kernel_termios_to_user_termios((struct termios __user *)arg, &kterm))
851 (struct termios __user *) arg))
860 if (kernel_termios_to_user_termios_1((struct termios __user *)arg, &kterm))
868 (struct termios __user *) arg))