Re: \Storage Card doesn't always reload when ATADISK reloaded
- From: Andrew Worsley <andrew.worsley@xxxxxxxxxxx>
- Date: Thu, 30 Jun 2005 09:16:41 +1200
Thanks Nick,
Unfortunately, we can't use the method you describe, because our card
door switch is a separate digital input - it does not interact with the
card detect signals. We had a good reason for designing it that way - we
want to support IO cards in the slot also, and the card door needs to be
open for most of those to work properly (since our door is made of
metal...). Hence we need to determine the card type (ie run the normal
PCMCIA detect functions) before deciding whether to load the associated
driver or not.
We get a separate interrupt when the card door opens/closes, and we have
built a separate device driver to handle those interrupts. We use that
driver as a proxy for loading/unloading the standard ATADISK driver (in
the same way the PCMCIA driver does it). We have the registry set up to
use the ATADISK driver's detection function, but (if an ATADISK card is
detected) to then load our "card door driver". The card door driver then
delays the loading of ATADISK until the door is closed, and it will
unload it again after the door is opened.
Having said that, it may be useful for us to get PCMCIA event
notifications as well, so thanks for the info on how to do it!
Andrew
In article <H6ywe.63752$g5.36768@xxxxxxxxxxxxxxxxxxxx>,
nospam@xxxxxxxxxxxxxxxxxxx says...
> Andrew,
>
> The door switch is not in the CF spec and it does not really indicate
> the actual insertion state of the CF card. Usually this is used as an
> additional signal in the system to disable access to the card. I've
> seen this used extensively on digital cameras.
>
> The card detect signals (which are defined in the PCMCIA/CF spec) are
> already handled in PCMCIA.DLL. This is what the OS is monitoring for
> insertion/removal notification.
>
> If your CF card is modeled after a PCMCIA card, then you can get
> notification of an insertion and removal by registering for PCMCIA event
> notifications. Here is how I did it.
>
> Also, at startup, if there is a CF in the slot, I think the OS generates
> an insertion signal artificially.
>
> Nick.
>
>
> PCMCIAHelper.H file:
> #include <cardserv.h>
>
> // define the function prototypes.
> // define PCMCIA_CARD_REGISTER_CLIENT as a pointer to a function that
> returns
> // a CARD_CLIENT_HANDLE and takes CLIENT_CALLBACK and
> PCARD_REGISTER_PARMS as
> // parameters.
> typedef CARD_CLIENT_HANDLE (CALLBACK* PCMCIA_CARD_REGISTER_CLIENT)
> (CLIENT_CALLBACK, PCARD_REGISTER_PARMS);
>
> // define PCMCIA_CARD_DEREGISTER_CLIENT as a pointer to a function that
> returns
> // a STATUS and takes CARD_CLIENT_HANDLE as a parameter.
> typedef STATUS (CALLBACK* PCMCIA_CARD_DEREGISTER_CLIENT)
> (CARD_CLIENT_HANDLE);
>
> // define PCMCIA_CARD_GET_STATUS as a pointer to a function that returns
> // a STATUS and takes PCARD_STATUS as a parameter.
> typedef STATUS (CALLBACK* PCMCIA_CARD_GET_STATUS) (PCARD_STATUS);
>
>
> PCMCIAHelper.C file:
>
> #include <windows.h>
> #include <ceddk.h>
>
> // Variables that are global to this module.
.
- References:
- \Storage Card doesn't always reload when ATADISK reloaded
- From: Andrew Worsley
- Re: \Storage Card doesn't always reload when ATADISK reloaded
- From: Ten
- \Storage Card doesn't always reload when ATADISK reloaded
- Prev by Date: Re: \Storage Card doesn't always reload when ATADISK reloaded
- Next by Date: Re: Closing a thread that is waiting for Irq
- Previous by thread: Re: \Storage Card doesn't always reload when ATADISK reloaded
- Next by thread: DEBUGCHK failed in file mapfile.c at line 2257
- Index(es):
Relevant Pages
|
|