down(&priv->sem); 
static void shim__set_security(struct net_device *dev,			       struct ieee80211_security *sec){	struct ipw_priv *priv = ieee80211_priv(dev);	int i;	down(&priv->sem);	for (i = 0; i < 4; i++) {		if (sec->flags & (1 << i)) {			priv->ieee->sec.key_sizes[i] = sec->key_sizes[i];			if (sec->key_sizes[i] == 0)				priv->ieee->sec.flags &= ~(1 << i);			else {				memcpy(priv->ieee->sec.keys[i], sec->keys[i],				       sec->key_sizes[i]);				priv->ieee->sec.flags |= (1 << i);			}			priv->status |= STATUS_SECURITY_UPDATED;		} else if (sec->level != SEC_LEVEL_1)			priv->ieee->sec.flags &= ~(1 << i);	}	if (sec->flags & SEC_ACTIVE_KEY) {		if (sec->active_key <= 3) {			priv->ieee->sec.active_key = sec->active_key;			priv->ieee->sec.flags |= SEC_ACTIVE_KEY;		} else			priv->ieee->sec.flags &= ~SEC_ACTIVE_KEY;		priv->status |= STATUS_SECURITY_UPDATED;	} else		priv->ieee->sec.flags &= ~SEC_ACTIVE_KEY;	if ((sec->flags & SEC_AUTH_MODE) &&	    (priv->ieee->sec.auth_mode != sec->auth_mode)) {		priv->ieee->sec.auth_mode = sec->auth_mode;		priv->ieee->sec.flags |= SEC_AUTH_MODE;		if (sec->auth_mode == WLAN_AUTH_SHARED_KEY)			priv->capability |= CAP_SHARED_KEY;		else			priv->capability &= ~CAP_SHARED_KEY;		priv->status |= STATUS_SECURITY_UPDATED;	}	if (sec->flags & SEC_ENABLED && priv->ieee->sec.enabled != sec->enabled) {		priv->ieee->sec.flags |= SEC_ENABLED;		priv->ieee->sec.enabled = sec->enabled;		priv->status |= STATUS_SECURITY_UPDATED;		if (sec->enabled)			priv->capability |= CAP_PRIVACY_ON;		else			priv->capability &= ~CAP_PRIVACY_ON;	}	priv->ieee->sec.encrypt = sec->encrypt;	if (sec->flags & SEC_LEVEL && priv->ieee->sec.level != sec->level) {		priv->ieee->sec.level = sec->level;		priv->ieee->sec.flags |= SEC_LEVEL;		priv->status |= STATUS_SECURITY_UPDATED;	}	if (!priv->ieee->host_encrypt)		ipw_set_hwcrypto_keys(priv);	/* To match current functionality of ipw2100 (which works well w/	 * various supplicants, we don't force a disassociate if the	 * privacy capability changes ... */#if 0	if ((priv->status & (STATUS_ASSOCIATED | STATUS_ASSOCIATING)) &&	    (((priv->assoc_request.capability &	       WLAN_CAPABILITY_PRIVACY) && !sec->enabled) ||	     (!(priv->assoc_request.capability &		WLAN_CAPABILITY_PRIVACY) && sec->enabled))) {		IPW_DEBUG_ASSOC("Disassociating due to capability "				"change.\n");		ipw_disassociate(priv);	}#endif	up(&priv->sem);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/afbf30a2b78cac38e6ddae10a73063943b4783ee/ipw2200.c/buggy/drivers/net/wireless/ipw2200.c