wlan: Use Reassociation during BSS Transition

qcacld-2.0 to prima propagation

The BSS transition request is handled by the supplicant.
The supplicant upon receiving the request will issue a
connect request to the driver with a hint of prev_bssid
telling the driver to perform a re-association.
Use this hint in the driver and initiate a re-association.
While doing the re-association, there is no need to do a
scan if the target AP is already present in the scan cache.
Optimize the re-association code to not do a scan if not
necessary in this particular case.

Git-commit:ca5977a93f42553da18a4e6638637bb577f706f7
Change-Id: Idf1a7058009a8d2082bc1742dca1364cf59c405b
CRs-Fixed: 1010596
diff --git a/CORE/HDD/src/wlan_hdd_main.c b/CORE/HDD/src/wlan_hdd_main.c
index 6592eb4..0bf91ec 100644
--- a/CORE/HDD/src/wlan_hdd_main.c
+++ b/CORE/HDD/src/wlan_hdd_main.c
@@ -2501,17 +2501,18 @@
 #endif
 
 /**
- * hdd_reassoc() - perform a userspace-directed reassoc
+ * hdd_reassoc() - perform a user space-directed reassoc
  *
  * @pAdapter: Adapter upon which the command was received
  * @bssid: BSSID with which to reassociate
  * @channel: channel upon which to reassociate
+ * @src:      The source for the trigger of this action
  *
  * Return: 0 for success non-zero for failure
  */
 #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
 static int hdd_reassoc(hdd_adapter_t *pAdapter, const tANI_U8 *bssid,
-						const tANI_U8 channel)
+			const tANI_U8 channel, const handoff_src src)
 {
 	hdd_station_ctx_t *pHddStaCtx;
 	tCsrHandoffRequest handoffInfo;
@@ -2542,14 +2543,14 @@
 
 	/* Proceed with reassoc */
 	handoffInfo.channel = channel;
-	hdd_assign_handoff_src_reassoc(&handoffInfo, REASSOC);
+	hdd_assign_handoff_src_reassoc(&handoffInfo, src);
 	memcpy(handoffInfo.bssid, bssid, sizeof(tSirMacAddr));
 	sme_HandoffRequest(pHddCtx->hHal, &handoffInfo);
 	return 0;
 }
 #else
 static int hdd_reassoc(hdd_adapter_t *pAdapter, const tANI_U8 *bssid,
-						const tANI_U8 channel)
+			const tANI_U8 channel, const handoff_src src)
 {
 	return -EPERM;
 }
@@ -2579,7 +2580,7 @@
 	if (ret)
 		hddLog(LOGE, FL("Failed to parse reassoc command data"));
 	else
-		ret = hdd_reassoc(pAdapter, bssid, channel);
+		ret = hdd_reassoc(pAdapter, bssid, channel, REASSOC);
 
 	return ret;
 }
@@ -2609,7 +2610,7 @@
 		hddLog(LOGE, FL("MAC address parsing failed"));
 		ret = -EINVAL;
 	} else {
-		ret = hdd_reassoc(pAdapter, bssid, params.channel);
+		ret = hdd_reassoc(pAdapter, bssid, params.channel, REASSOC);
 	}
 	return ret;
 }