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