From dd8bf40a4473ec7d086fabe045f65c119c3f878b Mon Sep 17 00:00:00 2001 From: Krunal Soni Date: Thu, 27 Sep 2018 17:34:25 -0700 Subject: [PATCH] qcacmn: Refactor operation related to gEnableStaConnectionIn5Ghz INI Ownership of gEnableStaConnectionIn5Ghz 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: I894467bab4b0bddf309463802b98904ef1150536 --- inc/wlan_policy_mgr_api.h | 14 ++++++++++++++ inc/wlan_policy_mgr_cfg.h | 26 +++++++++++++++++++++++++- inc/wlan_policy_mgr_ucfg.h | 14 ++++++++++++++ src/wlan_policy_mgr_get_set_utils.c | 15 +++++++++++++++ src/wlan_policy_mgr_i.h | 2 ++ src/wlan_policy_mgr_ucfg.c | 8 ++++++++ 6 files changed, 78 insertions(+), 1 deletion(-) diff --git a/inc/wlan_policy_mgr_api.h b/inc/wlan_policy_mgr_api.h index 14c239e9af88..31da207ed607 100644 --- a/inc/wlan_policy_mgr_api.h +++ b/inc/wlan_policy_mgr_api.h @@ -179,6 +179,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); + +/** + * policy_mgr_get_sta_cxn_5g_band() - to get STA's connection in 5G config + * + * @psoc: pointer to psoc + * @enable_sta_cxn_5g_band: value to be filled + * + * This API is used to find out if STA connection in 5G band is allowed or + * disallowed. + * + * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. + */ +QDF_STATUS policy_mgr_get_sta_cxn_5g_band(struct wlan_objmgr_psoc *psoc, + uint8_t *enable_sta_cxn_5g_band); /** * policy_mgr_set_concurrency_mode() - To set concurrency mode * @psoc: PSOC object data diff --git a/inc/wlan_policy_mgr_cfg.h b/inc/wlan_policy_mgr_cfg.h index df63b6466e19..22900022d06e 100644 --- a/inc/wlan_policy_mgr_cfg.h +++ b/inc/wlan_policy_mgr_cfg.h @@ -265,6 +265,29 @@ CFG_VALUE_OR_DEFAULT, \ "Enable/Disable MCC Adaptive Scheduler") +/* + * + * gEnableStaConnectionIn5Ghz - To enable/disable STA connection in 5G + * @Min: 0 + * @Max: 1 + * @Default: 1 + * + * This ini is used to enable/disable STA connection in 5G band + * + * Related: STA + * + * Supported Feature: Concurrency + * + * Usage: Internal/External + * + * + */ +#define CFG_ENABLE_STA_CONNECTION_IN_5GHZ CFG_INI_UINT(\ + "gEnableStaConnectionIn5Ghz", \ + 0, 1, 1, \ + CFG_VALUE_OR_DEFAULT, \ + "Enable/Disable STA connection in 5G") + #define CFG_POLICY_MGR_ALL \ CFG(CFG_MCC_TO_SCC_SWITCH) \ CFG(CFG_CONC_SYS_PREF) \ @@ -274,5 +297,6 @@ CFG(CFG_CHNL_SELECT_LOGIC_CONC) \ CFG(CFG_ENABLE_CONC_RULE1) \ CFG(CFG_ENABLE_CONC_RULE2) \ - CFG(CFG_ENABLE_MCC_ADATIVE_SCH_ENABLED_NAME) + CFG(CFG_ENABLE_MCC_ADATIVE_SCH_ENABLED_NAME)\ + CFG(CFG_ENABLE_STA_CONNECTION_IN_5GHZ) #endif diff --git a/inc/wlan_policy_mgr_ucfg.h b/inc/wlan_policy_mgr_ucfg.h index bc27c19286a4..661eebdec81e 100644 --- a/inc/wlan_policy_mgr_ucfg.h +++ b/inc/wlan_policy_mgr_ucfg.h @@ -164,4 +164,18 @@ QDF_STATUS ucfg_policy_mgr_get_chnl_select_plcy(struct wlan_objmgr_psoc *psoc, QDF_STATUS ucfg_policy_mgr_get_mcc_adaptive_sch(struct wlan_objmgr_psoc *psoc, uint8_t *enable_mcc_adaptive_sch); + +/** + * ucfg_policy_mgr_get_sta_cxn_5g_band() - to get STA's connection in 5G config + * + * @psoc: pointer to psoc + * @enable_sta_cxn_5g_band: value to be filled + * + * This API is used to find out if STA connection in 5G band is allowed or + * disallowed. + * + * Return: QDF_STATUS_SUCCESS up on success and any other status for failure. + */ +QDF_STATUS ucfg_policy_mgr_get_sta_cxn_5g_band(struct wlan_objmgr_psoc *psoc, + uint8_t *enable_sta_cxn_5g_band); #endif //__WLAN_POLICY_MGR_UCFG diff --git a/src/wlan_policy_mgr_get_set_utils.c b/src/wlan_policy_mgr_get_set_utils.c index 3e640c749a78..250b5fb94988 100644 --- a/src/wlan_policy_mgr_get_set_utils.c +++ b/src/wlan_policy_mgr_get_set_utils.c @@ -187,6 +187,21 @@ QDF_STATUS policy_mgr_get_mcc_adaptive_sch(struct wlan_objmgr_psoc *psoc, return QDF_STATUS_SUCCESS; } +QDF_STATUS policy_mgr_get_sta_cxn_5g_band(struct wlan_objmgr_psoc *psoc, + uint8_t *enable_sta_cxn_5g_band) +{ + 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_sta_cxn_5g_band = pm_ctx->cfg.enable_sta_cxn_5g_band; + + return QDF_STATUS_SUCCESS; +} + void policy_mgr_update_new_hw_mode_index(struct wlan_objmgr_psoc *psoc, uint32_t new_hw_mode_index) { diff --git a/src/wlan_policy_mgr_i.h b/src/wlan_policy_mgr_i.h index e5be24789e13..cc8c3436c388 100644 --- a/src/wlan_policy_mgr_i.h +++ b/src/wlan_policy_mgr_i.h @@ -224,6 +224,7 @@ struct sta_ap_intf_check_work_ctx { * @vdev_priority_list: Priority list for various vdevs * @chnl_select_plcy: Channel selection policy * @enable_mcc_adaptive_sch: Enable/Disable MCC adaptive scheduler + * @enable_sta_cxn_5g_band: Enable/Disable STA connection in 5G band */ struct policy_mgr_cfg { uint8_t mcc_to_scc_switch; @@ -232,6 +233,7 @@ struct policy_mgr_cfg { uint8_t conc_rule1; uint8_t conc_rule2; uint8_t enable_mcc_adaptive_sch; + uint8_t enable_sta_cxn_5g_band; uint32_t dbs_selection_plcy; uint32_t vdev_priority_list; uint32_t chnl_select_plcy; diff --git a/src/wlan_policy_mgr_ucfg.c b/src/wlan_policy_mgr_ucfg.c index 80365392e685..310019ba3249 100644 --- a/src/wlan_policy_mgr_ucfg.c +++ b/src/wlan_policy_mgr_ucfg.c @@ -42,6 +42,8 @@ static QDF_STATUS policy_mgr_init_cfg(struct wlan_objmgr_psoc *psoc) 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); + cfg->enable_sta_cxn_5g_band = + cfg_get(psoc, CFG_ENABLE_STA_CONNECTION_IN_5GHZ); return QDF_STATUS_SUCCESS; } @@ -136,3 +138,9 @@ QDF_STATUS ucfg_policy_mgr_get_mcc_adaptive_sch(struct wlan_objmgr_psoc *psoc, { return policy_mgr_get_mcc_adaptive_sch(psoc, mcc_adaptive_sch); } + +QDF_STATUS ucfg_policy_mgr_get_sta_cxn_5g_band(struct wlan_objmgr_psoc *psoc, + uint8_t *enable_sta_cxn_5g_band) +{ + return policy_mgr_get_sta_cxn_5g_band(psoc, enable_sta_cxn_5g_band); +}