1 /*
2  * Copyright (c) 2018-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: public API related to the wlan ipa called by north bound HDD/OSIF
21  */
22 
23 #include "wlan_ipa_ucfg_api.h"
24 #include "wlan_ipa_main.h"
25 #include "cfg_ucfg_api.h"
26 #include "qdf_module.h"
27 
ucfg_ipa_set_pld_enable(bool flag)28 void ucfg_ipa_set_pld_enable(bool flag)
29 {
30 	ipa_set_pld_enable(flag);
31 }
32 
33 qdf_export_symbol(ucfg_ipa_set_pld_enable);
34 
ucfg_ipa_get_pld_enable(void)35 bool ucfg_ipa_get_pld_enable(void)
36 {
37 	return ipa_get_pld_enable();
38 }
39 
40 qdf_export_symbol(ucfg_ipa_get_pld_enable);
41 
ucfg_ipa_is_present(void)42 bool ucfg_ipa_is_present(void)
43 {
44 	return ipa_is_hw_support();
45 }
46 
47 qdf_export_symbol(ucfg_ipa_is_present);
48 
ucfg_ipa_is_ready(void)49 bool ucfg_ipa_is_ready(void)
50 {
51 	return ipa_cb_is_ready();
52 }
53 
54 qdf_export_symbol(ucfg_ipa_is_ready);
55 
ucfg_ipa_is_enabled(void)56 bool ucfg_ipa_is_enabled(void)
57 {
58 	return ipa_config_is_enabled();
59 }
60 
61 qdf_export_symbol(ucfg_ipa_is_enabled);
62 
ucfg_ipa_uc_is_enabled(void)63 bool ucfg_ipa_uc_is_enabled(void)
64 {
65 	return ipa_config_is_uc_enabled();
66 }
67 
68 qdf_export_symbol(ucfg_ipa_uc_is_enabled);
69 
ucfg_ipa_is_vlan_enabled(void)70 bool ucfg_ipa_is_vlan_enabled(void)
71 {
72 	return ipa_config_is_vlan_enabled();
73 }
74 
75 qdf_export_symbol(ucfg_ipa_is_vlan_enabled);
76 
ucfg_ipa_set_pdev_id(struct wlan_objmgr_psoc * psoc,uint8_t pdev_id)77 void ucfg_ipa_set_pdev_id(struct wlan_objmgr_psoc *psoc,
78 			  uint8_t pdev_id)
79 {
80 	return ipa_set_pdev_id(psoc, pdev_id);
81 }
82 
83 qdf_export_symbol(ucfg_ipa_set_pdev_id);
84 
ucfg_ipa_set_dp_handle(struct wlan_objmgr_psoc * psoc,void * dp_soc)85 void ucfg_ipa_set_dp_handle(struct wlan_objmgr_psoc *psoc,
86 				     void *dp_soc)
87 {
88 	return ipa_set_dp_handle(psoc, dp_soc);
89 }
90 
91 qdf_export_symbol(ucfg_ipa_set_dp_handle);
92 
ucfg_ipa_set_perf_level(struct wlan_objmgr_pdev * pdev,uint64_t tx_packets,uint64_t rx_packets)93 QDF_STATUS ucfg_ipa_set_perf_level(struct wlan_objmgr_pdev *pdev,
94 				   uint64_t tx_packets, uint64_t rx_packets)
95 {
96 	return ipa_rm_set_perf_level(pdev, tx_packets, rx_packets);
97 }
98 
99 qdf_export_symbol(ucfg_ipa_set_perf_level);
100 
ucfg_ipa_uc_info(struct wlan_objmgr_pdev * pdev)101 void ucfg_ipa_uc_info(struct wlan_objmgr_pdev *pdev)
102 {
103 	return ipa_uc_info(pdev);
104 }
105 
106 qdf_export_symbol(ucfg_ipa_uc_info);
107 
ucfg_ipa_uc_stat(struct wlan_objmgr_pdev * pdev)108 void ucfg_ipa_uc_stat(struct wlan_objmgr_pdev *pdev)
109 {
110 	return ipa_uc_stat(pdev);
111 }
112 
113 qdf_export_symbol(ucfg_ipa_uc_stat);
114 
ucfg_ipa_uc_rt_debug_host_dump(struct wlan_objmgr_pdev * pdev)115 void ucfg_ipa_uc_rt_debug_host_dump(struct wlan_objmgr_pdev *pdev)
116 {
117 	return ipa_uc_rt_debug_host_dump(pdev);
118 }
119 
120 qdf_export_symbol(ucfg_ipa_uc_rt_debug_host_dump);
121 
ucfg_ipa_dump_info(struct wlan_objmgr_pdev * pdev)122 void ucfg_ipa_dump_info(struct wlan_objmgr_pdev *pdev)
123 {
124 	return ipa_dump_info(pdev);
125 }
126 
127 qdf_export_symbol(ucfg_ipa_dump_info);
128 
ucfg_ipa_uc_stat_request(struct wlan_objmgr_pdev * pdev,uint8_t reason)129 void ucfg_ipa_uc_stat_request(struct wlan_objmgr_pdev *pdev,
130 			      uint8_t reason)
131 {
132 	return ipa_uc_stat_request(pdev, reason);
133 }
134 
135 qdf_export_symbol(ucfg_ipa_uc_stat_request);
136 
ucfg_ipa_uc_stat_query(struct wlan_objmgr_pdev * pdev,uint32_t * ipa_tx_diff,uint32_t * ipa_rx_diff)137 void ucfg_ipa_uc_stat_query(struct wlan_objmgr_pdev *pdev,
138 			    uint32_t *ipa_tx_diff, uint32_t *ipa_rx_diff)
139 {
140 	return ipa_uc_stat_query(pdev, ipa_tx_diff, ipa_rx_diff);
141 }
142 
143 qdf_export_symbol(ucfg_ipa_uc_stat_query);
144 
ucfg_ipa_reg_sap_xmit_cb(struct wlan_objmgr_pdev * pdev,wlan_ipa_softap_xmit cb)145 void ucfg_ipa_reg_sap_xmit_cb(struct wlan_objmgr_pdev *pdev,
146 			      wlan_ipa_softap_xmit cb)
147 {
148 	return ipa_reg_sap_xmit_cb(pdev, cb);
149 }
150 
151 qdf_export_symbol(ucfg_ipa_reg_sap_xmit_cb);
152 
ucfg_ipa_reg_send_to_nw_cb(struct wlan_objmgr_pdev * pdev,wlan_ipa_send_to_nw cb)153 void ucfg_ipa_reg_send_to_nw_cb(struct wlan_objmgr_pdev *pdev,
154 				wlan_ipa_send_to_nw cb)
155 {
156 	return ipa_reg_send_to_nw_cb(pdev, cb);
157 }
158 
159 qdf_export_symbol(ucfg_ipa_reg_send_to_nw_cb);
160 
161 #if defined(QCA_CONFIG_RPS) && !defined(MDM_PLATFORM)
ucfg_ipa_reg_rps_enable_cb(struct wlan_objmgr_pdev * pdev,wlan_ipa_rps_enable cb)162 void ucfg_ipa_reg_rps_enable_cb(struct wlan_objmgr_pdev *pdev,
163 				wlan_ipa_rps_enable cb)
164 {
165 	return ipa_reg_rps_enable_cb(pdev, cb);
166 }
167 
168 qdf_export_symbol(ucfg_ipa_reg_rps_enable_cb);
169 #endif
170 
ucfg_ipa_reg_is_driver_unloading_cb(struct wlan_objmgr_pdev * pdev,wlan_ipa_driver_unloading cb)171 void ucfg_ipa_reg_is_driver_unloading_cb(struct wlan_objmgr_pdev *pdev,
172 					 wlan_ipa_driver_unloading cb)
173 {
174 	return ipa_reg_is_driver_unloading_cb(pdev, cb);
175 }
176 
ucfg_ipa_set_mcc_mode(struct wlan_objmgr_pdev * pdev,bool mcc_mode)177 void ucfg_ipa_set_mcc_mode(struct wlan_objmgr_pdev *pdev, bool mcc_mode)
178 {
179 	return ipa_set_mcc_mode(pdev, mcc_mode);
180 }
181 
182 qdf_export_symbol(ucfg_ipa_set_mcc_mode);
183 
ucfg_ipa_set_dfs_cac_tx(struct wlan_objmgr_pdev * pdev,bool tx_block)184 void ucfg_ipa_set_dfs_cac_tx(struct wlan_objmgr_pdev *pdev, bool tx_block)
185 {
186 	return ipa_set_dfs_cac_tx(pdev, tx_block);
187 }
188 
189 qdf_export_symbol(ucfg_ipa_set_dfs_cac_tx);
190 
ucfg_ipa_set_ap_ibss_fwd(struct wlan_objmgr_pdev * pdev,uint8_t session_id,bool intra_bss)191 void ucfg_ipa_set_ap_ibss_fwd(struct wlan_objmgr_pdev *pdev, uint8_t session_id,
192 			      bool intra_bss)
193 {
194 	return ipa_set_ap_ibss_fwd(pdev, session_id, intra_bss);
195 }
196 
197 qdf_export_symbol(ucfg_ipa_set_ap_ibss_fwd);
198 
ucfg_ipa_uc_force_pipe_shutdown(struct wlan_objmgr_pdev * pdev)199 void ucfg_ipa_uc_force_pipe_shutdown(struct wlan_objmgr_pdev *pdev)
200 {
201 	return ipa_uc_force_pipe_shutdown(pdev);
202 }
203 
204 qdf_export_symbol(ucfg_ipa_uc_force_pipe_shutdown);
205 
ucfg_ipa_flush(struct wlan_objmgr_pdev * pdev)206 void ucfg_ipa_flush(struct wlan_objmgr_pdev *pdev)
207 {
208 	return ipa_flush(pdev);
209 }
210 
211 qdf_export_symbol(ucfg_ipa_flush);
212 
ucfg_ipa_suspend(struct wlan_objmgr_pdev * pdev)213 QDF_STATUS ucfg_ipa_suspend(struct wlan_objmgr_pdev *pdev)
214 {
215 	return ipa_suspend(pdev);
216 }
217 
218 qdf_export_symbol(ucfg_ipa_suspend);
219 
ucfg_ipa_resume(struct wlan_objmgr_pdev * pdev)220 QDF_STATUS ucfg_ipa_resume(struct wlan_objmgr_pdev *pdev)
221 {
222 	return ipa_resume(pdev);
223 }
224 
225 qdf_export_symbol(ucfg_ipa_resume);
226 
ucfg_ipa_uc_ol_init(struct wlan_objmgr_pdev * pdev,qdf_device_t osdev)227 QDF_STATUS ucfg_ipa_uc_ol_init(struct wlan_objmgr_pdev *pdev,
228 			       qdf_device_t osdev)
229 {
230 	return ipa_uc_ol_init(pdev, osdev);
231 }
232 
233 qdf_export_symbol(ucfg_ipa_uc_ol_init);
234 
ucfg_ipa_uc_ol_deinit(struct wlan_objmgr_pdev * pdev)235 QDF_STATUS ucfg_ipa_uc_ol_deinit(struct wlan_objmgr_pdev *pdev)
236 {
237 	return ipa_uc_ol_deinit(pdev);
238 }
239 
240 qdf_export_symbol(ucfg_ipa_uc_ol_deinit);
241 
ucfg_ipa_is_tx_pending(struct wlan_objmgr_pdev * pdev)242 bool ucfg_ipa_is_tx_pending(struct wlan_objmgr_pdev *pdev)
243 {
244 	return ipa_is_tx_pending(pdev);
245 }
246 
247 qdf_export_symbol(ucfg_ipa_is_tx_pending);
248 
ucfg_ipa_send_mcc_scc_msg(struct wlan_objmgr_pdev * pdev,bool mcc_mode)249 QDF_STATUS ucfg_ipa_send_mcc_scc_msg(struct wlan_objmgr_pdev *pdev,
250 				     bool mcc_mode)
251 {
252 	return ipa_send_mcc_scc_msg(pdev, mcc_mode);
253 }
254 
255 qdf_export_symbol(ucfg_ipa_send_mcc_scc_msg);
256 
ucfg_ipa_wlan_evt(struct wlan_objmgr_pdev * pdev,qdf_netdev_t net_dev,uint8_t device_mode,uint8_t session_id,enum wlan_ipa_wlan_event ipa_event_type,const uint8_t * mac_addr,bool is_2g_iface)257 QDF_STATUS ucfg_ipa_wlan_evt(struct wlan_objmgr_pdev *pdev,
258 			     qdf_netdev_t net_dev, uint8_t device_mode,
259 			     uint8_t session_id,
260 			     enum wlan_ipa_wlan_event ipa_event_type,
261 			     const uint8_t *mac_addr, bool is_2g_iface)
262 {
263 	return ipa_wlan_evt(pdev, net_dev, device_mode, session_id,
264 			    ipa_event_type, mac_addr, is_2g_iface);
265 }
266 
267 qdf_export_symbol(ucfg_ipa_wlan_evt);
268 
ucfg_ipa_uc_smmu_map(bool map,uint32_t num_buf,qdf_mem_info_t * buf_arr)269 int ucfg_ipa_uc_smmu_map(bool map, uint32_t num_buf, qdf_mem_info_t *buf_arr)
270 {
271 	return ipa_uc_smmu_map(map, num_buf, buf_arr);
272 }
273 
274 qdf_export_symbol(ucfg_ipa_uc_smmu_map);
275 
ucfg_ipa_is_fw_wdi_activated(struct wlan_objmgr_pdev * pdev)276 bool ucfg_ipa_is_fw_wdi_activated(struct wlan_objmgr_pdev *pdev)
277 {
278 	return ipa_is_fw_wdi_activated(pdev);
279 }
280 
281 qdf_export_symbol(ucfg_ipa_is_fw_wdi_activated);
282 
ucfg_ipa_uc_cleanup_sta(struct wlan_objmgr_pdev * pdev,qdf_netdev_t net_dev,uint8_t session_id)283 void ucfg_ipa_uc_cleanup_sta(struct wlan_objmgr_pdev *pdev,
284 			     qdf_netdev_t net_dev, uint8_t session_id)
285 {
286 	return ipa_uc_cleanup_sta(pdev, net_dev, session_id);
287 }
288 
289 qdf_export_symbol(ucfg_ipa_uc_cleanup_sta);
290 
ucfg_ipa_uc_disconnect_ap(struct wlan_objmgr_pdev * pdev,qdf_netdev_t net_dev)291 QDF_STATUS ucfg_ipa_uc_disconnect_ap(struct wlan_objmgr_pdev *pdev,
292 				     qdf_netdev_t net_dev)
293 {
294 	return ipa_uc_disconnect_ap(pdev, net_dev);
295 }
296 
297 qdf_export_symbol(ucfg_ipa_uc_disconnect_ap);
298 
ucfg_ipa_cleanup_dev_iface(struct wlan_objmgr_pdev * pdev,qdf_netdev_t net_dev,uint8_t session_id)299 void ucfg_ipa_cleanup_dev_iface(struct wlan_objmgr_pdev *pdev,
300 				qdf_netdev_t net_dev, uint8_t session_id)
301 {
302 	return ipa_cleanup_dev_iface(pdev, net_dev, session_id);
303 }
304 
305 qdf_export_symbol(ucfg_ipa_cleanup_dev_iface);
306 
ucfg_ipa_uc_ssr_cleanup(struct wlan_objmgr_pdev * pdev)307 void ucfg_ipa_uc_ssr_cleanup(struct wlan_objmgr_pdev *pdev)
308 {
309 	return ipa_uc_ssr_cleanup(pdev);
310 }
311 
312 qdf_export_symbol(ucfg_ipa_uc_ssr_cleanup);
313 
ucfg_ipa_fw_rejuvenate_send_msg(struct wlan_objmgr_pdev * pdev)314 void ucfg_ipa_fw_rejuvenate_send_msg(struct wlan_objmgr_pdev *pdev)
315 {
316 	return ipa_fw_rejuvenate_send_msg(pdev);
317 }
318 
319 qdf_export_symbol(ucfg_ipa_fw_rejuvenate_send_msg);
320 
ucfg_ipa_component_config_update(struct wlan_objmgr_psoc * psoc)321 void ucfg_ipa_component_config_update(struct wlan_objmgr_psoc *psoc)
322 {
323 	ipa_component_config_update(psoc);
324 }
325 
326 qdf_export_symbol(ucfg_ipa_component_config_update);
327 
ucfg_ipa_component_config_free(void)328 void ucfg_ipa_component_config_free(void)
329 {
330 	ipa_component_config_free();
331 }
332 
333 qdf_export_symbol(ucfg_ipa_component_config_free);
334 
ucfg_ipa_get_tx_buf_count(void)335 uint32_t ucfg_ipa_get_tx_buf_count(void)
336 {
337 	return ipa_get_tx_buf_count();
338 }
339 
340 qdf_export_symbol(ucfg_ipa_get_tx_buf_count);
341 
ucfg_ipa_update_tx_stats(struct wlan_objmgr_pdev * pdev,uint64_t sta_tx,uint64_t ap_tx)342 void ucfg_ipa_update_tx_stats(struct wlan_objmgr_pdev *pdev, uint64_t sta_tx,
343 			      uint64_t ap_tx)
344 {
345 	ipa_update_tx_stats(pdev, sta_tx, ap_tx);
346 }
347 
348 qdf_export_symbol(ucfg_ipa_update_tx_stats);
349 
ucfg_ipa_flush_pending_vdev_events(struct wlan_objmgr_pdev * pdev,uint8_t vdev_id)350 void ucfg_ipa_flush_pending_vdev_events(struct wlan_objmgr_pdev *pdev,
351 					uint8_t vdev_id)
352 {
353 	ipa_flush_pending_vdev_events(pdev, vdev_id);
354 }
355 
356 qdf_export_symbol(ucfg_ipa_flush_pending_vdev_events);
357 
ucfg_ipa_is_wds_enabled(void)358 bool ucfg_ipa_is_wds_enabled(void)
359 {
360 	return ipa_is_wds_enabled();
361 }
362 
363 qdf_export_symbol(ucfg_ipa_is_wds_enabled);
364 
ucfg_ipa_get_alt_pipe(struct wlan_objmgr_pdev * pdev,uint8_t vdev_id,bool * alt_pipe)365 QDF_STATUS ucfg_ipa_get_alt_pipe(struct wlan_objmgr_pdev *pdev,
366 				 uint8_t vdev_id,
367 				 bool *alt_pipe)
368 {
369 	return ipa_get_alt_pipe(pdev, vdev_id, alt_pipe);
370 }
371 
372 qdf_export_symbol(ucfg_ipa_get_alt_pipe);
373 
ucfg_ipa_set_perf_level_bw_enabled(struct wlan_objmgr_pdev * pdev)374 bool ucfg_ipa_set_perf_level_bw_enabled(struct wlan_objmgr_pdev *pdev)
375 {
376 	return ipa_set_perf_level_bw_enabled(pdev);
377 }
378 
379 qdf_export_symbol(ucfg_ipa_set_perf_level_bw_enabled);
380 
ucfg_ipa_set_perf_level_bw(struct wlan_objmgr_pdev * pdev,enum wlan_ipa_bw_level lvl)381 void ucfg_ipa_set_perf_level_bw(struct wlan_objmgr_pdev *pdev,
382 				enum wlan_ipa_bw_level lvl)
383 {
384 	ipa_set_perf_level_bw(pdev, lvl);
385 }
386 
387 qdf_export_symbol(ucfg_ipa_set_perf_level_bw);
388