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
This commit is contained in:
Bruce Evans 1998-12-17 19:23:09 +00:00
parent 303826838c
commit 747c608e8d
3 changed files with 12 additions and 9 deletions

View file

@ -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 *

View file

@ -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 *

View file

@ -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 *