[ECOS] PC Card Interrupts
Trenton D. Adams
tadams@theone.dnsalias.com
Sat Oct 13 10:34:00 GMT 2001
I have the following for my wavelan driver.
ETH_DRV_SC(wvlan_sc,
&_wvlan_priv_data, // Driver specific data
"eth0", // Name for this interface
wvlan_start,
wvlan_stop,
wvlan_control,
wvlan_can_send,
wvlan_send,
wvlan_recv,
wvlan_int, // deliver function, called from fast net thread
wvlan_int,
wvlan_int_vector
);
Is the following really sufficient for receiving an interrupt for a card
driver?
cf_register_handler(dp->slot, (void*)eth_drv_dsr, sc);
Should something be added to the core PCMCIA interface such as card
PCMCIA controller interrupt handling as described below? Take for
instance the CL-PS6700 controller. It has an interrupt that indicates
there's an interrupt on the card. We could do something like the
following.
// Add this
struct cf_card_handler
{
void (*handler)(void *);
void *param;
}
// cf_slot updated to this.
struct cf_slot
{
int index; // In case hardware layer needs it
int state;
unsigned char *attr;
int attr_length;
unsigned char *io;
int io_length;
unsigned char *mem;
int mem_length;
int int_num; // Hardware interrupt number
struct cf_irq_handler irq_handler;
struct cf_card_handler card_handler;
};
// Add this
void cf_register_card_handler (struct cf_slot *slot, void
(*handler)(void *), void * param)
{
slot->card_handler.handler = handler;
slot->card_handler.param = param;
}
I think it would be very beneficial because then the PCMCIA controller
driver could handle any interrupt clearing and things. The card_handler
routine would only be called from the PCMCIA controller when an actual
card interrupt has occurred rather than calling it every interrupt like
irq_handler is. Maybe I'm just changing what was originally intended for
irq_handler?
We could still use the irq_handler routine to implement extra things
outside of the PCMCIA driver such as power management or something.
As it is right now, I have no way of know whether it's a card interrupt
or not unless I do the following.
// Inside wvlan_int ()
#ifdef __EDB7211 // Any other boards with a CL-PS6700?
if (*(unsigned volatile*)PCISR & EV_PCM_RDY_L))
{ // CARD INTERRUPT
#endif
// handle the card interrupt
#ifdef __EDB7211
}
#endif
Either that, or have the PCMCIA controller driver only call the
irq_handler when it is a card interrupt. That would however prevent me
from doing anything like power management when the controller is IDLE,
or the battery is low, etc.
What do you people think?
More information about the Ecos-discuss
mailing list