wl1271: Fix Association order and clean scan cache after "driver stop"

Change-Id: I433773112c7c2cba8cfac0de0e32df2e35dab184
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
diff --git a/wilink_6_1/wpa_supplicant_lib/driver_ti.c b/wilink_6_1/wpa_supplicant_lib/driver_ti.c
index a761716..8b4300b 100644
--- a/wilink_6_1/wpa_supplicant_lib/driver_ti.c
+++ b/wilink_6_1/wpa_supplicant_lib/driver_ti.c
@@ -615,6 +615,7 @@
 		}
 		ret = wpa_driver_tista_driver_stop(priv);
 		if( ret == 0 ) {
+			scan_exit(drv); /* clear scan cache */
 			drv->driver_is_loaded = FALSE;
 			wpa_msg(drv->ctx, MSG_INFO, WPA_EVENT_DRIVER_STATE "STOPPED");
 		}
@@ -1307,8 +1308,10 @@
 		}
 	}
 
+#if 0
 	if (!params->bssid)
 		wpa_driver_wext_set_bssid(drv->wext, NULL);
+#endif
 
 #ifdef WPA_SUPPLICANT_VER_0_5_X
 	/* Set driver network mode (Adhoc/Infrastructure) according to supplied parameters */
@@ -1363,7 +1366,6 @@
 	if (params->freq)
 		wpa_driver_wext_set_freq(drv->wext, params->freq);
 
-	ret = wpa_driver_wext_set_ssid(drv->wext, params->ssid, params->ssid_len);
 	if (params->bssid) {
 		wpa_printf(MSG_DEBUG, "wpa_driver_tista_associate: BSSID=" MACSTR,
 			            MAC2STR(params->bssid));
@@ -1373,6 +1375,7 @@
 		}
 	}
 
+	ret = wpa_driver_wext_set_ssid(drv->wext, params->ssid, params->ssid_len);
 	return ret;
 }