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 /**
18  * DOC: wlan_mgmt_txrx_rx_reo_ucfg_api.c
19  * This file contains mgmt rx re-ordering ucfg layer related
20  * function definitions
21  */
22 
23 #include <wlan_mgmt_txrx_rx_reo_ucfg_api.h>
24 #include "../../core/src/wlan_mgmt_txrx_rx_reo_i.h"
25 #include <cfg_ucfg_api.h>
26 
27 QDF_STATUS
28 ucfg_wlan_mgmt_rx_reo_sim_start(void)
29 {
30 	QDF_STATUS status;
31 
32 	if (!wlan_mgmt_rx_reo_is_simulation_in_progress()) {
33 		mgmt_rx_reo_debug("Starting rx reo simulation");
34 		status = wlan_mgmt_rx_reo_sim_start();
35 		if (QDF_IS_STATUS_ERROR(status)) {
36 			mgmt_rx_reo_err("Failed to start rx reo sim");
37 			return status;
38 		}
39 	}
40 
41 	mgmt_rx_reo_debug("Simulation is running");
42 	return QDF_STATUS_SUCCESS;
43 }
44 
45 qdf_export_symbol(ucfg_wlan_mgmt_rx_reo_sim_start);
46 
47 QDF_STATUS
48 ucfg_wlan_mgmt_rx_reo_sim_stop(void)
49 {
50 	QDF_STATUS status;
51 
52 	if (wlan_mgmt_rx_reo_is_simulation_in_progress()) {
53 		mgmt_rx_reo_debug("Stopping simulation");
54 		status = wlan_mgmt_rx_reo_sim_stop();
55 		if (QDF_IS_STATUS_ERROR(status)) {
56 			mgmt_rx_reo_err("Failed to stop rx reo sim");
57 			return status;
58 		}
59 	}
60 
61 	mgmt_rx_reo_debug("Simulation is not running");
62 	return QDF_STATUS_SUCCESS;
63 }
64 
65 qdf_export_symbol(ucfg_wlan_mgmt_rx_reo_sim_stop);
66 
67 bool
68 ucfg_wlan_mgmt_rx_reo_is_simulation_in_progress(void)
69 {
70 	return wlan_mgmt_rx_reo_is_simulation_in_progress();
71 }
72 
73 qdf_export_symbol(ucfg_wlan_mgmt_rx_reo_is_simulation_in_progress);
74