info_element = &beacon->info_element; 
info_element = beacon->info_element; 
static inline int ieee80211_network_init(struct ieee80211_device *ieee, struct ieee80211_probe_response					 *beacon,					 struct ieee80211_network *network,					 struct ieee80211_rx_stats *stats){#ifdef CONFIG_IEEE80211_DEBUG	char rates_str[64];	char *p;#endif	struct ieee80211_info_element *info_element;	u16 left;	u8 i;	/* Pull out fixed field data */	memcpy(network->bssid, beacon->header.addr3, ETH_ALEN);	network->capability = le16_to_cpu(beacon->capability);	network->last_scanned = jiffies;	network->time_stamp[0] = le32_to_cpu(beacon->time_stamp[0]);	network->time_stamp[1] = le32_to_cpu(beacon->time_stamp[1]);	network->beacon_interval = le16_to_cpu(beacon->beacon_interval);	/* Where to pull this? beacon->listen_interval; */	network->listen_interval = 0x0A;	network->rates_len = network->rates_ex_len = 0;	network->last_associate = 0;	network->ssid_len = 0;	network->flags = 0;	network->atim_window = 0;	if (stats->freq == IEEE80211_52GHZ_BAND) {		/* for A band (No DS info) */		network->channel = stats->received_channel;	} else		network->flags |= NETWORK_HAS_CCK;	network->wpa_ie_len = 0;	network->rsn_ie_len = 0;	info_element = &beacon->info_element;	left = stats->len - ((void *)info_element - (void *)beacon);	while (left >= sizeof(struct ieee80211_info_element_hdr)) {		if (sizeof(struct ieee80211_info_element_hdr) +		    info_element->len > left) {			IEEE80211_DEBUG_SCAN			    ("SCAN: parse failed: info_element->len + 2 > left : info_element->len+2=%Zd left=%d.\n",			     info_element->len +			     sizeof(struct ieee80211_info_element), left);			return 1;		}		switch (info_element->id) {		case MFIE_TYPE_SSID:			if (ieee80211_is_empty_essid(info_element->data,						     info_element->len)) {				network->flags |= NETWORK_EMPTY_ESSID;				break;			}			network->ssid_len = min(info_element->len,						(u8) IW_ESSID_MAX_SIZE);			memcpy(network->ssid, info_element->data,			       network->ssid_len);			if (network->ssid_len < IW_ESSID_MAX_SIZE)				memset(network->ssid + network->ssid_len, 0,				       IW_ESSID_MAX_SIZE - network->ssid_len);			IEEE80211_DEBUG_SCAN("MFIE_TYPE_SSID: '%s' len=%d.\n",					     network->ssid, network->ssid_len);			break;		case MFIE_TYPE_RATES:#ifdef CONFIG_IEEE80211_DEBUG			p = rates_str;#endif			network->rates_len =			    min(info_element->len, MAX_RATES_LENGTH);			for (i = 0; i < network->rates_len; i++) {				network->rates[i] = info_element->data[i];#ifdef CONFIG_IEEE80211_DEBUG				p += snprintf(p,					      sizeof(rates_str) - (p -								   rates_str),					      "%02X ", network->rates[i]);#endif				if (ieee80211_is_ofdm_rate				    (info_element->data[i])) {					network->flags |= NETWORK_HAS_OFDM;					if (info_element->data[i] &					    IEEE80211_BASIC_RATE_MASK)						network->flags &=						    ~NETWORK_HAS_CCK;				}			}			IEEE80211_DEBUG_SCAN("MFIE_TYPE_RATES: '%s' (%d)\n",					     rates_str, network->rates_len);			break;		case MFIE_TYPE_RATES_EX:#ifdef CONFIG_IEEE80211_DEBUG			p = rates_str;#endif			network->rates_ex_len =			    min(info_element->len, MAX_RATES_EX_LENGTH);			for (i = 0; i < network->rates_ex_len; i++) {				network->rates_ex[i] = info_element->data[i];#ifdef CONFIG_IEEE80211_DEBUG				p += snprintf(p,					      sizeof(rates_str) - (p -								   rates_str),					      "%02X ", network->rates[i]);#endif				if (ieee80211_is_ofdm_rate				    (info_element->data[i])) {					network->flags |= NETWORK_HAS_OFDM;					if (info_element->data[i] &					    IEEE80211_BASIC_RATE_MASK)						network->flags &=						    ~NETWORK_HAS_CCK;				}			}			IEEE80211_DEBUG_SCAN("MFIE_TYPE_RATES_EX: '%s' (%d)\n",					     rates_str, network->rates_ex_len);			break;		case MFIE_TYPE_DS_SET:			IEEE80211_DEBUG_SCAN("MFIE_TYPE_DS_SET: %d\n",					     info_element->data[0]);			if (stats->freq == IEEE80211_24GHZ_BAND)				network->channel = info_element->data[0];			break;		case MFIE_TYPE_FH_SET:			IEEE80211_DEBUG_SCAN("MFIE_TYPE_FH_SET: ignored\n");			break;		case MFIE_TYPE_CF_SET:			IEEE80211_DEBUG_SCAN("MFIE_TYPE_CF_SET: ignored\n");			break;		case MFIE_TYPE_TIM:			IEEE80211_DEBUG_SCAN("MFIE_TYPE_TIM: ignored\n");			break;		case MFIE_TYPE_IBSS_SET:			IEEE80211_DEBUG_SCAN("MFIE_TYPE_IBSS_SET: ignored\n");			break;		case MFIE_TYPE_CHALLENGE:			IEEE80211_DEBUG_SCAN("MFIE_TYPE_CHALLENGE: ignored\n");			break;		case MFIE_TYPE_GENERIC:			IEEE80211_DEBUG_SCAN("MFIE_TYPE_GENERIC: %d bytes\n",					     info_element->len);			if (info_element->len >= 4 &&			    info_element->data[0] == 0x00 &&			    info_element->data[1] == 0x50 &&			    info_element->data[2] == 0xf2 &&			    info_element->data[3] == 0x01) {				network->wpa_ie_len = min(info_element->len + 2,							  MAX_WPA_IE_LEN);				memcpy(network->wpa_ie, info_element,				       network->wpa_ie_len);			}			break;		case MFIE_TYPE_RSN:			IEEE80211_DEBUG_SCAN("MFIE_TYPE_RSN: %d bytes\n",					     info_element->len);			network->rsn_ie_len = min(info_element->len + 2,						  MAX_WPA_IE_LEN);			memcpy(network->rsn_ie, info_element,			       network->rsn_ie_len);			break;		default:			IEEE80211_DEBUG_SCAN("unsupported IE %d\n",					     info_element->id);			break;		}		left -= sizeof(struct ieee80211_info_element_hdr) +		    info_element->len;		info_element = (struct ieee80211_info_element *)		    &info_element->data[info_element->len];	}	network->mode = 0;	if (stats->freq == IEEE80211_52GHZ_BAND)		network->mode = IEEE_A;	else {		if (network->flags & NETWORK_HAS_OFDM)			network->mode |= IEEE_G;		if (network->flags & NETWORK_HAS_CCK)			network->mode |= IEEE_B;	}	if (network->mode == 0) {		IEEE80211_DEBUG_SCAN("Filtered out '%s (" MAC_FMT ")' "				     "network.\n",				     escape_essid(network->ssid,						  network->ssid_len),				     MAC_ARG(network->bssid));		return 1;	}	if (ieee80211_is_empty_essid(network->ssid, network->ssid_len))		network->flags |= NETWORK_EMPTY_ESSID;	memcpy(&network->stats, stats, sizeof(network->stats));	return 0;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/68e4e036b841d5fb23ae1ac51b1e40baf9d582bf/ieee80211_rx.c/buggy/net/ieee80211/ieee80211_rx.c