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 2028961675..28024645b3 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 @@ -88,6 +88,18 @@ QDF_STATUS policy_mgr_get_mcc_scc_switch(struct wlan_objmgr_psoc *psoc, */ QDF_STATUS policy_mgr_get_sys_pref(struct wlan_objmgr_psoc *psoc, uint8_t *sys_pref); +/** + * policy_mgr_set_sys_pref() - to set system preference + * @psoc: pointer to psoc + * @sys_pref: value to be applied as new INI setting + * + * This API is meant to override original INI setting for system pref + * with new value which is used by policy manager to provide PCL + * + * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. + */ +QDF_STATUS policy_mgr_set_sys_pref(struct wlan_objmgr_psoc *psoc, + uint8_t sys_pref); /** * policy_mgr_get_max_conc_cxns() - to get max num of conc connections * @psoc: pointer to psoc 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 7782f5c39f..a816b139d4 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 @@ -1055,7 +1055,6 @@ enum policy_mgr_pri_id { * @enable_mcc_adaptive_scheduler: Enable MCC adaptive scheduler * @max_concurrent_active_sessions: User allowed maximum active * connections - * @conc_system_pref: System preference for PCL table * @enable2x2: 2x2 chain mask user config * @sub_20_mhz_enabled: Is 5 or 10 Mhz enabled * @dbs_selection_policy: band preference or Vdev preference @@ -1073,7 +1072,6 @@ enum policy_mgr_pri_id { struct policy_mgr_user_cfg { uint8_t enable_mcc_adaptive_scheduler; uint8_t max_concurrent_active_sessions; - uint8_t conc_system_pref; 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 eb17a3c425..ab6e51c192 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 @@ -73,6 +73,18 @@ QDF_STATUS ucfg_policy_mgr_get_mcc_scc_switch(struct wlan_objmgr_psoc *psoc, */ QDF_STATUS ucfg_policy_mgr_get_sys_pref(struct wlan_objmgr_psoc *psoc, uint8_t *sys_pref); +/** + * ucfg_policy_mgr_set_sys_pref() - to set system preference + * @psoc: pointer to psoc + * @sys_pref: value to be applied as new INI setting + * + * This API is meant to override original INI setting for system pref + * with new value which is used by policy manager to provide PCL + * + * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. + */ +QDF_STATUS ucfg_policy_mgr_set_sys_pref(struct wlan_objmgr_psoc *psoc, + uint8_t sys_pref); /** * ucfg_policy_mgr_get_max_conc_cxns() - to get max num of conc connections * @psoc: pointer to psoc 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 3891909533..168d9876b2 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 @@ -66,6 +66,21 @@ QDF_STATUS policy_mgr_get_sys_pref(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } +QDF_STATUS policy_mgr_set_sys_pref(struct wlan_objmgr_psoc *psoc, + uint8_t sys_pref) +{ + 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; + } + pm_ctx->cfg.sys_pref = sys_pref; + + return QDF_STATUS_SUCCESS; +} + QDF_STATUS policy_mgr_get_max_conc_cxns(struct wlan_objmgr_psoc *psoc, uint8_t *max_conc_cxns) { @@ -2102,7 +2117,7 @@ QDF_STATUS policy_mgr_set_user_cfg(struct wlan_objmgr_psoc *psoc, user_cfg->dbs_selection_policy); policy_mgr_debug("vdev_priority_list 0x%x", user_cfg->vdev_priority_list); - pm_ctx->cur_conc_system_pref = pm_ctx->user_cfg.conc_system_pref; + pm_ctx->cur_conc_system_pref = pm_ctx->cfg.sys_pref; return QDF_STATUS_SUCCESS; } 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 70f9e85163..aad715d8e8 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 @@ -86,6 +86,12 @@ QDF_STATUS ucfg_policy_mgr_get_sys_pref(struct wlan_objmgr_psoc *psoc, return policy_mgr_get_sys_pref(psoc, sys_pref); } +QDF_STATUS ucfg_policy_mgr_set_sys_pref(struct wlan_objmgr_psoc *psoc, + uint8_t sys_pref) +{ + return policy_mgr_set_sys_pref(psoc, sys_pref); +} + QDF_STATUS ucfg_policy_mgr_get_max_conc_cxns(struct wlan_objmgr_psoc *psoc, uint8_t *max_conc_cxns) {