From f936eaa6de12bb96f9083245757ab6de8b2d33c9 Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Thu, 27 Sep 2018 10:40:24 -0700 Subject: [PATCH] qcacmn: Refactor operation related to INI gSystemPref Ownership of gSystemPref is changed from HDD to Policy manager. So policy manager doesn't have to rely on HDD to obtain the INI setting. CRs-Fixed: 2324395 Change-Id: Ia586896ea55c6e71d8dcff705bf0e74879931dbb --- .../policy_mgr/inc/wlan_policy_mgr_api.h | 12 ++++++++++++ .../inc/wlan_policy_mgr_public_struct.h | 2 -- .../policy_mgr/inc/wlan_policy_mgr_ucfg.h | 12 ++++++++++++ .../src/wlan_policy_mgr_get_set_utils.c | 17 ++++++++++++++++- .../policy_mgr/src/wlan_policy_mgr_ucfg.c | 6 ++++++ 5 files changed, 46 insertions(+), 3 deletions(-) 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 202896167519..28024645b332 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 7782f5c39f39..a816b139d466 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 eb17a3c425da..ab6e51c192d3 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 3891909533b0..168d9876b212 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 70f9e851635c..aad715d8e80d 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) {