Subject: Re: if_delete * if_alloc
To: None <tech-kern@NetBSD.ORG>
From: John Kohl <>
List: tech-kern
Date: 07/09/1997 18:08:43
>>>>> "cgd" == "Chris G Demetriou" <> writes:

cgd> Unfortunately, for the case where a driver's detaching because of an
cgd> interrupt-driven event (e.g. PCMCIA card being yanked while the device
cgd> is 'hot'), there's no great solution right now.

In that case, you're pretty much guaranteeed to get screwed at some time
or other by inopportune timing (say, a packet arrives on the interface
just as you pop it out; the driver then tries PIO to fetch it, and bus
cycles hang, etc.).

If the device is truly idle, you can probably get away with removing a
pcmcia card, but if you can make it go idle, why can't you then run a
pre-eject routine to clean up software state?

(Win95 has a "make it safe to remove this card" menu, and it will flame
you if you eject a card without doing that first.  It might hang, too,
depending on what you're doing when the card is physically ejected.