summaryrefslogtreecommitdiffstats
path: root/sys/pci/pci.c
diff options
context:
space:
mode:
authorluoqi <luoqi@FreeBSD.org>1999-09-03 04:30:01 +0000
committerluoqi <luoqi@FreeBSD.org>1999-09-03 04:30:01 +0000
commitf98ff677e522f0359d153bd481f32667e46cce3d (patch)
treeda0c38c84079e1ee146f62945a8a85c30f5cfc00 /sys/pci/pci.c
parent7dd0afc89ccaf0f8987f5ced9669b774738f7fd0 (diff)
downloadFreeBSD-src-f98ff677e522f0359d153bd481f32667e46cce3d.zip
FreeBSD-src-f98ff677e522f0359d153bd481f32667e46cce3d.tar.gz
Handle for passthru resource release correctly.
Diffstat (limited to 'sys/pci/pci.c')
-rw-r--r--sys/pci/pci.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/pci/pci.c b/sys/pci/pci.c
index 214d6f9..3792940 100644
--- a/sys/pci/pci.c
+++ b/sys/pci/pci.c
@@ -1376,6 +1376,7 @@ pci_release_resource(device_t dev, device_t child, int type, int rid,
struct pci_devinfo *dinfo = device_get_ivars(child);
pcicfgregs *cfg = &dinfo->cfg;
int map = 0;
+ int passthrough = (device_get_parent(child) != dev);
switch (type) {
case SYS_RES_IRQ:
@@ -1396,10 +1397,7 @@ pci_release_resource(device_t dev, device_t child, int type, int rid,
* Only check the map registers if this is a direct
* descendant.
*/
- if (device_get_parent(child) == dev)
- map = pci_mapno(cfg, rid);
- else
- map = -1;
+ map = passthrough ? -1 : pci_mapno(cfg, rid);
break;
default:
@@ -1411,7 +1409,8 @@ pci_release_resource(device_t dev, device_t child, int type, int rid,
if (rv == 0) {
switch (type) {
case SYS_RES_IRQ:
- cfg->irqres = 0;
+ if (!passthrough)
+ cfg->irqres = 0;
break;
case SYS_RES_DRQ: /* passthru for child isa */
OpenPOWER on IntegriCloud