Scan list is empty due to TDLS connecting

Introduce reject count and increment it whenever scan is rejected
due to TDLS is connecting. After reaching to TDLS_MAX_SCAN_REJECT
(5), force to make connecting state to idle and allow the scan.
Check TDLS in progress across the interface.
Reset link status to IDLE if cfg80211_tdls_mgmt is failed.
Avoid double teardown indication by checking status is CONNECTED.
Avoid pre-setup if TDLS is already ongoing.

Change-Id: I168e4f4144a19acb6902b982247d8cb45206181e
CRs-Fixed: 473259
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 0ec9a0e..45ea9cf 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -2823,7 +2823,7 @@
     }
 
     /* when others are on-going, we want to change link_status to idle */
-    if (wlan_hdd_tdls_is_progress(pAdapter, mac, TRUE))
+    if (NULL != wlan_hdd_tdls_is_progress(pHddCtx, mac, TRUE, TRUE))
     {
         VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
                    "%s: " MAC_ADDRESS_STR
@@ -6972,7 +6972,7 @@
 
     if (WLAN_IS_TDLS_SETUP_ACTION(action_code))
     {
-        if (wlan_hdd_tdls_is_progress(pAdapter, peer, TRUE))
+        if (NULL != wlan_hdd_tdls_is_progress(pHddCtx, peer, TRUE, TRUE))
         {
             VOS_TRACE( VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
                        "%s: " MAC_ADDRESS_STR
@@ -7075,7 +7075,7 @@
             VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
                       "%s: Mgmt Tx Completion failed status %ld TxCompletion %lu",
                       __func__, rc, pAdapter->mgmtTxCompletionStatus);
-            return -EPERM;
+            goto error;
         }
     }