summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBala Venkatesh <bjavvaji@codeaurora.org>2018-04-04 18:33:09 +0530
committernshrivas <nshrivas@codeaurora.org>2018-04-13 00:02:29 -0700
commit2f50a40937a7519eb4e2af1415922b155aa0e225 (patch)
tree2386b882689e0d621fee637715f5ba3171c4d2bc
parentc65f25eb25899d9fb5d9d63c6dae647981b288b8 (diff)
qcacld-3.0: Enable ct tracker for external ctrl mode after tdls link enable
For TDLS external control mode, link may be enabled without connection tracker running, if force peer is not configured, then it will act as explicit mode. This may result in improper tdls teardown. Start and stop the connection tracker based on connected peer count. Change-Id: Ic5a0c31fca6a5a5d4625fec279717e86b7c489d6 CRs-Fixed: 2216733
-rw-r--r--core/cds/src/cds_concurrency.c2
-rw-r--r--core/hdd/src/wlan_hdd_tdls.c35
2 files changed, 35 insertions, 2 deletions
diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c
index 54d9dea47abc..617f953b40a2 100644
--- a/core/cds/src/cds_concurrency.c
+++ b/core/cds/src/cds_concurrency.c
@@ -3696,6 +3696,8 @@ void cds_set_tdls_ct_mode(hdd_context_t *hdd_ctx)
if (hdd_ctx->config->fTDLSExternalControl) {
if (hdd_ctx->tdls_external_peer_count)
state = true;
+ else if (hdd_ctx->connected_peer_count >= 1)
+ state = true;
else
state = false;
}
diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c
index b4e2afa467db..e9d6dfff7970 100644
--- a/core/hdd/src/wlan_hdd_tdls.c
+++ b/core/hdd/src/wlan_hdd_tdls.c
@@ -1757,7 +1757,8 @@ static void wlan_hdd_tdls_set_mode(hdd_context_t *pHddCtx,
= true;
if (tdls_mode == eTDLS_SUPPORT_EXTERNAL_CONTROL
- && !pHddCtx->tdls_external_peer_count) {
+ && !pHddCtx->tdls_external_peer_count
+ && !pHddCtx->connected_peer_count) {
/* Disable connection tracker if tdls
* mode is external and no force peers
* were configured by application.
@@ -4712,7 +4713,8 @@ int wlan_hdd_tdls_extctrl_deconfig_peer(hdd_adapter_t *pAdapter,
cds_set_tdls_ct_mode(pHddCtx);
mutex_lock(&pHddCtx->tdls_lock);
- if (pHddCtx->enable_tdls_connection_tracker)
+ if (pHddCtx->enable_tdls_connection_tracker &&
+ (!wlan_hdd_tdls_connected_peers(pAdapter)))
wlan_hdd_tdls_implicit_disable(tdls_ctx);
mutex_unlock(&pHddCtx->tdls_lock);
@@ -4749,6 +4751,7 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy,
uint16_t peer_staid;
uint8_t peer_offchannelsupp;
int ret;
+ tdlsCtx_t *tdls_ctx;
ENTER();
@@ -4777,6 +4780,7 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy,
pAdapter->sessionId, oper));
status = wlan_hdd_validate_context(pHddCtx);
+ tdls_ctx = WLAN_HDD_GET_TDLS_CTX_PTR(pAdapter);
if (0 != status)
return status;
@@ -5080,6 +5084,21 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy,
hdd_wlan_tdls_enable_link_event(peer,
peer_offchannelsupp,
0, 0);
+ /* In external control mode, if external peer is not configured
+ * then enabling link without connection tracker running
+ * will act as explicit mode. Teardown will not happen unless
+ * teardown frame is received.
+ * Enable connection tracker for external mode, if connected
+ * peer present.
+ */
+ if (pHddCtx->config->fTDLSExternalControl &&
+ (!pHddCtx->tdls_external_peer_count)) {
+ mutex_lock(&pHddCtx->tdls_lock);
+ pHddCtx->enable_tdls_connection_tracker = true;
+ if (wlan_hdd_tdls_connected_peers(pAdapter) == 1)
+ wlan_hdd_tdls_implicit_enable(tdls_ctx);
+ mutex_unlock(&pHddCtx->tdls_lock);
+ }
}
break;
case NL80211_TDLS_DISABLE_LINK:
@@ -5157,6 +5176,18 @@ static int __wlan_hdd_cfg80211_tdls_oper(struct wiphy *wiphy,
"%s: TDLS Peer Station doesn't exist.",
__func__);
}
+ /* Disable the connection tracker for external control mode
+ * If no force and connected peer present.
+ */
+ if (pHddCtx->config->fTDLSExternalControl &&
+ (!pHddCtx->tdls_external_peer_count)) {
+ mutex_lock(&pHddCtx->tdls_lock);
+ if (!wlan_hdd_tdls_connected_peers(pAdapter)) {
+ wlan_hdd_tdls_implicit_disable(tdls_ctx);
+ pHddCtx->enable_tdls_connection_tracker = false;
+ }
+ mutex_unlock(&pHddCtx->tdls_lock);
+ }
}
break;
case NL80211_TDLS_TEARDOWN: