static int atmel_get_scan(struct net_device *dev,			  struct iw_request_info *info,			  struct iw_point *dwrq,			  char *extra){	struct atmel_private *priv = netdev_priv(dev);	int i;	char *current_ev = extra;	struct iw_event	iwe;		if (priv->site_survey_state != SITE_SURVEY_COMPLETED)		return -EAGAIN;		for(i=0; i<priv->BSS_list_entries; i++) { 		iwe.cmd = SIOCGIWAP;		iwe.u.ap_addr.sa_family = ARPHRD_ETHER;		memcpy(iwe.u.ap_addr.sa_data, priv->BSSinfo[i].BSSID, 6);		current_ev = iwe_stream_add_event(current_ev, extra + IW_SCAN_MAX_DATA, &iwe, IW_EV_ADDR_LEN);		iwe.u.data.length =  priv->BSSinfo[i].SSIDsize;		if (iwe.u.data.length > 32)			iwe.u.data.length = 32;		iwe.cmd = SIOCGIWESSID;		iwe.u.data.flags = 1;		current_ev = iwe_stream_add_point(current_ev, extra + IW_SCAN_MAX_DATA, &iwe, priv->BSSinfo[i].SSID);				iwe.cmd = SIOCGIWMODE;		iwe.u.mode = priv->BSSinfo[i].BSStype;		current_ev = iwe_stream_add_event(current_ev, extra + IW_SCAN_MAX_DATA, &iwe, IW_EV_UINT_LEN);			iwe.cmd = SIOCGIWFREQ;		iwe.u.freq.m = priv->BSSinfo[i].channel;		iwe.u.freq.e = 0;		current_ev = iwe_stream_add_event(current_ev, extra + IW_SCAN_MAX_DATA, &iwe, IW_EV_FREQ_LEN);				iwe.cmd = SIOCGIWENCODE;		if (priv->BSSinfo[i].UsingWEP)			iwe.u.data.flags = IW_ENCODE_ENABLED | IW_ENCODE_NOKEY;		else			iwe.u.data.flags = IW_ENCODE_DISABLED;		iwe.u.data.length = 0;		current_ev = iwe_stream_add_point(current_ev, extra + IW_SCAN_MAX_DATA, &iwe, NULL);			}	/* Length of data */	dwrq->length = (current_ev - extra);	dwrq->flags = 0;   		return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/4d791aadf63c9d605bc9a4144e79d5756fc29fb3/atmel.c/clean/drivers/net/wireless/atmel.c