struct hfa384x_scan_result *selected, *entry; 
struct hfa384x_hostscan_result *selected, *entry; 
static void prism2_host_roaming(local_info_t *local){	struct hfa384x_join_request req;	struct net_device *dev = local->dev;	struct hfa384x_scan_result *selected, *entry;	int i;	unsigned long flags;	if (local->last_join_time &&	    time_before(jiffies, local->last_join_time + 10 * HZ)) {		PDEBUG(DEBUG_EXTRA, "%s: last join request has not yet been "		       "completed - waiting for it before issuing new one\n",		       dev->name);		return;	}	/* ScanResults are sorted: first ESS results in decreasing signal	 * quality then IBSS results in similar order.	 * Trivial roaming policy: just select the first entry.	 * This could probably be improved by adding hysteresis to limit	 * number of handoffs, etc.	 *	 * Could do periodic RID_SCANREQUEST or Inquire F101 to get new	 * ScanResults */	spin_lock_irqsave(&local->lock, flags);	if (local->last_scan_results == NULL ||	    local->last_scan_results_count == 0) {		spin_unlock_irqrestore(&local->lock, flags);		PDEBUG(DEBUG_EXTRA, "%s: no scan results for host roaming\n",		       dev->name);		return;	}	selected = &local->last_scan_results[0];	if (local->preferred_ap[0] || local->preferred_ap[1] ||	    local->preferred_ap[2] || local->preferred_ap[3] ||	    local->preferred_ap[4] || local->preferred_ap[5]) {		/* Try to find preferred AP */		PDEBUG(DEBUG_EXTRA, "%s: Preferred AP BSSID " MACSTR "\n",		       dev->name, MAC2STR(local->preferred_ap));		for (i = 0; i < local->last_scan_results_count; i++) {			entry = &local->last_scan_results[i];			if (memcmp(local->preferred_ap, entry->bssid, 6) == 0)			{				PDEBUG(DEBUG_EXTRA, "%s: using preferred AP "				       "selection\n", dev->name);				selected = entry;				break;			}		}	}	memcpy(req.bssid, selected->bssid, 6);	req.channel = selected->chid;	spin_unlock_irqrestore(&local->lock, flags);	PDEBUG(DEBUG_EXTRA, "%s: JoinRequest: BSSID=" MACSTR " channel=%d\n",	       dev->name, MAC2STR(req.bssid), le16_to_cpu(req.channel));	if (local->func->set_rid(dev, HFA384X_RID_JOINREQUEST, &req,				 sizeof(req))) {		printk(KERN_DEBUG "%s: JoinRequest failed\n", dev->name);	}	local->last_join_time = jiffies;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/2e4fd068e7e25e654a454ed4a425f239c0f6407a/hostap_info.c/buggy/drivers/net/wireless/hostap/hostap_info.c