From 1577230c1ff3dfbbc17c909afd206d94456d06b7 Mon Sep 17 00:00:00 2001 From: Kabilan Kannan Date: Tue, 9 Jan 2018 21:01:01 -0800 Subject: [PATCH] qcacld-3.0: Reject TDLS operation, when it is disabled via INI TDLS operations should not be allowed, when it is disabled through INI param. Reject TDLS operation, if it is disabled through INI param. Change-Id: I9ee03d84d619312f869f75327ca977534ff5bb07 CRs-Fixed: 2164148 --- core/hdd/src/wlan_hdd_tdls.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c index 8d0761960922..d9d60d5c0695 100644 --- a/core/hdd/src/wlan_hdd_tdls.c +++ b/core/hdd/src/wlan_hdd_tdls.c @@ -477,6 +477,12 @@ static int __wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, if (wlan_hdd_validate_context(hdd_ctx)) return -EINVAL; + if (false == hdd_ctx->config->fEnableTDLSSupport) { + hdd_debug("TDLS Disabled in INI OR not enabled in FW. " + "Cannot process TDLS commands"); + return -ENOTSUPP; + } + if (hdd_ctx->tdls_umac_comp_active) return wlan_cfg80211_tdls_mgmt(hdd_ctx->hdd_pdev, dev, peer, @@ -646,6 +652,12 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy, return -EINVAL; } + if (false == hdd_ctx->config->fEnableTDLSSupport) { + hdd_debug("TDLS Disabled in INI OR not enabled in FW. " + "Cannot process TDLS commands"); + return -ENOTSUPP; + } + MTRACE(qdf_trace(QDF_MODULE_ID_HDD, TRACE_CODE_HDD_CFG80211_TDLS_OPER, adapter->session_id, oper));