From 261f3fbc57cdbcf905f61a02d591239f4238a42e Mon Sep 17 00:00:00 2001 From: Kabilan Kannan Date: Tue, 17 Jan 2017 20:59:31 -0800 Subject: qcacld-3.0: Fix TDLS mode problem in P2P client operation TDLS mode is incorrectly set in P2P remain on channel operation, and due to this TDLS connection happens in P2P client mode, even when it is not configured. Set the correct TDLS mode in P2P ROC operation. Change-Id: I480f09b03da8637ec4fc283b8feb2c08b0917ac4 CRs-Fixed: 1112790 --- core/hdd/src/wlan_hdd_p2p.c | 2 +- core/hdd/src/wlan_hdd_tdls.c | 26 ++++++++++++++------------ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index 8d63b3cc49e9..1d346d3f93da 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -527,7 +527,7 @@ static void wlan_hdd_remain_on_chan_timeout(void *data) pRemainChanCtx->scan_id); } - hdd_restart_tdls_source_timer(hdd_ctx, eTDLS_SUPPORT_ENABLED); + hdd_restart_tdls_source_timer(hdd_ctx, hdd_ctx->tdls_mode_last); qdf_runtime_pm_allow_suspend(hdd_ctx->runtime_context.roc); hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC); } diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c index b85bd106460d..93682925331b 100644 --- a/core/hdd/src/wlan_hdd_tdls.c +++ b/core/hdd/src/wlan_hdd_tdls.c @@ -652,6 +652,17 @@ void hdd_tdls_context_init(hdd_context_t *hdd_ctx) hdd_ctx->tdls_nss_teardown_complete = false; hdd_ctx->tdls_nss_transition_mode = TDLS_NSS_TRANSITION_UNKNOWN; + if (false == hdd_ctx->config->fEnableTDLSImplicitTrigger) { + hdd_ctx->tdls_mode = eTDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY; + hdd_notice("TDLS Implicit trigger not enabled!"); + } else if (true == hdd_ctx->config->fTDLSExternalControl) { + hdd_ctx->tdls_mode = eTDLS_SUPPORT_EXTERNAL_CONTROL; + } else { + hdd_ctx->tdls_mode = eTDLS_SUPPORT_ENABLED; + } + + hdd_ctx->tdls_mode_last = hdd_ctx->tdls_mode; + if (hdd_ctx->config->fEnableTDLSSleepSta || hdd_ctx->config->fEnableTDLSBufferSta || hdd_ctx->config->fEnableTDLSOffChannel) @@ -800,15 +811,6 @@ int wlan_hdd_tdls_init(hdd_adapter_t *pAdapter) pHddTdlsCtx->threshold_config.rssi_delta = pHddCtx->config->fTDLSRSSIDelta; - if (false == pHddCtx->config->fEnableTDLSImplicitTrigger) { - pHddCtx->tdls_mode = eTDLS_SUPPORT_EXPLICIT_TRIGGER_ONLY; - hdd_notice("TDLS Implicit trigger not enabled!"); - } else if (true == pHddCtx->config->fTDLSExternalControl) { - pHddCtx->tdls_mode = eTDLS_SUPPORT_EXTERNAL_CONTROL; - } else { - pHddCtx->tdls_mode = eTDLS_SUPPORT_ENABLED; - } - INIT_DELAYED_WORK(&pHddCtx->tdls_scan_ctxt.tdls_scan_work, wlan_hdd_tdls_schedule_scan); @@ -6033,8 +6035,8 @@ void wlan_hdd_change_tdls_mode(void *data) { hdd_context_t *hdd_ctx = (hdd_context_t *)data; - wlan_hdd_tdls_set_mode(hdd_ctx, eTDLS_SUPPORT_ENABLED, false, - HDD_SET_TDLS_MODE_SOURCE_OFFCHANNEL); + wlan_hdd_tdls_set_mode(hdd_ctx, hdd_ctx->tdls_mode_last, false, + HDD_SET_TDLS_MODE_SOURCE_P2P); } /** @@ -6056,7 +6058,7 @@ void hdd_restart_tdls_source_timer(hdd_context_t *pHddCtx, if (tdls_mode == eTDLS_SUPPORT_DISABLED) { wlan_hdd_tdls_set_mode(pHddCtx, tdls_mode, false, - HDD_SET_TDLS_MODE_SOURCE_OFFCHANNEL); + HDD_SET_TDLS_MODE_SOURCE_P2P); wlan_hdd_tdls_disable_offchan_and_teardown_links(pHddCtx); } -- cgit v1.2.3