diff options
author | imp <imp@FreeBSD.org> | 2003-02-12 05:57:02 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2003-02-12 05:57:02 +0000 |
commit | 7c1257f6fed77e3303772837c2907d017c60e7c9 (patch) | |
tree | 28e5fe448911572787908451c6c8d9ba67940fe9 /sys/dev/cardbus | |
parent | 69fdce865dd81c6c7a9905ef288c04f1d54503f1 (diff) | |
download | FreeBSD-src-7c1257f6fed77e3303772837c2907d017c60e7c9.zip FreeBSD-src-7c1257f6fed77e3303772837c2907d017c60e7c9.tar.gz |
MFp4:
Second part of the kldload patches for cardbus. This makes
kldload of a driver for a device that's inserted now appears
to work. To make it work, we only do a power cycle of the card
if there's no children drivers attached.
This likely is papering over bogosities in the power system. The
power sequence needs to be re-written, so I'll not worry about
the papering over until the re-write.
Diffstat (limited to 'sys/dev/cardbus')
-rw-r--r-- | sys/dev/cardbus/cardbus.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/sys/dev/cardbus/cardbus.c b/sys/dev/cardbus/cardbus.c index 01e7700..48a58fc 100644 --- a/sys/dev/cardbus/cardbus.c +++ b/sys/dev/cardbus/cardbus.c @@ -313,6 +313,17 @@ cardbus_driver_added(device_t cbdev, driver_t *driver) DEVICE_IDENTIFY(driver, cbdev); device_get_children(cbdev, &devlist, &numdevs); + /* + * If there are no drivers attached, but there are children, + * then power the card up. + */ + for (i = 0; i < numdevs; i++) { + dev = devlist[i]; + if (device_get_state(dev) != DS_NOTPRESENT) + break; + } + if (i > 0 && i == numdevs) + POWER_ENABLE_SOCKET(device_get_parent(cbdev), cbdev); for (i = 0; i < numdevs; i++) { dev = devlist[i]; if (device_get_state(dev) != DS_NOTPRESENT) |