From 3c6bd4eed31b4eb2a02c8d3831f95fe785cd87b0 Mon Sep 17 00:00:00 2001 From: Rachit Kankane Date: Thu, 2 Jul 2020 08:16:31 +0530 Subject: [PATCH] qcacld-3.0: Add runtime support for Inter-Band MCC To handle no-inter-band MCC scenarios for dual MAC non-DBS solutions, add changes to detect capability at run-time based on service bits. If the service is set then code for only intra-band MCC will be exercised. Change-Id: If62068f8f05c17278d279f36ec11bc9ca123dfbd CRs-Fixed: 2730359 --- .../src/wlan_policy_mgr_init_deinit.c | 32 +++++++++++++++---- .../src/wlan_policy_mgr_tables_no_dbs_i.h | 3 +- .../src/pe/lim/lim_send_sme_rsp_messages.c | 9 ------ 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_init_deinit.c b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_init_deinit.c index c50c9d37e6dc..8dda691f345b 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_init_deinit.c +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_init_deinit.c @@ -35,6 +35,7 @@ #include "qdf_types.h" #include "qdf_trace.h" #include "wlan_objmgr_global_obj.h" +#include "target_if.h" static QDF_STATUS policy_mgr_psoc_obj_create_cb(struct wlan_objmgr_psoc *psoc, void *data) @@ -408,15 +409,32 @@ static void policy_mgr_update_5g_scc_prefer(struct wlan_objmgr_psoc *psoc) } #ifdef FEATURE_NO_DBS_INTRABAND_MCC_SUPPORT -static void policy_mgr_init_non_dbs_pcl(void) +static void policy_mgr_init_non_dbs_pcl(struct wlan_objmgr_psoc *psoc) { - second_connection_pcl_non_dbs_table = - &second_connection_pcl_nodbs_no_interband_mcc_table; - third_connection_pcl_non_dbs_table = - &third_connection_pcl_nodbs_no_interband_mcc_table; + struct wmi_unified *wmi_handle = get_wmi_unified_hdl_from_psoc(psoc); + + if (!wmi_handle) { + policy_mgr_debug("Invalid WMI handle"); + return; + } + + if (wmi_service_enabled(wmi_handle, + wmi_service_no_interband_mcc_support) && + !wmi_service_enabled(wmi_handle, + wmi_service_dual_band_simultaneous_support)) { + second_connection_pcl_non_dbs_table = + &second_connection_pcl_nodbs_no_interband_mcc_table; + third_connection_pcl_non_dbs_table = + &third_connection_pcl_nodbs_no_interband_mcc_table; + } else { + second_connection_pcl_non_dbs_table = + &second_connection_pcl_nodbs_table; + third_connection_pcl_non_dbs_table = + &third_connection_pcl_nodbs_table; + } } #else -static void policy_mgr_init_non_dbs_pcl(void) +static void policy_mgr_init_non_dbs_pcl(struct wlan_objmgr_psoc *psoc) { second_connection_pcl_non_dbs_table = &second_connection_pcl_nodbs_table; @@ -523,7 +541,7 @@ QDF_STATUS policy_mgr_psoc_enable(struct wlan_objmgr_psoc *psoc) &pm_third_connection_pcl_dbs_1x1_table; /* Initialize non-DBS pcl table pointer to particular table*/ - policy_mgr_init_non_dbs_pcl(); + policy_mgr_init_non_dbs_pcl(psoc); if (policy_mgr_is_hw_dbs_2x2_capable(psoc) || policy_mgr_is_hw_dbs_required_for_band(psoc, diff --git a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_tables_no_dbs_i.h b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_tables_no_dbs_i.h index b8f9ffb6f0b8..93d7e7dedd5f 100644 --- a/components/cmn_services/policy_mgr/src/wlan_policy_mgr_tables_no_dbs_i.h +++ b/components/cmn_services/policy_mgr/src/wlan_policy_mgr_tables_no_dbs_i.h @@ -21,7 +21,6 @@ #include "wlan_policy_mgr_api.h" -#ifndef FEATURE_NO_DBS_INTRABAND_MCC_SUPPORT /** * second_connection_pcl_nodbs_table - table which provides PCL * for the 2nd connection, when we have a connection already in @@ -1529,7 +1528,7 @@ third_connection_pcl_nodbs_table[PM_MAX_TWO_CONNECTION_MODE] [PM_NDI_MODE] = {PM_NONE, PM_NONE, PM_NONE} }, }; -#else /* FEATURE_NO_DBS_INTRABAND_MCC_SUPPORT */ +#ifdef FEATURE_NO_DBS_INTRABAND_MCC_SUPPORT /** * second_connection_pcl_nodbs_no_interband_mcc_table - table diff --git a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c index 3a629c786bf7..ebc2083d7b9c 100644 --- a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c @@ -1533,7 +1533,6 @@ prnt_log: return QDF_STATUS_SUCCESS; } -#ifdef FEATURE_NO_DBS_INTRABAND_MCC_SUPPORT static bool lim_is_csa_channel_allowed(struct mac_context *mac_ctx, qdf_freq_t ch_freq1, uint32_t ch_freq2) @@ -1549,14 +1548,6 @@ static bool lim_is_csa_channel_allowed(struct mac_context *mac_ctx, return is_allowed; } -#else -static bool lim_is_csa_channel_allowed(struct mac_context *mac_ctx, - qdf_freq_t ch_freq1, - uint32_t ch_freq2) -{ - return true; -} -#endif /** * lim_handle_csa_offload_msg() - Handle CSA offload message