priv->channel = bss->channel & 0x7f; 
priv->channel = bss->channel & 0x7f; 
void atmel_join_bss(struct atmel_private *priv, int bss_index){	struct bss_info *bss =  &priv->BSSinfo[bss_index];	memcpy(priv->CurrentBSSID, bss->BSSID, 6);	memcpy(priv->SSID, bss->SSID, priv->SSID_size = bss->SSIDsize);	/* The WPA stuff cares about the current AP address */	if (priv->use_wpa)		build_wpa_mib(priv);		/* When switching to AdHoc turn OFF Power Save if needed */	if (bss->BSStype == IW_MODE_ADHOC &&	    priv->operating_mode != IW_MODE_ADHOC &&	    priv->power_mode) {		priv->power_mode = 0;		priv->listen_interval = 1;		atmel_set_mib8(priv, Mac_Mgmt_Mib_Type, MAC_MGMT_MIB_PS_MODE_POS,  ACTIVE_MODE);		atmel_set_mib16(priv, Mac_Mgmt_Mib_Type, MAC_MGMT_MIB_LISTEN_INTERVAL_POS, 1);	}			priv->operating_mode = bss->BSStype;	priv->channel = bss->channel & 0x7f; 		priv->beacon_period = bss->beacon_period;		if (priv->preamble != bss->preamble) {		priv->preamble = bss->preamble;		atmel_set_mib8(priv, Local_Mib_Type, LOCAL_MIB_PREAMBLE_TYPE, bss->preamble);	}		if (!priv->wep_is_on && bss->UsingWEP) {		atmel_enter_state(priv, STATION_STATE_MGMT_ERROR);		priv->station_is_associated = 0;		return;	}			if (priv->wep_is_on && !bss->UsingWEP) {		atmel_enter_state(priv, STATION_STATE_MGMT_ERROR);		priv->station_is_associated = 0;		return;	}	atmel_enter_state(priv, STATION_STATE_JOINNING);		if (priv->operating_mode == IW_MODE_INFRA)		join(priv, BSS_TYPE_INFRASTRUCTURE);	else 		join(priv, BSS_TYPE_AD_HOC);}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/4d791aadf63c9d605bc9a4144e79d5756fc29fb3/atmel.c/clean/drivers/net/wireless/atmel.c