From 84f2effd3fa83e9eab1ee95544560b5e04002144 Mon Sep 17 00:00:00 2001 From: Shashikala Prabhu Date: Mon, 24 Jun 2019 17:33:34 +0530 Subject: [PATCH] qcacmn: Fix target assert caused due to DBS band limitation WAR In some boards, FW can send preferred HW mode as DBS and num HW modes as 2. In this scenario, with I65ab1b803f652cf6b636cd885c6c0afd2251b0ce change we observed a target assert. To fix the assert, apply the DBS mode phy0 band limitation WAR only if FW sends preferred mode as DBS and DBS_SBS. Change-Id: If71d143b4b6a60df7499c0f7b9da00ebf73f2b4e CRs-Fixed: 2465391 --- .../init_deinit/src/service_ready_util.c | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/target_if/init_deinit/src/service_ready_util.c b/target_if/init_deinit/src/service_ready_util.c index 1a2837a07eee..beac8bd695ba 100644 --- a/target_if/init_deinit/src/service_ready_util.c +++ b/target_if/init_deinit/src/service_ready_util.c @@ -526,6 +526,8 @@ static void init_deinit_update_phy_reg_cap(struct wlan_objmgr_psoc *psoc, { struct target_psoc_info *tgt_hdl; enum wmi_host_hw_mode_config_type mode; + uint32_t num_hw_modes; + uint8_t idx; tgt_hdl = (struct target_psoc_info *)wlan_psoc_get_tgt_if_handle( psoc); @@ -536,14 +538,24 @@ static void init_deinit_update_phy_reg_cap(struct wlan_objmgr_psoc *psoc, mode = target_psoc_get_preferred_hw_mode(tgt_hdl); - if ((mode == WMI_HOST_HW_MODE_DBS) && - (info->hw_modes.num_modes == NUM_RF_MODES)) { - if (reg_cap[phy0].low_5ghz_chan > reg_cap[phy2].low_5ghz_chan) - reg_cap[phy0].low_5ghz_chan = reg_cap[phy2].low_5ghz_chan; - else if (reg_cap[phy0].high_5ghz_chan < reg_cap[phy2].high_5ghz_chan) - reg_cap[phy0].high_5ghz_chan = reg_cap[phy2].high_5ghz_chan; - } + num_hw_modes = info->hw_modes.num_modes; + if ((mode != WMI_HOST_HW_MODE_DBS) || (num_hw_modes < NUM_RF_MODES)) + return; + + for (idx = 0; idx < num_hw_modes; idx++) + if (info->hw_modes.hw_mode_ids[idx] == + WMI_HOST_HW_MODE_DBS_SBS) { + if (reg_cap[phy0].low_5ghz_chan > + reg_cap[phy2].low_5ghz_chan) + reg_cap[phy0].low_5ghz_chan = + reg_cap[phy2].low_5ghz_chan; + else if (reg_cap[phy0].high_5ghz_chan < + reg_cap[phy2].high_5ghz_chan) + reg_cap[phy0].high_5ghz_chan = + reg_cap[phy2].high_5ghz_chan; + break; + } } #else static void init_deinit_update_phy_reg_cap(struct wlan_objmgr_psoc *psoc,