1 /*
2  * Copyright (c) 2018, 2020-2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2021-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  * DOC: Declare public API related to the wlan ipa called by north bound
21  */
22 
23 #ifndef _WLAN_IPA_OBJ_MGMT_H_
24 #define _WLAN_IPA_OBJ_MGMT_H_
25 
26 #include "wlan_ipa_public_struct.h"
27 #include "wlan_objmgr_pdev_obj.h"
28 #include "wlan_ipa_main.h"
29 
30 #ifdef IPA_OFFLOAD
31 
32 /**
33  * ipa_init() - IPA module initialization
34  *
35  * Return: QDF_STATUS_SUCCESS on success
36  */
37 QDF_STATUS ipa_init(void);
38 
39 /**
40  * ipa_deinit() - IPA module deinitialization
41  *
42  * Return: QDF_STATUS_SUCCESS on success
43  */
44 QDF_STATUS ipa_deinit(void);
45 
46 /**
47  * ipa_register_is_ipa_ready() - Register IPA ready callback
48  * @pdev: pointer to pdev
49  *
50  * Return: QDF_STATUS_SUCCESS on success
51  */
52 QDF_STATUS ipa_register_is_ipa_ready(struct wlan_objmgr_pdev *pdev);
53 
54 /**
55  * ipa_disable_register_cb() - Reset the IPA is ready flag
56  *
57  * Return: Set the ipa_is_ready flag to false when module is
58  * unloaded to indicate that ipa ready cb is not registered
59  */
60 void ipa_disable_register_cb(void);
61 
62 /**
63  * wlan_ipa_config_is_enabled() - api to get IPA enable status
64  *
65  * Return: true - ipa is enabled
66  *         false - ipa is not enabled
67  */
wlan_ipa_config_is_enabled(void)68 static inline bool wlan_ipa_config_is_enabled(void)
69 {
70 	return ipa_config_is_enabled();
71 }
72 
73 /**
74  * wlan_ipa_get_hdl() - Get ipa hdl set by IPA driver
75  * @soc: void psoc object
76  * @pdev_id: pdev id
77  *
78  * Return: IPA handle
79  */
80 qdf_ipa_wdi_hdl_t wlan_ipa_get_hdl(void *soc, uint8_t pdev_id);
81 
82 /**
83  * wlan_ipa_is_vlan_enabled() - get IPA vlan support enable status
84  *
85  * Return: true - ipa vlan support is enabled
86  *         false - ipa vlan support is not enabled
87  */
88 bool wlan_ipa_is_vlan_enabled(void);
89 #else
90 
ipa_init(void)91 static inline QDF_STATUS ipa_init(void)
92 {
93 	return QDF_STATUS_SUCCESS;
94 }
95 
ipa_deinit(void)96 static inline QDF_STATUS ipa_deinit(void)
97 {
98 	return QDF_STATUS_SUCCESS;
99 }
100 
ipa_register_is_ipa_ready(struct wlan_objmgr_pdev * pdev)101 static inline QDF_STATUS ipa_register_is_ipa_ready(
102 	struct wlan_objmgr_pdev *pdev)
103 {
104 	return QDF_STATUS_SUCCESS;
105 }
106 
ipa_disable_register_cb(void)107 static inline void ipa_disable_register_cb(void)
108 {
109 }
110 
ipa_config_is_opt_wifi_dp_enabled(void)111 static inline bool ipa_config_is_opt_wifi_dp_enabled(void)
112 {
113 	return false;
114 }
115 
wlan_ipa_config_is_enabled(void)116 static inline bool wlan_ipa_config_is_enabled(void)
117 {
118 	return false;
119 }
120 
wlan_ipa_is_vlan_enabled(void)121 static inline bool wlan_ipa_is_vlan_enabled(void)
122 {
123 	return false;
124 }
125 #endif /* IPA_OFFLOAD */
126 
127 #endif /* _WLAN_IPA_OBJ_MGMT_H_ */
128