wlan: rate limit logs from HDD during scan and connect

Currently logs are printed from HDD during scan and connect for every
retry, which is causing MCThread to get stuck at printk and crash

Rate limit the hdd logs to print for every 5 retries to avoid filling
the log buffer

Change-Id: I09ad38cd89bbd20081673142bf5a350c55b0f005
CRs-Fixed: 2090761
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 1c1ff25..5ecdfff 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -13739,7 +13739,7 @@
                  (eConnectionState_Connecting ==
                 (WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))->conn_info.connState))
             {
-                hddLog(VOS_TRACE_LEVEL_ERROR,
+                hddLog(LOG1,
                        "%s: %p(%d) Connection is in progress", __func__,
                        WLAN_HDD_GET_STATION_CTX_PTR(pAdapter), pAdapter->sessionId);
                 if (session_id && reason)
@@ -13752,7 +13752,7 @@
             if ((WLAN_HDD_INFRA_STATION == pAdapter->device_mode) &&
                  smeNeighborMiddleOfRoaming(WLAN_HDD_GET_HAL_CTX(pAdapter)))
             {
-                hddLog(VOS_TRACE_LEVEL_ERROR,
+                hddLog(LOG1,
                        "%s: %p(%d) Reassociation is in progress", __func__,
                        WLAN_HDD_GET_STATION_CTX_PTR(pAdapter), pAdapter->sessionId);
                 if (session_id && reason)
@@ -13771,7 +13771,7 @@
                     (VOS_FALSE == pHddStaCtx->conn_info.uIsAuthenticated))
                 {
                     staMac = (v_U8_t *) &(pAdapter->macAddressCurrent.bytes[0]);
-                    hddLog(VOS_TRACE_LEVEL_ERROR,
+                    hddLog(LOG1,
                            "%s: client " MAC_ADDRESS_STR
                            " is in the middle of WPS/EAPOL exchange.", __func__,
                             MAC_ADDR_ARRAY(staMac));
@@ -13801,7 +13801,7 @@
                     {
                         staMac = (v_U8_t *) &(pSapCtx->aStaInfo[staId].macAddrSTA.bytes[0]);
 
-                        hddLog(VOS_TRACE_LEVEL_ERROR,
+                        hddLog(LOG1,
                                "%s: client " MAC_ADDRESS_STR " of SoftAP/P2P-GO is in the "
                                "middle of WPS/EAPOL exchange.", __func__,
                                 MAC_ADDR_ARRAY(staMac));
@@ -13976,7 +13976,10 @@
     }
     if (hdd_isConnectionInProgress(pHddCtx, &curr_session_id, &curr_reason))
     {
-        hddLog(VOS_TRACE_LEVEL_ERROR, FL("Scan not allowed"));
+
+        if (!(pHddCtx->scan_reject_cnt % HDD_SCAN_REJECT_RATE_LIMIT))
+            hddLog(LOGE, FL("Scan not allowed Session %d reason %d"),
+                curr_session_id, curr_reason);
         if (pHddCtx->last_scan_reject_session_id != curr_session_id ||
             pHddCtx->last_scan_reject_reason != curr_reason ||
             !pHddCtx->last_scan_reject_timestamp)
@@ -13991,16 +13994,15 @@
         {
             pHddCtx->scan_reject_cnt++;
 
-            hddLog(LOGE, FL("Session %d reason %d reject cnt %d threshold time has elapsed? %d"),
-               curr_session_id, curr_reason,  pHddCtx->scan_reject_cnt,
-               vos_system_time_after(jiffies_to_msecs(jiffies),
-               pHddCtx->last_scan_reject_timestamp));
-
             if ((pHddCtx->scan_reject_cnt >=
                SCAN_REJECT_THRESHOLD) &&
                vos_system_time_after(jiffies_to_msecs(jiffies),
                pHddCtx->last_scan_reject_timestamp))
             {
+                hddLog(LOGE, FL("Session %d reason %d reject cnt %d threshold time has elapsed? %d"),
+                    curr_session_id, curr_reason, pHddCtx->scan_reject_cnt,
+                    vos_system_time_after(jiffies_to_msecs(jiffies),
+                    pHddCtx->last_scan_reject_timestamp));
                 pHddCtx->last_scan_reject_timestamp = 0;
                 pHddCtx->scan_reject_cnt = 0;
                 if (pHddCtx->cfg_ini->enableFatalEvent)