summaryrefslogtreecommitdiffstats
path: root/sys/dev/if_ndis
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2004-03-09 18:39:40 +0000
committerwpaul <wpaul@FreeBSD.org>2004-03-09 18:39:40 +0000
commit696d0d4e7fdd6d7c8ef68038b94148e516ab1a1d (patch)
treed7d9c66921ab5e745c40b4b6797ceca82d3ce7ad /sys/dev/if_ndis
parentf4904161798c0e975b39eeb410bf57e52f3a4c6c (diff)
downloadFreeBSD-src-696d0d4e7fdd6d7c8ef68038b94148e516ab1a1d.zip
FreeBSD-src-696d0d4e7fdd6d7c8ef68038b94148e516ab1a1d.tar.gz
If the resource listing obtained from BUS_GET_RESOURCE_LIST() in
ndis_probe_pci() doesn't contain an entry for an IRQ resource, try to force one to be routed to us anyway by adding an extra call to bus_alloc_resource(). If this fails, then we have to abort the attach. Patch provided by jhb, tweaked by me.
Diffstat (limited to 'sys/dev/if_ndis')
-rw-r--r--sys/dev/if_ndis/if_ndis_pci.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/sys/dev/if_ndis/if_ndis_pci.c b/sys/dev/if_ndis/if_ndis_pci.c
index 6b293e5..36bdcb8 100644
--- a/sys/dev/if_ndis/if_ndis_pci.c
+++ b/sys/dev/if_ndis/if_ndis_pci.c
@@ -263,6 +263,26 @@ ndis_attach_pci(dev)
}
/*
+ * If the BIOS did not set up an interrupt for this device,
+ * the resource traversal code above will fail to set up
+ * an IRQ resource. This is usually a bad thing, so try to
+ * force the allocation of an interrupt here. If one was
+ * not assigned to us by the BIOS, bus_alloc_resource()
+ * should route one for us.
+ */
+ if (sc->ndis_irq == NULL) {
+ rid = 0;
+ 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, "couldn't route interrupt\n");
+ error = ENXIO;
+ goto fail;
+ }
+ sc->ndis_rescnt++;
+ }
+
+ /*
* Allocate the parent bus DMA tag appropriate for PCI.
*/
#define NDIS_NSEG_NEW 32
OpenPOWER on IntegriCloud