Fix alloc_driver() so that calls devclass_get_device() with slt->slotnum

as the unit argument instead of 0. disable_slot() calls
devclass_get_device() correctly, however because alloc_driver() does
it wrong, disable_slot() is unable to locate the child devices
attached to the pccard bus and thus fails to call device_delete_child()
on them. The end result is that when a card is removed, its detach
routine is never called, and re-insertion always fails.

With this fix (and the previous one to if_wi.c), I can now insert,
remove and re-insert my WaveLAN/IEEE card and things behave correctly.
kldunloading the if_wi.ko module also seems to work properly now.

Ok'ed by: imp
This commit is contained in:
wpaul 1999-12-08 05:34:17 +00:00
parent 235e74ef14
commit 0fef0f17e2

View File

@ -347,7 +347,7 @@ allocate_driver(struct slot *slt, struct dev_desc *desc)
int err, irq = 0;
device_t child;
pccarddev = devclass_get_device(pccard_devclass, 0);
pccarddev = devclass_get_device(pccard_devclass, slt->slotnum);
irq = ffs(desc->irqmask) - 1;
MALLOC(devi, struct pccard_devinfo *, sizeof(*devi), M_DEVBUF, M_WAITOK);
bzero(devi, sizeof(*devi));