blob: 15ea5da072ac3f258a9b4f453902d3e7db254f0e [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Ashish Kumar Dhanotiyaaa9fdbb2018-12-14 15:29:14 +05302 * Copyright (c) 2014-2019 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003 *
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08004 * 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
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080019#if !defined(__CDS_API_H)
20#define __CDS_API_H
21
22/**
23 * DOC: cds_api.h
24 *
25 * Connectivity driver services public API
26 *
27 */
28
Anurag Chouhan6d760662016-02-20 16:05:43 +053029#include <qdf_types.h>
Anurag Chouhance0dc992016-02-16 18:18:03 +053030#include <qdf_status.h>
Anurag Chouhan600c3a02016-03-01 10:33:54 +053031#include <qdf_mem.h>
Mahesh Kumar Kalikot Veetil319dbcd2016-10-27 15:03:48 -070032#include <qdf_debugfs.h>
Anurag Chouhanffb21542016-02-17 14:33:03 +053033#include <qdf_list.h>
Anurag Chouhanb2dc16f2016-02-25 11:47:37 +053034#include <qdf_trace.h>
Anurag Chouhance0dc992016-02-16 18:18:03 +053035#include <qdf_event.h>
Anurag Chouhana37b5b72016-02-21 14:53:42 +053036#include <qdf_lock.h>
Ryan Hsud0327d52018-05-29 15:07:25 -070037#include "qdf_platform.h"
38#include "qdf_cpuhp.h"
Ashish Kumar Dhanotiyaaa9fdbb2018-12-14 15:29:14 +053039#include <wlan_cmn.h>
Amar Singhal5cccafe2017-02-15 12:42:58 -080040#include "reg_services_public_struct.h"
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080041#include <cds_reg_service.h>
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080042#include <cds_packet.h>
43#include <cds_sched.h>
Anurag Chouhan512c7d52016-02-19 15:49:46 +053044#include <qdf_threads.h>
Anurag Chouhan210db072016-02-22 18:42:15 +053045#include <qdf_mc_timer.h>
Selvaraj, Sridhar0672a122016-12-29 16:11:48 +053046#include <wlan_objmgr_psoc_obj.h>
Venkata Sharath Chandra Manchala83985632017-02-28 14:16:22 -080047#include <cdp_txrx_handle.h>
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080048
49/* Amount of time to wait for WMA to perform an asynchronous activity.
50 * This value should be larger than the timeout used by WMI to wait for
51 * a response from target
52 */
53#define CDS_WMA_TIMEOUT (15000)
54
Prashanth Bhatta9e143052015-12-04 11:56:47 -080055/**
56 * enum cds_driver_state - Driver state
57 * @CDS_DRIVER_STATE_UNINITIALIZED: Driver is in uninitialized state.
58 * CDS_DRIVER_STATE_LOADED: Driver is loaded and functional.
59 * CDS_DRIVER_STATE_LOADING: Driver probe is in progress.
60 * CDS_DRIVER_STATE_UNLOADING: Driver remove is in progress.
61 * CDS_DRIVER_STATE_RECOVERING: Recovery in progress.
Hanumanth Reddy Pothula2a8a7402017-07-03 14:06:11 +053062 * CDS_DRIVER_STATE_BAD: Driver in bad state.
Manjunathappa Prakash71c74a42017-10-19 23:28:43 -070063 * CDS_DRIVER_STATE_MODULE_STOPPING: Module stop in progress.
Prashanth Bhatta9e143052015-12-04 11:56:47 -080064 */
65enum cds_driver_state {
Manjunathappa Prakash71c74a42017-10-19 23:28:43 -070066 CDS_DRIVER_STATE_UNINITIALIZED = 0,
67 CDS_DRIVER_STATE_LOADED = BIT(0),
68 CDS_DRIVER_STATE_LOADING = BIT(1),
69 CDS_DRIVER_STATE_UNLOADING = BIT(2),
70 CDS_DRIVER_STATE_RECOVERING = BIT(3),
71 CDS_DRIVER_STATE_BAD = BIT(4),
72 CDS_DRIVER_STATE_FW_READY = BIT(5),
73 CDS_DRIVER_STATE_MODULE_STOPPING = BIT(6),
Prashanth Bhatta9e143052015-12-04 11:56:47 -080074};
75
76#define __CDS_IS_DRIVER_STATE(_state, _mask) (((_state) & (_mask)) == (_mask))
77
78void cds_set_driver_state(enum cds_driver_state);
79void cds_clear_driver_state(enum cds_driver_state);
80enum cds_driver_state cds_get_driver_state(void);
81
82/**
83 * cds_is_driver_loading() - Is driver load in progress
84 *
85 * Return: true if driver is loading and false otherwise.
86 */
87static inline bool cds_is_driver_loading(void)
88{
89 enum cds_driver_state state = cds_get_driver_state();
90
91 return __CDS_IS_DRIVER_STATE(state, CDS_DRIVER_STATE_LOADING);
92}
93
94/**
95 * cds_is_driver_unloading() - Is driver unload in progress
96 *
97 * Return: true if driver is unloading and false otherwise.
98 */
99static inline bool cds_is_driver_unloading(void)
100{
101 enum cds_driver_state state = cds_get_driver_state();
102
103 return __CDS_IS_DRIVER_STATE(state, CDS_DRIVER_STATE_UNLOADING);
104}
105
106/**
107 * cds_is_driver_recovering() - Is recovery in progress
108 *
109 * Return: true if recovery in progress and false otherwise.
110 */
111static inline bool cds_is_driver_recovering(void)
112{
113 enum cds_driver_state state = cds_get_driver_state();
114
115 return __CDS_IS_DRIVER_STATE(state, CDS_DRIVER_STATE_RECOVERING);
116}
117
118/**
Hanumanth Reddy Pothula2a8a7402017-07-03 14:06:11 +0530119 * cds_is_driver_in_bad_state() - is driver in bad state
120 *
121 * Return: true if driver is in bad state and false otherwise.
122 */
123static inline bool cds_is_driver_in_bad_state(void)
124{
125 enum cds_driver_state state = cds_get_driver_state();
126
127 return __CDS_IS_DRIVER_STATE(state, CDS_DRIVER_STATE_BAD);
128}
129
130/**
Rajeev Kumarfec3dbe2016-01-19 15:23:52 -0800131 * cds_is_load_or_unload_in_progress() - Is driver load OR unload in progress
Prashanth Bhatta9e143052015-12-04 11:56:47 -0800132 *
Rajeev Kumard8508cb2016-01-19 15:05:09 -0800133 * Return: true if driver is loading OR unloading and false otherwise.
Prashanth Bhatta9e143052015-12-04 11:56:47 -0800134 */
Rajeev Kumarfec3dbe2016-01-19 15:23:52 -0800135static inline bool cds_is_load_or_unload_in_progress(void)
Prashanth Bhatta9e143052015-12-04 11:56:47 -0800136{
137 enum cds_driver_state state = cds_get_driver_state();
138
Rajeev Kumard8508cb2016-01-19 15:05:09 -0800139 return __CDS_IS_DRIVER_STATE(state, CDS_DRIVER_STATE_LOADING) ||
140 __CDS_IS_DRIVER_STATE(state, CDS_DRIVER_STATE_UNLOADING);
Prashanth Bhatta9e143052015-12-04 11:56:47 -0800141}
142
143/**
Manjunathappa Prakash71c74a42017-10-19 23:28:43 -0700144 * cds_is_module_stop_in_progress() - Is module stopping
145 *
146 * Return: true if module stop is in progress.
147 */
148static inline bool cds_is_module_stop_in_progress(void)
149{
150 enum cds_driver_state state = cds_get_driver_state();
151
152 return __CDS_IS_DRIVER_STATE(state, CDS_DRIVER_STATE_MODULE_STOPPING);
153}
154
155/**
Govind Singha1f6dac2017-06-13 11:45:07 +0530156 * cds_is_target_ready() - Is target is in ready state
157 *
158 * Return: true if target is in ready state and false otherwise.
159 */
160static inline bool cds_is_target_ready(void)
161{
162 enum cds_driver_state state = cds_get_driver_state();
163
164 return __CDS_IS_DRIVER_STATE(state, CDS_DRIVER_STATE_FW_READY);
165}
166
167/**
Prashanth Bhatta9e143052015-12-04 11:56:47 -0800168 * cds_set_recovery_in_progress() - Set recovery in progress
169 * @value: value to set
170 *
171 * Return: none
172 */
173static inline void cds_set_recovery_in_progress(uint8_t value)
174{
175 if (value)
176 cds_set_driver_state(CDS_DRIVER_STATE_RECOVERING);
177 else
178 cds_clear_driver_state(CDS_DRIVER_STATE_RECOVERING);
179}
180
181/**
Hanumanth Reddy Pothula2a8a7402017-07-03 14:06:11 +0530182 * cds_set_driver_in_bad_state() - Set driver state
183 * @value: value to set
184 *
185 * Return: none
186 */
187static inline void cds_set_driver_in_bad_state(uint8_t value)
188{
189 if (value)
190 cds_set_driver_state(CDS_DRIVER_STATE_BAD);
191 else
192 cds_clear_driver_state(CDS_DRIVER_STATE_BAD);
193}
194
195/**
Govind Singha1f6dac2017-06-13 11:45:07 +0530196 * cds_set_target_ready() - Set target ready state
197 * @value: value to set
198 *
199 * Return: none
200 */
201static inline void cds_set_target_ready(uint8_t value)
202{
203 if (value)
204 cds_set_driver_state(CDS_DRIVER_STATE_FW_READY);
205 else
206 cds_clear_driver_state(CDS_DRIVER_STATE_FW_READY);
207}
208
209/**
Prashanth Bhatta9e143052015-12-04 11:56:47 -0800210 * cds_set_load_in_progress() - Set load in progress
211 * @value: value to set
212 *
213 * Return: none
214 */
215static inline void cds_set_load_in_progress(uint8_t value)
216{
217 if (value)
218 cds_set_driver_state(CDS_DRIVER_STATE_LOADING);
219 else
220 cds_clear_driver_state(CDS_DRIVER_STATE_LOADING);
221}
222
223/**
224 * cds_set_driver_loaded() - Set load completed
225 * @value: value to set
226 *
227 * Return: none
228 */
229static inline void cds_set_driver_loaded(uint8_t value)
230{
231 if (value)
232 cds_set_driver_state(CDS_DRIVER_STATE_LOADED);
233 else
234 cds_clear_driver_state(CDS_DRIVER_STATE_LOADED);
235}
236
237/**
238 * cds_set_unload_in_progress() - Set unload in progress
239 * @value: value to set
240 *
241 * Return: none
242 */
243static inline void cds_set_unload_in_progress(uint8_t value)
244{
245 if (value)
246 cds_set_driver_state(CDS_DRIVER_STATE_UNLOADING);
247 else
248 cds_clear_driver_state(CDS_DRIVER_STATE_UNLOADING);
249}
250
Sachin Ahujadddd2632017-03-07 19:07:24 +0530251/**
Manjunathappa Prakash71c74a42017-10-19 23:28:43 -0700252 * cds_set_module_stop_in_progress() - Setting module stop in progress
253 *
254 * @value: value to set
255 *
256 * Return: none
257 */
258static inline void cds_set_module_stop_in_progress(bool value)
259{
260 if (value)
261 cds_set_driver_state(CDS_DRIVER_STATE_MODULE_STOPPING);
262 else
263 cds_clear_driver_state(CDS_DRIVER_STATE_MODULE_STOPPING);
264}
265
266/**
Sachin Ahujadddd2632017-03-07 19:07:24 +0530267 * cds_is_driver_loaded() - Is driver loaded
268 *
269 * Return: true if driver is loaded or false otherwise.
270 */
271static inline bool cds_is_driver_loaded(void)
272{
273 enum cds_driver_state state = cds_get_driver_state();
274
275 return __CDS_IS_DRIVER_STATE(state, CDS_DRIVER_STATE_LOADED);
276}
277
Jeff Johnson7aaeeea2017-09-26 13:16:24 -0700278/**
279 * cds_init() - Initialize CDS
280 *
281 * This function allocates the resource required for CDS, but does not
282 * initialize all the members. This overall initialization will happen at
283 * cds_open().
284 *
285 * Return: QDF_STATUS_SUCCESS if CDS was initialized and an error on failure
286 */
287QDF_STATUS cds_init(void);
288
Prashanth Bhatta5da711e2015-11-30 14:28:52 -0800289void cds_deinit(void);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800290
Jeff Johnson3a280122017-09-13 07:42:00 -0700291QDF_STATUS cds_pre_enable(void);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800292
Selvaraj, Sridhar0672a122016-12-29 16:11:48 +0530293QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800294
Venkata Sharath Chandra Manchala4aaae0f2017-07-10 11:59:19 -0700295/**
296 * cds_dp_open() - Open datapath module
297 * @psoc - object manager soc handle
298 *
299 * API to map the datapath rings to interrupts
300 * and also open the datapath pdev module.
301 *
302 * Return: QDF status
303 */
304QDF_STATUS cds_dp_open(struct wlan_objmgr_psoc *psoc);
305
Jeff Johnson4ea79742018-07-21 21:57:24 -0700306/**
307 * cds_enable() - start/enable cds module
308 * @psoc: Psoc pointer
309 *
310 * Return: QDF status
311 */
Jeff Johnson8f9dd5f2017-09-13 14:16:08 -0700312QDF_STATUS cds_enable(struct wlan_objmgr_psoc *psoc);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800313
Jeff Johnsonea5c2aa12017-09-13 14:18:59 -0700314QDF_STATUS cds_disable(struct wlan_objmgr_psoc *psoc);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800315
Rajeev Kumarbe021242017-02-16 16:12:23 -0800316QDF_STATUS cds_post_disable(void);
Govind Singhb048e872016-09-27 22:07:43 +0530317
Jeff Johnsone4b14592017-09-13 14:23:33 -0700318QDF_STATUS cds_close(struct wlan_objmgr_psoc *psoc);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800319
Venkata Sharath Chandra Manchala4aaae0f2017-07-10 11:59:19 -0700320/**
321 * cds_dp_close() - Close datapath module
322 * @psoc: Object manager soc handle
323 *
324 * API used to detach interrupts assigned to service
325 * datapath rings and close pdev module
326 *
327 * Return: Status
328 */
329QDF_STATUS cds_dp_close(struct wlan_objmgr_psoc *psoc);
330
Jeff Johnsonb3be6a62018-05-30 18:50:12 -0700331void *cds_get_context(QDF_MODULE_ID module_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800332
Venkata Sharath Chandra Manchala83985632017-02-28 14:16:22 -0800333uint8_t cds_get_datapath_handles(void **soc, struct cdp_pdev **pdev,
334 struct cdp_vdev **vdev, uint8_t sessionId);
Jeff Johnson31a67582017-09-26 14:54:28 -0700335void *cds_get_global_context(void);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800336
Jeff Johnson13269962018-05-30 19:16:46 -0700337QDF_STATUS cds_alloc_context(QDF_MODULE_ID module_id, void **module_context,
Jeff Johnsonadb3b1c2017-09-13 10:42:36 -0700338 uint32_t size);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800339
Jeff Johnson13269962018-05-30 19:16:46 -0700340QDF_STATUS cds_free_context(QDF_MODULE_ID module_id, void *module_context);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800341
Komal Seelam1aac1982016-03-02 15:57:26 +0530342QDF_STATUS cds_set_context(QDF_MODULE_ID module_id, void *context);
Komal Seelamad5a90d2016-02-16 13:50:03 +0530343
Jeff Johnsonc1e62782017-11-09 09:50:17 -0800344QDF_STATUS cds_get_vdev_types(enum QDF_OPMODE mode, uint32_t *type,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800345 uint32_t *subType);
346
347void cds_flush_work(void *work);
348void cds_flush_delayed_work(void *dwork);
349
Nirav Shahbb8e47c2018-05-17 16:56:41 +0530350#ifdef REMOVE_PKT_LOG
351static inline
352bool cds_is_packet_log_enabled(void)
353{
354 return false;
355}
356#else
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800357bool cds_is_packet_log_enabled(void);
Nirav Shahbb8e47c2018-05-17 16:56:41 +0530358#endif
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800359
Anurag Chouhan4085ff72017-10-05 18:09:56 +0530360/**
361 * cds_get_recovery_reason() - get self recovery reason
362 * @reason: cds hang reason
363 *
364 * Return: None
365 */
366void cds_get_recovery_reason(enum qdf_hang_reason *reason);
367
368/**
369 * cds_reset_recovery_reason() - reset the reason to unspecified
370 *
371 * Return: None
372 */
373void cds_reset_recovery_reason(void);
374
375/**
376 * cds_trigger_recovery() - trigger self recovery
377 * @reason: recovery reason
378 *
379 * Return: none
380 */
Dustin Brown2a24d7c2018-08-16 10:19:10 -0700381#define cds_trigger_recovery(reason) \
382 __cds_trigger_recovery(reason, __func__, __LINE__)
383void __cds_trigger_recovery(enum qdf_hang_reason reason, const char *func,
384 const uint32_t line);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800385
386void cds_set_wakelock_logging(bool value);
387bool cds_is_wakelock_enabled(void);
388void cds_set_ring_log_level(uint32_t ring_id, uint32_t log_level);
389enum wifi_driver_log_level cds_get_ring_log_level(uint32_t ring_id);
390void cds_set_multicast_logging(uint8_t value);
391uint8_t cds_is_multicast_logging(void);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530392QDF_STATUS cds_set_log_completion(uint32_t is_fatal,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800393 uint32_t type,
Abhishek Singh5ea86532016-04-27 14:10:53 +0530394 uint32_t sub_type,
395 bool recovery_needed);
396void cds_get_and_reset_log_completion(uint32_t *is_fatal,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800397 uint32_t *type,
Abhishek Singh5ea86532016-04-27 14:10:53 +0530398 uint32_t *sub_type,
399 bool *recovery_needed);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800400bool cds_is_log_report_in_progress(void);
Abhishek Singh5ea86532016-04-27 14:10:53 +0530401bool cds_is_fatal_event_enabled(void);
Yu Wang66a250b2017-07-19 11:46:40 +0800402
403#ifdef WLAN_FEATURE_TSF_PLUS
404bool cds_is_ptp_rx_opt_enabled(void);
405bool cds_is_ptp_tx_opt_enabled(void);
406#else
407static inline bool cds_is_ptp_rx_opt_enabled(void)
408{
409 return false;
410}
411
412static inline bool cds_is_ptp_tx_opt_enabled(void)
413{
414 return false;
415}
416#endif
417
Abhishek Singh5ea86532016-04-27 14:10:53 +0530418uint32_t cds_get_log_indicator(void);
419void cds_set_fatal_event(bool value);
420void cds_wlan_flush_host_logs_for_fatal(void);
421
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800422void cds_init_log_completion(void);
Anurag Chouhanfb54ab02016-02-18 18:00:46 +0530423QDF_STATUS cds_flush_logs(uint32_t is_fatal,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800424 uint32_t indicator,
Abhishek Singh5ea86532016-04-27 14:10:53 +0530425 uint32_t reason_code,
426 bool dump_mac_trace,
427 bool recovery_needed);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800428void cds_logging_set_fw_flush_complete(void);
Komal Seelam78ff65a2016-08-18 15:25:24 +0530429void cds_svc_fw_shutdown_ind(struct device *dev);
Abhishek Singh437606a2016-04-27 13:51:49 +0530430#ifdef FEATURE_WLAN_DIAG_SUPPORT
431void cds_tdls_tx_rx_mgmt_event(uint8_t event_id, uint8_t tx_rx,
432 uint8_t type, uint8_t sub_type, uint8_t *peer_mac);
433#else
434static inline
435void cds_tdls_tx_rx_mgmt_event(uint8_t event_id, uint8_t tx_rx,
436 uint8_t type, uint8_t sub_type, uint8_t *peer_mac)
437
438{
439}
440#endif /* FEATURE_WLAN_DIAG_SUPPORT */
441
Ryan Hsuceddceb2016-04-28 10:20:14 -0700442int cds_get_radio_index(void);
443QDF_STATUS cds_set_radio_index(int radio_index);
Arun Khandavallic811dcc2016-06-26 07:37:21 +0530444void cds_init_ini_config(struct cds_config_info *cds_cfg);
445void cds_deinit_ini_config(void);
446struct cds_config_info *cds_get_ini_config(void);
447
Naveen Rawat64e477e2016-05-20 10:34:56 -0700448bool cds_is_5_mhz_enabled(void);
449bool cds_is_10_mhz_enabled(void);
450bool cds_is_sub_20_mhz_enabled(void);
Naveen Rawat91df30a2016-10-12 21:26:18 -0700451bool cds_is_self_recovery_enabled(void);
Yuanyuan Liue4709772018-09-05 14:57:46 -0700452bool cds_is_fw_down(void);
Jeff Johnson876c1a62017-12-12 10:43:07 -0800453enum QDF_GLOBAL_MODE cds_get_conparam(void);
Dustin Brown8d2d0f52017-04-03 17:02:08 -0700454
Nirav Shaheb017be2018-02-15 11:20:58 +0530455#ifdef WLAN_LOGGING_SOCK_SVC_ENABLE
456void cds_pkt_stats_to_logger_thread(void *pl_hdr, void *pkt_dump, void *data);
457#else
458static inline
459void cds_pkt_stats_to_logger_thread(void *pl_hdr, void *pkt_dump, void *data)
460{
461}
462#endif
463
Rachit Kankaneb1035622018-01-24 18:41:35 +0530464#ifdef FEATURE_HTC_CREDIT_HISTORY
465/**
466 * cds_print_htc_credit_history() - Helper function to copy HTC credit
467 * history via htc_print_credit_history()
468 *
469 * @count: Number of lines to be copied
470 * @print: Print callback to print in the buffer
471 *
472 * Return: none
473 */
474void cds_print_htc_credit_history(uint32_t count,
475 qdf_abstract_print * print,
476 void *print_priv);
477#else
Dustin Brown8d2d0f52017-04-03 17:02:08 -0700478
Rachit Kankaneb1035622018-01-24 18:41:35 +0530479static inline
480void cds_print_htc_credit_history(uint32_t count,
481 qdf_abstract_print *print,
482 void *print_priv)
483{
484}
485#endif
Rajeev Kumar Sirasanagandla686abd92017-06-08 18:09:01 +0530486/**
487 * cds_is_group_addr() - checks whether addr is multi cast
488 * @mac_addr: address to be checked for multicast
489 *
490 * Check if the input mac addr is multicast addr
491 *
492 * Return: true if multicast addr else false
493 */
494static inline
495bool cds_is_group_addr(uint8_t *mac_addr)
496{
497 if (mac_addr[0] & 0x01)
498 return true;
499 else
500 return false;
501}
502
Poddar, Siddarth31797fa2018-01-22 17:24:15 +0530503/**
504 * cds_get_arp_stats_gw_ip() - get arp stats track IP
505 * @context: osif dev
506 *
507 * Return: ARP stats IP to track.
508 */
509uint32_t cds_get_arp_stats_gw_ip(void *context);
Poddar, Siddarth3906e172018-01-09 11:24:58 +0530510/**
511 * cds_get_connectivity_stats_pkt_bitmap() - get pkt-type bitmap
512 * @context: osif dev context
513 *
514 * Return: pkt bitmap to track
515 */
516uint32_t cds_get_connectivity_stats_pkt_bitmap(void *context);
Sravan Kumar Kairamc1ae71c2017-02-24 12:27:27 +0530517void cds_incr_arp_stats_tx_tgt_delivered(void);
518void cds_incr_arp_stats_tx_tgt_acked(void);
Himanshu Agarwaledf30dc2017-06-05 15:54:27 +0530519
520/**
521 * cds_smmu_mem_map_setup() - Check SMMU S1 stage enable
522 * status and setup wlan driver
523 * @osdev: Parent device instance
Yun Park45d35972018-03-02 09:57:54 -0800524 * @ipa_present: IPA HW support flag
Himanshu Agarwaledf30dc2017-06-05 15:54:27 +0530525 *
526 * This API checks if SMMU S1 translation is enabled in
527 * platform driver or not and sets it accordingly in driver.
528 *
Himanshu Agarwala89ce242017-11-17 17:36:34 +0530529 * Return: QDF_STATUS
Himanshu Agarwaledf30dc2017-06-05 15:54:27 +0530530 */
Yun Park45d35972018-03-02 09:57:54 -0800531QDF_STATUS cds_smmu_mem_map_setup(qdf_device_t osdev, bool ipa_present);
Himanshu Agarwaledf30dc2017-06-05 15:54:27 +0530532
533/**
534 * cds_smmu_map_unmap() - Map / Unmap DMA buffer to IPA UC
535 * @map: Map / unmap operation
536 * @num_buf: Number of buffers in array
537 * @buf_arr: Buffer array of DMA mem mapping info
538 *
539 * This API maps/unmaps WLAN-IPA buffers if SMMU S1 translation
540 * is enabled.
541 *
542 * Return: Status of map operation
543 */
544int cds_smmu_map_unmap(bool map, uint32_t num_buf, qdf_mem_info_t *buf_arr);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800545#endif /* if !defined __CDS_API_H */