Make if_ndis_pci.c and if_ndis_pccard.c use bus_alloc_resource() again
instead of bus_alloc_resource_any() to restore source compatibility with 5.2-REL and 5.2.1-REL systems. bus_alloc_resource_any() doesn't really do anything besides hide some of bus_alloc_resource()'s arguments from us, and in my opinion this isn't worth breaking backwards compatibility for people who want to use the NDISulator code on 5.2.x.
This commit is contained in:
parent
aba0edf2e1
commit
67aa83405a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=127281
@ -194,9 +194,9 @@ ndis_attach_pccard(dev)
|
||||
sc->ndis_dev = dev;
|
||||
|
||||
sc->ndis_io_rid = 0;
|
||||
sc->ndis_res_io = bus_alloc_resource_any(dev,
|
||||
sc->ndis_res_io = bus_alloc_resource(dev,
|
||||
SYS_RES_IOPORT, &sc->ndis_io_rid,
|
||||
RF_ACTIVE);
|
||||
0, ~0, 1, RF_ACTIVE);
|
||||
if (sc->ndis_res_io == NULL) {
|
||||
device_printf(dev,
|
||||
"couldn't map iospace\n");
|
||||
@ -206,8 +206,8 @@ ndis_attach_pccard(dev)
|
||||
sc->ndis_rescnt++;
|
||||
|
||||
rid = 0;
|
||||
sc->ndis_irq = bus_alloc_resource_any(dev,
|
||||
SYS_RES_IRQ, &rid,
|
||||
sc->ndis_irq = bus_alloc_resource(dev,
|
||||
SYS_RES_IRQ, &rid, 0, ~0, 1,
|
||||
RF_SHAREABLE | RF_ACTIVE);
|
||||
if (sc->ndis_irq == NULL) {
|
||||
device_printf(dev,
|
||||
|
@ -184,9 +184,9 @@ ndis_attach_pci(dev)
|
||||
switch (rle->type) {
|
||||
case SYS_RES_IOPORT:
|
||||
sc->ndis_io_rid = rle->rid;
|
||||
sc->ndis_res_io = bus_alloc_resource_any(dev,
|
||||
sc->ndis_res_io = bus_alloc_resource(dev,
|
||||
SYS_RES_IOPORT, &sc->ndis_io_rid,
|
||||
RF_ACTIVE);
|
||||
0, ~0, 1, RF_ACTIVE);
|
||||
if (sc->ndis_res_io == NULL) {
|
||||
device_printf(dev,
|
||||
"couldn't map iospace\n");
|
||||
@ -205,10 +205,10 @@ ndis_attach_pci(dev)
|
||||
if (rle->rid == PCIR_BAR(2)) {
|
||||
sc->ndis_altmem_rid = rle->rid;
|
||||
sc->ndis_res_altmem =
|
||||
bus_alloc_resource_any(dev,
|
||||
bus_alloc_resource(dev,
|
||||
SYS_RES_MEMORY,
|
||||
&sc->ndis_altmem_rid,
|
||||
RF_ACTIVE);
|
||||
0, ~0, 1, RF_ACTIVE);
|
||||
if (sc->ndis_res_altmem == NULL) {
|
||||
device_printf(dev,
|
||||
"couldn't map alt "
|
||||
@ -219,10 +219,10 @@ ndis_attach_pci(dev)
|
||||
} else {
|
||||
sc->ndis_mem_rid = rle->rid;
|
||||
sc->ndis_res_mem =
|
||||
bus_alloc_resource_any(dev,
|
||||
bus_alloc_resource(dev,
|
||||
SYS_RES_MEMORY,
|
||||
&sc->ndis_mem_rid,
|
||||
RF_ACTIVE);
|
||||
0, ~0, 1, RF_ACTIVE);
|
||||
if (sc->ndis_res_mem == NULL) {
|
||||
device_printf(dev,
|
||||
"couldn't map memory\n");
|
||||
@ -233,8 +233,8 @@ ndis_attach_pci(dev)
|
||||
break;
|
||||
case SYS_RES_IRQ:
|
||||
rid = rle->rid;
|
||||
sc->ndis_irq = bus_alloc_resource_any(dev,
|
||||
SYS_RES_IRQ, &rid,
|
||||
sc->ndis_irq = bus_alloc_resource(dev,
|
||||
SYS_RES_IRQ, &rid, 0, ~0, 1,
|
||||
RF_SHAREABLE | RF_ACTIVE);
|
||||
if (sc->ndis_irq == NULL) {
|
||||
device_printf(dev,
|
||||
|
Loading…
Reference in New Issue
Block a user