Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Dec 1995 01:05:23 +0100 (MET)
From:      Ollivier Robert <roberto@keltia.freenix.fr>
To:        bde@zeta.org.au (Bruce Evans)
Cc:        freebsd-current@FreeBSD.org
Subject:   Re: Mouse not working for two days
Message-ID:  <199512180005.BAA00293@keltia.freenix.fr>
In-Reply-To: <199512162032.HAA09302@godzilla.zeta.org.au> from "Bruce Evans" at Dec 17, 95 07:32:16 am

next in thread | previous in thread | raw e-mail | index | archive | help
It seems that Bruce Evans said:
> It breaks COM_NOFIFO() for at least 16650's and stops the output fifo
> being used at speeds <= 4800.  These bugs shouldn't matter for mouses.
> Perhaps the second bug interferes with the SMC bugfix (what happens
> when the fifos are reset while the fifos are not enabled?).

Here is the patch I made to restore most  of the 1.126 sio.c code, changing
the  constants  FIFO_TRIGGER_*  into the  new    FIFO_RX_*. The new   16650
detection code is between STARTECH_PROBE (from a patch Peter sent me). 

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 !

I found that because it would not work till I inserted the lines back... 

Index: sio.c
===================================================================
RCS file: /spare/FreeBSD-current/src/sys/i386/isa/sio.c,v
retrieving revision 1.129
diff -u -2 -r1.129 sio.c
--- sio.c	1995/12/10 20:54:38	1.129
+++ sio.c	1995/12/17 23:57:24
@@ -174,4 +174,6 @@
 	u_char	cfcr_image;	/* copy of value written to CFCR */
 	u_char	ftl;		/* current rx fifo trigger level */
+	u_char  ftl_init;       /* ftl_max for next open */
+	u_char  ftl_max;        /* maximum ftl for current open */ 
 	bool_t	hasfifo;	/* nonzero for 16550 UARTs */
 	bool_t	loses_outints;	/* nonzero if device loses output interrupts */
@@ -835,8 +837,12 @@
 		} else {
 			com->hasfifo = TRUE;
+			com->ftl_init = FIFO_RX_HIGH;
 			com->tx_fifo_size = 16;
 			kdc_sio[unit].kdc_description =
 			  "Serial port: National 16550A or compatible";
 		}
+#ifndef STARTECH_PROBE
+		printf(" 16550A");
+#else
 		/*
 		 * Check for the Startech ST16C650 chip.
@@ -861,7 +867,10 @@
 			  "Serial port: Startech 16C650 or similar";
 		}
+#endif
 		if (!com->tx_fifo_size)
 			printf(" fifo disabled");
+#ifdef STARTECH_PROBE
 		}
+#endif
 		break;
 	}
@@ -1036,4 +1045,5 @@
 				? com->it_out : com->it_in;
 		(void)commctl(com, TIOCM_DTR | TIOCM_RTS, DMSET);
+		com->ftl_max = com->ftl_init;
 		com->poll = com->no_irq;
 		com->poll_output = com->loses_outints;
@@ -1062,5 +1072,6 @@
 			while (TRUE) {
 				outb(iobase + com_fifo,
-				     FIFO_RCV_RST | FIFO_XMT_RST | com->ftl);
+					FIFO_RCV_RST | FIFO_XMT_RST
+					| FIFO_ENABLE | com->ftl);
 				DELAY(100);
 				if (!(inb(com->line_status_port) & LSR_RXRDY))
@@ -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);
 	}
 
-- 
Ollivier ROBERT    -=- The daemon is FREE! -=-    roberto@keltia.frmug.fr.net
   FreeBSD keltia.freenix.fr 2.2-CURRENT #4: Fri Dec 15 19:22:25 MET 1995



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