bmi.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /*
  2. * Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
  3. * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
  4. *
  5. * Permission to use, copy, modify, and/or distribute this software for
  6. * any purpose with or without fee is hereby granted, provided that the
  7. * above copyright notice and this permission notice appear in all
  8. * copies.
  9. *
  10. * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
  11. * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
  12. * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
  13. * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  14. * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  15. * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  16. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  17. * PERFORMANCE OF THIS SOFTWARE.
  18. */
  19. /* ================================================================ */
  20. /* BMI declarations and prototypes */
  21. /* */
  22. /* ================================================================= */
  23. #ifndef _BMI_H_
  24. #define _BMI_H_
  25. #include "bmi_msg.h"
  26. #include "qdf_trace.h"
  27. #include "ol_if_athvar.h"
  28. #include "hif.h"
  29. struct ol_context;
  30. /**
  31. * struct ol_config_info - Place Holder for offload configuration
  32. * @enable_uart_print: UART Print
  33. * @enable_self_recovery: Self Recovery
  34. * @enable_fw_log: To Enable FW LOG
  35. * @enable_lpass_support: LPASS support
  36. * @enable_ramdump_collection: Ramdump Collection
  37. *
  38. * Structure for holding ini parameters.
  39. */
  40. struct ol_config_info {
  41. bool enable_uart_print;
  42. bool enable_self_recovery;
  43. uint8_t enable_fw_log;
  44. bool enable_lpass_support;
  45. bool enable_ramdump_collection;
  46. };
  47. #ifdef WLAN_FEATURE_BMI
  48. QDF_STATUS ol_cds_init(qdf_device_t qdf_dev, void *hif_ctx);
  49. void ol_cds_free(void);
  50. void ol_init_ini_config(struct ol_context *ol_ctx,
  51. struct ol_config_info *cfg);
  52. /**
  53. * ol_set_fw_crashed_cb() - set firmware crashed callback
  54. * @ol_ctx: ol context
  55. * @callback_fn: fw crashed callback function
  56. *
  57. * Return: None
  58. */
  59. void ol_set_fw_crashed_cb(struct ol_context *ol_ctx,
  60. void (*callback_fn)(void));
  61. void bmi_cleanup(struct ol_context *scn);
  62. QDF_STATUS bmi_done(struct ol_context *ol_ctx);
  63. void bmi_target_ready(struct hif_opaque_softc *scn, void *cfg_ctx);
  64. QDF_STATUS bmi_download_firmware(struct ol_context *ol_ctx);
  65. #else /* WLAN_FEATURE_BMI */
  66. static inline QDF_STATUS
  67. ol_cds_init(qdf_device_t qdf_dev, void *hif_ctx)
  68. {
  69. return QDF_STATUS_SUCCESS;
  70. }
  71. static inline void ol_cds_free(void)
  72. {
  73. }
  74. static inline void
  75. ol_init_ini_config(struct ol_context *ol_ctx, struct ol_config_info *cfg)
  76. {
  77. }
  78. static inline void
  79. ol_set_fw_crashed_cb(struct ol_context *ol_ctx, void (*callback_fn)(void))
  80. {
  81. }
  82. static inline void bmi_cleanup(struct ol_context *scn)
  83. {
  84. }
  85. static inline QDF_STATUS bmi_done(struct ol_context *ol_ctx)
  86. {
  87. return QDF_STATUS_SUCCESS;
  88. }
  89. static inline void
  90. bmi_target_ready(struct hif_opaque_softc *scn, void *cfg_ctx)
  91. {
  92. }
  93. static inline QDF_STATUS
  94. bmi_download_firmware(struct ol_context *ol_ctx)
  95. {
  96. return QDF_STATUS_SUCCESS;
  97. }
  98. #endif /* WLAN_FEATURE_BMI */
  99. #endif /* _BMI_H_ */