diff --git a/src/wlan_policy_mgr_action.c b/src/wlan_policy_mgr_action.c index 27bf91d634e2..809406cc8191 100644 --- a/src/wlan_policy_mgr_action.c +++ b/src/wlan_policy_mgr_action.c @@ -1855,7 +1855,9 @@ QDF_STATUS policy_mgr_set_hw_mode_on_channel_switch( action = (*policy_mgr_get_current_pref_hw_mode_ptr)(psoc); if ((action != PM_DBS_DOWNGRADE) && - (action != PM_SINGLE_MAC_UPGRADE)) { + (action != PM_SINGLE_MAC_UPGRADE) && + (action != PM_DBS1_DOWNGRADE) && + (action != PM_DBS2_DOWNGRADE)) { policy_mgr_err("Invalid action: %d", action); status = QDF_STATUS_SUCCESS; goto done; diff --git a/src/wlan_policy_mgr_core.c b/src/wlan_policy_mgr_core.c index de1763c75df2..a91ecd9c1f12 100644 --- a/src/wlan_policy_mgr_core.c +++ b/src/wlan_policy_mgr_core.c @@ -2955,6 +2955,39 @@ enum policy_mgr_conc_next_action return next_action; } +enum policy_mgr_conc_next_action +policy_mgr_get_current_pref_hw_mode_dual_dbs( + struct wlan_objmgr_psoc *psoc) +{ + enum policy_mgr_conc_next_action next_action; + struct policy_mgr_psoc_priv_obj *pm_ctx; + enum policy_mgr_conc_next_action preferred_dbs; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("Invalid Context"); + return PM_NOP; + } + + next_action = policy_mgr_get_current_pref_hw_mode_dbs_1x1(psoc); + policy_mgr_info("next_action %d", next_action); + if (next_action != PM_DBS_DOWNGRADE) + return next_action; + + preferred_dbs = policy_mgr_get_preferred_dbs_action_table( + psoc, INVALID_VDEV_ID, 0, 0); + if (preferred_dbs == PM_DBS1) { + next_action = PM_DBS1_DOWNGRADE; + } else if (preferred_dbs == PM_DBS2) { + next_action = PM_DBS2_DOWNGRADE; + } else { + policy_mgr_err("DBS1 and DBS2 hw mode not supported"); + return PM_NOP; + } + policy_mgr_info("preferred_dbs %d", next_action); + return next_action; +} + /** * policy_mgr_reset_sap_mandatory_channels() - Reset the SAP mandatory channels * diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index 0a9d52b47050..5f29c534f726 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -489,6 +489,20 @@ enum policy_mgr_conc_next_action enum policy_mgr_conc_next_action policy_mgr_get_current_pref_hw_mode_dbs_1x1( struct wlan_objmgr_psoc *psoc); + +/** + * policy_mgr_get_current_pref_hw_mode_dual_dbs() - Get the + * current preferred hw mode + * + * Get the preferred hw mode based on the current connection combinations + * + * Return: No change (PM_NOP), (PM_SINGLE_MAC_UPGRADE), + * DBS (PM_DBS1_DOWNGRADE or PM_DBS2_DOWNGRADE) + */ +enum policy_mgr_conc_next_action + policy_mgr_get_current_pref_hw_mode_dual_dbs( + struct wlan_objmgr_psoc *psoc); + QDF_STATUS policy_mgr_reset_sap_mandatory_channels( struct policy_mgr_psoc_priv_obj *pm_ctx); diff --git a/src/wlan_policy_mgr_init_deinit.c b/src/wlan_policy_mgr_init_deinit.c index 2dc015d3f404..3b99c7ce6620 100644 --- a/src/wlan_policy_mgr_init_deinit.c +++ b/src/wlan_policy_mgr_init_deinit.c @@ -423,6 +423,9 @@ QDF_STATUS policy_mgr_psoc_enable(struct wlan_objmgr_psoc *psoc) if (policy_mgr_is_hw_dbs_2x2_capable(psoc)) policy_mgr_get_current_pref_hw_mode_ptr = policy_mgr_get_current_pref_hw_mode_dbs_2x2; + else if (policy_mgr_is_2x2_1x1_dbs_capable(psoc)) + policy_mgr_get_current_pref_hw_mode_ptr = + policy_mgr_get_current_pref_hw_mode_dual_dbs; else policy_mgr_get_current_pref_hw_mode_ptr = policy_mgr_get_current_pref_hw_mode_dbs_1x1;