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/MAC/src/pe/lim/limSendManagementFrames.c b/CORE/MAC/src/pe/lim/limSendManagementFrames.c
index 9833e91..a1bb3bb 100644
--- a/CORE/MAC/src/pe/lim/limSendManagementFrames.c
+++ b/CORE/MAC/src/pe/lim/limSendManagementFrames.c
@@ -4117,6 +4117,11 @@
     eHalStatus       halstatus;
     tANI_U8          txFlag = 0;
     tANI_U32         val = 0;
+#ifdef FEATURE_WLAN_TDLS
+    tANI_U16          aid;
+    tpDphHashNode     pStaDs;
+#endif
+
     if(NULL == psessionEntry)
     {
         return;
@@ -4214,6 +4219,10 @@
     }
 #endif
 
+#ifdef FEATURE_WLAN_TDLS
+    pStaDs = dphLookupHashEntry(pMac, peer, &aid, &psessionEntry->dph.dphHashTable);
+#endif
+
     if (waitForAck)
     {
         // Queue Disassociation frame in high priority WQ
@@ -4257,12 +4266,28 @@
     }
     else
     {
-        // Queue Disassociation frame in high priority WQ
-        halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes,
+#ifdef FEATURE_WLAN_TDLS
+        if ((NULL != pStaDs) && (STA_ENTRY_TDLS_PEER == pStaDs->staType))
+        {
+            // Queue Disassociation frame in high priority WQ
+            halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes,
                 HAL_TXRX_FRM_802_11_MGMT,
-                ANI_TXDIR_TODS,
+                ANI_TXDIR_IBSS,
                 7,//SMAC_SWBD_TX_TID_MGMT_HIGH,
                 limTxComplete, pFrame, txFlag );
+        }
+        else
+        {
+#endif
+            // Queue Disassociation frame in high priority WQ
+            halstatus = halTxFrame( pMac, pPacket, ( tANI_U16 ) nBytes,
+                    HAL_TXRX_FRM_802_11_MGMT,
+                    ANI_TXDIR_TODS,
+                    7,//SMAC_SWBD_TX_TID_MGMT_HIGH,
+                    limTxComplete, pFrame, txFlag );
+#ifdef FEATURE_WLAN_TDLS
+        }
+#endif
         if ( ! HAL_STATUS_SUCCESS ( halstatus ) )
         {
             limLog( pMac, LOGE, FL("Failed to send De-Authentication "