xref: /wlan-driver/qcacld-3.0/core/cds/inc/cds_api.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2014-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 #if !defined(__CDS_API_H)
21 #define __CDS_API_H
22 
23 /**
24  * DOC:  cds_api.h
25  *
26  * Connectivity driver services public API
27  *
28  */
29 
30 #include <qdf_types.h>
31 #include <qdf_status.h>
32 #include <qdf_mem.h>
33 #include <qdf_debugfs.h>
34 #include <qdf_list.h>
35 #include <qdf_trace.h>
36 #include <qdf_event.h>
37 #include <qdf_lock.h>
38 #include "qdf_platform.h"
39 #include "qdf_cpuhp.h"
40 #include <wlan_cmn.h>
41 #include "reg_services_public_struct.h"
42 #include <cds_reg_service.h>
43 #include <cds_packet.h>
44 #include <cds_sched.h>
45 #include <qdf_threads.h>
46 #include <qdf_mc_timer.h>
47 #include <wlan_objmgr_psoc_obj.h>
48 #include <cdp_txrx_handle.h>
49 
50 /* The ini gReorderOffloadSupported is deprecated. So, defining a new macro
51  * DP_REORDER_OFFLOAD_SUPPORT with the ini's default value.
52  */
53 #define DP_REORDER_OFFLOAD_SUPPORT (1)
54 
55 /* Amount of time to wait for WMA to perform an asynchronous activity.
56  * This value should be larger than the timeout used by WMI to wait for
57  * a response from target
58  */
59 #define CDS_WMA_TIMEOUT  (15000)
60 
61 /**
62  * enum cds_driver_state - Driver state
63  * @CDS_DRIVER_STATE_UNINITIALIZED: Driver is in uninitialized state.
64  * @CDS_DRIVER_STATE_LOADED: Driver is loaded and functional.
65  * @CDS_DRIVER_STATE_LOADING: Driver probe is in progress.
66  * @CDS_DRIVER_STATE_UNLOADING: Driver remove is in progress.
67  * @CDS_DRIVER_STATE_RECOVERING: Recovery in progress.
68  * @CDS_DRIVER_STATE_BAD: Driver in bad state.
69  * @CDS_DRIVER_STATE_FW_READY: Driver Firmware ready
70  * @CDS_DRIVER_STATE_MODULE_STOP: Module stop in progress or done.
71  * @CDS_DRIVER_STATE_ASSERTING_TARGET: Driver assert target in progress.
72  * @CDS_DRIVER_STATE_SYS_REBOOTING: System reboot in progress.
73  */
74 enum cds_driver_state {
75 	CDS_DRIVER_STATE_UNINITIALIZED          = 0,
76 	CDS_DRIVER_STATE_LOADED                 = BIT(0),
77 	CDS_DRIVER_STATE_LOADING                = BIT(1),
78 	CDS_DRIVER_STATE_UNLOADING              = BIT(2),
79 	CDS_DRIVER_STATE_RECOVERING             = BIT(3),
80 	CDS_DRIVER_STATE_BAD                    = BIT(4),
81 	CDS_DRIVER_STATE_FW_READY               = BIT(5),
82 	CDS_DRIVER_STATE_MODULE_STOP            = BIT(6),
83 	CDS_DRIVER_STATE_ASSERTING_TARGET       = BIT(7),
84 	CDS_DRIVER_STATE_SYS_REBOOTING          = BIT(8),
85 };
86 
87 /**
88  * struct cds_vdev_dp_stats - vdev stats populated from DP
89  * @tx_retries: packet number of successfully transmitted after more
90  *              than one retransmission attempt
91  * @tx_retries_mpdu: mpdu number of successfully transmitted after more
92  *              than one retransmission attempt
93  * @tx_mpdu_success_with_retries: Number of MPDU transmission retries done
94  *				  in case of successful transmission.
95  */
96 struct cds_vdev_dp_stats {
97 	uint32_t tx_retries;
98 	uint32_t tx_retries_mpdu;
99 	uint32_t tx_mpdu_success_with_retries;
100 };
101 
102 #define __CDS_IS_DRIVER_STATE(_state, _mask) (((_state) & (_mask)) == (_mask))
103 
104 void cds_set_driver_state(enum cds_driver_state);
105 void cds_clear_driver_state(enum cds_driver_state);
106 enum cds_driver_state cds_get_driver_state(void);
107 
108 /**
109  * cds_is_driver_loading() - Is driver load in progress
110  *
111  * Return: true if driver is loading and false otherwise.
112  */
cds_is_driver_loading(void)113 static inline bool cds_is_driver_loading(void)
114 {
115 	enum cds_driver_state state = cds_get_driver_state();
116 
117 	return __CDS_IS_DRIVER_STATE(state, CDS_DRIVER_STATE_LOADING);
118 }
119 
120 /**
121  * cds_is_driver_unloading() - Is driver unload in progress
122  *
123  * Return: true if driver is unloading and false otherwise.
124  */
cds_is_driver_unloading(void)125 static inline bool cds_is_driver_unloading(void)
126 {
127 	enum cds_driver_state state = cds_get_driver_state();
128 
129 	return __CDS_IS_DRIVER_STATE(state, CDS_DRIVER_STATE_UNLOADING);
130 }
131 
132 /**
133  * cds_is_driver_recovering() - Is recovery in progress
134  *
135  * Return: true if recovery in progress  and false otherwise.
136  */
cds_is_driver_recovering(void)137 static inline bool cds_is_driver_recovering(void)
138 {
139 	enum cds_driver_state state = cds_get_driver_state();
140 
141 	return __CDS_IS_DRIVER_STATE(state, CDS_DRIVER_STATE_RECOVERING);
142 }
143 
144 /**
145  * cds_is_driver_in_bad_state() - is driver in bad state
146  *
147  * Return: true if driver is in bad state and false otherwise.
148  */
cds_is_driver_in_bad_state(void)149 static inline bool cds_is_driver_in_bad_state(void)
150 {
151 	enum cds_driver_state state = cds_get_driver_state();
152 
153 	return __CDS_IS_DRIVER_STATE(state, CDS_DRIVER_STATE_BAD);
154 }
155 
156 /**
157  * cds_is_load_or_unload_in_progress() - Is driver load OR unload in progress
158  *
159  * Return: true if driver is loading OR unloading and false otherwise.
160  */
cds_is_load_or_unload_in_progress(void)161 static inline bool cds_is_load_or_unload_in_progress(void)
162 {
163 	enum cds_driver_state state = cds_get_driver_state();
164 
165 	return __CDS_IS_DRIVER_STATE(state, CDS_DRIVER_STATE_LOADING) ||
166 		__CDS_IS_DRIVER_STATE(state, CDS_DRIVER_STATE_UNLOADING);
167 }
168 
169 /**
170  * cds_is_target_ready() - Is target is in ready state
171  *
172  * Return: true if target is in ready state and false otherwise.
173  */
cds_is_target_ready(void)174 static inline bool cds_is_target_ready(void)
175 {
176 	enum cds_driver_state state = cds_get_driver_state();
177 
178 	return __CDS_IS_DRIVER_STATE(state, CDS_DRIVER_STATE_FW_READY);
179 }
180 
181 /**
182  * cds_is_driver_state_module_stop - Is module stop is in-progress or done
183  *
184  * Return: true if driver state is module stop and false otherwise.
185  */
cds_is_driver_state_module_stop(void)186 static inline bool cds_is_driver_state_module_stop(void)
187 {
188 	enum cds_driver_state state = cds_get_driver_state();
189 
190 	return __CDS_IS_DRIVER_STATE(state, CDS_DRIVER_STATE_MODULE_STOP);
191 }
192 
193 /**
194  * cds_set_recovery_in_progress() - Set recovery in progress
195  * @value: value to set
196  *
197  * Return: none
198  */
cds_set_recovery_in_progress(uint8_t value)199 static inline void cds_set_recovery_in_progress(uint8_t value)
200 {
201 	if (value)
202 		cds_set_driver_state(CDS_DRIVER_STATE_RECOVERING);
203 	else
204 		cds_clear_driver_state(CDS_DRIVER_STATE_RECOVERING);
205 }
206 
207 /**
208  * cds_set_driver_in_bad_state() - Set driver state
209  * @value: value to set
210  *
211  * Return: none
212  */
cds_set_driver_in_bad_state(uint8_t value)213 static inline void cds_set_driver_in_bad_state(uint8_t value)
214 {
215 	if (value)
216 		cds_set_driver_state(CDS_DRIVER_STATE_BAD);
217 	else
218 		cds_clear_driver_state(CDS_DRIVER_STATE_BAD);
219 }
220 
221 /**
222  * cds_set_target_ready() - Set target ready state
223  * @value: value to set
224  *
225  * Return: none
226  */
cds_set_target_ready(uint8_t value)227 static inline void cds_set_target_ready(uint8_t value)
228 {
229 	if (value)
230 		cds_set_driver_state(CDS_DRIVER_STATE_FW_READY);
231 	else
232 		cds_clear_driver_state(CDS_DRIVER_STATE_FW_READY);
233 }
234 
235 /**
236  * cds_set_load_in_progress() - Set load in progress
237  * @value: value to set
238  *
239  * Return: none
240  */
cds_set_load_in_progress(uint8_t value)241 static inline void cds_set_load_in_progress(uint8_t value)
242 {
243 	if (value)
244 		cds_set_driver_state(CDS_DRIVER_STATE_LOADING);
245 	else
246 		cds_clear_driver_state(CDS_DRIVER_STATE_LOADING);
247 }
248 
249 /**
250  * cds_set_driver_loaded() - Set load completed
251  * @value: value to set
252  *
253  * Return: none
254  */
cds_set_driver_loaded(uint8_t value)255 static inline void cds_set_driver_loaded(uint8_t value)
256 {
257 	if (value)
258 		cds_set_driver_state(CDS_DRIVER_STATE_LOADED);
259 	else
260 		cds_clear_driver_state(CDS_DRIVER_STATE_LOADED);
261 }
262 
263 /**
264  * cds_set_unload_in_progress() - Set unload in progress
265  * @value: value to set
266  *
267  * Return: none
268  */
cds_set_unload_in_progress(uint8_t value)269 static inline void cds_set_unload_in_progress(uint8_t value)
270 {
271 	if (value)
272 		cds_set_driver_state(CDS_DRIVER_STATE_UNLOADING);
273 	else
274 		cds_clear_driver_state(CDS_DRIVER_STATE_UNLOADING);
275 }
276 
277 /**
278  * cds_set_driver_state_module_stop() - Setting module stop in progress or done
279  *
280  * @value: value to set
281  *
282  * Return: none
283  */
cds_set_driver_state_module_stop(bool value)284 static inline void cds_set_driver_state_module_stop(bool value)
285 {
286 	if (value)
287 		cds_set_driver_state(CDS_DRIVER_STATE_MODULE_STOP);
288 	else
289 		cds_clear_driver_state(CDS_DRIVER_STATE_MODULE_STOP);
290 }
291 
292 /**
293  * cds_is_driver_loaded() - Is driver loaded
294  *
295  * Return: true if driver is loaded or false otherwise.
296  */
cds_is_driver_loaded(void)297 static inline bool cds_is_driver_loaded(void)
298 {
299 	enum cds_driver_state state = cds_get_driver_state();
300 
301 	return __CDS_IS_DRIVER_STATE(state, CDS_DRIVER_STATE_LOADED);
302 }
303 
304 /**
305  * cds_set_assert_target_in_progress() - Setting assert target in progress
306  *
307  * @value: value to set
308  *
309  * Return: none
310  */
cds_set_assert_target_in_progress(bool value)311 static inline void cds_set_assert_target_in_progress(bool value)
312 {
313 	if (value)
314 		cds_set_driver_state(CDS_DRIVER_STATE_ASSERTING_TARGET);
315 	else
316 		cds_clear_driver_state(CDS_DRIVER_STATE_ASSERTING_TARGET);
317 }
318 
319 /**
320  * cds_is_target_asserting() - Is driver asserting target
321  *
322  * Return: true if driver is asserting target
323  */
cds_is_target_asserting(void)324 static inline bool cds_is_target_asserting(void)
325 {
326 	enum cds_driver_state state = cds_get_driver_state();
327 
328 	return __CDS_IS_DRIVER_STATE(state, CDS_DRIVER_STATE_ASSERTING_TARGET);
329 }
330 
331 /**
332  * cds_set_sys_rebooting() - Set system reboot in progress
333  *
334  * Return: none
335  */
336 void cds_set_sys_rebooting(void);
337 
338 /**
339  * cds_sys_reboot_protect() - Require the lock for system reboot and get
340  * system rebooting state
341  *
342  * cds_sys_reboot_protect() and cds_sys_reboot_unprotect() MUST be used
343  * in pair.
344  *
345  * Return: true if system is rebooting, false otherwise
346  */
347 bool cds_sys_reboot_protect(void);
348 
349 /**
350  * cds_sys_reboot_unprotect() - Release the lock for system reboot
351  *
352  * Return: none
353  */
354 void cds_sys_reboot_unprotect(void);
355 
356 /**
357  * cds_init() - Initialize CDS
358  *
359  * This function allocates the resource required for CDS, but does not
360  * initialize all the members. This overall initialization will happen at
361  * cds_open().
362  *
363  * Return: QDF_STATUS_SUCCESS if CDS was initialized and an error on failure
364  */
365 QDF_STATUS cds_init(void);
366 
367 void cds_deinit(void);
368 
369 QDF_STATUS cds_pre_enable(void);
370 
371 QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc);
372 
373 /**
374  * cds_dp_open() - Open datapath module
375  * @psoc: object manager soc handle
376  *
377  * API to map the datapath rings to interrupts
378  * and also open the datapath pdev module.
379  *
380  * Return: QDF status
381  */
382 QDF_STATUS cds_dp_open(struct wlan_objmgr_psoc *psoc);
383 
384 /**
385  * cds_enable() - start/enable cds module
386  * @psoc: Psoc pointer
387  *
388  * Return: QDF status
389  */
390 QDF_STATUS cds_enable(struct wlan_objmgr_psoc *psoc);
391 
392 QDF_STATUS cds_disable(struct wlan_objmgr_psoc *psoc);
393 
394 QDF_STATUS cds_post_disable(void);
395 
396 QDF_STATUS cds_close(struct wlan_objmgr_psoc *psoc);
397 
398 /**
399  * cds_dp_close() - Close datapath module
400  * @psoc: Object manager soc handle
401  *
402  * API used to detach interrupts assigned to service
403  * datapath rings and close pdev module
404  *
405  * Return: Status
406  */
407 QDF_STATUS cds_dp_close(struct wlan_objmgr_psoc *psoc);
408 
409 /**
410  * cds_get_context() - get context data area
411  * @module_id: ID of the module who's context data is being retrieved.
412  *
413  * Each module in the system has a context/data area that is allocated
414  * and managed by CDS.  This API allows any user to get a pointer to its
415  * allocated context data area from the CDS global context.
416  *
417  * Return: pointer to the context data area of the module ID
418  *	   specified, or NULL if the context data is not allocated for
419  *	   the module ID specified.
420  */
421 #define cds_get_context(module_id) \
422 	__cds_get_context(module_id, __func__)
423 void *__cds_get_context(QDF_MODULE_ID module_id, const char *func);
424 
425 void *cds_get_global_context(void);
426 
427 QDF_STATUS cds_alloc_context(QDF_MODULE_ID module_id, void **module_context,
428 			     uint32_t size);
429 
430 QDF_STATUS cds_free_context(QDF_MODULE_ID module_id, void *module_context);
431 
432 QDF_STATUS cds_set_context(QDF_MODULE_ID module_id, void *context);
433 
434 void cds_flush_work(void *work);
435 void cds_flush_delayed_work(void *dwork);
436 
437 #ifdef REMOVE_PKT_LOG
438 static inline
cds_is_packet_log_enabled(void)439 bool cds_is_packet_log_enabled(void)
440 {
441 	return false;
442 }
443 #else
444 bool cds_is_packet_log_enabled(void);
445 #endif
446 
447 /**
448  * cds_get_recovery_reason() - get self recovery reason
449  * @reason: cds hang reason
450  *
451  * Return: None
452  */
453 void cds_get_recovery_reason(enum qdf_hang_reason *reason);
454 
455 /**
456  * cds_reset_recovery_reason() - reset the reason to unspecified
457  *
458  * Return: None
459  */
460 void cds_reset_recovery_reason(void);
461 
462 /**
463  * cds_trigger_recovery() - trigger self recovery
464  * @reason: recovery reason
465  *
466  * Return: none
467  */
468 #define cds_trigger_recovery(reason) \
469 	__cds_trigger_recovery(reason, __func__, __LINE__)
470 
471 void cds_trigger_recovery_psoc(void *psoc, enum qdf_hang_reason reason,
472 			       const char *func, const uint32_t line);
473 
474 void __cds_trigger_recovery(enum qdf_hang_reason reason, const char *func,
475 			    const uint32_t line);
476 
477 void cds_set_wakelock_logging(bool value);
478 bool cds_is_wakelock_enabled(void);
479 void cds_set_ring_log_level(uint32_t ring_id, uint32_t log_level);
480 enum wifi_driver_log_level cds_get_ring_log_level(uint32_t ring_id);
481 void cds_set_multicast_logging(uint8_t value);
482 uint8_t cds_is_multicast_logging(void);
483 QDF_STATUS cds_set_log_completion(uint32_t is_fatal,
484 		uint32_t type,
485 		uint32_t sub_type,
486 		bool recovery_needed);
487 void cds_get_and_reset_log_completion(uint32_t *is_fatal,
488 		uint32_t *type,
489 		uint32_t *sub_type,
490 		bool *recovery_needed);
491 bool cds_is_log_report_in_progress(void);
492 bool cds_is_fatal_event_enabled(void);
493 
494 #ifdef WLAN_FEATURE_TSF_PLUS_SOCK_TS
495 bool cds_is_ptp_rx_opt_enabled(void);
496 bool cds_is_ptp_tx_opt_enabled(void);
497 #else
cds_is_ptp_rx_opt_enabled(void)498 static inline bool cds_is_ptp_rx_opt_enabled(void)
499 {
500 	return false;
501 }
502 
cds_is_ptp_tx_opt_enabled(void)503 static inline bool cds_is_ptp_tx_opt_enabled(void)
504 {
505 	return false;
506 }
507 #endif
508 
509 uint32_t cds_get_log_indicator(void);
510 void cds_set_fatal_event(bool value);
511 void cds_wlan_flush_host_logs_for_fatal(void);
512 
513 void cds_init_log_completion(void);
514 QDF_STATUS cds_flush_logs(uint32_t is_fatal,
515 		uint32_t indicator,
516 		uint32_t reason_code,
517 		bool dump_mac_trace,
518 		bool recovery_needed);
519 void cds_logging_set_fw_flush_complete(void);
520 void cds_svc_fw_shutdown_ind(struct device *dev);
521 #ifdef FEATURE_WLAN_DIAG_SUPPORT
522 void cds_tdls_tx_rx_mgmt_event(uint8_t event_id, uint8_t tx_rx,
523 			uint8_t type, uint8_t sub_type, uint8_t *peer_mac);
524 #else
525 static inline
cds_tdls_tx_rx_mgmt_event(uint8_t event_id,uint8_t tx_rx,uint8_t type,uint8_t sub_type,uint8_t * peer_mac)526 void cds_tdls_tx_rx_mgmt_event(uint8_t event_id, uint8_t tx_rx,
527 			uint8_t type, uint8_t sub_type, uint8_t *peer_mac)
528 
529 {
530 }
531 #endif /* FEATURE_WLAN_DIAG_SUPPORT */
532 
533 int cds_get_radio_index(void);
534 QDF_STATUS cds_set_radio_index(int radio_index);
535 void cds_init_ini_config(struct cds_config_info *cds_cfg);
536 void cds_deinit_ini_config(void);
537 struct cds_config_info *cds_get_ini_config(void);
538 
539 bool cds_is_5_mhz_enabled(void);
540 bool cds_is_10_mhz_enabled(void);
541 bool cds_is_sub_20_mhz_enabled(void);
542 bool cds_is_self_recovery_enabled(void);
543 bool cds_is_fw_down(void);
544 enum QDF_GLOBAL_MODE cds_get_conparam(void);
545 
546 #ifdef WLAN_LOGGING_SOCK_SVC_ENABLE
547 void cds_pkt_stats_to_logger_thread(void *pl_hdr, void *pkt_dump, void *data);
548 #else
549 static inline
cds_pkt_stats_to_logger_thread(void * pl_hdr,void * pkt_dump,void * data)550 void cds_pkt_stats_to_logger_thread(void *pl_hdr, void *pkt_dump, void *data)
551 {
552 }
553 #endif
554 
555 #ifdef FEATURE_HTC_CREDIT_HISTORY
556 /**
557  * cds_print_htc_credit_history() - Helper function to copy HTC credit
558  *				    history via htc_print_credit_history()
559  *
560  * @count:	Number of lines to be copied
561  * @print:	Print callback to print in the buffer
562  * @print_priv:	Print callback private data
563  *
564  * Return:	none
565  */
566 void cds_print_htc_credit_history(uint32_t count,
567 				qdf_abstract_print * print,
568 				void *print_priv);
569 #else
570 
571 static inline
cds_print_htc_credit_history(uint32_t count,qdf_abstract_print * print,void * print_priv)572 void cds_print_htc_credit_history(uint32_t count,
573 				qdf_abstract_print *print,
574 				void *print_priv)
575 {
576 }
577 #endif
578 /**
579  * cds_is_group_addr() - checks whether addr is multi cast
580  * @mac_addr: address to be checked for multicast
581  *
582  * Check if the input mac addr is multicast addr
583  *
584  * Return: true if multicast addr else false
585  */
586 static inline
cds_is_group_addr(uint8_t * mac_addr)587 bool cds_is_group_addr(uint8_t *mac_addr)
588 {
589 	if (mac_addr[0] & 0x01)
590 		return true;
591 	else
592 		return false;
593 }
594 
595 #ifdef FEATURE_ALIGN_STATS_FROM_DP
596 /**
597  * cds_dp_get_vdev_stats() - get vdev stats from DP
598  * @vdev_id: vdev id
599  * @stats: structure of counters which CP is interested in
600  *
601  * Return: if get vdev stats from DP success, return true otherwise false
602  */
603 bool cds_dp_get_vdev_stats(uint8_t vdev_id, struct cds_vdev_dp_stats *stats);
604 #else
605 static inline bool
cds_dp_get_vdev_stats(uint8_t vdev_id,struct cds_vdev_dp_stats * stats)606 cds_dp_get_vdev_stats(uint8_t vdev_id, struct cds_vdev_dp_stats *stats)
607 {
608 	return false;
609 }
610 #endif
611 
612 /**
613  * cds_smmu_mem_map_setup() - Check SMMU S1 stage enable
614  *                            status and setup wlan driver
615  * @osdev: Parent device instance
616  * @ipa_present: IPA HW support flag
617  *
618  * This API checks if SMMU S1 translation is enabled in
619  * platform driver or not and sets it accordingly in driver.
620  *
621  * Return: QDF_STATUS
622  */
623 QDF_STATUS cds_smmu_mem_map_setup(qdf_device_t osdev, bool ipa_present);
624 
625 /**
626  * cds_smmu_map_unmap() - Map / Unmap DMA buffer to IPA UC
627  * @map: Map / unmap operation
628  * @num_buf: Number of buffers in array
629  * @buf_arr: Buffer array of DMA mem mapping info
630  *
631  * This API maps/unmaps WLAN-IPA buffers if SMMU S1 translation
632  * is enabled.
633  *
634  * Return: Status of map operation
635  */
636 int cds_smmu_map_unmap(bool map, uint32_t num_buf, qdf_mem_info_t *buf_arr);
637 
638 /**
639  * cds_is_driver_transitioning() - Is driver transitioning
640  *
641  * Return: true if driver is loading/unloading/recovering and false otherwise.
642  */
cds_is_driver_transitioning(void)643 static inline bool cds_is_driver_transitioning(void)
644 {
645 	enum cds_driver_state state = cds_get_driver_state();
646 
647 	return __CDS_IS_DRIVER_STATE(state, CDS_DRIVER_STATE_LOADING) ||
648 		__CDS_IS_DRIVER_STATE(state, CDS_DRIVER_STATE_UNLOADING) ||
649 		__CDS_IS_DRIVER_STATE(state, CDS_DRIVER_STATE_RECOVERING) ||
650 		__CDS_IS_DRIVER_STATE(state, CDS_DRIVER_STATE_BAD);
651 }
652 
653 #endif /* if !defined __CDS_API_H */
654