wlan: Dampen scan periodicity if no roamable candidates found.

This fix limts the iterations of background scans to find potential roam
candidates in scenarios where there are none (home environment or
enterprise network with coverage holes).

When no roamable candidates are found, we register with a new lookup
threshold and continue to scan if the RSSI of the current AP falls below
the new threshold. However, if we are in an area where the current AP is
the only available candidate and RSSI is below the threshold, we would
endlessly continue to scan. In the interest of
power consumption, we would like to dampen the scans every time there
are no roamable candidates found.

For every scan that results in no candidates, double the scan
periodicity (initialized to 1s) until we hit a max (defined as 60s).
Subsequently, scan every 60s if we continue to not find any candidates.
Once a candidate is found, the periodicity is reset back to 1s.

Change-Id: I8049aab5a8d25f51f6633d2249971678c5a6c2a7
CR-Fixed: 407719
diff --git a/CORE/SME/inc/csrNeighborRoam.h b/CORE/SME/inc/csrNeighborRoam.h
index 2df7e8b..8659fe7 100644
--- a/CORE/SME/inc/csrNeighborRoam.h
+++ b/CORE/SME/inc/csrNeighborRoam.h
@@ -127,6 +127,15 @@
  * NEIGHBOR_LOOKUP_THRESHOLD_INCREMENT_CONSTANT) */
 #define NEIGHBOR_LOOKUP_THRESHOLD_INCREMENT_CONSTANT    5
 #define LOOKUP_THRESHOLD_INCREMENT_MULTIPLIER_MAX       4
+/* 
+ * For every scan that results in no candidates, double the scan periodicity 
+ * (initialized to NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD_MIN) until we hit 
+ * NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD_MAX (60s). Subsequently, scan every 
+ * 60s if we continue to find no candidates. Once a candidate is found, 
+ * the periodicity is reset back to NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD_MIN.
+ */
+#define NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD_MIN (1000)
+#define NEIGHBOR_SCAN_RESULTS_REFRESH_PERIOD_MAX (60000)
 
 /* Complete control information for neighbor roam algorithm */
 typedef struct sCsrNeighborRoamControlInfo
@@ -141,7 +150,6 @@
     tCsrTimerInfo               neighborScanTimerInfo;
     tCsrNeighborRoamChannelInfo roamChannelInfo;
     tANI_U8                     currentNeighborLookupThreshold;
-    tANI_U8                     currentLookupIncrementMultiplier;
     tANI_BOOLEAN                scanRspPending;
     tANI_TIMESTAMP              scanRequestTimeStamp;
     tDblLinkList                roamableAPList;    // List of current FT candidates
@@ -156,6 +164,7 @@
     tANI_BOOLEAN                isVOAdmitted;
     tANI_U32                    MinQBssLoadRequired;
 #endif
+    tANI_U16                    currentScanResultsRefreshPeriod;
 } tCsrNeighborRoamControlInfo, *tpCsrNeighborRoamControlInfo;