aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/char/pcmcia/synclink_cs.c2
-rw-r--r--drivers/tty/amiserial.c2
-rw-r--r--drivers/tty/cyclades.c2
-rw-r--r--drivers/tty/isicom.c2
-rw-r--r--drivers/tty/mxser.c2
-rw-r--r--drivers/tty/serial/mxs-auart.c2
-rw-r--r--drivers/tty/serial/serial_core.c4
-rw-r--r--drivers/tty/synclink.c2
-rw-r--r--drivers/tty/synclink_gt.c2
-rw-r--r--drivers/tty/synclinkmp.c2
-rw-r--r--include/linux/tty.h6
-rw-r--r--net/irda/ircomm/ircomm_tty.c4
-rw-r--r--net/irda/ircomm/ircomm_tty_attach.c2
13 files changed, 20 insertions, 14 deletions
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c
index 5db08c78beb5..3f57d5de3957 100644
--- a/drivers/char/pcmcia/synclink_cs.c
+++ b/drivers/char/pcmcia/synclink_cs.c
@@ -1050,7 +1050,7 @@ static void cts_change(MGSLPC_INFO *info, struct tty_struct *tty)
1050 wake_up_interruptible(&info->status_event_wait_q); 1050 wake_up_interruptible(&info->status_event_wait_q);
1051 wake_up_interruptible(&info->event_wait_q); 1051 wake_up_interruptible(&info->event_wait_q);
1052 1052
1053 if (info->port.flags & ASYNC_CTS_FLOW) { 1053 if (tty_port_cts_enabled(&info->port)) {
1054 if (tty->hw_stopped) { 1054 if (tty->hw_stopped) {
1055 if (info->serial_signals & SerialSignal_CTS) { 1055 if (info->serial_signals & SerialSignal_CTS) {
1056 if (debug_level >= DEBUG_LEVEL_ISR) 1056 if (debug_level >= DEBUG_LEVEL_ISR)
diff --git a/drivers/tty/amiserial.c b/drivers/tty/amiserial.c
index 2b7535d42e05..42d0a2581a87 100644
--- a/drivers/tty/amiserial.c
+++ b/drivers/tty/amiserial.c
@@ -420,7 +420,7 @@ static void check_modem_status(struct serial_state *info)
420 tty_hangup(port->tty); 420 tty_hangup(port->tty);
421 } 421 }
422 } 422 }
423 if (port->flags & ASYNC_CTS_FLOW) { 423 if (tty_port_cts_enabled(port)) {
424 if (port->tty->hw_stopped) { 424 if (port->tty->hw_stopped) {
425 if (!(status & SER_CTS)) { 425 if (!(status & SER_CTS)) {
426#if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW)) 426#if (defined(SERIAL_DEBUG_INTR) || defined(SERIAL_DEBUG_FLOW))
diff --git a/drivers/tty/cyclades.c b/drivers/tty/cyclades.c
index e3954dae5064..0a6a0bc1b598 100644
--- a/drivers/tty/cyclades.c
+++ b/drivers/tty/cyclades.c
@@ -727,7 +727,7 @@ static void cyy_chip_modem(struct cyclades_card *cinfo, int chip,
727 else 727 else
728 tty_hangup(tty); 728 tty_hangup(tty);
729 } 729 }
730 if ((mdm_change & CyCTS) && (info->port.flags & ASYNC_CTS_FLOW)) { 730 if ((mdm_change & CyCTS) && tty_port_cts_enabled(&info->port)) {
731 if (tty->hw_stopped) { 731 if (tty->hw_stopped) {
732 if (mdm_status & CyCTS) { 732 if (mdm_status & CyCTS) {
733 /* cy_start isn't used 733 /* cy_start isn't used
diff --git a/drivers/tty/isicom.c b/drivers/tty/isicom.c
index 99cf22e5f2b6..d7492e183607 100644
--- a/drivers/tty/isicom.c
+++ b/drivers/tty/isicom.c
@@ -600,7 +600,7 @@ static irqreturn_t isicom_interrupt(int irq, void *dev_id)
600 port->status &= ~ISI_DCD; 600 port->status &= ~ISI_DCD;
601 } 601 }
602 602
603 if (port->port.flags & ASYNC_CTS_FLOW) { 603 if (tty_port_cts_enabled(&port->port)) {
604 if (tty->hw_stopped) { 604 if (tty->hw_stopped) {
605 if (header & ISI_CTS) { 605 if (header & ISI_CTS) {
606 port->port.tty->hw_stopped = 0; 606 port->port.tty->hw_stopped = 0;
diff --git a/drivers/tty/mxser.c b/drivers/tty/mxser.c
index bb2da4ca8257..cfda47dabd28 100644
--- a/drivers/tty/mxser.c
+++ b/drivers/tty/mxser.c
@@ -830,7 +830,7 @@ static void mxser_check_modem_status(struct tty_struct *tty,
830 wake_up_interruptible(&port->port.open_wait); 830 wake_up_interruptible(&port->port.open_wait);
831 } 831 }
832 832
833 if (port->port.flags & ASYNC_CTS_FLOW) { 833 if (tty_port_cts_enabled(&port->port)) {
834 if (tty->hw_stopped) { 834 if (tty->hw_stopped) {
835 if (status & UART_MSR_CTS) { 835 if (status & UART_MSR_CTS) {
836 tty->hw_stopped = 0; 836 tty->hw_stopped = 0;
diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs-auart.c
index 3a667eed63d6..dafeef2bfb49 100644
--- a/drivers/tty/serial/mxs-auart.c
+++ b/drivers/tty/serial/mxs-auart.c
@@ -262,7 +262,7 @@ static void mxs_auart_set_mctrl(struct uart_port *u, unsigned mctrl)
262 262
263 ctrl &= ~AUART_CTRL2_RTSEN; 263 ctrl &= ~AUART_CTRL2_RTSEN;
264 if (mctrl & TIOCM_RTS) { 264 if (mctrl & TIOCM_RTS) {
265 if (u->state->port.flags & ASYNC_CTS_FLOW) 265 if (tty_port_cts_enabled(&u->state->port))
266 ctrl |= AUART_CTRL2_RTSEN; 266 ctrl |= AUART_CTRL2_RTSEN;
267 } 267 }
268 268
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index bb5f23603836..137b25ce39a7 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -176,7 +176,7 @@ static int uart_port_startup(struct tty_struct *tty, struct uart_state *state,
176 uart_set_mctrl(uport, TIOCM_RTS | TIOCM_DTR); 176 uart_set_mctrl(uport, TIOCM_RTS | TIOCM_DTR);
177 } 177 }
178 178
179 if (port->flags & ASYNC_CTS_FLOW) { 179 if (tty_port_cts_enabled(port)) {
180 spin_lock_irq(&uport->lock); 180 spin_lock_irq(&uport->lock);
181 if (!(uport->ops->get_mctrl(uport) & TIOCM_CTS)) 181 if (!(uport->ops->get_mctrl(uport) & TIOCM_CTS))
182 tty->hw_stopped = 1; 182 tty->hw_stopped = 1;
@@ -2509,7 +2509,7 @@ void uart_handle_cts_change(struct uart_port *uport, unsigned int status)
2509 2509
2510 uport->icount.cts++; 2510 uport->icount.cts++;
2511 2511
2512 if (port->flags & ASYNC_CTS_FLOW) { 2512 if (tty_port_cts_enabled(port)) {
2513 if (tty->hw_stopped) { 2513 if (tty->hw_stopped) {
2514 if (status) { 2514 if (status) {
2515 tty->hw_stopped = 0; 2515 tty->hw_stopped = 0;
diff --git a/drivers/tty/synclink.c b/drivers/tty/synclink.c
index 666aa1455fc7..70e3a525bc82 100644
--- a/drivers/tty/synclink.c
+++ b/drivers/tty/synclink.c
@@ -1359,7 +1359,7 @@ static void mgsl_isr_io_pin( struct mgsl_struct *info )
1359 } 1359 }
1360 } 1360 }
1361 1361
1362 if ( (info->port.flags & ASYNC_CTS_FLOW) && 1362 if (tty_port_cts_enabled(&info->port) &&
1363 (status & MISCSTATUS_CTS_LATCHED) ) { 1363 (status & MISCSTATUS_CTS_LATCHED) ) {
1364 if (info->port.tty->hw_stopped) { 1364 if (info->port.tty->hw_stopped) {
1365 if (status & MISCSTATUS_CTS) { 1365 if (status & MISCSTATUS_CTS) {
diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c
index 45f6136f4e51..b38e954eedd3 100644
--- a/drivers/tty/synclink_gt.c
+++ b/drivers/tty/synclink_gt.c
@@ -2053,7 +2053,7 @@ static void cts_change(struct slgt_info *info, unsigned short status)
2053 wake_up_interruptible(&info->event_wait_q); 2053 wake_up_interruptible(&info->event_wait_q);
2054 info->pending_bh |= BH_STATUS; 2054 info->pending_bh |= BH_STATUS;
2055 2055
2056 if (info->port.flags & ASYNC_CTS_FLOW) { 2056 if (tty_port_cts_enabled(&info->port)) {
2057 if (info->port.tty) { 2057 if (info->port.tty) {
2058 if (info->port.tty->hw_stopped) { 2058 if (info->port.tty->hw_stopped) {
2059 if (info->signals & SerialSignal_CTS) { 2059 if (info->signals & SerialSignal_CTS) {
diff --git a/drivers/tty/synclinkmp.c b/drivers/tty/synclinkmp.c
index 53429c890a89..f17d9f3d84a2 100644
--- a/drivers/tty/synclinkmp.c
+++ b/drivers/tty/synclinkmp.c
@@ -2500,7 +2500,7 @@ static void isr_io_pin( SLMP_INFO *info, u16 status )
2500 } 2500 }
2501 } 2501 }
2502 2502
2503 if ( (info->port.flags & ASYNC_CTS_FLOW) && 2503 if (tty_port_cts_enabled(&info->port) &&
2504 (status & MISCSTATUS_CTS_LATCHED) ) { 2504 (status & MISCSTATUS_CTS_LATCHED) ) {
2505 if ( info->port.tty ) { 2505 if ( info->port.tty ) {
2506 if (info->port.tty->hw_stopped) { 2506 if (info->port.tty->hw_stopped) {
diff --git a/include/linux/tty.h b/include/linux/tty.h
index dbebd1e56bc1..9892121354cd 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -514,6 +514,12 @@ static inline struct tty_port *tty_port_get(struct tty_port *port)
514 return port; 514 return port;
515} 515}
516 516
517/* If the cts flow control is enabled, return true. */
518static inline bool tty_port_cts_enabled(struct tty_port *port)
519{
520 return port->flags & ASYNC_CTS_FLOW;
521}
522
517extern struct tty_struct *tty_port_tty_get(struct tty_port *port); 523extern struct tty_struct *tty_port_tty_get(struct tty_port *port);
518extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty); 524extern void tty_port_tty_set(struct tty_port *port, struct tty_struct *tty);
519extern int tty_port_carrier_raised(struct tty_port *port); 525extern int tty_port_carrier_raised(struct tty_port *port);
diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c
index 96689906b93c..95a3a7a336ba 100644
--- a/net/irda/ircomm/ircomm_tty.c
+++ b/net/irda/ircomm/ircomm_tty.c
@@ -1070,7 +1070,7 @@ void ircomm_tty_check_modem_status(struct ircomm_tty_cb *self)
1070 goto put; 1070 goto put;
1071 } 1071 }
1072 } 1072 }
1073 if (tty && self->port.flags & ASYNC_CTS_FLOW) { 1073 if (tty && tty_port_cts_enabled(&self->port)) {
1074 if (tty->hw_stopped) { 1074 if (tty->hw_stopped) {
1075 if (status & IRCOMM_CTS) { 1075 if (status & IRCOMM_CTS) {
1076 IRDA_DEBUG(2, 1076 IRDA_DEBUG(2,
@@ -1313,7 +1313,7 @@ static void ircomm_tty_line_info(struct ircomm_tty_cb *self, struct seq_file *m)
1313 1313
1314 seq_puts(m, "Flags:"); 1314 seq_puts(m, "Flags:");
1315 sep = ' '; 1315 sep = ' ';
1316 if (self->port.flags & ASYNC_CTS_FLOW) { 1316 if (tty_port_cts_enabled(&self->port)) {
1317 seq_printf(m, "%cASYNC_CTS_FLOW", sep); 1317 seq_printf(m, "%cASYNC_CTS_FLOW", sep);
1318 sep = '|'; 1318 sep = '|';
1319 } 1319 }
diff --git a/net/irda/ircomm/ircomm_tty_attach.c b/net/irda/ircomm/ircomm_tty_attach.c
index 3ab70e7a0715..edab393e0c82 100644
--- a/net/irda/ircomm/ircomm_tty_attach.c
+++ b/net/irda/ircomm/ircomm_tty_attach.c
@@ -578,7 +578,7 @@ void ircomm_tty_link_established(struct ircomm_tty_cb *self)
578 * will have to wait for the peer device (DCE) to raise the CTS 578 * will have to wait for the peer device (DCE) to raise the CTS
579 * line. 579 * line.
580 */ 580 */
581 if ((self->port.flags & ASYNC_CTS_FLOW) && 581 if (tty_port_cts_enabled(&self->port) &&
582 ((self->settings.dce & IRCOMM_CTS) == 0)) { 582 ((self->settings.dce & IRCOMM_CTS) == 0)) {
583 IRDA_DEBUG(0, "%s(), waiting for CTS ...\n", __func__ ); 583 IRDA_DEBUG(0, "%s(), waiting for CTS ...\n", __func__ );
584 goto put; 584 goto put;