Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Dec 1995 11:51:05 +1100
From:      Bruce Evans <bde@zeta.org.au>
To:        bde@zeta.org.au, roberto@keltia.freenix.fr
Cc:        freebsd-current@FreeBSD.org
Subject:   Re: Mouse not working for two days
Message-ID:  <199512180051.LAA27345@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>I don't know if all of what I inserted  back is useful  but as it is needed
>for the last part of the patch which is the *culprit* in my problem !

Is it really the last part?:

>@@ -1898,6 +1909,8 @@
> 		 */
> 		com->ftl = t->c_ospeed <= 4800
>-			   ? 0 : FIFO_ENABLE | FIFO_RX_HIGH;
>-		outb(iobase + com_fifo, com->ftl);
>+			? FIFO_RX_LOW : FIFO_RX_HIGH;
>+		if (com->ftl > com->ftl_max)
>+			com->ftl = com->ftl_max;
>+		outb(iobase + com_fifo, FIFO_ENABLE | com->ftl);
> 	}
> 

I think this is a no-op at speeds > 4800, and your mouse is at 9600.
Perhaps the speed is sometimes set to 0?  (This might be part of the
mouse initialization for certain mouses).  A speed of 0 means is a
command to drop DTR and it shouldn't be used for anything to do with the
line speed like it is here.  Disabling the FIFO should be fairly
harmless, but is may fail for the buggy SMC chips.  The code to work
around the bug wouldn't help because the FIFO_ENABLE bit isn't set in
com->ftl either.

Try the following change.  It keeps the FIFO enabled and fixes a
bitrotted name and comment.

Bruce

*** sio.c~	Mon Dec 11 10:12:30 1995
--- sio.c	Mon Dec 11 10:13:00 1995
***************
*** 173,177 ****
  	bool_t  active_out;	/* nonzero if the callout device is open */
  	u_char	cfcr_image;	/* copy of value written to CFCR */
! 	u_char	ftl;		/* current rx fifo trigger level */
  	bool_t	hasfifo;	/* nonzero for 16550 UARTs */
  	bool_t	loses_outints;	/* nonzero if device loses output interrupts */
--- 173,177 ----
  	bool_t  active_out;	/* nonzero if the callout device is open */
  	u_char	cfcr_image;	/* copy of value written to CFCR */
! 	u_char	fifo_image;	/* copy of value written to FIFO */
  	bool_t	hasfifo;	/* nonzero for 16550 UARTs */
  	bool_t	loses_outints;	/* nonzero if device loses output interrupts */
***************
*** 1062,1066 ****
  			while (TRUE) {
  				outb(iobase + com_fifo,
! 				     FIFO_RCV_RST | FIFO_XMT_RST | com->ftl);
  				DELAY(100);
  				if (!(inb(com->line_status_port) & LSR_RXRDY))
--- 1062,1067 ----
  			while (TRUE) {
  				outb(iobase + com_fifo,
! 				     FIFO_RCV_RST | FIFO_XMT_RST
! 				     | com->fifo_image);
  				DELAY(100);
  				if (!(inb(com->line_status_port) & LSR_RXRDY))
***************
*** 1897,1903 ****
  		 * latencies are larger.
  		 */
! 		com->ftl = t->c_ospeed <= 4800
! 			   ? 0 : FIFO_ENABLE | FIFO_RX_HIGH;
! 		outb(iobase + com_fifo, com->ftl);
  	}
  
--- 1898,1904 ----
  		 * latencies are larger.
  		 */
! 		com->fifo_image = t->c_ospeed <= 4800
! 				  ? FIFO_ENABLE : FIFO_ENABLE | FIFO_RX_HIGH;
! 		outb(iobase + com_fifo, com->fifo_image);
  	}
  



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199512180051.LAA27345>