summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1998-12-17 19:23:09 +0000
committerbde <bde@FreeBSD.org>1998-12-17 19:23:09 +0000
commitb3eb9623043dce7ee5235a8232a7f28c2f9aceff (patch)
tree65986023559f40662101652799adef9643d57bc6
parentd91789e59626a6d86471c19af25b9fadd021d984 (diff)
downloadFreeBSD-src-b3eb9623043dce7ee5235a8232a7f28c2f9aceff.zip
FreeBSD-src-b3eb9623043dce7ee5235a8232a7f28c2f9aceff.tar.gz
Flush the tx fifo in cystop(). Now ttyflush() (and thus tcflush(3))
almost works properly. Unfortunately, there is no way to flush the rx fifo without resetting the channel, which also flushes the tx fifo. We avoid resetting even when both fifos need to be flushed, since resetting seems to cause the rx to lose sync if it is done while data is arriving. Reminded by: NIST-PCTS
-rw-r--r--sys/dev/cy/cy.c7
-rw-r--r--sys/dev/cy/cy_isa.c7
-rw-r--r--sys/i386/isa/cy.c7
3 files changed, 12 insertions, 9 deletions
diff --git a/sys/dev/cy/cy.c b/sys/dev/cy/cy.c
index df09722..b23cf66 100644
--- a/sys/dev/cy/cy.c
+++ b/sys/dev/cy/cy.c
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: cy.c,v 1.78 1998/12/17 18:18:06 bde Exp $
+ * $Id: cy.c,v 1.79 1998/12/17 18:43:08 bde Exp $
*/
#include "opt_compat.h"
@@ -2387,15 +2387,16 @@ siostop(tp, rw)
com->state &= ~(CS_ODONE | CS_BUSY);
}
if (rw & FREAD) {
+ /* XXX no way to reset only input fifo. */
com_events -= (com->iptr - com->ibuf);
com->iptr = com->ibuf;
}
enable_intr();
if (wakeup_etc)
wakeup(&com->etc);
+ if (rw & FWRITE && com->etc == ETC_NONE)
+ cd1400_channel_cmd(com, CD1400_CCR_CMDRESET | CD1400_CCR_FTF);
comstart(tp);
-
- /* XXX should clear h/w fifos too. */
}
static struct tty *
diff --git a/sys/dev/cy/cy_isa.c b/sys/dev/cy/cy_isa.c
index df09722..b23cf66 100644
--- a/sys/dev/cy/cy_isa.c
+++ b/sys/dev/cy/cy_isa.c
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: cy.c,v 1.78 1998/12/17 18:18:06 bde Exp $
+ * $Id: cy.c,v 1.79 1998/12/17 18:43:08 bde Exp $
*/
#include "opt_compat.h"
@@ -2387,15 +2387,16 @@ siostop(tp, rw)
com->state &= ~(CS_ODONE | CS_BUSY);
}
if (rw & FREAD) {
+ /* XXX no way to reset only input fifo. */
com_events -= (com->iptr - com->ibuf);
com->iptr = com->ibuf;
}
enable_intr();
if (wakeup_etc)
wakeup(&com->etc);
+ if (rw & FWRITE && com->etc == ETC_NONE)
+ cd1400_channel_cmd(com, CD1400_CCR_CMDRESET | CD1400_CCR_FTF);
comstart(tp);
-
- /* XXX should clear h/w fifos too. */
}
static struct tty *
diff --git a/sys/i386/isa/cy.c b/sys/i386/isa/cy.c
index df09722..b23cf66 100644
--- a/sys/i386/isa/cy.c
+++ b/sys/i386/isa/cy.c
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Id: cy.c,v 1.78 1998/12/17 18:18:06 bde Exp $
+ * $Id: cy.c,v 1.79 1998/12/17 18:43:08 bde Exp $
*/
#include "opt_compat.h"
@@ -2387,15 +2387,16 @@ siostop(tp, rw)
com->state &= ~(CS_ODONE | CS_BUSY);
}
if (rw & FREAD) {
+ /* XXX no way to reset only input fifo. */
com_events -= (com->iptr - com->ibuf);
com->iptr = com->ibuf;
}
enable_intr();
if (wakeup_etc)
wakeup(&com->etc);
+ if (rw & FWRITE && com->etc == ETC_NONE)
+ cd1400_channel_cmd(com, CD1400_CCR_CMDRESET | CD1400_CCR_FTF);
comstart(tp);
-
- /* XXX should clear h/w fifos too. */
}
static struct tty *
OpenPOWER on IntegriCloud