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
58 speed_t tty_termios_baud_rate(const struct ktermios *termios)
62 cbaud = termios->c_cflag & CBAUD;
66 return termios->c_ospeed;
78 * @termios: termios structure
80 * Convert termios baud rate data into a speed. This should be called
81 * with the termios lock held if this termios is a terminal termios
88 speed_t tty_termios_input_baud_rate(const struct ktermios *termios)
90 unsigned int cbaud = (termios->c_cflag >> IBSHIFT) & CBAUD;
93 return tty_termios_baud_rate(termios);
97 return termios->c_ispeed;
109 * @termios: ktermios structure holding user requested state
113 * Encode the speeds set into the passed termios structure. This is
122 * Locking: Caller should hold termios lock. This is already held
123 * when calling this function from the driver termios handler.
129 void tty_termios_encode_baud_rate(struct ktermios *termios,
140 termios->c_ispeed = ibaud;
141 termios->c_ospeed = obaud;
143 if (((termios->c_cflag >> IBSHIFT) & CBAUD) != B0)
151 if ((termios->c_cflag & CBAUD) == BOTHER) {
156 if (((termios->c_cflag >> IBSHIFT) & CBAUD) == BOTHER)
159 termios->c_cflag &= ~CBAUD;
160 termios->c_cflag &= ~(CBAUD << IBSHIFT);
172 termios->c_cflag |= baud_bits[i];
184 termios->c_cflag |= (baud_bits[i] << IBSHIFT);
191 termios->c_cflag |= BOTHER;
196 termios->c_cflag |= (BOTHER << IBSHIFT);
206 * Update the current termios data for the tty with the new speed
213 tty_termios_encode_baud_rate(&tty->termios, ibaud, obaud);