From 9350da3f9847bf5ef63748000a29fd5685788a32 Mon Sep 17 00:00:00 2001 From: imp Date: Mon, 14 May 2001 04:53:02 +0000 Subject: When activating or deactivating a resource, only attempt to deal with the resource activation if we're dealing with our grandchild. Otherwise, we run into two problems. One, if the pccard layer wanted to allocate and activate something, we'd wind up trying to do the wrong thing twice: the ivars are wrong and we don't want the bridge to map the resource to the slot. If we're more than a grandchild, then who knows what kind of ivar is present. In either of these cases, we just pass it up the food chain. --- sys/pccard/pcic.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sys/pccard/pcic.c') diff --git a/sys/pccard/pcic.c b/sys/pccard/pcic.c index 9b319c7..f76e72f 100644 --- a/sys/pccard/pcic.c +++ b/sys/pccard/pcic.c @@ -1135,6 +1135,10 @@ pcic_activate_resource(device_t dev, device_t child, int type, int rid, struct pccard_devinfo *devi = device_get_ivars(child); int err; + if (dev != device_get_parent(device_get_parent(child)) || devi == NULL) + return (bus_generic_activate_resource(dev, child, type, + rid, r)); + switch (type) { case SYS_RES_IOPORT: { struct io_desc *ip; @@ -1187,6 +1191,10 @@ pcic_deactivate_resource(device_t dev, device_t child, int type, int rid, struct pccard_devinfo *devi = device_get_ivars(child); int err; + if (dev != device_get_parent(device_get_parent(child)) || devi == NULL) + return (bus_generic_deactivate_resource(dev, child, type, + rid, r)); + switch (type) { case SYS_RES_IOPORT: { struct io_desc *ip = &devi->slt->io[rid]; -- cgit v1.1