if (link->open) { 
if (dev_open) { 
static int prism2_event(event_t event, int priority,			event_callback_args_t *args){	dev_link_t *link = args->client_data;	struct net_device *dev = (struct net_device *) link->priv;	switch (event) {	case CS_EVENT_CARD_INSERTION:		PDEBUG(DEBUG_EXTRA, "%s: CS_EVENT_CARD_INSERTION\n", dev_info);		link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;		if (prism2_config(link)) {			PDEBUG(DEBUG_EXTRA, "prism2_config() failed\n");		}		break;	case CS_EVENT_CARD_REMOVAL:		PDEBUG(DEBUG_EXTRA, "%s: CS_EVENT_CARD_REMOVAL\n", dev_info);		link->state &= ~DEV_PRESENT;		if (link->state & DEV_CONFIG) {			netif_stop_queue(dev);			netif_device_detach(dev);			prism2_release((u_long) link);		}		break;	case CS_EVENT_PM_SUSPEND:		PDEBUG(DEBUG_EXTRA, "%s: CS_EVENT_PM_SUSPEND\n", dev_info);		link->state |= DEV_SUSPEND;		/* fall through */	case CS_EVENT_RESET_PHYSICAL:		PDEBUG(DEBUG_EXTRA, "%s: CS_EVENT_RESET_PHYSICAL\n", dev_info);		if (link->state & DEV_CONFIG) {			if (link->open) {				netif_stop_queue(dev);				netif_device_detach(dev);			}			prism2_suspend(dev);			pcmcia_release_configuration(link->handle);		}		break;	case CS_EVENT_PM_RESUME:		PDEBUG(DEBUG_EXTRA, "%s: CS_EVENT_PM_RESUME\n", dev_info);		link->state &= ~DEV_SUSPEND;		/* fall through */	case CS_EVENT_CARD_RESET:		PDEBUG(DEBUG_EXTRA, "%s: CS_EVENT_CARD_RESET\n", dev_info);		if (link->state & DEV_CONFIG) {			pcmcia_request_configuration(link->handle,						     &link->conf);			prism2_hw_shutdown(dev, 1);			prism2_hw_config(dev, link->open ? 0 : 1);			if (link->open) {				netif_device_attach(dev);				netif_start_queue(dev);			}		}		break;	default:		PDEBUG(DEBUG_EXTRA, "%s: prism2_event() - unknown event %d\n",		       dev_info, event);		break;	}	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/bab76198b3111bd0328be3c1fa208237eb12f86e/hostap_cs.c/clean/drivers/net/wireless/hostap/hostap_cs.c