From 2a331374b838aa91577f6723fd7fb57c0a73b7b8 Mon Sep 17 00:00:00 2001 From: Vivek Date: Thu, 19 Jul 2018 18:31:16 +0530 Subject: [PATCH] qcacmn: Add cfg API to parse additional files Add cfg API's to parse different global and psoc INI files, but store to the same global or psoc store as required. Change-Id: I588f47bc61094640ddfe4b29712ca978908f2844 CRs-Fixed: 2278934 --- cfg/inc/cfg_ucfg_api.h | 18 ++++++++++++++++++ cfg/src/cfg.c | 20 ++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/cfg/inc/cfg_ucfg_api.h b/cfg/inc/cfg_ucfg_api.h index 4c19be689d..e1b49c789c 100644 --- a/cfg/inc/cfg_ucfg_api.h +++ b/cfg/inc/cfg_ucfg_api.h @@ -155,6 +155,24 @@ void cfg_release(void); */ QDF_STATUS cfg_psoc_parse(struct wlan_objmgr_psoc *psoc, const char *path); +/** + * cfg_parse_to_psoc_store() - Parse file @path and update psoc ini store + * @psoc: The psoc whose config store should be updated + * @path: The full file path of the ini file to parse + * + * Return: QDF_STATUS + */ +QDF_STATUS cfg_parse_to_psoc_store(struct wlan_objmgr_psoc *psoc, + const char *path); + +/** + * cfg_parse_to_global_store() Parse file @path and update global ini store + * @path: The full file path of the ini file to parse + * + * Return: QDF_STATUS + */ +QDF_STATUS cfg_parse_to_global_store(const char *path); + /** * cfg_get() - lookup the configured value for @id from @psoc * @psoc: The psoc from which to lookup the configured value diff --git a/cfg/src/cfg.c b/cfg/src/cfg.c index 7e0e7c05d2..66df7d321f 100644 --- a/cfg/src/cfg.c +++ b/cfg/src/cfg.c @@ -501,6 +501,26 @@ cfg_ini_parse_to_store(const char *path, struct cfg_value_store *store) return status; } +QDF_STATUS cfg_parse_to_psoc_store(struct wlan_objmgr_psoc *psoc, + const char *path) +{ + return cfg_ini_parse_to_store(path, cfg_psoc_get_ctx(psoc)->store); +} + +qdf_export_symbol(cfg_parse_to_psoc_store); + +QDF_STATUS cfg_parse_to_global_store(const char *path) +{ + if (!__cfg_global_store) { + cfg_err("Global INI store is not valid"); + return QDF_STATUS_E_NOMEM; + } + + return cfg_ini_parse_to_store(path, __cfg_global_store); +} + +qdf_export_symbol(cfg_parse_to_global_store); + static void cfg_init(void) { qdf_list_create(&__cfg_stores_list, 0);