Lines Matching refs:termios

8 #include <linux/termios.h>
48 * @termios: termios structure
50 * Convert termios baud rate data into a speed. This should be called
51 * with the termios lock held if this termios is a terminal termios
52 * structure. May change the termios data. Device drivers can call this
58 speed_t tty_termios_baud_rate(struct ktermios *termios)
62 cbaud = termios->c_cflag & CBAUD;
67 return termios->c_ospeed;
73 termios->c_cflag &= ~CBAUDEX;
83 * @termios: termios structure
85 * Convert termios baud rate data into a speed. This should be called
86 * with the termios lock held if this termios is a terminal termios
87 * structure. May change the termios data. Device drivers can call this
93 speed_t tty_termios_input_baud_rate(struct ktermios *termios)
96 unsigned int cbaud = (termios->c_cflag >> IBSHIFT) & CBAUD;
99 return tty_termios_baud_rate(termios);
103 return termios->c_ispeed;
109 termios->c_cflag &= ~(CBAUDEX << IBSHIFT);
115 return tty_termios_baud_rate(termios);
122 * @termios: ktermios structure holding user requested state
126 * Encode the speeds set into the passed termios structure. This is
135 * Locking: Caller should hold termios lock. This is already held
136 * when calling this function from the driver termios handler.
142 void tty_termios_encode_baud_rate(struct ktermios *termios,
153 termios->c_ispeed = ibaud;
154 termios->c_ospeed = obaud;
157 if ((termios->c_cflag >> IBSHIFT) & CBAUD)
165 if ((termios->c_cflag & CBAUD) == BOTHER) {
170 if (((termios->c_cflag >> IBSHIFT) & CBAUD) == BOTHER)
173 termios->c_cflag &= ~CBAUD;
175 termios->c_cflag &= ~(CBAUD << IBSHIFT);
188 termios->c_cflag |= baud_bits[i];
200 termios->c_cflag |= (baud_bits[i] << IBSHIFT);
212 termios->c_cflag |= BOTHER;
216 termios->c_cflag |= (BOTHER << IBSHIFT);
229 * Update the current termios data for the tty with the new speed
236 tty_termios_encode_baud_rate(&tty->termios, ibaud, obaud);