diff --git a/cfg/inc/cfg_ucfg_api.h b/cfg/inc/cfg_ucfg_api.h index 7ea98778f1..11fae9914c 100644 --- a/cfg/inc/cfg_ucfg_api.h +++ b/cfg/inc/cfg_ucfg_api.h @@ -173,6 +173,14 @@ QDF_STATUS cfg_parse_to_psoc_store(struct wlan_objmgr_psoc *psoc, */ QDF_STATUS cfg_parse_to_global_store(const char *path); +/** + * cfg_ucfg_store_print() prints the cfg ini/non ini logs + * @psoc: psoc + * + * Return: QDF_STATUS + */ +QDF_STATUS ucfg_cfg_store_print(struct wlan_objmgr_psoc *psoc); + /** * cfg_get() - lookup the configured value for @id from @psoc * @psoc: The psoc from which to lookup the configured value diff --git a/cfg/inc/i_cfg.h b/cfg/inc/i_cfg.h index 92a7088e35..afc240b808 100644 --- a/cfg/inc/i_cfg.h +++ b/cfg/inc/i_cfg.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -34,6 +34,20 @@ #define cfg_enter() QDF_TRACE_ENTER(QDF_MODULE_ID_CONFIG, "enter") #define cfg_exit() QDF_TRACE_EXIT(QDF_MODULE_ID_CONFIG, "exit") +#define cfg_err_rl(params...) QDF_TRACE_ERROR_RL(QDF_MODULE_ID_CONFIG, params) +#define cfg_warn_rl(params...) QDF_TRACE_WARN_RL(QDF_MODULE_ID_CONFIG, params) +#define cfg_info_rl(params...) QDF_TRACE_INFO_RL(QDF_MODULE_ID_CONFIG, params) +#define cfg_debug_rl(params...) QDF_TRACE_DEBUG_RL(QDF_MODULE_ID_CONFIG, params) + +#define cfg_nofl_err(params...) \ + QDF_TRACE_ERROR_NO_FL(QDF_MODULE_ID_CONFIG, params) +#define cfg_nofl_warn(params...) \ + QDF_TRACE_WARN_NO_FL(QDF_MODULE_ID_CONFIG, params) +#define cfg_nofl_info(params...) \ + QDF_TRACE_INFO_NO_FL(QDF_MODULE_ID_CONFIG, params) +#define cfg_nofl_debug(params...) \ + QDF_TRACE_DEBUG_NO_FL(QDF_MODULE_ID_CONFIG, params) + /* define global config values structure */ #undef __CFG_INI_STRING diff --git a/cfg/src/cfg.c b/cfg/src/cfg.c index 57b82152ce..04c0b66023 100644 --- a/cfg/src/cfg.c +++ b/cfg/src/cfg.c @@ -309,6 +309,7 @@ static void cfg_store_set_defaults(struct cfg_value_store *store) #undef __CFG_INI_STRING #define __CFG_INI_STRING(id, mtype, ctype, name, min_len, max_len, ...) \ qdf_str_lcopy((char *)&store->values.id##_internal, id, (max_len) + 1); + #undef __CFG_INI #define __CFG_INI(id, mtype, ctype, name, min, max, fallback, desc, def...) \ *(ctype *)&store->values.id##_internal = id; @@ -519,6 +520,60 @@ QDF_STATUS cfg_parse_to_global_store(const char *path) qdf_export_symbol(cfg_parse_to_global_store); + +static QDF_STATUS +cfg_store_print(struct wlan_objmgr_psoc *psoc) +{ + struct cfg_value_store *store; + struct cfg_psoc_ctx *psoc_ctx; + + cfg_enter(); + + psoc_ctx = cfg_psoc_get_ctx(psoc); + if (!psoc_ctx) + return QDF_STATUS_E_FAILURE; + + store = psoc_ctx->store; + if (!store) + return QDF_STATUS_E_FAILURE; + +#undef __CFG_INI_MAC +#define __CFG_INI_MAC(id, mtype, ctype, name, desc, def...) \ + cfg_nofl_debug("%s %pM", name, (&store->values.id##_internal)->bytes); + +#undef __CFG_INI_IPV4 +#define __CFG_INI_IPV4(id, mtype, ctype, name, desc, def...) \ + cfg_nofl_debug("%s %pI4", name, (&store->values.id##_internal)->bytes); + +#undef __CFG_INI_IPV6 +#define __CFG_INI_IPV6(id, mtype, ctype, name, desc, def...) \ + cfg_nofl_debug("%s %pI6c", name, (&store->values.id##_internal)->bytes); + +#undef __CFG_INI +#define __CFG_INI(id, mtype, ctype, name, min, max, fallback, desc, def...) \ + cfg_nofl_debug("%s %u", name, *(ctype *)&store->values.id##_internal); + +#undef __CFG_INI_STRING +#define __CFG_INI_STRING(id, mtype, ctype, name, min_len, max_len, ...) \ + cfg_nofl_debug("%s %s", name, (char *)&store->values.id##_internal); + + CFG_ALL + +#undef __CFG_INI_MAC +#undef __CFG_INI_IPV4 +#undef __CFG_INI_IPV6 +#undef __CFG_INI +#undef __CFG_INI_STRING + + cfg_exit(); + return QDF_STATUS_SUCCESS; +} + +QDF_STATUS ucfg_cfg_store_print(struct wlan_objmgr_psoc *psoc) +{ + return cfg_store_print(psoc); +} + static QDF_STATUS cfg_on_psoc_create(struct wlan_objmgr_psoc *psoc, void *context) {