wlan: START command to FW during manual reassoc

If there is a Preauth failure during a manual reassoc,
a START command is to be issued instead of RESTART,since
a STOP command is already issued during the begin of a
manual reassoc.The FW expects a START after a STOP.
CRs-Fixed: 496932

Change-Id: Ib6cb8081f6d3b379fd4bf329882f557635a0613d
diff --git a/CORE/SME/inc/csrNeighborRoam.h b/CORE/SME/inc/csrNeighborRoam.h
index 8de9a48..9f0126f 100644
--- a/CORE/SME/inc/csrNeighborRoam.h
+++ b/CORE/SME/inc/csrNeighborRoam.h
@@ -278,7 +278,7 @@
 eHalStatus csrNeighborRoamHandoffReqHdlr(tpAniSirGlobal pMac, void* pMsg);
 eHalStatus csrNeighborRoamProceedWithHandoffReq(tpAniSirGlobal pMac);
 eHalStatus csrNeighborRoamSssidScanDone(tpAniSirGlobal pMac, eHalStatus status);
-eHalStatus csrNeighborRoamRestartLfrScan(tpAniSirGlobal pMac);
+eHalStatus csrNeighborRoamStartLfrScan(tpAniSirGlobal pMac);
 #endif
 
 
diff --git a/CORE/SME/src/csr/csrApiScan.c b/CORE/SME/src/csr/csrApiScan.c
index 351e417..4b0d3f4 100644
--- a/CORE/SME/src/csr/csrApiScan.c
+++ b/CORE/SME/src/csr/csrApiScan.c
@@ -1617,7 +1617,7 @@
             //notify LFR state m/c
             if(eHAL_STATUS_SUCCESS != csrNeighborRoamSssidScanDone(pMac, eHAL_STATUS_SUCCESS))
             {
-                csrNeighborRoamRestartLfrScan(pMac);
+                csrNeighborRoamStartLfrScan(pMac);
             }
             status = eHAL_STATUS_SUCCESS;
             break;
@@ -1702,7 +1702,7 @@
         //notify LFR state m/c
         if(eHAL_STATUS_SUCCESS != csrNeighborRoamSssidScanDone(pMac, eHAL_STATUS_FAILURE))
         {
-            csrNeighborRoamRestartLfrScan(pMac);
+            csrNeighborRoamStartLfrScan(pMac);
         }
         return eHAL_STATUS_SUCCESS;
     }
diff --git a/CORE/SME/src/csr/csrNeighborRoam.c b/CORE/SME/src/csr/csrNeighborRoam.c
index 33b3bb3..b4840bd 100644
--- a/CORE/SME/src/csr/csrNeighborRoam.c
+++ b/CORE/SME/src/csr/csrNeighborRoam.c
@@ -1149,8 +1149,15 @@
 #ifdef WLAN_FEATURE_ROAM_SCAN_OFFLOAD
         if (csrRoamIsRoamOffloadScanEnabled(pMac))
         {
-          pNeighborRoamInfo->uOsRequestedHandoff = 0;
-          csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_RESTART, REASON_PREAUTH_FAILED_FOR_ALL);
+          if(pNeighborRoamInfo->uOsRequestedHandoff)
+          {
+             pNeighborRoamInfo->uOsRequestedHandoff = 0;
+             csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_START, REASON_PREAUTH_FAILED_FOR_ALL);
+          }
+          else
+          {
+             csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_RESTART, REASON_PREAUTH_FAILED_FOR_ALL);
+          }
           CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_CONNECTED);
         } else
         {
@@ -2029,10 +2036,17 @@
    {
     if (!tempVal || !roamNow)
     {
-       pNeighborRoamInfo->uOsRequestedHandoff = 0;
-      /* There is no candidate or We are not roaming Now.
-       * Inform the FW to restart Roam Offload Scan  */
-       csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_RESTART, REASON_NO_CAND_FOUND_OR_NOT_ROAMING_NOW);
+       if (pNeighborRoamInfo->uOsRequestedHandoff)
+       {
+          csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_START, REASON_NO_CAND_FOUND_OR_NOT_ROAMING_NOW);
+          pNeighborRoamInfo->uOsRequestedHandoff = 0;
+       }
+       else
+       {
+         /* There is no candidate or We are not roaming Now.
+          * Inform the FW to restart Roam Offload Scan  */
+          csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_RESTART, REASON_NO_CAND_FOUND_OR_NOT_ROAMING_NOW);
+       }
        CSR_NEIGHBOR_ROAM_STATE_TRANSITION(eCSR_NEIGHBOR_ROAM_STATE_CONNECTED);
     }
    }
@@ -4924,23 +4938,24 @@
 
 /* ---------------------------------------------------------------------------
 
-    \fn csrNeighborRoamRestartLfrScan
+    \fn csrNeighborRoamStartLfrScan
 
     \brief  This function is called if HDD requested handoff failed for some
-    reason. Restart the LFR logic at that point.
+    reason. start the LFR logic at that point.By the time, this function is
+    called, a STOP command has already been issued.
 
     \param  pMac - The handle returned by macOpen.
 
     \return eHAL_STATUS_SUCCESS on success, corresponding error code otherwise
 
 ---------------------------------------------------------------------------*/
-eHalStatus csrNeighborRoamRestartLfrScan(tpAniSirGlobal pMac)
+eHalStatus csrNeighborRoamStartLfrScan(tpAniSirGlobal pMac)
 {
     tpCsrNeighborRoamControlInfo    pNeighborRoamInfo = &pMac->roam.neighborRoamInfo;
     pNeighborRoamInfo->uOsRequestedHandoff = 0;
     /* There is no candidate or We are not roaming Now.
      * Inform the FW to restart Roam Offload Scan  */
-    csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_RESTART, REASON_NO_CAND_FOUND_OR_NOT_ROAMING_NOW);
+    csrRoamOffloadScan(pMac, ROAM_SCAN_OFFLOAD_START, REASON_NO_CAND_FOUND_OR_NOT_ROAMING_NOW);
 
     return eHAL_STATUS_SUCCESS;
 }