/* This is for the later (WPA enabled) firmware. */ 
/* This is for the later (WPA enabled) firmware. */ 
static void build_wpa_mib(struct atmel_private *priv){	/* This is for the later (WPA enabled) firmware. */	   	struct { /* NB this is matched to the hardware, don't change. */		u8 cipher_default_key_value[MAX_ENCRYPTION_KEYS][MAX_ENCRYPTION_KEY_SIZE];		u8 receiver_address[6];		u8 wep_is_on;                 		u8 default_key; /* 0..3 */		u8 group_key;		u8 exclude_unencrypted;		u8 encryption_type;		u8 reserved;				u32 WEPICV_error_count;		u32 WEP_excluded_count;				u8 key_RSC[4][8];	} mib;		int i;	mib.wep_is_on = priv->wep_is_on;	mib.exclude_unencrypted = priv->exclude_unencrypted;	memcpy(mib.receiver_address, priv->CurrentBSSID, 6);		/* zero all the keys before adding in valid ones. */	memset(mib.cipher_default_key_value, 0, sizeof(mib.cipher_default_key_value));		if (priv->wep_is_on) {		/* There's a comment in the Atmel code to the effect that this is only valid		   when still using WEP, it may need to be set to something to use WPA */		memset(mib.key_RSC, 0, sizeof(mib.key_RSC));				mib.default_key = mib.group_key = 255;		for (i = 0; i < MAX_ENCRYPTION_KEYS; i++) {			if (priv->wep_key_len[i] > 0) {				memcpy(mib.cipher_default_key_value[i], priv->wep_keys[i], MAX_ENCRYPTION_KEY_SIZE);				if (i == priv->default_key) {					mib.default_key = i;					mib.cipher_default_key_value[i][MAX_ENCRYPTION_KEY_SIZE-1] = 7;					mib.cipher_default_key_value[i][MAX_ENCRYPTION_KEY_SIZE-2] = priv->pairwise_cipher_suite; 				} else {					mib.group_key = i;					priv->group_cipher_suite = priv->pairwise_cipher_suite;				        mib.cipher_default_key_value[i][MAX_ENCRYPTION_KEY_SIZE-1] = 1;					mib.cipher_default_key_value[i][MAX_ENCRYPTION_KEY_SIZE-2] = priv->group_cipher_suite;					}			}		}		if (mib.default_key == 255)			mib.default_key = mib.group_key != 255 ? mib.group_key : 0;		if (mib.group_key == 255)			mib.group_key = mib.default_key;			}		atmel_set_mib(priv, Mac_Wep_Mib_Type, 0, (u8 *)&mib, sizeof(mib));}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/4d791aadf63c9d605bc9a4144e79d5756fc29fb3/atmel.c/clean/drivers/net/wireless/atmel.c