re driver woes

Joerg Sonnenberger joerg at britannica.bec.de
Wed Jul 14 00:17:35 PDT 2004


Shawn, can you try the attached patch?

Joerg
? if_re.c.diff
? if_re.diff
Index: if_re.c
===================================================================
RCS file: /cvs/src/sys/dev/netif/re/if_re.c,v
retrieving revision 1.1
diff -u -r1.1 if_re.c
--- if_re.c	7 Jul 2004 09:47:27 -0000	1.1
+++ if_re.c	14 Jul 2004 07:14:44 -0000
@@ -739,8 +739,8 @@
 	 * Temporarily map the I/O space so we can read the chip ID register.
 	 */
 	sc = malloc(sizeof(*sc), M_TEMP, M_WAITOK | M_ZERO);
-	rid = RE_PCI_LOMEM;
-	sc->re_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
+	rid = RE_PCI_LOIO;
+	sc->re_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid,
 					    RF_ACTIVE);
 	if (sc->re_res == NULL) {
 		device_printf(dev, "couldn't map ports/memory\n");
@@ -752,7 +752,7 @@
 	sc->re_bhandle = rman_get_bushandle(sc->re_res);
 
 	hwrev = CSR_READ_4(sc, RE_TXCFG) & RE_TXCFG_HWREV;
-	bus_release_resource(dev, SYS_RES_MEMORY, RE_PCI_LOMEM, sc->re_res);
+	bus_release_resource(dev, SYS_RES_IOPORT, RE_PCI_LOIO, sc->re_res);
 	free(sc, M_TEMP);
 
 	/*
@@ -1012,7 +1012,7 @@
 	pci_enable_busmaster(dev);
 
 	rid = RE_PCI_LOMEM;
-	sc->re_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
+	sc->re_res = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid,
 					    RF_ACTIVE);
 
 	if (sc->re_res == NULL) {
@@ -1198,7 +1198,7 @@
 	if (sc->re_irq)
 		bus_release_resource(dev, SYS_RES_IRQ, 0, sc->re_irq);
 	if (sc->re_res)
-		bus_release_resource(dev, SYS_RES_MEMORY, RE_PCI_LOMEM,
+		bus_release_resource(dev, SYS_RES_IOPORT, RE_PCI_LOIO,
 				     sc->re_res);
 
 	/* Unload and free the RX DMA ring memory and map */
Index: if_rereg.h
===================================================================
RCS file: /cvs/src/sys/dev/netif/re/if_rereg.h,v
retrieving revision 1.1
diff -u -r1.1 if_rereg.h
--- if_rereg.h	7 Jul 2004 09:47:27 -0000	1.1
+++ if_rereg.h	14 Jul 2004 07:14:44 -0000
@@ -814,4 +814,5 @@
  * other PCI registers.
  */
 
+#define RE_PCI_LOIO		0x10
 #define RE_PCI_LOMEM		0x14




More information about the Bugs mailing list