prima: Always send the Beacon measurement report

qcacld-2.0 to prima propagation

1) Whenever the beacon request measurement is done, always
send a beacon report despite finding any AP's or not on the
requested channels

2) Send the report always so that it implicitly also cleans up
the RRM context in the LIM and enables to process the
subsequent requests. Otherwise, the cleanup is not done and
RRM processing will be stuck

CRs-Fixed: 982133
Change-Id: I3ce023fbd4aa9d18f8d025a220a5c1d979a555f5
diff --git a/CORE/SME/src/rrm/sme_rrm.c b/CORE/SME/src/rrm/sme_rrm.c
index f74675a..2c5276c 100644
--- a/CORE/SME/src/rrm/sme_rrm.c
+++ b/CORE/SME/src/rrm/sme_rrm.c
@@ -575,6 +575,8 @@
    while (pScanResult)
    {
       pNextResult = sme_ScanResultGetNext(pMac, pResult);
+      smsLog(pMac, LOG1, "Scan res timer:%lu, rrm scan timer:%lu",
+             pScanResult->timer, RRM_scan_timer);
       if(pScanResult->timer >= RRM_scan_timer)
          pScanResultsArr[counter++] = pScanResult;
       pScanResult = pNextResult; //sme_ScanResultGetNext(hHal, pResult);
@@ -582,26 +584,35 @@
          break;
       }
 
-   if (counter)
-   {
-          smsLog(pMac, LOG1, " Number of BSS Desc with RRM Scan %d ", counter);
+   smsLog(pMac, LOG1, " Number of BSS Desc with RRM Scan %d ", counter);
+   /*
+    * The beacon report should be sent whether the counter is zero or non-zero.
+    * There might be a few scan results in the cache but not actually are a
+    * result of this scan. During that scenario, the counter will be zero.
+    * The report should be sent and LIM will further cleanup the RRM to
+    * accept the further incoming requests
+    * In case the counter is Zero, the pScanResultsArr will be NULL.
+    * The next level routine does a check for the measurementDone to determine
+    * whether to send a report or not.
+    */
+
 #if defined(FEATURE_WLAN_ESE_UPLOAD)
-         if (eRRM_MSG_SOURCE_ESE_UPLOAD == pSmeRrmContext->msgSource)
-         {
-             status = sme_EseSendBeaconReqScanResults(pMac,
+   if (eRRM_MSG_SOURCE_ESE_UPLOAD == pSmeRrmContext->msgSource)
+   {
+       status = sme_EseSendBeaconReqScanResults(pMac,
                                                 sessionId,
                                                 chanList[0],
                                                 pScanResultsArr,
                                                 measurementDone,
                                                 counter);
-         }
-         else
+   }
+   else
 #endif /*FEATURE_WLAN_ESE_UPLOAD*/
-             status = sme_RrmSendBeaconReportXmitInd( pMac,
+       status = sme_RrmSendBeaconReportXmitInd( pMac,
                                                 pScanResultsArr,
                                                 measurementDone,
                                                 counter);
-   }
+
    sme_ScanResultPurge(pMac, pResult); 
 
    return status;
diff --git a/Kbuild b/Kbuild
index f373faa..b7c1f72 100644
--- a/Kbuild
+++ b/Kbuild
@@ -563,8 +563,8 @@
                 -DWLAN_LOGGING_SOCK_SVC_ENABLE \
                 -DWLAN_FEATURE_LINK_LAYER_STATS \
                 -DWLAN_FEATURE_EXTSCAN \
-                -DFEATURE_EXT_LL_STAT
-
+                -DFEATURE_EXT_LL_STAT \
+                -DWLAN_VOWIFI_DEBUG
 
 ifneq ($(CONFIG_PRONTO_WLAN),)
 CDEFINES += -DWCN_PRONTO