lkml.org 
[lkml]   [2005]   [Jun]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: [CFT:PATCH] 2/3: Check status of CTS when using flow control
    Fix bugme #4712: read the CTS status and set hw_stopped if CTS
    is not active.

    Thanks to Stefan Wolff for spotting this problem.

    Index: drivers/serial/serial_core.c
    ===================================================================
    --- a/drivers/serial/serial_core.c (mode:100644)
    +++ b/drivers/serial/serial_core.c (mode:100644)
    @@ -180,6 +180,13 @@
    */
    if (info->tty->termios->c_cflag & CBAUD)
    uart_set_mctrl(port, TIOCM_RTS | TIOCM_DTR);
    +
    + if (info->flags & UIF_CTS_FLOW) {
    + spin_lock_irq(&port->lock);
    + if (!(port->ops->get_mctrl(port) & TIOCM_CTS))
    + info->tty->hw_stopped = 1;
    + spin_unlock_irq(&port->lock);
    + }
    }

    info->flags |= UIF_INITIALIZED;
    @@ -1134,6 +1141,16 @@
    spin_unlock_irqrestore(&state->port->lock, flags);
    }

    + /* Handle turning on CRTSCTS */
    + if (!(old_termios->c_cflag & CRTSCTS) && (cflag & CRTSCTS)) {
    + spin_lock_irqsave(&state->port->lock, flags);
    + if (!(state->port->ops->get_mctrl(state->port) & TIOCM_CTS)) {
    + tty->hw_stopped = 1;
    + state->port->ops->stop_tx(state->port, 0);
    + }
    + spin_unlock_irqrestore(&state->port->lock, flags);
    + }
    +
    #if 0
    /*
    * No need to wake up processes in open wait, since they
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/
    \
     
     \ /
      Last update: 2005-06-27 00:21    [W:7.442 / U:0.032 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site