Date: Mon, 24 Jan 2011 18:34:16 +0000 (UTC) From: Marcel Moolenaar <marcel@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r217800 - head/sys/dev/uart Message-ID: <201101241834.p0OIYGJR002263@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: marcel Date: Mon Jan 24 18:34:16 2011 New Revision: 217800 URL: http://svn.freebsd.org/changeset/base/217800 Log: In uart_tty_outwakeup(), check CTS/RTS flow control settings and prevent sending data when CTS is de-asserted. In uart_tty_intr(), call uart_tty_outwakeup() when the CTS signal changed, knowing that uart_tty_outwakeup() will do the right thing for flow control. This avoids redundant conditionals. PR: kern/148644 Submitted by: John Wehle <john@feith.com> MFC after: 3 days Modified: head/sys/dev/uart/uart_tty.c Modified: head/sys/dev/uart/uart_tty.c ============================================================================== --- head/sys/dev/uart/uart_tty.c Mon Jan 24 18:24:28 2011 (r217799) +++ head/sys/dev/uart/uart_tty.c Mon Jan 24 18:34:16 2011 (r217800) @@ -168,6 +168,14 @@ uart_tty_outwakeup(struct tty *tp) if (sc->sc_txbusy) return; + /* + * Respect RTS/CTS (output) flow control if enabled and not already + * handled by hardware. + */ + if ((tp->t_termios.c_cflag & CCTS_OFLOW) && !sc->sc_hwoflow && + !(sc->sc_hwsig & SER_CTS)) + return; + sc->sc_txdatasz = ttydisc_getc(tp, sc->sc_txbuf, sc->sc_txfifosz); if (sc->sc_txdatasz != 0) UART_TRANSMIT(sc); @@ -315,11 +323,8 @@ uart_tty_intr(void *arg) sig = pend & SER_INT_SIGMASK; if (sig & SER_DDCD) ttydisc_modem(tp, sig & SER_DCD); - if ((sig & SER_DCTS) && (tp->t_termios.c_cflag & CCTS_OFLOW) && - !sc->sc_hwoflow) { - if (sig & SER_CTS) - uart_tty_outwakeup(tp); - } + if (sig & SER_DCTS) + uart_tty_outwakeup(tp); } if (pend & SER_INT_TXIDLE)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201101241834.p0OIYGJR002263>