[PATCH] libertas: make association paths consistent

The BSS to associate with (in either Infrastructure or IBSS join
operations) is now stored in _one_ place in the association request (the
bss member), not two places as before (pattemptedbss and
curbssparams->bssdescriptor).

Association requests are passed to the necessary association functions
to (a) give them access to the bss member and (b) ensure that
association/join/start setup uses settings from the request, not the
current adapter settings (which may not be valid for the requested
settings).

Because the 'bss' member of the association request is used now, the
command return functions from associate and adhoc join/start need access
to the in-progress association request to update curbssparams when
everything is done.  The association worker moves the request from
pending to in-progress for the duration of the association attempt.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
diff --git a/drivers/net/wireless/libertas/cmdresp.c b/drivers/net/wireless/libertas/cmdresp.c
index 45459d4..6bf50c1 100644
--- a/drivers/net/wireless/libertas/cmdresp.c
+++ b/drivers/net/wireless/libertas/cmdresp.c
@@ -67,25 +67,19 @@
 	lbs_deb_cmd("Previous SSID=%s, ssid length=%u\n",
 	       adapter->previousssid.ssid, adapter->previousssid.ssidlength);
 
-	/* reset internal flags */
-	adapter->secinfo.WPAenabled = 0;
-	adapter->secinfo.WPA2enabled = 0;
-	adapter->wpa_ie_len = 0;
-
 	adapter->connect_status = libertas_disconnected;
 
-	/*
-	 * memorize the previous SSID and BSSID
-	 * it could be used for re-assoc
-	 */
+	/* Save previous SSID and BSSID for possible reassociation */
 	memcpy(&adapter->previousssid,
 	       &adapter->curbssparams.ssid, sizeof(struct WLAN_802_11_SSID));
 	memcpy(adapter->previousbssid,
 	       adapter->curbssparams.bssid, ETH_ALEN);
 
-	/* need to erase the current SSID and BSSID info */
-	adapter->pattemptedbssdesc = NULL;
-	memset(&adapter->curbssparams, 0, sizeof(adapter->curbssparams));
+	/* Clear out associated SSID and BSSID since connection is
+	 * no longer valid.
+	 */
+	memset(&adapter->curbssparams.bssid, 0, ETH_ALEN);
+	memset(&adapter->curbssparams.ssid, 0, sizeof(struct WLAN_802_11_SSID));
 
 	if (adapter->psstate != PS_STATE_FULL_POWER) {
 		/* make firmware to exit PS mode */