1 /*
2 * Copyright (c) 2022-2023 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 * @ml_grp_id: MLO Group ID to be checked against.
32 *
33 * This API starts the simulation framework which mimics the management frame
34 * generation by target. MAC HW is modelled as a kthread. FW and host layers
35 * are modelled as an ordered work queues.
36 *
37 * Return: QDF_STATUS
38 */
39 QDF_STATUS
40 ucfg_wlan_mgmt_rx_reo_sim_start(uint8_t ml_grp_id);
41
42 /**
43 * ucfg_wlan_mgmt_rx_reo_sim_stop() - Helper API to stop mgmt rx reorder
44 * simulation
45 * @ml_grp_id: MLO Group ID to be checked against.
46 *
47 * This API stops the simulation framework which mimics the management frame
48 * generation by target. MAC HW is modelled as a kthread. FW and host layers
49 * are modelled as an ordered work queues.
50 *
51 * Return: QDF_STATUS
52 */
53 QDF_STATUS
54 ucfg_wlan_mgmt_rx_reo_sim_stop(uint8_t ml_grp_id);
55
56 /**
57 * ucfg_wlan_mgmt_rx_reo_is_simulation_in_progress() - API to check whether
58 * simulation is in progress
59 * @ml_grp_id: MLO Group ID to be checked against.
60 *
61 * Return: true if simulation is in progress, else false
62 */
63 bool
64 ucfg_wlan_mgmt_rx_reo_is_simulation_in_progress(uint8_t ml_grp_id);
65
66 #else
67 /**
68 * ucfg_wlan_mgmt_rx_reo_sim_start() - Helper API to start mgmt rx
69 * reorder simulation
70 * @ml_grp_id: MLO Group ID to be checked against.
71 *
72 * Error print is added to indicate that simulation framework is not compiled.
73 *
74 * Return: QDF_STATUS_E_INVAL
75 */
76 static inline QDF_STATUS
ucfg_wlan_mgmt_rx_reo_sim_start(uint8_t ml_grp_id)77 ucfg_wlan_mgmt_rx_reo_sim_start(uint8_t ml_grp_id)
78 {
79 mgmt_txrx_err("Mgmt rx reo simulation is not compiled");
80
81 return QDF_STATUS_E_INVAL;
82 };
83
84 /**
85 * ucfg_wlan_mgmt_rx_reo_sim_stop() - Helper API to stop mgmt rx
86 * reorder simulation
87 * @ml_grp_id: MLO Group ID to be checked against.
88 *
89 * Error print is added to indicate that simulation framework is not compiled.
90 *
91 * Return: QDF_STATUS_E_INVAL
92 */
93 static inline QDF_STATUS
ucfg_wlan_mgmt_rx_reo_sim_stop(uint8_t ml_grp_id)94 ucfg_wlan_mgmt_rx_reo_sim_stop(uint8_t ml_grp_id)
95 {
96 mgmt_txrx_err("Mgmt rx reo simulation is not compiled");
97
98 return QDF_STATUS_E_INVAL;
99 }
100 #endif /* WLAN_MGMT_RX_REO_SUPPORT */
101 #endif /* _WLAN_MGMT_TXRX_RX_REO_UCFG_API_H_ */
102