[PATCH] libertas: fix 'keep previous scan' behavior

Do not clear the scan list except under specific conditions, such as
when (a) user-requested, or (b) joining/starting an adhoc network.
Furthermore, only clear entries which match the SSID or BSSID of the
request, not the whole scan list.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c
index 4605bd3..4bc128f 100644
--- a/drivers/net/wireless/libertas/assoc.c
+++ b/drivers/net/wireless/libertas/assoc.c
@@ -25,7 +25,7 @@
 	lbs_deb_assoc("New SSID requested: %s\n", assoc_req->ssid.ssid);
 	if (assoc_req->mode == IW_MODE_INFRA) {
 		if (adapter->prescan) {
-			libertas_send_specific_SSID_scan(priv, &assoc_req->ssid, 1);
+			libertas_send_specific_SSID_scan(priv, &assoc_req->ssid, 0);
 		}
 
 		bss = libertas_find_SSID_in_list(adapter, &assoc_req->ssid,
@@ -44,7 +44,7 @@
 		/* Scan for the network, do not save previous results.  Stale
 		 *   scan data will cause us to join a non-existant adhoc network
 		 */
-		libertas_send_specific_SSID_scan(priv, &assoc_req->ssid, 0);
+		libertas_send_specific_SSID_scan(priv, &assoc_req->ssid, 1);
 
 		/* Search for the requested SSID in the scan table */
 		bss = libertas_find_SSID_in_list(adapter, &assoc_req->ssid, NULL,