1 /*
2  * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16 
17 #ifndef _WLAN_MGMT_TXRX_RX_REO_UCFG_API_H_
18 #define _WLAN_MGMT_TXRX_RX_REO_UCFG_API_H_
19 
20 /**
21  * DOC: wlan_mgmt_txrx_rx_reo_ucfg_api.h
22  * This file contains mgmt rx-reorder ucfg layer related APIs
23  */
24 
25 #include <wlan_mgmt_txrx_rx_reo_utils_api.h>
26 
27 #ifdef WLAN_MGMT_RX_REO_SUPPORT
28 /**
29  * ucfg_wlan_mgmt_rx_reo_sim_start() - Helper API to start mgmt rx reorder
30  * simulation
31  *
32  * This API starts the simulation framework which mimics the management frame
33  * generation by target. MAC HW is modelled as a kthread. FW and host layers
34  * are modelled as an ordered work queues.
35  *
36  * Return: QDF_STATUS
37  */
38 QDF_STATUS
39 ucfg_wlan_mgmt_rx_reo_sim_start(void);
40 
41 /**
42  * ucfg_wlan_mgmt_rx_reo_sim_stop() - Helper API to stop mgmt rx reorder
43  * simulation
44  *
45  * This API stops the simulation framework which mimics the management frame
46  * generation by target. MAC HW is modelled as a kthread. FW and host layers
47  * are modelled as an ordered work queues.
48  * Return: QDF_STATUS
49  */
50 QDF_STATUS
51 ucfg_wlan_mgmt_rx_reo_sim_stop(void);
52 
53 /**
54  * ucfg_wlan_mgmt_rx_reo_is_simulation_in_progress() - API to check whether
55  * simulation is in progress
56  *
57  * Return: true if simulation is in progress, else false
58  */
59 bool
60 ucfg_wlan_mgmt_rx_reo_is_simulation_in_progress(void);
61 
62 #else
63 /**
64  * ucfg_wlan_mgmt_rx_reo_sim_start() - Helper API to start mgmt rx
65  * reorder simulation
66  *
67  * Error print is added to indicate that simulation framework is not compiled.
68  * Return: QDF_STATUS_E_INVAL
69  */
70 static inline QDF_STATUS
71 ucfg_wlan_mgmt_rx_reo_sim_start(void)
72 {
73 	mgmt_txrx_err("Mgmt rx reo simulation is not compiled");
74 
75 	return QDF_STATUS_E_INVAL;
76 };
77 
78 /**
79  * ucfg_wlan_mgmt_rx_reo_sim_stop() - Helper API to stop mgmt rx
80  * reorder simulation
81  *
82  * Error print is added to indicate that simulation framework is not compiled.
83  * Return: QDF_STATUS_E_INVAL
84  */
85 static inline QDF_STATUS
86 ucfg_wlan_mgmt_rx_reo_sim_stop(void)
87 {
88 	mgmt_txrx_err("Mgmt rx reo simulation is not compiled");
89 
90 	return QDF_STATUS_E_INVAL;
91 }
92 #endif /* WLAN_MGMT_RX_REO_SUPPORT */
93 #endif /* _WLAN_MGMT_TXRX_RX_REO_UCFG_API_H_ */
94