aboutsummaryrefslogtreecommitdiffstats
path: root/net/irda
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2012-07-14 10:31:47 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-07-16 16:00:41 -0400
commitadc8d746caa67fff4b53ba3e5163a6cbacc3b523 (patch)
treee3f6c05f27c163b369ddd4da5f31d2a61bde6d3a /net/irda
parent6d31a88cb2e01d46c0cb74aa5da529e1f92ae3db (diff)
tty: move the termios object into the tty
This will let us sort out a whole pile of tty related races. The alternative would be to keep points and refcount the termios objects. However 1. They are tiny anyway 2. Many devices don't use the stored copies 3. We can remove a pty special case Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'net/irda')
-rw-r--r--net/irda/ircomm/ircomm_tty.c12
-rw-r--r--net/irda/ircomm/ircomm_tty_ioctl.c10
2 files changed, 11 insertions, 11 deletions
diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c
index 4e35b45c1c73..7a0d6115d06f 100644
--- a/net/irda/ircomm/ircomm_tty.c
+++ b/net/irda/ircomm/ircomm_tty.c
@@ -292,7 +292,7 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self,
292 return 0; 292 return 0;
293 } 293 }
294 294
295 if (tty->termios->c_cflag & CLOCAL) { 295 if (tty->termios.c_cflag & CLOCAL) {
296 IRDA_DEBUG(1, "%s(), doing CLOCAL!\n", __func__ ); 296 IRDA_DEBUG(1, "%s(), doing CLOCAL!\n", __func__ );
297 do_clocal = 1; 297 do_clocal = 1;
298 } 298 }
@@ -319,7 +319,7 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self,
319 port->blocked_open++; 319 port->blocked_open++;
320 320
321 while (1) { 321 while (1) {
322 if (tty->termios->c_cflag & CBAUD) 322 if (tty->termios.c_cflag & CBAUD)
323 tty_port_raise_dtr_rts(port); 323 tty_port_raise_dtr_rts(port);
324 324
325 current->state = TASK_INTERRUPTIBLE; 325 current->state = TASK_INTERRUPTIBLE;
@@ -421,8 +421,8 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp)
421 * 421 *
422 * Note this is completely usafe and doesn't work properly 422 * Note this is completely usafe and doesn't work properly
423 */ 423 */
424 tty->termios->c_iflag = 0; 424 tty->termios.c_iflag = 0;
425 tty->termios->c_oflag = 0; 425 tty->termios.c_oflag = 0;
426 426
427 /* Insert into hash */ 427 /* Insert into hash */
428 /* FIXME there is a window from find to here */ 428 /* FIXME there is a window from find to here */
@@ -842,7 +842,7 @@ static void ircomm_tty_throttle(struct tty_struct *tty)
842 ircomm_tty_send_xchar(tty, STOP_CHAR(tty)); 842 ircomm_tty_send_xchar(tty, STOP_CHAR(tty));
843 843
844 /* Hardware flow control? */ 844 /* Hardware flow control? */
845 if (tty->termios->c_cflag & CRTSCTS) { 845 if (tty->termios.c_cflag & CRTSCTS) {
846 self->settings.dte &= ~IRCOMM_RTS; 846 self->settings.dte &= ~IRCOMM_RTS;
847 self->settings.dte |= IRCOMM_DELTA_RTS; 847 self->settings.dte |= IRCOMM_DELTA_RTS;
848 848
@@ -874,7 +874,7 @@ static void ircomm_tty_unthrottle(struct tty_struct *tty)
874 } 874 }
875 875
876 /* Using hardware flow control? */ 876 /* Using hardware flow control? */
877 if (tty->termios->c_cflag & CRTSCTS) { 877 if (tty->termios.c_cflag & CRTSCTS) {
878 self->settings.dte |= (IRCOMM_RTS|IRCOMM_DELTA_RTS); 878 self->settings.dte |= (IRCOMM_RTS|IRCOMM_DELTA_RTS);
879 879
880 ircomm_param_request(self, IRCOMM_DTE, TRUE); 880 ircomm_param_request(self, IRCOMM_DTE, TRUE);
diff --git a/net/irda/ircomm/ircomm_tty_ioctl.c b/net/irda/ircomm/ircomm_tty_ioctl.c
index 0eab6500e99f..b343f50dc8d7 100644
--- a/net/irda/ircomm/ircomm_tty_ioctl.c
+++ b/net/irda/ircomm/ircomm_tty_ioctl.c
@@ -63,7 +63,7 @@ static void ircomm_tty_change_speed(struct ircomm_tty_cb *self,
63 if (!self->ircomm) 63 if (!self->ircomm)
64 return; 64 return;
65 65
66 cflag = tty->termios->c_cflag; 66 cflag = tty->termios.c_cflag;
67 67
68 /* byte size and parity */ 68 /* byte size and parity */
69 switch (cflag & CSIZE) { 69 switch (cflag & CSIZE) {
@@ -149,12 +149,12 @@ void ircomm_tty_set_termios(struct tty_struct *tty,
149 struct ktermios *old_termios) 149 struct ktermios *old_termios)
150{ 150{
151 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data; 151 struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) tty->driver_data;
152 unsigned int cflag = tty->termios->c_cflag; 152 unsigned int cflag = tty->termios.c_cflag;
153 153
154 IRDA_DEBUG(2, "%s()\n", __func__ ); 154 IRDA_DEBUG(2, "%s()\n", __func__ );
155 155
156 if ((cflag == old_termios->c_cflag) && 156 if ((cflag == old_termios->c_cflag) &&
157 (RELEVANT_IFLAG(tty->termios->c_iflag) == 157 (RELEVANT_IFLAG(tty->termios.c_iflag) ==
158 RELEVANT_IFLAG(old_termios->c_iflag))) 158 RELEVANT_IFLAG(old_termios->c_iflag)))
159 { 159 {
160 return; 160 return;
@@ -173,7 +173,7 @@ void ircomm_tty_set_termios(struct tty_struct *tty,
173 if (!(old_termios->c_cflag & CBAUD) && 173 if (!(old_termios->c_cflag & CBAUD) &&
174 (cflag & CBAUD)) { 174 (cflag & CBAUD)) {
175 self->settings.dte |= IRCOMM_DTR; 175 self->settings.dte |= IRCOMM_DTR;
176 if (!(tty->termios->c_cflag & CRTSCTS) || 176 if (!(tty->termios.c_cflag & CRTSCTS) ||
177 !test_bit(TTY_THROTTLED, &tty->flags)) { 177 !test_bit(TTY_THROTTLED, &tty->flags)) {
178 self->settings.dte |= IRCOMM_RTS; 178 self->settings.dte |= IRCOMM_RTS;
179 } 179 }
@@ -182,7 +182,7 @@ void ircomm_tty_set_termios(struct tty_struct *tty,
182 182
183 /* Handle turning off CRTSCTS */ 183 /* Handle turning off CRTSCTS */
184 if ((old_termios->c_cflag & CRTSCTS) && 184 if ((old_termios->c_cflag & CRTSCTS) &&
185 !(tty->termios->c_cflag & CRTSCTS)) 185 !(tty->termios.c_cflag & CRTSCTS))
186 { 186 {
187 tty->hw_stopped = 0; 187 tty->hw_stopped = 0;
188 ircomm_tty_start(tty); 188 ircomm_tty_start(tty);