diff options
| -rw-r--r-- | core/cds/src/cds_concurrency.c | 2 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_tdls.c | 35 |
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: |
