cp210x.c (f61309d9c96a308465bec9d2e5206da265b075a0) | cp210x.c (03f32d7cb51b62f6cc7fd884d6978fe1a6ad3f8d) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Silicon Laboratories CP210x USB to RS232 serial adaptor driver 4 * 5 * Copyright (C) 2005 Craig Shelley (craig@microtron.org.uk) 6 * 7 * Support to set flow control line levels using TIOCMGET and TIOCMSET 8 * thanks to Karl Hiramoto karl@hiramoto.org. RTSCTS hardware flow --- 1099 unchanged lines hidden (view full) --- 1108 return result; 1109 } 1110 1111 return 0; 1112} 1113 1114static bool cp210x_termios_change(const struct ktermios *a, const struct ktermios *b) 1115{ | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Silicon Laboratories CP210x USB to RS232 serial adaptor driver 4 * 5 * Copyright (C) 2005 Craig Shelley (craig@microtron.org.uk) 6 * 7 * Support to set flow control line levels using TIOCMGET and TIOCMSET 8 * thanks to Karl Hiramoto karl@hiramoto.org. RTSCTS hardware flow --- 1099 unchanged lines hidden (view full) --- 1108 return result; 1109 } 1110 1111 return 0; 1112} 1113 1114static bool cp210x_termios_change(const struct ktermios *a, const struct ktermios *b) 1115{ |
1116 bool iflag_change; | 1116 bool iflag_change, cc_change; |
1117 1118 iflag_change = ((a->c_iflag ^ b->c_iflag) & (INPCK | IXON | IXOFF)); | 1117 1118 iflag_change = ((a->c_iflag ^ b->c_iflag) & (INPCK | IXON | IXOFF)); |
1119 cc_change = a->c_cc[VSTART] != b->c_cc[VSTART] || 1120 a->c_cc[VSTOP] != b->c_cc[VSTOP]; |
|
1119 | 1121 |
1120 return tty_termios_hw_change(a, b) || iflag_change; | 1122 return tty_termios_hw_change(a, b) || iflag_change || cc_change; |
1121} 1122 1123static void cp210x_set_flow_control(struct tty_struct *tty, 1124 struct usb_serial_port *port, struct ktermios *old_termios) 1125{ 1126 struct cp210x_special_chars chars; 1127 struct cp210x_flow_ctl flow_ctl; 1128 u32 flow_repl; 1129 u32 ctl_hs; 1130 int ret; 1131 1132 if (old_termios && 1133 C_CRTSCTS(tty) == (old_termios->c_cflag & CRTSCTS) && 1134 I_IXON(tty) == (old_termios->c_iflag & IXON) && | 1123} 1124 1125static void cp210x_set_flow_control(struct tty_struct *tty, 1126 struct usb_serial_port *port, struct ktermios *old_termios) 1127{ 1128 struct cp210x_special_chars chars; 1129 struct cp210x_flow_ctl flow_ctl; 1130 u32 flow_repl; 1131 u32 ctl_hs; 1132 int ret; 1133 1134 if (old_termios && 1135 C_CRTSCTS(tty) == (old_termios->c_cflag & CRTSCTS) && 1136 I_IXON(tty) == (old_termios->c_iflag & IXON) && |
1135 I_IXOFF(tty) == (old_termios->c_iflag & IXOFF)) { | 1137 I_IXOFF(tty) == (old_termios->c_iflag & IXOFF) && 1138 START_CHAR(tty) == old_termios->c_cc[VSTART] && 1139 STOP_CHAR(tty) == old_termios->c_cc[VSTOP]) { |
1136 return; 1137 } 1138 1139 if (I_IXON(tty) || I_IXOFF(tty)) { 1140 memset(&chars, 0, sizeof(chars)); 1141 1142 chars.bXonChar = START_CHAR(tty); 1143 chars.bXoffChar = STOP_CHAR(tty); --- 745 unchanged lines hidden --- | 1140 return; 1141 } 1142 1143 if (I_IXON(tty) || I_IXOFF(tty)) { 1144 memset(&chars, 0, sizeof(chars)); 1145 1146 chars.bXonChar = START_CHAR(tty); 1147 chars.bXoffChar = STOP_CHAR(tty); --- 745 unchanged lines hidden --- |