prima: Enable/Disable TDLS only for p2p interfaces

Currently, Disable and Teardown functionality invoked for
TDLS during concurrency only if device mode is other than
WLAN_HDD_INFRA_STATION and during p2p disconnection since the
device mode will be either WLAN_HDD_P2P_CLIENT/WLAN_HDD_P2P_GO
which would invoke Disable and teardown functionality again and
thus disabling TDLS and connection attempt was not made.

To mitigate:
Include check for device mode and invoke Disable and
Teardown TDLS functionality only if device mode is
WLAN_HDD_P2P_DEVICE and interface type is
NL80211_IFTYPE_P2P_CLIENT/NL80211_IFTYPE_P2P_GO.

Change-Id: Ia2c272a2975c83aebff147ceb6b2fb57a90182b2
CRs-Fixed: 891225
diff --git a/CORE/HDD/src/wlan_hdd_cfg80211.c b/CORE/HDD/src/wlan_hdd_cfg80211.c
index ab23e73..6869885 100644
--- a/CORE/HDD/src/wlan_hdd_cfg80211.c
+++ b/CORE/HDD/src/wlan_hdd_cfg80211.c
@@ -8232,12 +8232,20 @@
     /* Reset the current device mode bit mask*/
     wlan_hdd_clear_concurrency_mode(pHddCtx, pAdapter->device_mode);
 
-    /* Notify Mode change in case of concurrency.
-     * Below function invokes TDLS teardown Functionality Since TDLS is
-     * not Supported in case of concurrency i.e Once P2P session
-     * is detected disable offchannel and teardown TDLS links
-     */
-    hdd_tdls_notify_mode_change(pAdapter, pHddCtx);
+    if ((pAdapter->device_mode == WLAN_HDD_P2P_DEVICE) &&
+        ((type == NL80211_IFTYPE_P2P_CLIENT) ||
+         (type == NL80211_IFTYPE_P2P_GO)))
+    {
+        /* Notify Mode change in case of concurrency.
+         * Below function invokes TDLS teardown Functionality Since TDLS is
+         * not Supported in case of concurrency i.e Once P2P session
+         * is detected disable offchannel and teardown TDLS links
+         */
+        hddLog(LOG1,
+               FL("Device mode = %d Interface type = %d"),
+               pAdapter->device_mode, type);
+        hdd_tdls_notify_mode_change(pAdapter, pHddCtx);
+    }
 
     if( (pAdapter->device_mode == WLAN_HDD_INFRA_STATION)
       || (pAdapter->device_mode == WLAN_HDD_P2P_CLIENT)