From 8fd69cb240a8757435e3fcaf97cb1b963cb80883 Mon Sep 17 00:00:00 2001 From: sheenam monga Date: Fri, 9 Jul 2021 16:54:00 +0530 Subject: [PATCH] qcacmn: Check ext cc event support before pouplating sec chan list Currently host is populating secondary channel list from master channel list based on ap power type. In case fw doesn't support extd cc event then secondary channel list will not have 6g freq, which may break legacy 6g handling. Fix is to add validation check for ext cc event support, copy secondary channel list from ap power type in case ext cc event is supported by fw else copy secondary channel list from reg current channel list. Change-Id: I2e13be2936b624ccbee5e8e426987355076a0062 CRs-Fixed: 2987951 --- target_if/regulatory/src/target_if_reg.c | 6 ++++- .../obj_mgr/inc/wlan_objmgr_psoc_obj.h | 2 ++ .../regulatory/core/src/reg_build_chan_list.c | 26 +++++++++++++++---- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/target_if/regulatory/src/target_if_reg.c b/target_if/regulatory/src/target_if_reg.c index 666324cab10b..04965082e817 100644 --- a/target_if/regulatory/src/target_if_reg.c +++ b/target_if/regulatory/src/target_if_reg.c @@ -228,8 +228,12 @@ target_if_reg_is_reg_cc_ext_event_host_supported(struct wlan_objmgr_psoc *psoc) return reg_ext_cc_supp; } - if (reg_tx_ops->register_master_ext_handler) + if (reg_tx_ops->register_master_ext_handler) { reg_ext_cc_supp = true; + wlan_psoc_nif_fw_ext_cap_set(psoc, + WLAN_SOC_EXT_EVENT_SUPPORTED); + } + return reg_ext_cc_supp; } diff --git a/umac/cmn_services/obj_mgr/inc/wlan_objmgr_psoc_obj.h b/umac/cmn_services/obj_mgr/inc/wlan_objmgr_psoc_obj.h index ace94f484fb6..453fec522438 100644 --- a/umac/cmn_services/obj_mgr/inc/wlan_objmgr_psoc_obj.h +++ b/umac/cmn_services/obj_mgr/inc/wlan_objmgr_psoc_obj.h @@ -146,6 +146,8 @@ #define WLAN_SOC_CEXT_SCAN_PER_CH_CONFIG 0x01000000 /* CAPABILITY: csa offload in case of AP */ #define WLAN_SOC_CEXT_CSA_TX_OFFLOAD 0x02000000 + /* ext event supported by fw */ +#define WLAN_SOC_EXT_EVENT_SUPPORTED 0x04000000 /* feature_flags */ /* CONF: ATH FF enabled */ diff --git a/umac/regulatory/core/src/reg_build_chan_list.c b/umac/regulatory/core/src/reg_build_chan_list.c index ae7a45681b23..1e781c36e7c2 100644 --- a/umac/regulatory/core/src/reg_build_chan_list.c +++ b/umac/regulatory/core/src/reg_build_chan_list.c @@ -1046,15 +1046,31 @@ static void reg_populate_secondary_cur_chan_list(struct wlan_regulatory_pdev_priv_obj *pdev_priv_obj) { - qdf_mem_copy(pdev_priv_obj->secondary_cur_chan_list, - pdev_priv_obj->cur_chan_list, - (NUM_CHANNELS - NUM_6GHZ_CHANNELS) * - sizeof(struct regulatory_channel)); - qdf_mem_copy(&pdev_priv_obj-> + struct wlan_objmgr_psoc *psoc; + + psoc = wlan_pdev_get_psoc(pdev_priv_obj->pdev_ptr); + if (!psoc) { + reg_err("psoc is NULL"); + return; + } + if (wlan_psoc_nif_fw_ext_cap_get(psoc, + WLAN_SOC_EXT_EVENT_SUPPORTED)) { + qdf_mem_copy(pdev_priv_obj->secondary_cur_chan_list, + pdev_priv_obj->cur_chan_list, + (NUM_CHANNELS - NUM_6GHZ_CHANNELS) * + sizeof(struct regulatory_channel)); + + qdf_mem_copy(&pdev_priv_obj-> secondary_cur_chan_list[MIN_6GHZ_CHANNEL], pdev_priv_obj->mas_chan_list_6g_ap [pdev_priv_obj->reg_cur_6g_ap_pwr_type], NUM_6GHZ_CHANNELS * sizeof(struct regulatory_channel)); + } else { + qdf_mem_copy(pdev_priv_obj->secondary_cur_chan_list, + pdev_priv_obj->cur_chan_list, + (NUM_CHANNELS) * + sizeof(struct regulatory_channel)); + } } #else /* CONFIG_REG_CLIENT */ static void