diff --git a/umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h b/umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h index 59b645a28428..14c239e9af88 100644 --- a/umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h +++ b/umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_api.h @@ -167,6 +167,18 @@ QDF_STATUS policy_mgr_get_vdev_priority_list(struct wlan_objmgr_psoc *psoc, */ QDF_STATUS policy_mgr_get_chnl_select_plcy(struct wlan_objmgr_psoc *psoc, uint32_t *chnl_select_plcy); + +/** + * policy_mgr_get_mcc_adaptive_sch() - to get mcc adaptive scheduler + * @psoc: pointer to psoc + * @enable_mcc_adaptive_sch: value to be filled + * + * This API is used to find out if mcc adaptive scheduler enabled or disabled + * + * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. + */ +QDF_STATUS policy_mgr_get_mcc_adaptive_sch(struct wlan_objmgr_psoc *psoc, + uint8_t *enable_mcc_adaptive_sch); /** * policy_mgr_set_concurrency_mode() - To set concurrency mode * @psoc: PSOC object data @@ -2127,19 +2139,6 @@ enum policy_mgr_hw_mode_change policy_mgr_get_hw_mode_change_from_hw_mode_index( */ bool policy_mgr_is_scan_simultaneous_capable(struct wlan_objmgr_psoc *psoc); -/** - * policy_mgr_is_mcc_adaptive_scheduler_enabled() - Function to - * gets the policy manager mcc adaptive scheduler enabled - * @psoc: PSOC object information - * - * This function gets the value mcc adaptive scheduler - * - * Return: true if MCC adaptive scheduler is set else false - * - */ -bool policy_mgr_is_mcc_adaptive_scheduler_enabled( - struct wlan_objmgr_psoc *psoc); - /** * policy_mgr_set_user_cfg() - Function to set user cfg variables * required by policy manager component diff --git a/umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_cfg.h b/umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_cfg.h index 19b0495859ac..df63b6466e19 100644 --- a/umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_cfg.h +++ b/umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_cfg.h @@ -242,6 +242,28 @@ 0, 1, 0, \ CFG_VALUE_OR_DEFAULT, \ "Enable custom concurrency rule 2") +/* + * + * gEnableMCCAdaptiveScheduler - MCC Adaptive Scheduler feature. + * @Min: 0 + * @Max: 1 + * @Default: 1 + * + * This ini is used to enable/disable MCC Adaptive Scheduler feature. + * + * Related: None. + * + * Supported Feature: Concurrency + * + * Usage: Internal/External + * + * + */ +#define CFG_ENABLE_MCC_ADATIVE_SCH_ENABLED_NAME CFG_INI_UINT(\ + "gEnableMCCAdaptiveScheduler", \ + 0, 1, 1, \ + CFG_VALUE_OR_DEFAULT, \ + "Enable/Disable MCC Adaptive Scheduler") #define CFG_POLICY_MGR_ALL \ CFG(CFG_MCC_TO_SCC_SWITCH) \ @@ -251,5 +273,6 @@ CFG(CFG_VDEV_CUSTOM_PRIORITY_LIST) \ CFG(CFG_CHNL_SELECT_LOGIC_CONC) \ CFG(CFG_ENABLE_CONC_RULE1) \ - CFG(CFG_ENABLE_CONC_RULE2) + CFG(CFG_ENABLE_CONC_RULE2) \ + CFG(CFG_ENABLE_MCC_ADATIVE_SCH_ENABLED_NAME) #endif diff --git a/umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_public_struct.h b/umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_public_struct.h index 89cb5c6ce7bd..53c605853ab0 100644 --- a/umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_public_struct.h +++ b/umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_public_struct.h @@ -1052,12 +1052,10 @@ enum policy_mgr_pri_id { /** * struct policy_mgr_user_cfg - Policy manager user config variables - * @enable_mcc_adaptive_scheduler: Enable MCC adaptive scheduler * @enable2x2: 2x2 chain mask user config * @sub_20_mhz_enabled: Is 5 or 10 Mhz enabled */ struct policy_mgr_user_cfg { - uint8_t enable_mcc_adaptive_scheduler; bool enable2x2; bool sub_20_mhz_enabled; bool is_sta_sap_scc_allowed_on_dfs_chan; diff --git a/umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_ucfg.h b/umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_ucfg.h index 33e246cfa3fa..bc27c19286a4 100644 --- a/umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_ucfg.h +++ b/umac/cmn_services/policy_mgr/inc/wlan_policy_mgr_ucfg.h @@ -152,4 +152,16 @@ QDF_STATUS ucfg_policy_mgr_get_vdev_priority_list(struct wlan_objmgr_psoc *psoc, */ QDF_STATUS ucfg_policy_mgr_get_chnl_select_plcy(struct wlan_objmgr_psoc *psoc, uint32_t *chnl_select_plcy); +/** + * policy_mgr_get_mcc_adaptive_sch() - to get mcc adaptive scheduler + * @psoc: pointer to psoc + * @enable_mcc_adaptive_sch: value to be filled + * + * This API is used to find out if mcc adaptive scheduler enabled or disabled + * + * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. + */ +QDF_STATUS +ucfg_policy_mgr_get_mcc_adaptive_sch(struct wlan_objmgr_psoc *psoc, + uint8_t *enable_mcc_adaptive_sch); #endif //__WLAN_POLICY_MGR_UCFG diff --git a/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c b/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c index 3aeddd794bac..3e640c749a78 100644 --- a/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c +++ b/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_get_set_utils.c @@ -172,6 +172,20 @@ QDF_STATUS policy_mgr_get_chnl_select_plcy(struct wlan_objmgr_psoc *psoc, } +QDF_STATUS policy_mgr_get_mcc_adaptive_sch(struct wlan_objmgr_psoc *psoc, + uint8_t *enable_mcc_adaptive_sch) +{ + struct policy_mgr_psoc_priv_obj *pm_ctx; + + pm_ctx = policy_mgr_get_context(psoc); + if (!pm_ctx) { + policy_mgr_err("pm_ctx is NULL"); + return QDF_STATUS_E_FAILURE; + } + *enable_mcc_adaptive_sch = pm_ctx->cfg.enable_mcc_adaptive_sch; + + return QDF_STATUS_SUCCESS; +} void policy_mgr_update_new_hw_mode_index(struct wlan_objmgr_psoc *psoc, uint32_t new_hw_mode_index) @@ -2275,20 +2289,6 @@ bool policy_mgr_check_for_session_conc(struct wlan_objmgr_psoc *psoc, return true; } -bool policy_mgr_is_mcc_adaptive_scheduler_enabled( - struct wlan_objmgr_psoc *psoc) { - struct policy_mgr_psoc_priv_obj *pm_ctx; - - pm_ctx = policy_mgr_get_context(psoc); - if (!pm_ctx) { - policy_mgr_err("Invalid context"); - return false; - } - - return pm_ctx->user_cfg.enable_mcc_adaptive_scheduler ? - true : false; -} - /** * policy_mgr_change_mcc_go_beacon_interval() - Change MCC beacon interval * @psoc: PSOC object information diff --git a/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_i.h b/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_i.h index 1be204cfdbaf..e5be24789e13 100644 --- a/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_i.h +++ b/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_i.h @@ -223,6 +223,7 @@ struct sta_ap_intf_check_work_ctx { * @dbs_selection_plcy: DBS selection policy for concurrency * @vdev_priority_list: Priority list for various vdevs * @chnl_select_plcy: Channel selection policy + * @enable_mcc_adaptive_sch: Enable/Disable MCC adaptive scheduler */ struct policy_mgr_cfg { uint8_t mcc_to_scc_switch; @@ -230,6 +231,7 @@ struct policy_mgr_cfg { uint8_t max_conc_cxns; uint8_t conc_rule1; uint8_t conc_rule2; + uint8_t enable_mcc_adaptive_sch; uint32_t dbs_selection_plcy; uint32_t vdev_priority_list; uint32_t chnl_select_plcy; diff --git a/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_ucfg.c b/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_ucfg.c index aad715d8e80d..80365392e685 100644 --- a/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_ucfg.c +++ b/umac/cmn_services/policy_mgr/src/wlan_policy_mgr_ucfg.c @@ -40,6 +40,8 @@ static QDF_STATUS policy_mgr_init_cfg(struct wlan_objmgr_psoc *psoc) cfg->dbs_selection_plcy = cfg_get(psoc, CFG_DBS_SELECTION_PLCY); cfg->vdev_priority_list = cfg_get(psoc, CFG_VDEV_CUSTOM_PRIORITY_LIST); cfg->chnl_select_plcy = cfg_get(psoc, CFG_CHNL_SELECT_LOGIC_CONC); + cfg->enable_mcc_adaptive_sch = + cfg_get(psoc, CFG_ENABLE_MCC_ADATIVE_SCH_ENABLED_NAME); return QDF_STATUS_SUCCESS; } @@ -127,3 +129,10 @@ QDF_STATUS ucfg_policy_mgr_get_chnl_select_plcy(struct wlan_objmgr_psoc *psoc, { return policy_mgr_get_chnl_select_plcy(psoc, chnl_select_plcy); } + + +QDF_STATUS ucfg_policy_mgr_get_mcc_adaptive_sch(struct wlan_objmgr_psoc *psoc, + uint8_t *mcc_adaptive_sch) +{ + return policy_mgr_get_mcc_adaptive_sch(psoc, mcc_adaptive_sch); +}