svn commit: r202898 - head/sys/dev/ieee488

Joerg Wunsch joerg at FreeBSD.org
Sat Jan 23 21:33:34 UTC 2010


Author: joerg
Date: Sat Jan 23 21:33:33 2010
New Revision: 202898
URL: http://svn.freebsd.org/changeset/base/202898

Log:
  Fix breakage introduced to the tnt4882 driver in r202870.  This PCI
  frontend uses the same uPD7210 backend as the pcii ISA frontend, so
  the backend has to cope with both situations.
  
  Also, hide the first printf in pcii_probe (address mismatch) behind
  bootverbose as the ISA bus parent tries to probe all configured ISA
  devices against each driver, so a the console has been cluttered with
  this message for a bunch of unrelated driver probes.
  
  MFC after:	3 days

Modified:
  head/sys/dev/ieee488/pcii.c
  head/sys/dev/ieee488/tnt4882.c
  head/sys/dev/ieee488/upd7210.c
  head/sys/dev/ieee488/upd7210.h

Modified: head/sys/dev/ieee488/pcii.c
==============================================================================
--- head/sys/dev/ieee488/pcii.c	Sat Jan 23 20:28:37 2010	(r202897)
+++ head/sys/dev/ieee488/pcii.c	Sat Jan 23 21:33:33 2010	(r202898)
@@ -138,9 +138,10 @@ pcii_probe(device_t dev)
 	 * 1989 Edition, National Instruments.)
 	 */
 	if ((start & 0x3ff) != 0x2e1) {
-		printf("pcii_probe: PCIIA base address 0x%lx not "
-		       "0x2e1/0x22e1/0x42e1/0x62e1\n",
-		       start);
+		if (bootverbose)
+			printf("pcii_probe: PCIIA base address 0x%lx not "
+			       "0x2e1/0x22e1/0x42e1/0x62e1\n",
+			       start);
 		return (ENXIO);
 	}
 
@@ -234,6 +235,7 @@ pcii_attach(device_t dev)
 
 	for (rid = 0; rid < 8; rid++) {
 		sc->upd7210.reg_res[rid] = sc->res[2 + rid];
+		sc->upd7210.reg_offset[rid] = 0;
 	}
 	sc->upd7210.irq_clear_res = sc->res[10];
 

Modified: head/sys/dev/ieee488/tnt4882.c
==============================================================================
--- head/sys/dev/ieee488/tnt4882.c	Sat Jan 23 20:28:37 2010	(r202897)
+++ head/sys/dev/ieee488/tnt4882.c	Sat Jan 23 21:33:33 2010	(r202898)
@@ -309,6 +309,9 @@ tnt_attach(device_t dev)
 	/* No DMA help */
 	sc->upd7210.dmachan = -1;
 
+	/* No "special interrupt handling" needed here. */
+	sc->upd7210.irq_clear_res = NULL;
+
 	upd7210attach(&sc->upd7210);
 
 	return (0);

Modified: head/sys/dev/ieee488/upd7210.c
==============================================================================
--- head/sys/dev/ieee488/upd7210.c	Sat Jan 23 20:28:37 2010	(r202897)
+++ head/sys/dev/ieee488/upd7210.c	Sat Jan 23 21:33:33 2010	(r202898)
@@ -72,7 +72,7 @@ upd7210_rd(struct upd7210 *u, enum upd72
 {
 	u_int r;
 
-	r = bus_read_1(u->reg_res[reg], 0);
+	r = bus_read_1(u->reg_res[reg], u->reg_offset[reg]);
 	u->rreg[reg] = r;
 	return (r);
 }
@@ -81,7 +81,7 @@ void
 upd7210_wr(struct upd7210 *u, enum upd7210_wreg reg, u_int val)
 {
 
-	bus_write_1(u->reg_res[reg], 0, val);
+	bus_write_1(u->reg_res[reg], u->reg_offset[reg], val);
 	u->wreg[reg] = val;
 	if (reg == AUXMR)
 		u->wreg[8 + (val >> 5)] = val & 0x1f;
@@ -125,7 +125,8 @@ upd7210intr(void *arg)
 		 * Some clones apparently don't implement this
 		 * feature, but National Instrument cards do.
 		 */
-		bus_write_1(u->irq_clear_res, 0, 42);
+		if (u->irq_clear_res != NULL)
+			bus_write_1(u->irq_clear_res, 0, 42);
 	}
 	mtx_unlock(&u->mutex);
 }

Modified: head/sys/dev/ieee488/upd7210.h
==============================================================================
--- head/sys/dev/ieee488/upd7210.h	Sat Jan 23 20:28:37 2010	(r202897)
+++ head/sys/dev/ieee488/upd7210.h	Sat Jan 23 21:33:33 2010	(r202898)
@@ -50,6 +50,7 @@ typedef int upd7210_irq_t(struct upd7210
 struct upd7210 {
 	struct resource		*reg_res[8];
 	struct resource		*irq_clear_res;
+	u_int			reg_offset[8];
 	int			dmachan;
 	int			unit;
 


More information about the svn-src-head mailing list