Date: Tue, 30 Nov 1999 21:35:32 -0500 From: Christopher Masto <chris@netmonger.net> To: Warner Losh <imp@village.org> Cc: Nick Hibma <hibma@skylink.it>, Mike Smith <msmith@FreeBSD.ORG>, FreeBSD CURRENT Mailing List <current@FreeBSD.ORG> Subject: Re: PCCARD eject freeze (was Re: your mail) Message-ID: <19991130213532.A2764@netmonger.net> In-Reply-To: <199911302352.QAA06230@harmony.village.org>; from Warner Losh on Tue, Nov 30, 1999 at 04:52:33PM -0700 References: <19991130160829.A13848@netmonger.net> <199911302112.OAA05264@harmony.village.org> <19991130165407.A467@netmonger.net> <199911302159.OAA05508@harmony.village.org> <19991130173920.A22943@netmonger.net> <199911302304.QAA05780@harmony.village.org> <19991130181313.B24151@netmonger.net> <199911302319.QAA05945@harmony.village.org> <19991130182738.A25453@netmonger.net> <199911302352.QAA06230@harmony.village.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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 chris@netmonger.net info@netmonger.net http://www.netmonger.net Free yourself, free your machine, free the daemon -- http://www.freebsd.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19991130213532.A2764>