if (priv->sec.flags & SEC_UNICAST_GROUP) use_group = priv->sec.unicast_uses_group; 
if (priv->ieee->sec.flags & SEC_UNICAST_GROUP) use_group = priv->ieee->sec.unicast_uses_group; 
static int ipw2100_configure_security(struct ipw2100_priv *priv, int batch_mode){	int i, err, auth_mode, sec_level, use_group;	if (!(priv->status & STATUS_RUNNING))		return 0;	if (!batch_mode) {		err = ipw2100_disable_adapter(priv);		if (err)			return err;	}	if (!priv->sec.enabled) {		err =		    ipw2100_set_security_information(priv, IPW_AUTH_OPEN,						     SEC_LEVEL_0, 0, 1);	} else {		auth_mode = IPW_AUTH_OPEN;		if ((priv->sec.flags & SEC_AUTH_MODE) &&		    (priv->sec.auth_mode == WLAN_AUTH_SHARED_KEY))			auth_mode = IPW_AUTH_SHARED;		sec_level = SEC_LEVEL_0;		if (priv->sec.flags & SEC_LEVEL)			sec_level = priv->sec.level;		use_group = 0;		if (priv->sec.flags & SEC_UNICAST_GROUP)			use_group = priv->sec.unicast_uses_group;		err =		    ipw2100_set_security_information(priv, auth_mode, sec_level,						     use_group, 1);	}	if (err)		goto exit;	if (priv->sec.enabled) {		for (i = 0; i < 4; i++) {			if (!(priv->sec.flags & (1 << i))) {				memset(priv->sec.keys[i], 0, WEP_KEY_LEN);				priv->sec.key_sizes[i] = 0;			} else {				err = ipw2100_set_key(priv, i,						      priv->sec.keys[i],						      priv->sec.key_sizes[i],						      1);				if (err)					goto exit;			}		}		ipw2100_set_key_index(priv, priv->ieee->tx_keyidx, 1);	}	/* Always enable privacy so the Host can filter WEP packets if	 * encrypted data is sent up */	err =	    ipw2100_set_wep_flags(priv,				  priv->sec.enabled ? IPW_PRIVACY_CAPABLE : 0,				  1);	if (err)		goto exit;	priv->status &= ~STATUS_SECURITY_UPDATED;      exit:	if (!batch_mode)		ipw2100_enable_adapter(priv);	return err;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/25b645be1e25e16ea7a25678ac195a0e7595c629/ipw2100.c/clean/drivers/net/wireless/ipw2100.c