Merge "prima: Change default value of gEnableTDLSScan to 1" into wlan-driver.lnx.1.0
diff --git a/CORE/HDD/inc/wlan_hdd_cfg.h b/CORE/HDD/inc/wlan_hdd_cfg.h
index e0a2d2d..f452a82 100644
--- a/CORE/HDD/inc/wlan_hdd_cfg.h
+++ b/CORE/HDD/inc/wlan_hdd_cfg.h
@@ -2227,7 +2227,7 @@
 #define CFG_TDLS_SCAN_ENABLE            "gEnableTDLSScan"
 #define CFG_TDLS_SCAN_ENABLE_MIN        (0)
 #define CFG_TDLS_SCAN_ENABLE_MAX        (2)
-#define CFG_TDLS_SCAN_ENABLE_DEFAULT    (0)
+#define CFG_TDLS_SCAN_ENABLE_DEFAULT    (1)
 
 #define CFG_TDLS_ENABLE_DEFER_TIMER           "gTDLSEnableDeferTime"
 #define CFG_TDLS_ENABLE_DEFER_TIMER_MIN       (2000)
diff --git a/CORE/HDD/src/wlan_hdd_tdls.c b/CORE/HDD/src/wlan_hdd_tdls.c
index 633931e..eb26cb4 100644
--- a/CORE/HDD/src/wlan_hdd_tdls.c
+++ b/CORE/HDD/src/wlan_hdd_tdls.c
@@ -3098,6 +3098,21 @@
     else
         mutex_unlock(&pHddCtx->tdls_lock);
 
+    /* if fEnableTDLSScan flag is 1 ; driverwill allow scan even if
+     * peer station is not buffer STA capable
+     *
+     *  RX: If there is any RX activity, device will lose RX packets,
+     *  as peer will not be aware that device is off channel.
+     *  TX: TX is stopped whenever device initiate scan.
+     */
+
+    if (pHddCtx->cfg_ini->fEnableTDLSScan == 1)
+    {
+        VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,
+                   FL("Allow SCAN in all TDLS cases"));
+        return 1;
+    }
+
     /* tdls teardown is ongoing */
     if (eTDLS_SUPPORT_DISABLED == pHddCtx->tdls_mode)
     {
@@ -3124,21 +3139,6 @@
                 __func__, connectedTdlsPeers, pHddCtx->scan_ctxt.attempt);
         return 1;
     }
-
-    /* if fEnableTDLSScan flag is 1 ; driverwill allow scan even if
-     * peer station is not buffer STA capable
-     *
-     *  RX: If there is any RX activity, device will lose RX packets,
-     *  as peer will not be aware that device is off channel.
-     *  TX: TX is stopped whenever device initiate scan.
-     */
-    if (pHddCtx->cfg_ini->fEnableTDLSScan == 1)
-    {
-        VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO,
-                   FL("Allow SCAN in all TDLS cases"));
-        return 1;
-    }
-
     /* while tdls is up, first time scan */
     else if (eTDLS_SUPPORT_ENABLED == pHddCtx->tdls_mode ||
         eTDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY == pHddCtx->tdls_mode)