ipw_set_fixed_rate(priv, network); 
ipw_set_fixed_rate(priv, network->mode); 
static int ipw_associate_network(struct ipw_priv *priv,				 struct ieee80211_network *network,				 struct ipw_supported_rates *rates, int roaming){	int err;	if (priv->config & CFG_FIXED_RATE)		ipw_set_fixed_rate(priv, network);	if (!(priv->config & CFG_STATIC_ESSID)) {		priv->essid_len = min(network->ssid_len,				      (u8) IW_ESSID_MAX_SIZE);		memcpy(priv->essid, network->ssid, priv->essid_len);	}	network->last_associate = jiffies;	memset(&priv->assoc_request, 0, sizeof(priv->assoc_request));	priv->assoc_request.channel = network->channel;	if ((priv->capability & CAP_PRIVACY_ON) &&	    (priv->capability & CAP_SHARED_KEY)) {		priv->assoc_request.auth_type = AUTH_SHARED_KEY;		priv->assoc_request.auth_key = priv->sec.active_key;	} else {		priv->assoc_request.auth_type = AUTH_OPEN;		priv->assoc_request.auth_key = 0;	}	if (priv->capability & CAP_PRIVACY_ON)		ipw_send_wep_keys(priv);	if (priv->ieee->wpa_ie_len) {		priv->assoc_request.policy_support = 0x02;	/* RSN active */		ipw_set_rsn_capa(priv, priv->ieee->wpa_ie,				 priv->ieee->wpa_ie_len);	}	/*	 * It is valid for our ieee device to support multiple modes, but	 * when it comes to associating to a given network we have to choose	 * just one mode.	 */	if (network->mode & priv->ieee->mode & IEEE_A)		priv->assoc_request.ieee_mode = IPW_A_MODE;	else if (network->mode & priv->ieee->mode & IEEE_G)		priv->assoc_request.ieee_mode = IPW_G_MODE;	else if (network->mode & priv->ieee->mode & IEEE_B)		priv->assoc_request.ieee_mode = IPW_B_MODE;	priv->assoc_request.capability = network->capability;	if ((network->capability & WLAN_CAPABILITY_SHORT_PREAMBLE)	    && !(priv->config & CFG_PREAMBLE_LONG)) {		priv->assoc_request.preamble_length = DCT_FLAG_SHORT_PREAMBLE;	} else {		priv->assoc_request.preamble_length = DCT_FLAG_LONG_PREAMBLE;		/* Clear the short preamble if we won't be supporting it */		priv->assoc_request.capability &=		    ~WLAN_CAPABILITY_SHORT_PREAMBLE;	}	IPW_DEBUG_ASSOC("%sssocation attempt: '%s', channel %d, "			"802.11%c [%d], %s[:%s], enc=%s%s%s%c%c\n",			roaming ? "Rea" : "A",			escape_essid(priv->essid, priv->essid_len),			network->channel,			ipw_modes[priv->assoc_request.ieee_mode],			rates->num_rates,			(priv->assoc_request.preamble_length ==			 DCT_FLAG_LONG_PREAMBLE) ? "long" : "short",			network->capability &			WLAN_CAPABILITY_SHORT_PREAMBLE ? "short" : "long",			priv->capability & CAP_PRIVACY_ON ? "on " : "off",			priv->capability & CAP_PRIVACY_ON ?			(priv->capability & CAP_SHARED_KEY ? "(shared)" :			 "(open)") : "",			priv->capability & CAP_PRIVACY_ON ? " key=" : "",			priv->capability & CAP_PRIVACY_ON ?			'1' + priv->sec.active_key : '.',			priv->capability & CAP_PRIVACY_ON ? '.' : ' ');	priv->assoc_request.beacon_interval = network->beacon_interval;	if ((priv->ieee->iw_mode == IW_MODE_ADHOC) &&	    (network->time_stamp[0] == 0) && (network->time_stamp[1] == 0)) {		priv->assoc_request.assoc_type = HC_IBSS_START;		priv->assoc_request.assoc_tsf_msw = 0;		priv->assoc_request.assoc_tsf_lsw = 0;	} else {		if (unlikely(roaming))			priv->assoc_request.assoc_type = HC_REASSOCIATE;		else			priv->assoc_request.assoc_type = HC_ASSOCIATE;		priv->assoc_request.assoc_tsf_msw = network->time_stamp[1];		priv->assoc_request.assoc_tsf_lsw = network->time_stamp[0];	}	memcpy(&priv->assoc_request.bssid, network->bssid, ETH_ALEN);	if (priv->ieee->iw_mode == IW_MODE_ADHOC) {		memset(&priv->assoc_request.dest, 0xFF, ETH_ALEN);		priv->assoc_request.atim_window = network->atim_window;	} else {		memcpy(&priv->assoc_request.dest, network->bssid, ETH_ALEN);		priv->assoc_request.atim_window = 0;	}	priv->assoc_request.listen_interval = network->listen_interval;	err = ipw_send_ssid(priv, priv->essid, priv->essid_len);	if (err) {		IPW_DEBUG_HC("Attempt to send SSID command failed.\n");		return err;	}	rates->ieee_mode = priv->assoc_request.ieee_mode;	rates->purpose = IPW_RATE_CONNECT;	ipw_send_supported_rates(priv, rates);	if (priv->assoc_request.ieee_mode == IPW_G_MODE)		priv->sys_config.dot11g_auto_detection = 1;	else		priv->sys_config.dot11g_auto_detection = 0;	if (priv->ieee->iw_mode == IW_MODE_ADHOC)		priv->sys_config.answer_broadcast_ssid_probe = 1;	else		priv->sys_config.answer_broadcast_ssid_probe = 0;	err = ipw_send_system_config(priv, &priv->sys_config);	if (err) {		IPW_DEBUG_HC("Attempt to send sys config command failed.\n");		return err;	}	IPW_DEBUG_ASSOC("Association sensitivity: %d\n", network->stats.rssi);	err = ipw_set_sensitivity(priv, network->stats.rssi + IPW_RSSI_TO_DBM);	if (err) {		IPW_DEBUG_HC("Attempt to send associate command failed.\n");		return err;	}	/*	 * If preemption is enabled, it is possible for the association	 * to complete before we return from ipw_send_associate.  Therefore	 * we have to be sure and update our priviate data first.	 */	priv->channel = network->channel;	memcpy(priv->bssid, network->bssid, ETH_ALEN);	priv->status |= STATUS_ASSOCIATING;	priv->status &= ~STATUS_SECURITY_UPDATED;	priv->assoc_network = network;	err = ipw_send_associate(priv, &priv->assoc_request);	if (err) {		IPW_DEBUG_HC("Attempt to send associate command failed.\n");		return err;	}	IPW_DEBUG(IPW_DL_STATE, "associating: '%s' " MAC_FMT " \n",		  escape_essid(priv->essid, priv->essid_len),		  MAC_ARG(priv->bssid));	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/b095c3819805f87d73d41641a53e4c070360d783/ipw2200.c/buggy/drivers/net/wireless/ipw2200.c