i_cfg.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * Copyright (c) 2018 The Linux Foundation. All rights reserved.
  3. *
  4. * Permission to use, copy, modify, and/or distribute this software for
  5. * any purpose with or without fee is hereby granted, provided that the
  6. * above copyright notice and this permission notice appear in all
  7. * copies.
  8. *
  9. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  10. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  11. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  12. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  13. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  14. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  15. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  16. * PERFORMANCE OF THIS SOFTWARE.
  17. */
  18. /**
  19. * DOC: Internal APIs for the configuration component.
  20. */
  21. #ifndef __I_CFG_H
  22. #define __I_CFG_H
  23. #include "cfg_define.h"
  24. #include "qdf_trace.h"
  25. #include "qdf_types.h"
  26. #include "wlan_objmgr_psoc_obj.h"
  27. #define __cfg_log(level, fmt, args...) \
  28. QDF_TRACE(QDF_MODULE_ID_CONFIG, level, FL(fmt), ##args)
  29. #define cfg_err(fmt, args...) __cfg_log(QDF_TRACE_LEVEL_ERROR, fmt, ##args)
  30. #define cfg_info(fmt, args...) __cfg_log(QDF_TRACE_LEVEL_INFO, fmt, ##args)
  31. #define cfg_debug(fmt, args...) __cfg_log(QDF_TRACE_LEVEL_DEBUG, fmt, ##args)
  32. #define cfg_enter() cfg_debug("enter")
  33. #define cfg_exit() cfg_debug("exit")
  34. /* define global config values structure */
  35. #undef __CFG_INI_STRING
  36. #define __CFG_INI_STRING(id, mtype, ctype, name, min, max, fallback, desc, \
  37. def...) \
  38. const char id##_internal[(max) + 1];
  39. #undef __CFG_INI
  40. #define __CFG_INI(id, mtype, ctype, name, min, max, fallback, desc, def...) \
  41. const ctype id##_internal;
  42. struct cfg_values {
  43. /* e.g. const int32_t __CFG_SCAN_DWELL_TIME_internal; */
  44. CFG_ALL
  45. };
  46. #undef __CFG_INI_STRING
  47. #define __CFG_INI_STRING(args...) __CFG_INI(args)
  48. #undef __CFG_INI
  49. #define __CFG_INI(args...) (args)
  50. struct cfg_values *cfg_psoc_get_values(struct wlan_objmgr_psoc *psoc);
  51. #define __cfg_get(psoc, id) (cfg_psoc_get_values(psoc)->id##_internal)
  52. #endif /* __I_CFG_H */