summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrunal Soni <ksoni@codeaurora.org>2018-12-19 10:37:02 -0800
committernshrivas <nshrivas@codeaurora.org>2018-12-23 20:04:16 -0800
commit22371e6c46f31a2ec5c9e898b2cebf0dcf372199 (patch)
tree81e7c04f88c11c089ce82220485d47a44dee9498
parent1e4c0b02632ffdb8388d23144a63563d0cd67036 (diff)
qcacld-3.0: Driver fails to report gDualMacFeatureDisable val to FW
If DBS is disabled from INI then driver just bails out in wlan_hdd_update_dbs_scan_and_fw_mode_config() API and never report it to FW. This creates a confusion when DBS is disable INI but our HW is capable of doing DBS, i.e. driver thinks that DBS disabled but FW thinks that DBS is enabled. Provide a fix that driver should report exact INI setting to FW. This issue got introduced as part of regression caused by: Iec2ef7e77e91f332028904c319d24e1ed134306d ROME platform doesn't support any DBS related commands in FW, so if driver sends wmi command with dual_mac_config with all params set to 0 then FW wouldn't respond back and driver would timeout on waiting for response. This was the original issue for which Iec2ef7e77e91f332028904c319d24e1ed134306d was added. Make sure current solution doesn't break backward compatibility. Add a check to make sure FW supports DBS to eliminate ROME vs NON-ROME platform. CRs-Fixed: 2361628 Change-Id: I8a3b795b20e82391ae5d5c86d1e7d814d103ce64
-rw-r--r--core/hdd/src/wlan_hdd_main.c79
-rw-r--r--core/wma/inc/wma_api.h12
-rw-r--r--core/wma/src/wma_utils.c65
3 files changed, 100 insertions, 56 deletions
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 8c4989301e23..36777e9e7bb5 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -2020,51 +2020,62 @@ static int hdd_mon_open(struct net_device *dev)
static QDF_STATUS
wlan_hdd_update_dbs_scan_and_fw_mode_config(void)
{
- struct sir_dual_mac_config cfg = {0};
- QDF_STATUS status;
- uint32_t channel_select_logic_conc;
- hdd_context_t *hdd_ctx;
-
- hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
- if (!hdd_ctx) {
- hdd_err("HDD context is NULL");
- return QDF_STATUS_E_FAILURE;
- }
- if (!wma_is_hw_dbs_capable())
- return QDF_STATUS_SUCCESS;
+ struct sir_dual_mac_config cfg = {0};
+ QDF_STATUS status;
+ uint32_t chnl_sel_logic_conc = 0, dbs_disable;
+ hdd_context_t *hdd_ctx;
- cfg.scan_config = 0;
- cfg.fw_mode_config = 0;
- cfg.set_dual_mac_cb = cds_soc_set_dual_mac_cfg_cb;
+ hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
+ if (!hdd_ctx) {
+ hdd_err("HDD context is NULL");
+ return QDF_STATUS_E_FAILURE;
+ }
- channel_select_logic_conc = hdd_ctx->config->
- channel_select_logic_conc;
+ /*
+ * ROME platform doesn't support any DBS related commands in FW,
+ * so if driver sends wmi command with dual_mac_config with all set to
+ * 0 then FW wouldn't respond back and driver would timeout on waiting
+ * for response. Check if FW supports DBS to eliminate ROME vs
+ * NON-ROME platform.
+ */
+ if (!wma_find_if_fw_supports_dbs())
+ return QDF_STATUS_SUCCESS;
- if (hdd_ctx->config->dual_mac_feature_disable !=
- DISABLE_DBS_CXN_AND_SCAN) {
- status = wma_get_updated_scan_and_fw_mode_config(
- &cfg.scan_config, &cfg.fw_mode_config,
- hdd_ctx->config->dual_mac_feature_disable,
- channel_select_logic_conc);
+ cfg.scan_config = 0;
+ cfg.fw_mode_config = 0;
+ cfg.set_dual_mac_cb = cds_soc_set_dual_mac_cfg_cb;
- if (status != QDF_STATUS_SUCCESS) {
- hdd_err("wma_get_updated_scan_and_fw_mode_config failed %d",
- status);
- return status;
- }
- }
+ if (wma_is_hw_dbs_capable())
+ chnl_sel_logic_conc =
+ hdd_ctx->config->channel_select_logic_conc;
- hdd_debug("send scan_cfg: 0x%x fw_mode_cfg: 0x%x to fw",
- cfg.scan_config, cfg.fw_mode_config);
+ dbs_disable = hdd_ctx->config->dual_mac_feature_disable;
+ if (hdd_ctx->config->dual_mac_feature_disable !=
+ DISABLE_DBS_CXN_AND_SCAN) {
+ status =
+ wma_get_updated_scan_and_fw_mode_config(&cfg.scan_config,
+ &cfg.fw_mode_config,
+ dbs_disable,
+ chnl_sel_logic_conc);
- status = sme_soc_set_dual_mac_config(hdd_ctx->hHal, cfg);
if (status != QDF_STATUS_SUCCESS) {
- hdd_err("sme_soc_set_dual_mac_config failed %d",
+ hdd_err("can't get updated scan and fw cfg status:%d",
status);
return status;
}
+ }
- return QDF_STATUS_SUCCESS;
+ hdd_debug("send scan_cfg: 0x%x fw_mode_cfg: 0x%x to fw",
+ cfg.scan_config, cfg.fw_mode_config);
+
+ status = sme_soc_set_dual_mac_config(hdd_ctx->hHal, cfg);
+ if (status != QDF_STATUS_SUCCESS) {
+ hdd_err("sme_soc_set_dual_mac_config failed %d",
+ status);
+ return status;
+ }
+
+ return QDF_STATUS_SUCCESS;
}
/**
* hdd_start_adapter() - Wrapper function for device specific adapter
diff --git a/core/wma/inc/wma_api.h b/core/wma/inc/wma_api.h
index 172c332de9b2..e8567492c40d 100644
--- a/core/wma/inc/wma_api.h
+++ b/core/wma/inc/wma_api.h
@@ -368,6 +368,18 @@ static inline QDF_STATUS wma_encrypt_decrypt_msg(WMA_HANDLE wma,
#endif
/**
+ * wma_find_if_fw_supports_dbs() - to check if FW supports DBS
+ *
+ * Firmware sends supported HW mode as part of service ready and
+ * service ready extension WMI message. This API checks through
+ * those HW mode list and figures out if DBS is supported by
+ * FW/HW.
+ *
+ * Return: True if FW/HW supports DBS else returns false.
+ */
+bool wma_find_if_fw_supports_dbs(void);
+
+/**
* wma_set_cts2self_for_p2p_go() - set CTS2SELF command for P2P GO.
* @wma_handle: pointer to wma handle.
* @cts2self_for_p2p_go: value needs to set to firmware.
diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c
index 1aeb9dae5ea5..d7d5f7f0698a 100644
--- a/core/wma/src/wma_utils.c
+++ b/core/wma/src/wma_utils.c
@@ -4771,41 +4771,41 @@ int8_t wma_get_num_dbs_hw_modes(void)
return wma->num_dbs_hw_modes;
}
-/**
- * wma_is_hw_dbs_capable() - Check if HW is DBS capable
- *
- * Checks if the HW is DBS capable
- *
- * Return: true if the HW is DBS capable
- */
-bool wma_is_hw_dbs_capable(void)
+bool wma_find_if_fw_supports_dbs(void)
{
tp_wma_handle wma;
- uint32_t param, i, found = 0;
+ bool dbs_support;
wma = cds_get_context(QDF_MODULE_ID_WMA);
if (!wma) {
WMA_LOGE("%s: Invalid WMA handle", __func__);
return false;
}
-
- if (!wma_is_dbs_enable()) {
- WMA_LOGD("%s: DBS is disabled", __func__);
- return false;
- }
-
- WMA_LOGD("%s: DBS service bit map: %d", __func__,
- WMI_SERVICE_IS_ENABLED(wma->wmi_service_bitmap,
- WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT));
-
+ dbs_support =
+ WMI_SERVICE_IS_ENABLED(wma->wmi_service_bitmap,
+ WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT);
+ WMA_LOGD("%s: is DBS supported by FW/HW: %s", __func__,
+ dbs_support ? "yes" : "no");
/* The agreement with FW is that: To know if the target is DBS
* capable, DBS needs to be supported both in the HW mode list
* and in the service ready event
*/
- if (!(WMI_SERVICE_IS_ENABLED(wma->wmi_service_bitmap,
- WMI_SERVICE_DUAL_BAND_SIMULTANEOUS_SUPPORT)))
+ if (!dbs_support)
return false;
+ return true;
+}
+
+static bool wma_find_if_hwlist_has_dbs(void)
+{
+ tp_wma_handle wma;
+ uint32_t param, i, found = 0;
+
+ wma = cds_get_context(QDF_MODULE_ID_WMA);
+ if (!wma) {
+ WMA_LOGE("%s: Invalid WMA handle", __func__);
+ return false;
+ }
for (i = 0; i < wma->num_dbs_hw_modes; i++) {
param = wma->hw_mode.hw_mode_list[i];
WMA_LOGD("%s: HW param: %x", __func__, param);
@@ -4815,7 +4815,6 @@ bool wma_is_hw_dbs_capable(void)
break;
}
}
-
if (found)
return true;
@@ -4823,6 +4822,28 @@ bool wma_is_hw_dbs_capable(void)
}
/**
+ * wma_is_hw_dbs_capable() - Check if HW is DBS capable
+ *
+ * Checks if the HW is DBS capable
+ *
+ * Return: true if the HW is DBS capable
+ */
+bool wma_is_hw_dbs_capable(void)
+{
+ if (!wma_is_dbs_enable()) {
+ WMA_LOGD("%s: DBS is disabled", __func__);
+ return false;
+ }
+
+ if (!wma_find_if_fw_supports_dbs()) {
+ WMA_LOGD("%s: HW mode list has no dbs", __func__);
+ return false;
+ }
+
+ return wma_find_if_hwlist_has_dbs();
+}
+
+/**
* wma_get_cds_hw_mode_change_from_hw_mode_index - Returns value in terms of
* cds_hw_mode_change enums derived from hw_mode_index.
*