Subject: Re: question on device detachment
To: Ferry Sutanto <fsutanto@yahoo.com>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-kern
Date: 10/18/2001 21:04:35
On Thu, Oct 18, 2001 at 01:37:53AM -0700, Ferry Sutanto wrote:
> Hello,
> 
> I did a search on www.netbsd.org on "device
> detachment", and I got lots of results. But, I got few
> questions. 
> 
> I looked into sys/dev/pcmcia codes and in that
> directory, there are some detach function defines. I
> want to know who called the detach function ? I assume
> that the following call chain occurs:
> 
> 1. pcmcia interrupt happen.
> 2. the interrupt handler will handle the interrupt and
> signal the daemon process.
> 3. the daemon process will do ioctl on the device.
> 4. ioctl will do the detachment. I think to do the
> detachment, it should start with config_detach ?? (and
> from the device tree, it will finds its way to the
> device specific detach function. 
> 
> Am I right with the above assumption ? 

Almost. This is not a daemon, but a kernel thread.
And, for the pcmcia case I'm not sure there is a kernel thread at all (the
interrupt routine calls the detach funtion directly).
There is a kernel thread for cardbus.

--
Manuel Bouyer <bouyer@antioche.eu.org>
--