bmi.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /*
  2. * Copyright (c) 2013-2019 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. /* BMI declarations and prototypes */
  20. /* */
  21. /* ================================================================= */
  22. #ifndef _BMI_H_
  23. #define _BMI_H_
  24. #include "bmi_msg.h"
  25. #include "qdf_trace.h"
  26. #include "ol_if_athvar.h"
  27. #include "hif.h"
  28. struct ol_context;
  29. /**
  30. * struct hif_config_info - Place Holder for hif confiruation
  31. * @enable_uart_print: UART Print
  32. * @enable_self_recovery: Self Recovery
  33. * @enable_fw_log: To Enable FW LOG
  34. * @enable_lpass_support: LPASS support
  35. * @enable_ramdump_collection: Ramdump Collection
  36. *
  37. * Structure for holding ini parameters.
  38. */
  39. struct ol_config_info {
  40. bool enable_uart_print;
  41. bool enable_self_recovery;
  42. uint8_t enable_fw_log;
  43. bool enable_lpass_support;
  44. bool enable_ramdump_collection;
  45. };
  46. #ifdef WLAN_FEATURE_BMI
  47. QDF_STATUS ol_cds_init(qdf_device_t qdf_dev, void *hif_ctx);
  48. void ol_cds_free(void);
  49. void ol_init_ini_config(struct ol_context *ol_ctx,
  50. struct ol_config_info *cfg);
  51. /**
  52. * ol_set_fw_crashed_cb() - set firmware crashed callback
  53. * @ol_ctx: ol context
  54. * @callback_fn: fw crashed callback function
  55. *
  56. * Return: None
  57. */
  58. void ol_set_fw_crashed_cb(struct ol_context *ol_ctx,
  59. void (*callback_fn)(void));
  60. void bmi_cleanup(struct ol_context *scn);
  61. QDF_STATUS bmi_done(struct ol_context *ol_ctx);
  62. void bmi_target_ready(struct hif_opaque_softc *scn, void *cfg_ctx);
  63. QDF_STATUS bmi_download_firmware(struct ol_context *ol_ctx);
  64. #else /* WLAN_FEATURE_BMI */
  65. static inline QDF_STATUS
  66. ol_cds_init(qdf_device_t qdf_dev, void *hif_ctx)
  67. {
  68. return QDF_STATUS_SUCCESS;
  69. }
  70. static inline void ol_cds_free(void)
  71. {
  72. }
  73. static inline void
  74. ol_init_ini_config(struct ol_context *ol_ctx, struct ol_config_info *cfg)
  75. {
  76. }
  77. static inline void
  78. ol_set_fw_crashed_cb(struct ol_context *ol_ctx, void (*callback_fn)(void))
  79. {
  80. }
  81. static inline void bmi_cleanup(struct ol_context *scn)
  82. {
  83. }
  84. static inline QDF_STATUS bmi_done(struct ol_context *ol_ctx)
  85. {
  86. return QDF_STATUS_SUCCESS;
  87. }
  88. static inline void
  89. bmi_target_ready(struct hif_opaque_softc *scn, void *cfg_ctx)
  90. {
  91. }
  92. static inline QDF_STATUS
  93. bmi_download_firmware(struct ol_context *ol_ctx)
  94. {
  95. return QDF_STATUS_SUCCESS;
  96. }
  97. #endif /* WLAN_FEATURE_BMI */
  98. #endif /* _BMI_H_ */