kernels/linux-2.4.0/drivers/isdn/avmb1/avm_cs.c
/*======================================================================

    The card status event handler.  Mostly, this schedules other
    stuff to run after an event is received.  A CARD_REMOVAL event
    also sets some flags to discourage the net drivers from trying
    to talk to the card any more.

    When a CARD_REMOVAL event is received, we immediately set a flag
    to block future accesses to this device.  All the functions that
    actually access the device should check this flag to make sure
    the card is still present.
    
======================================================================*/
The card status event handler.  Mostly, this schedules other
stuff to run after an event is received.  A CARD_REMOVAL event
also sets some flags to discourage the net drivers from trying
to talk to the card any more.

When a CARD_REMOVAL event is received, we immediately set a flag
to block future accesses to this device.  All the functions that
actually access the device should check this flag to make sure
the card is still present.
The card status event handler . Mostly this schedules other stuff to run after an event is received . A CARD_REMOVAL event also sets some flags to discourage the net drivers from trying to talk to the card any more . When a CARD_REMOVAL event is received we immediately set a flag to block future accesses to this device . All the functions that actually access the device should check this flag to make sure the card is still present .
static int avmcs_event(event_t event, int priority,
			  event_callback_args_t *args)
{
    dev_link_t *link = args->client_data;
    switch (event) {
    case CS_EVENT_CARD_REMOVAL:
	link->state &= ~DEV_PRESENT;
	if (link->state & DEV_CONFIG) {
	    link->release.expires = jiffies + (HZ/20);
	    add_timer(&link->release);
	}
	break;
    case CS_EVENT_CARD_INSERTION:
	link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
	avmcs_config(link);
	break;
    case CS_EVENT_PM_SUSPEND:
	link->state |= DEV_SUSPEND;
    case CS_EVENT_RESET_PHYSICAL:
	if (link->state & DEV_CONFIG)
	    CardServices(ReleaseConfiguration, link->handle);
	break;
    case CS_EVENT_PM_RESUME:
	link->state &= ~DEV_SUSPEND;
    case CS_EVENT_CARD_RESET:
	if (link->state & DEV_CONFIG)
	    CardServices(RequestConfiguration, link->handle, &link->conf);
	break;
    }
    return 0;
}
static int avmcs_event ( event_t event , int priority , event_callback_args_t * args ) { dev_link_t * link = args -> client_data ; switch ( event ) { case CS_EVENT_CARD_REMOVAL : link -> state &= ~ DEV_PRESENT ; if ( link -> state & DEV_CONFIG ) { link -> release . expires = jiffies + ( HZ / 20 ) ; add_timer ( & link -> release ) ; } break ; case CS_EVENT_CARD_INSERTION : link -> state |= DEV_PRESENT | DEV_CONFIG_PENDING ; avmcs_config ( link ) ; break ; case CS_EVENT_PM_SUSPEND : link -> state |= DEV_SUSPEND ; case CS_EVENT_RESET_PHYSICAL : if ( link -> state & DEV_CONFIG ) CardServices ( ReleaseConfiguration , link -> handle ) ; break ; case CS_EVENT_PM_RESUME : link -> state &= ~ DEV_SUSPEND ; case CS_EVENT_CARD_RESET : if ( link -> state & DEV_CONFIG ) CardServices ( RequestConfiguration , link -> handle , & link -> conf ) ; break ; } return 0 ; }
The card status event handler.
The card status event handler .
/* Fall through... */ /* Fall through... */