From owner-freebsd-current Sun Dec 17 16:56:21 1995 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id QAA13133 for current-outgoing; Sun, 17 Dec 1995 16:56:21 -0800 (PST) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id QAA13113 for ; Sun, 17 Dec 1995 16:56:12 -0800 (PST) Received: (from bde@localhost) by godzilla.zeta.org.au (8.6.9/8.6.9) id LAA27345; Mon, 18 Dec 1995 11:51:05 +1100 Date: Mon, 18 Dec 1995 11:51:05 +1100 From: Bruce Evans Message-Id: <199512180051.LAA27345@godzilla.zeta.org.au> To: bde@zeta.org.au, roberto@keltia.freenix.fr Subject: Re: Mouse not working for two days Cc: freebsd-current@FreeBSD.org Sender: owner-current@FreeBSD.org Precedence: bulk >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); }