Subject: port-i386/432: i386 com.c: FIFO_TRIGGER_1 should be used at low baud rates
To: None <gnats-admin>
From: Mark Weaver <mhw@cs.brown.edu>
List: netbsd-bugs
Date: 08/22/1994 12:20:07
>Number:         432
>Category:       port-i386
>Synopsis:       i386 com.c: FIFO_TRIGGER_1 should be used at low baud rates
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          change-request
>Submitter-Id:   mhw
>Arrival-Date:   Mon Aug 22 12:20:06 1994
>Originator:     Mark Weaver
>Organization:
--------------------------------------------------------------------
Email: Mark_Weaver@brown.edu           | Brown University
PGP Key: finger mhw@cs.brown.edu       | Dept of Computer Science
>Release:        NetBSD 1.0_BETA (21-July-1994)
>Environment:

System: NetBSD cis-ts3-slip4.cis.brown.edu 1.0_BETA NetBSD 1.0_BETA (EXCELSIOR) #2: Mon Aug 22 00:02:40 EDT 1994 mhw@excelsior.cis.brown.edu:/usr/src/sys/arch/i386/compile/EXCELSIOR i386

>Description:
	It would be nice is FIFO_TRIGGER_1 was used at low baud rates,
	because the pointer in X is very jerky when using a serial mouse.
	The included patch uses FIFO_TRIGGER_1 when slower than 2400 baud,
	otherwise it uses FIFO_TRIGGER_8.  I've tested it and it seems to
	work fine.

>How-To-Repeat:
>Fix:
*** src/sys/arch/i386/isa/com.c.mhw1	Tue Aug  9 06:28:01 1994
--- src/sys/arch/i386/isa/com.c	Mon Aug 22 00:01:41 1994
***************
*** 297,306 ****
  
  		iobase = sc->sc_iobase;
  		/* flush any pending I/O */
- 		if (sc->sc_hwflags & COM_HW_FIFO)
- 			outb(iobase + com_fifo,
- 			    FIFO_ENABLE | FIFO_RCV_RST | FIFO_XMT_RST |
- 			    FIFO_TRIGGER_8);
  		(void) inb(iobase + com_lsr);
  		(void) inb(iobase + com_data);
  		/* you turn me on, baby */
--- 297,302 ----
***************
*** 579,584 ****
--- 575,586 ----
  				outb(iobase + com_mcr, sc->sc_mcr &= ~MCR_RTS);
  		}
  	}
+ 
+ 	/* If the speed changed, we might need to change the fifo trigger */
+ 	if (sc->sc_hwflags & COM_HW_FIFO)
+ 		outb(iobase + com_fifo,
+ 		    FIFO_ENABLE | FIFO_RCV_RST | FIFO_XMT_RST |
+ 		    (t->c_ispeed < 2400 ? FIFO_TRIGGER_1 : FIFO_TRIGGER_8));
  
  	/*
  	 * If CTS is off and CRTSCTS is changed, we must toggle TS_TTSTOP.
>Audit-Trail:
>Unformatted:


------------------------------------------------------------------------------