On Tue, Nov 30, 1999 at 04:52:33PM -0700, Warner Losh wrote:
> It would help me if you could send me your patches...
Well, here's all I've got. It's basically just a sloppy version of
what you suggested.
Index: pccard.c
===================================================================
RCS file: /usr/local/ncvs/freebsd/src/sys/pccard/pccard.c,v
retrieving revision 1.93
diff -u -r1.93 pccard.c
--- pccard.c 1999/11/20 05:01:59 1.93
+++ pccard.c 1999/12/01 02:33:52
@@ -177,8 +177,10 @@
disable_slot(struct slot *slt)
{
device_t pccarddev;
+ device_t *kids;
+ int nkids;
struct pccard_devinfo *devi;
- int i;
+ int i, ret;
/*
* Unload all the drivers on this slot. Note we can't
@@ -191,14 +193,26 @@
* driver is accessing the device and it is removed, then
* all bets are off...
*/
- pccarddev = devclass_get_device(pccard_devclass, 0);
- for (devi = slt->devices; devi; devi = devi->next) {
- if (devi->isahd.id_device != 0) {
- device_delete_child(pccarddev, devi->isahd.id_device);
- devi->isahd.id_device = 0;
- }
+ pccarddev = devclass_get_device(pccard_devclass, slt->slotnum);
+ device_get_children(pccarddev, &kids, &nkids);
+ printf("pccard: %d kids\n", nkids);
+ for (i = 0; i < nkids; i++) {
+ printf("pccard: deleting kid %d\n", i);
+ if (ret=device_delete_child(pccarddev, kids[i]))
+ printf("pccard: delete kid %d failed: %d\n", i, ret);
}
+ /* for (devi = slt->devices; devi; devi = devi->next) {
+ printf("pccard: considering delete\n");
+ if (devi->isahd.id_device != 0) {
+ printf("pccard: doing the delete\n");
+ if (device_delete_child(pccarddev, devi->isahd.id_device))
+ printf("pccard: device_delete_child failed\n");
+ devi->isahd.id_device = 0;
+ }
+ }
+ */
+ printf("pccard: ready to power off\n");
/* Power off the slot 1/2 second after removal of the card */
slt->poff_ch = timeout(power_off_slot, (caddr_t)slt, hz / 2);
slt->pwr_off_pending = 1;
--
Christopher Masto Senior Network Monkey NetMonger Communications
[EMAIL PROTECTED] [EMAIL PROTECTED] http://www.netmonger.net
Free yourself, free your machine, free the daemon -- http://www.freebsd.org/
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message