diff options
author | imp <imp@FreeBSD.org> | 2003-02-11 05:31:35 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2003-02-11 05:31:35 +0000 |
commit | 7a6774448c00a4576af3f0388dd673ae8a3e272f (patch) | |
tree | 9bcdd10c97a4ee1b81928b4a9adcdc1f9b92b5e9 /sys/dev/cardbus | |
parent | 0f7ddd626884fc47570602e01894d31ca7c0ca4c (diff) | |
download | FreeBSD-src-7a6774448c00a4576af3f0388dd673ae8a3e272f.zip FreeBSD-src-7a6774448c00a4576af3f0388dd673ae8a3e272f.tar.gz |
Don't turn off the power of cards when new drivers are added
unconditionally. kldloading a cardbus driver was shooting down other
attached devices because most drivers assume that one cannot
power-cycle cards w/o the driver knowning about it.
Submitted by: simokawa-san
Diffstat (limited to 'sys/dev/cardbus')
-rw-r--r-- | sys/dev/cardbus/cardbus.c | 32 |
1 files changed, 13 insertions, 19 deletions
diff --git a/sys/dev/cardbus/cardbus.c b/sys/dev/cardbus/cardbus.c index f231558..322879c 100644 --- a/sys/dev/cardbus/cardbus.c +++ b/sys/dev/cardbus/cardbus.c @@ -307,29 +307,23 @@ cardbus_driver_added(device_t cbdev, driver_t *driver) { int numdevs; device_t *devlist; - int tmp; + device_t dev; + int i; struct cardbus_devinfo *dinfo; - device_get_children(cbdev, &devlist, &numdevs); - DEVICE_IDENTIFY(driver, cbdev); - POWER_ENABLE_SOCKET(device_get_parent(cbdev), cbdev); - for (tmp = 0; tmp < numdevs; tmp++) { - if (device_get_state(devlist[tmp]) == DS_NOTPRESENT) { - dinfo = device_get_ivars(devlist[tmp]); -#ifdef notyet - cardbus_device_setup_regs(brdev, bus, slot, func, - &dinfo->pci.cfg); -#endif - cardbus_print_verbose(dinfo); - resource_list_init(&dinfo->pci.resources); - cardbus_do_cis(cbdev, dinfo->pci.cfg.dev); - if (device_probe_and_attach(dinfo->pci.cfg.dev) != 0) { - cardbus_release_all_resources(cbdev, dinfo); - } - } + device_get_children(cbdev, &devlist, &numdevs); + for (i = 0; i < numdevs; i++) { + dev = devlist[i]; + if (device_get_state(dev) != DS_NOTPRESENT) + continue; + dinfo = device_get_ivars(dev); + cardbus_print_verbose(dinfo); + resource_list_init(&dinfo->pci.resources); + cardbus_do_cis(cbdev, dev); + if (device_probe_and_attach(dev) != 0) + cardbus_release_all_resources(cbdev, dinfo); } - free(devlist, M_TEMP); } |