qcacld-3.0: Enable the DBS ini if DBS is mandatory

The driver does not check the device DBS capability
and the DBS ini compatibility.
If the DBS ini gDualMacFeatureDisable is disabled
and HW mandates DBS capability then overide the ini
to always keep it enable.

Change-Id: I2b31453f9c8a04cef7f943b30d3c28f844c276b5
CRs-Fixed: 2551644
This commit is contained in:
gaurank kathpalia 2019-11-12 16:44:31 +05:30 committed by nshrivas
parent 8af102d467
commit e314029ccf
4 changed files with 80 additions and 1 deletions

View File

@ -151,6 +151,19 @@ policy_mgr_get_enable_overlap_chnl(struct wlan_objmgr_psoc *psoc,
*/
QDF_STATUS policy_mgr_get_dual_mac_feature(struct wlan_objmgr_psoc *psoc,
uint8_t *dual_mac_feature);
/**
* policy_mgr_set_dual_mac_feature() - to set the dual mac feature value
* @psoc: pointer to psoc
* @dual_mac_feature: value to be updated
*
* This API is used to update the dual mac (dual radio) specific feature value
*
* Return: QDF_STATUS_SUCCESS up on success and any other status for failure.
*/
QDF_STATUS policy_mgr_set_dual_mac_feature(struct wlan_objmgr_psoc *psoc,
uint8_t dual_mac_feature);
/**
* policy_mgr_get_force_1x1() - to find out if 1x1 connection is enforced
*

View File

@ -71,6 +71,22 @@ policy_mgr_get_enable_overlap_chnl(struct wlan_objmgr_psoc *psoc,
return QDF_STATUS_SUCCESS;
}
QDF_STATUS policy_mgr_set_dual_mac_feature(struct wlan_objmgr_psoc *psoc,
uint8_t dual_mac_feature)
{
struct policy_mgr_psoc_priv_obj *pm_ctx;
pm_ctx = policy_mgr_get_context(psoc);
if (!pm_ctx) {
policy_mgr_err("pm_ctx is NULL");
return QDF_STATUS_E_FAILURE;
}
pm_ctx->cfg.dual_mac_feature = dual_mac_feature;
return QDF_STATUS_SUCCESS;
}
QDF_STATUS policy_mgr_get_dual_mac_feature(struct wlan_objmgr_psoc *psoc,
uint8_t *dual_mac_feature)
{
@ -856,7 +872,7 @@ bool policy_mgr_find_if_fw_supports_dbs(struct wlan_objmgr_psoc *psoc)
return true;
}
static bool policy_mgr_find_if_hwlist_has_dbs(struct wlan_objmgr_psoc *psoc)
bool policy_mgr_find_if_hwlist_has_dbs(struct wlan_objmgr_psoc *psoc)
{
struct policy_mgr_psoc_priv_obj *pm_ctx;
uint32_t param, i, found = 0;

View File

@ -396,6 +396,16 @@ QDF_STATUS policy_mgr_get_updated_fw_mode_config(
bool policy_mgr_is_dual_mac_disabled_in_ini(
struct wlan_objmgr_psoc *psoc);
/**
* policy_mgr_find_if_hwlist_has_dbs() - Find if hw list has DBS modes or not
* @psoc: PSOC object information
*
* Find if hw list has DBS modes or not
*
* Return: true or false
*/
bool policy_mgr_find_if_hwlist_has_dbs(struct wlan_objmgr_psoc *psoc);
/**
* policy_mgr_get_mcc_to_scc_switch_mode() - MCC to SCC
* switch mode value in the user config

View File

@ -98,6 +98,7 @@
#include "nan_ucfg_api.h"
#include "wma_coex.h"
#include "target_if_vdev_mgr_rx_ops.h"
#include "wlan_policy_mgr_i.h"
#ifdef DIRECT_BUF_RX_ENABLE
#include <target_if_direct_buf_rx_api.h>
@ -5396,6 +5397,40 @@ static void wma_update_mlme_related_tgt_caps(struct wlan_objmgr_psoc *psoc,
wlan_mlme_update_cfg_with_tgt_caps(psoc, &mlme_tgt_cfg);
}
static bool
wma_is_dbs_mandatory(struct wlan_objmgr_psoc *psoc,
struct target_psoc_info *tgt_hdl)
{
uint8_t i, total_mac_phy_cnt;
struct wlan_psoc_host_mac_phy_caps *mac_cap, *mac_phy_cap;
uint8_t supported_band = 0;
if (!policy_mgr_find_if_fw_supports_dbs(psoc) ||
!policy_mgr_find_if_hwlist_has_dbs(psoc))
return false;
total_mac_phy_cnt = target_psoc_get_total_mac_phy_cnt(tgt_hdl);
mac_phy_cap = target_psoc_get_mac_phy_cap(tgt_hdl);
for (i = 0; i < total_mac_phy_cnt; i++) {
mac_cap = &mac_phy_cap[i];
if (mac_cap->phy_id == 0)
supported_band |= mac_cap->supported_bands;
}
/* If Mac0 supports both the bands then DBS is not mandatory */
if (supported_band & WLAN_2G_CAPABILITY &&
supported_band & WLAN_5G_CAPABILITY) {
wma_debug("Mac0 supports both bands DBS is optional");
return false;
}
wma_info("MAC0 does not support both bands %d DBS is mandatory",
supported_band);
return true;
}
/**
* wma_update_hdd_cfg() - update HDD config
* @wma_handle: wma handle
@ -6696,6 +6731,11 @@ int wma_rx_service_ready_ext_event(void *handle, uint8_t *event,
WMA_LOGD("WMA --> WMI_INIT_CMDID");
if (wma_is_dbs_mandatory(wma_handle->psoc, tgt_hdl) &&
(policy_mgr_is_dual_mac_disabled_in_ini(wma_handle->psoc)))
policy_mgr_set_dual_mac_feature(wma_handle->psoc,
ENABLE_DBS_CXN_AND_DISABLE_SIMULTANEOUS_SCAN);
wma_init_scan_fw_mode_config(wma_handle->psoc, conc_scan_config_bits,
fw_config_bits);