From owner-svn-src-stable-8@FreeBSD.ORG Fri Jan 28 00:22:04 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5569D106566C; Fri, 28 Jan 2011 00:22:04 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 442568FC1D; Fri, 28 Jan 2011 00:22:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p0S0M4MT046694; Fri, 28 Jan 2011 00:22:04 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0S0M4IV046692; Fri, 28 Jan 2011 00:22:04 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201101280022.p0S0M4IV046692@svn.freebsd.org> From: Marcel Moolenaar Date: Fri, 28 Jan 2011 00:22:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218000 - stable/8/sys/dev/uart X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 00:22:04 -0000 Author: marcel Date: Fri Jan 28 00:22:03 2011 New Revision: 218000 URL: http://svn.freebsd.org/changeset/base/218000 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 Modified: stable/8/sys/dev/uart/uart_tty.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/dev/uart/uart_tty.c ============================================================================== --- stable/8/sys/dev/uart/uart_tty.c Thu Jan 27 23:28:00 2011 (r217999) +++ stable/8/sys/dev/uart/uart_tty.c Fri Jan 28 00:22:03 2011 (r218000) @@ -169,6 +169,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); @@ -316,11 +324,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)