DragonFly BSD
DragonFly commits List (threaded) for 2005-05
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: cvs commit: src/sys/dev/netif/bge if_bge.c


From: Sepherosa Ziehau <sepherosa@xxxxxxxxx>
Date: Sat, 21 May 2005 16:28:28 +0800

attachment teach xl(4) to use bus_alloc_resource_any() too

On 5/21/05, Joerg Sonnenberger <joerg@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> joerg       2005/05/21 00:38:41 PDT
> 
> DragonFly src repository
> 
>   Modified files:
>     sys/dev/netif/bge    if_bge.c
>   Log:
>   Use bus_alloc_resource_any. Use pci helper functions, don't roll them
>   by hand.
> 
>   Revision  Changes    Path
>   1.30      +6 -8      src/sys/dev/netif/bge/if_bge.c
> 
> 
> http://www.dragonflybsd.org/cvsweb/src/sys/dev/netif/bge/if_bge.c.diff?r1=1.29&r2=1.30&f=u
> 


-- 
Live Free or Die
Index: if_xl.c
===================================================================
RCS file: /opt/df_cvs/src/sys/dev/netif/xl/if_xl.c,v
retrieving revision 1.20
diff -u -r1.20 if_xl.c
--- if_xl.c	14 May 2005 01:33:35 -0000	1.20
+++ if_xl.c	21 May 2005 08:34:26 -0000
@@ -1406,8 +1406,7 @@
 	res = SYS_RES_MEMORY;
 
 #if 0
-	sc->xl_res = bus_alloc_resource(dev, res, &rid,
-	    0, ~0, 1, RF_ACTIVE);
+	sc->xl_res = bus_alloc_resource_any(dev, res, &rid, RF_ACTIVE);
 #endif
 
 	if (sc->xl_res != NULL) {
@@ -1417,8 +1416,7 @@
 	} else {
 		rid = XL_PCI_LOIO;
 		res = SYS_RES_IOPORT;
-		sc->xl_res = bus_alloc_resource(dev, res, &rid,
-		    0, ~0, 1, RF_ACTIVE);
+		sc->xl_res = bus_alloc_resource_any(dev, res, &rid, RF_ACTIVE);
 		if (sc->xl_res == NULL) {
 			device_printf(dev, "couldn't map ports/memory\n");
 			error = ENXIO;
@@ -1433,8 +1431,8 @@
 
 	if (sc->xl_flags & XL_FLAG_FUNCREG) {
 		rid = XL_PCI_FUNCMEM;
-		sc->xl_fres = bus_alloc_resource(dev, SYS_RES_MEMORY, &rid,
-		    0, ~0, 1, RF_ACTIVE);
+		sc->xl_fres = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &rid,
+		    RF_ACTIVE);
 
 		if (sc->xl_fres == NULL) {
 			device_printf(dev, "couldn't map ports/memory\n");
@@ -1448,7 +1446,7 @@
 
 	/* Allocate interrupt */
 	rid = 0;
-	sc->xl_irq = bus_alloc_resource(dev, SYS_RES_IRQ, &rid, 0, ~0, 1,
+	sc->xl_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
 	    RF_SHAREABLE | RF_ACTIVE);
 	if (sc->xl_irq == NULL) {
 		device_printf(dev, "couldn't map interrupt\n");


[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]