Reverting "Postpone scan request until TDLS torn down"

Remove the rescheduling of scan when TDLS link is present
as it's causing crash in tdls_scan_callback.
Changes made to send the teardown to all the TDLS link when
scan is issued to driver and return -EBUSY.

CRs-Fixed: 465895
Change-Id: I33b3e89581f5a7b99bb7e8beccd4d1e85b2f4a55
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index d71639d..bf7a0a7 100755
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -4189,10 +4189,6 @@
      * to process the connect request to AP */
     hdd_allow_suspend_timeout(100);
 
-#ifdef FEATURE_WLAN_TDLS
-    wlan_hdd_tdls_scan_done_callback(pAdapter);
-#endif
-
     EXIT();
     return 0;
 }
@@ -4354,21 +4350,28 @@
         return -EBUSY;
     }
 #ifdef FEATURE_WLAN_TDLS
-    /* if tdls disagree scan right now, return immediately.
-       tdls will schedule the scan when scan is allowed. (return SUCCESS)
-       or will reject the scan if any TDLS is in progress. (return -EBUSY)
-    */
-    status = wlan_hdd_tdls_scan_callback (pAdapter,
-                                         wiphy,
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,6,0))
-                                         dev,
-#endif
-                                         request);
-    if(status <= 0)
+    if (wlan_hdd_tdlsConnectedPeers(pAdapter))
     {
-        hddLog(VOS_TRACE_LEVEL_INFO, "%s: TDLS Pending %d", __func__, status);
-        return status;
+        tANI_U8 staIdx;
+
+        for (staIdx = 0; staIdx < HDD_MAX_NUM_TDLS_STA; staIdx++)
+        {
+            if (pHddCtx->tdlsConnInfo[staIdx].staId)
+            {
+                VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR,
+                          ("scan: indicate TDLS teadown (staId %d)"), pHddCtx->tdlsConnInfo[staIdx].staId);
+            }
+#ifdef CONFIG_TDLS_IMPLICIT
+            cfg80211_tdls_oper_request(pAdapter->dev,
+                                       pHddCtx->tdlsConnInfo[staIdx].peerMac.bytes,
+                                       NL80211_TDLS_TEARDOWN,
+                                       eSIR_MAC_TDLS_TEARDOWN_UNSPEC_REASON,
+                                       GFP_KERNEL);
+#endif
+        }
+        return -EBUSY;
     }
+
 #endif
 
     if (mutex_lock_interruptible(&pHddCtx->tmInfo.tmOperationLock))