diff --git a/target_if/core/src/target_if_main.c b/target_if/core/src/target_if_main.c index ffe980bdda45..a32a0770bb0d 100644 --- a/target_if/core/src/target_if_main.c +++ b/target_if/core/src/target_if_main.c @@ -456,6 +456,21 @@ void target_if_ftm_tx_ops_register(struct wlan_lmac_if_tx_ops *tx_ops) { } #endif + +#ifdef FEATURE_NO_DBS_INTRABAND_MCC_SUPPORT +static enum wmi_host_hw_mode_config_type +target_if_get_default_pref_hw_mode(struct target_psoc_info *psoc_info) +{ + return WMI_HOST_HW_MODE_DETECT; +} +#else +static enum wmi_host_hw_mode_config_type +target_if_get_default_pref_hw_mode(struct target_psoc_info *psoc_info) +{ + return WMI_HOST_HW_MODE_MAX; +} +#endif + static QDF_STATUS target_if_register_umac_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops) { @@ -595,6 +610,7 @@ QDF_STATUS target_if_free_pdev_tgt_info(struct wlan_objmgr_pdev *pdev) QDF_STATUS target_if_alloc_psoc_tgt_info(struct wlan_objmgr_psoc *psoc) { struct target_psoc_info *tgt_psoc_info; + enum wmi_host_hw_mode_config_type hw_mode; if (!psoc) { target_if_err("psoc is null"); @@ -607,7 +623,8 @@ QDF_STATUS target_if_alloc_psoc_tgt_info(struct wlan_objmgr_psoc *psoc) return QDF_STATUS_E_NOMEM; wlan_psoc_set_tgt_if_handle(psoc, tgt_psoc_info); - target_psoc_set_preferred_hw_mode(tgt_psoc_info, WMI_HOST_HW_MODE_MAX); + hw_mode = target_if_get_default_pref_hw_mode(tgt_psoc_info); + target_psoc_set_preferred_hw_mode(tgt_psoc_info, hw_mode); wlan_minidump_log(tgt_psoc_info, sizeof(*tgt_psoc_info), psoc, WLAN_MD_OBJMGR_PSOC_TGT_INFO, "target_psoc_info"); diff --git a/target_if/init_deinit/src/init_cmd_api.c b/target_if/init_deinit/src/init_cmd_api.c index ebc0b3b7c8ab..1127fc77c019 100644 --- a/target_if/init_deinit/src/init_cmd_api.c +++ b/target_if/init_deinit/src/init_cmd_api.c @@ -361,6 +361,37 @@ void init_deinit_derive_band_to_mac_param( } } +/* if num of mac per band is sent by host then FW will not initialize + * its data structure with its default value. Host either have to set + * these value as per current HW mode or else these variable should be + * initialized to 0. + * Ex - If host is sending default HW mode as DBS in INIT_CMDID + * then either host should fill both the MACs (mac0 and mac1) or + * else don't fill for even a single mac, it should be initialized to + * 0 which means FW will initialize its data structures based on its + * default value. + */ +#ifdef FEATURE_NO_DBS_INTRABAND_MCC_SUPPORT +static bool is_num_band_to_mac_required(struct wmi_unified *wmi_handle) +{ + bool is_required = true; + + /* For target where interband MCC is not supported, num of + * mac should be set to default value i.e. 0 + */ + is_required = (wmi_service_enabled(wmi_handle, + wmi_service_dual_band_simultaneous_support) || + !wmi_service_enabled(wmi_handle, + wmi_service_no_interband_mcc_support)); + return is_required; +} +#else +static bool is_num_band_to_mac_required(struct wmi_unified *wmi_handle) +{ + return true; +} +#endif + void init_deinit_prepare_send_init_cmd( struct wlan_objmgr_psoc *psoc, struct target_psoc_info *tgt_hdl) @@ -391,8 +422,9 @@ void init_deinit_prepare_send_init_cmd( if (info->preferred_hw_mode == WMI_HOST_HW_MODE_SINGLE) init_param.hw_mode_id = WMI_HOST_HW_MODE_MAX; - init_param.num_band_to_mac = target_psoc_get_num_radios( - tgt_hdl); + if (is_num_band_to_mac_required(wmi_handle)) + init_param.num_band_to_mac = + target_psoc_get_num_radios(tgt_hdl); init_deinit_derive_band_to_mac_param(psoc, tgt_hdl, init_param.band_to_mac); diff --git a/target_if/init_deinit/src/service_ready_util.c b/target_if/init_deinit/src/service_ready_util.c index 51f0c0530f9f..1cf07874fbdb 100644 --- a/target_if/init_deinit/src/service_ready_util.c +++ b/target_if/init_deinit/src/service_ready_util.c @@ -362,6 +362,9 @@ int init_deinit_populate_hw_mode_capability( target_if_info("Preferred mode is not set, use mode id %d\n", selected_mode); target_psoc_set_preferred_hw_mode(tgt_hdl, selected_mode); + + /* Change default DBS hw mode as per selected one */ + info->target_caps.default_dbs_hw_mode_index = selected_mode; } status = get_sar_version(wmi_handle, event, &info->service_ext_param);