 if (priv->station_state == STATION_STATE_SCANNING ) store_bss_info(priv, header, capability, beacon_interval, channel, rssi, ssid_length, &beacon->rates_el_id, subtype == C80211_SUBTYPE_MGMT_BEACON) ; 
 if (priv->station_state == STATION_STATE_SCANNING) store_bss_info(priv, header, capability, beacon_interval, channel, rssi, ssid_length, &beacon->rates_el_id, subtype == C80211_SUBTYPE_MGMT_BEACON); 
static void atmel_management_frame(struct atmel_private *priv, struct ieee80211_hdr_4addr *header, 		      u16 frame_len, u8 rssi){	u16 subtype;		switch (subtype = le16_to_cpu(header->frame_ctl) & IEEE80211_FCTL_STYPE) {	case C80211_SUBTYPE_MGMT_BEACON :	case C80211_SUBTYPE_MGMT_ProbeResponse:				/* beacon frame has multiple variable-length fields -		   never let an engineer loose with a data structure design. */		{			struct beacon_format {				u64 timestamp;				u16 interval;				u16 capability;				u8 ssid_el_id;				u8 ssid_length;				/* ssid here */				u8 rates_el_id;				u8 rates_length;				/* rates here */				u8 ds_el_id;				u8 ds_length;				/* ds here */			} *beacon = (struct beacon_format *)priv->rx_buf;						u8 channel, rates_length, ssid_length;			u64 timestamp = le64_to_cpu(beacon->timestamp);			u16 beacon_interval = le16_to_cpu(beacon->interval);			u16 capability = le16_to_cpu(beacon->capability);			u8 *beaconp = priv->rx_buf;			ssid_length = beacon->ssid_length;			/* this blows chunks. */			if (frame_len < 14 || frame_len < ssid_length + 15) 				return;			rates_length = beaconp[beacon->ssid_length + 15];			if (frame_len < ssid_length + rates_length + 18)				return;			if (ssid_length >  MAX_SSID_LENGTH)				return;			channel = beaconp[ssid_length + rates_length + 18];		       			if (priv->station_state == STATION_STATE_READY) {				smooth_rssi(priv, rssi);				if (is_frame_from_current_bss(priv, header)) { 					priv->beacons_this_sec++;					atmel_smooth_qual(priv);					if (priv->last_beacon_timestamp) {						/* Note truncate this to 32 bits - kernel can't divide a long long */						u32 beacon_delay = timestamp - priv->last_beacon_timestamp;						int beacons = beacon_delay / (beacon_interval * 1000);						if (beacons > 1)							priv->wstats.miss.beacon += beacons - 1;					}					priv->last_beacon_timestamp = timestamp;					handle_beacon_probe(priv, capability, channel);				}			}						if (priv->station_state == STATION_STATE_SCANNING ) 				store_bss_info(priv, header, capability, beacon_interval, channel,					       rssi, ssid_length, &beacon->rates_el_id,					       subtype == C80211_SUBTYPE_MGMT_BEACON) ;		}		break;			case C80211_SUBTYPE_MGMT_Authentication:		if (priv->station_state == STATION_STATE_AUTHENTICATING)			authenticate(priv, frame_len);			break;			case C80211_SUBTYPE_MGMT_ASS_RESPONSE:	case C80211_SUBTYPE_MGMT_REASS_RESPONSE:				if (priv->station_state == STATION_STATE_ASSOCIATING || 		    priv->station_state == STATION_STATE_REASSOCIATING)			associate(priv, frame_len, subtype);				break;	case C80211_SUBTYPE_MGMT_DISASSOSIATION:		if (priv->station_is_associated && 		    priv->operating_mode == IW_MODE_INFRA && 		    is_frame_from_current_bss(priv, header)) {			priv->station_was_associated = 0;			priv->station_is_associated = 0;						atmel_enter_state(priv, STATION_STATE_JOINNING);			join(priv, BSS_TYPE_INFRASTRUCTURE);		}				break;	case C80211_SUBTYPE_MGMT_Deauthentication:		if (priv->operating_mode == IW_MODE_INFRA &&		    is_frame_from_current_bss(priv, header)) {			priv->station_was_associated = 0;			atmel_enter_state(priv, STATION_STATE_JOINNING);			join(priv, BSS_TYPE_INFRASTRUCTURE);		}				break;	}}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/4d791aadf63c9d605bc9a4144e79d5756fc29fb3/atmel.c/clean/drivers/net/wireless/atmel.c