Fix to delete all connected tdls peer

We are not clearing the TDLS peers information from lim/sme
and also not unregistering the peers from TL when we are
getting diassoc/deauth from the AP in case we are leaving
the BSS or AP goes down. Also, we are not sending teardown
or deauth frame on direct link to all the connected peers.

CRs-Fixed: 445085
Change-Id: Ia701d287ddb9059abe1af89fab2f691d952d4129
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index 7076e29..1634b92 100755
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -5330,6 +5330,9 @@
                     &(WLAN_HDD_GET_WEXT_STATE_PTR(pAdapter))->roamProfile;
     int status = 0;
     hdd_station_ctx_t *pHddStaCtx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter);
+#ifdef FEATURE_WLAN_TDLS
+    tANI_U8 staIdx;
+#endif
     
     ENTER();
     
@@ -5378,6 +5381,18 @@
             (WLAN_HDD_GET_CTX(pAdapter))->isAmpAllowed = VOS_TRUE;
             INIT_COMPLETION(pAdapter->disconnect_comp_var);
 
+#ifdef FEATURE_WLAN_TDLS
+            /* First clean up the tdls peers if any */
+            for (staIdx = 1 ; staIdx < HDD_MAX_NUM_TDLS_STA; staIdx++)
+            {
+                if (pHddStaCtx->conn_info.staId[staIdx])
+                {
+                    sme_DeleteTdlsPeerSta(WLAN_HDD_GET_HAL_CTX(pAdapter),
+                              pAdapter->sessionId,
+                              pHddStaCtx->conn_info.peerMacAddress[staIdx].bytes);
+                }
+            }
+#endif
             /*issue disconnect*/
             status = sme_RoamDisconnect( WLAN_HDD_GET_HAL_CTX(pAdapter), 
                                          pAdapter->sessionId, reasonCode);