Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Apr 2006 00:06:41 GMT
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 96171 for review
Message-ID:  <200604270006.k3R06fQ5043378@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=96171

Change 96171 by marcel@marcel_nfs on 2006/04/27 00:05:57

	Use the ILR to filter devices without pending interrupt.

Affected files ...

.. //depot/projects/uart/dev/puc/puc.c#37 edit

Differences ...

==== //depot/projects/uart/dev/puc/puc.c#37 (text+ko) ====

@@ -132,10 +132,30 @@
 	struct puc_softc *sc = arg;
 	u_long dev, devs;
 	int i, idx, ipend, isrc;
+	uint8_t ilr;
+
+	devs = sc->sc_serdevs;
+	if (sc->sc_ilr == PUC_ILR_DIGI) {
+		idx = 0;
+		while (devs & (0xfful << idx)) {
+			ilr = ~bus_read_1(sc->sc_port[idx].p_rres, 7);
+			devs &= ~0ul ^ ((u_long)ilr << idx);
+			idx += 8;
+		}
+	} else if (sc->sc_ilr == PUC_ILR_QUATECH) {
+		/*
+		 * Don't trust the value if it's the same as the option
+		 * register. It may mean that the ILR is not active and
+		 * we're reading the option register instead. This may
+		 * lead to false positives on 8-port boards.
+		 */
+		ilr = bus_read_1(sc->sc_port[0].p_rres, 7);
+		if (ilr != (sc->sc_cfg_data & 0xff))
+			devs &= (u_long)ilr;
+	}
 
 	ipend = 0;
 	idx = 0, dev = 1UL;
-	devs = sc->sc_serdevs;
 	while (devs != 0UL) {
 		while ((devs & dev) == 0UL)
 			idx++, dev <<= 1;



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