 if (status == C80211_MGMT_SC_Success && priv->wep_is_on) { 
 if (status == C80211_MGMT_SC_Success && priv->wep_is_on) { 
static void authenticate(struct atmel_private *priv, u16 frame_len){	struct auth_body *auth = (struct auth_body *)priv->rx_buf;	u16 status = le16_to_cpu(auth->status);	u16 trans_seq_no = le16_to_cpu(auth->trans_seq);	u16 system = le16_to_cpu(auth->alg);		if (status == C80211_MGMT_SC_Success && !priv->wep_is_on) { 		/* no WEP */		if (priv->station_was_associated) {			atmel_enter_state(priv, STATION_STATE_REASSOCIATING);			send_association_request(priv, 1);			return;		} else {			atmel_enter_state(priv, STATION_STATE_ASSOCIATING);			send_association_request(priv, 0);			return;		} 	}			if (status == C80211_MGMT_SC_Success && priv->wep_is_on) { 		/* WEP */		if (trans_seq_no != priv->ExpectedAuthentTransactionSeqNum)			return;						if (trans_seq_no == 0x0002 &&		    auth->el_id == C80211_MGMT_ElementID_ChallengeText) {			send_authentication_request(priv, system, auth->chall_text, auth->chall_text_len);			return;		}				if (trans_seq_no == 0x0004) {			if(priv->station_was_associated) {				atmel_enter_state(priv, STATION_STATE_REASSOCIATING);				send_association_request(priv, 1);				return;			} else {				atmel_enter_state(priv, STATION_STATE_ASSOCIATING);				send_association_request(priv, 0);				return;			} 		}	}					if (status == C80211_MGMT_SC_AuthAlgNotSupported) {		/* Do opensystem first, then try sharedkey */		if (system ==  C80211_MGMT_AAN_OPENSYSTEM) {			priv->CurrentAuthentTransactionSeqNum = 0x001;			send_authentication_request(priv, C80211_MGMT_AAN_SHAREDKEY, NULL, 0);		} else if (priv->connect_to_any_BSS) {			int bss_index;						priv->BSSinfo[(int)(priv->current_BSS)].channel |= 0x80;						if ((bss_index  = retrieve_bss(priv)) != -1) {				atmel_join_bss(priv, bss_index);				return;			}		}	}			priv->AuthenticationRequestRetryCnt = 0;	atmel_enter_state(priv,  STATION_STATE_MGMT_ERROR);	priv->station_is_associated = 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/4d791aadf63c9d605bc9a4144e79d5756fc29fb3/atmel.c/clean/drivers/net/wireless/atmel.c