mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 05:39:54 -04:00
qcacmn: Set preferred mode per target
Set preferred HW mode by default to HW_MODE_DETECT or HW_MODE_MAX based on target type, also update preferred hw mode and num_band_to_mac accordingly. Change-Id: Iab231b182b54af15d09714e6cf3426c145d4ac3c CRs-Fixed: 2711504
This commit is contained in:
parent
86084af159
commit
4d124bfb1d
3 changed files with 55 additions and 3 deletions
|
|
@ -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");
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue