Subject: Re: question on device detachment
To: Gregory McGarry <g.mcgarry@ieee.org>
From: Ferry Sutanto <fsutanto@yahoo.com>
List: tech-kern
Date: 10/18/2001 15:26:38
--- Gregory McGarry <g.mcgarry@ieee.org> wrote:
> Ferry Sutanto wrote:
> 
> > 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 ? 
> 
> The pcmcia controller receives the insertion/removal
> events, tells the card to deactivate itself and
> notifies its kernel thread to detach the card.
> No ioctls involved.

Thanks for all the replies. I want to know what would
be the right/clean way if a microdrive is connected to
the pcmcia controller. I think it is better to
mount/unmount the drive as the device is
attached/removed. What I have currently is the
following.

1. Interrupt happen.
2. Interrupt handler will send a signal to my daemon.
3. The daemon will ioctl the device and it will
attached/detached the device.
4. When attachment/detachment is successful, the
daemon will mount/unmount. 

Has this been done before ? Any code example i can
look at ?

Thanks!!

Ferry

__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com