1 /*
2  * Copyright (c) 2015,2017-2020 The Linux Foundation. All rights reserved.
3  * Copyright (c) 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 #ifndef _SPECTRAL_SIM_H_
21 #define _SPECTRAL_SIM_H_
22 
23 #ifdef QCA_SUPPORT_SPECTRAL_SIMULATION
24 #include "target_if_spectral.h"
25 
26 /**
27  * target_if_spectral_sim_attach() - Initialize Spectral Simulation
28  * functionality
29  * @spectral: pointer to spectral internal data structure
30  *
31  * Setup data structures to be used for serving out data corresponding to
32  * various bandwidths and configurations.
33  *
34  * Return: Integer status value. 0:Success, -1:Failure
35  */
36 int target_if_spectral_sim_attach(struct target_if_spectral *spectral);
37 
38 /**
39  * target_if_spectral_sim_detach() - De-initialize Spectral Simulation
40  * functionality
41  * @spectral: pointer to spectral internal data structure
42  *
43  * Free up data structures used for serving out data corresponding to various
44  * bandwidths and configurations.
45  *
46  * Return: None
47  */
48 void target_if_spectral_sim_detach(struct target_if_spectral *spectral);
49 
50 /**
51  * target_if_spectral_sops_sim_is_active() - Check if Spectral(simulated) is
52  * active
53  * @arg: pointer to spectral internal data structure
54  *
55  * Check if Spectral (simulated) is active
56  *
57  * Return: Integer status value. 0: Not active, 1: Active
58  */
59 uint32_t target_if_spectral_sops_sim_is_active(void *arg);
60 
61 /**
62  * target_if_spectral_sops_sim_is_enabled() - Check if Spectral(simulated) is
63  * enabled
64  * @arg: pointer to spectral internal data structure
65  *
66  * Check if Spectral(simulated) is enabled
67  *
68  * Return: Integer status value. 0: Not enabled, 1: Enabled
69  */
70 uint32_t target_if_spectral_sops_sim_is_enabled(void *arg);
71 
72 /**
73  * target_if_spectral_sops_sim_start_scan() - Start Spectral simulation
74  * @arg: pointer to spectral internal data structure
75  *
76  * Start Spectral simulation
77  *
78  * Return: Integer status value. 0: Failure, 1: Success
79  */
80 uint32_t target_if_spectral_sops_sim_start_scan(void *arg);
81 
82 /**
83  * target_if_spectral_sops_sim_stop_scan() - Stop Spectral simulation
84  * @arg: pointer to spectral internal data structure
85  *
86  * Stop Spectral simulation
87  *
88  * Return: Integer status value. 0: Failure, 1: Success
89  */
90 uint32_t target_if_spectral_sops_sim_stop_scan(void *arg);
91 
92 /**
93  * target_if_spectral_sops_sim_configure_params() - Configure Spectral
94  * parameters into simulation
95  * @arg: pointer to ath_spectral structure
96  * @params: pointer to struct spectral_config structure bearing Spectral
97  *          configuration
98  * @smode: Spectral scan mode
99  *
100  *  Internally, this function actually searches if a record set with the desired
101  *  configuration has been loaded. If so, it points to the record set for
102  *  later usage when the simulation is started. If not, it returns an error.
103  *
104  * Return: Integer status value. 0: Failure, 1: Success
105  */
106 uint32_t target_if_spectral_sops_sim_configure_params(
107 	void *arg,
108 	struct spectral_config *params,
109 	enum spectral_scan_mode smode);
110 
111 /**
112  * target_if_spectral_sops_sim_get_params() - Get Spectral parameters configured
113  * into simulation
114  * @arg: pointer to ath_spectral structure
115  * @params: pointer to struct spectral_config structure which should be
116  *          populated with Spectral configuration
117  *
118  * Get Spectral parameters configured into simulation
119  *
120  * Return: Integer status value. 0: Failure, 1: Success
121  */
122 uint32_t target_if_spectral_sops_sim_get_params(
123 	void *arg,
124 	struct spectral_config *params);
125 
126 #endif				/* QCA_SUPPORT_SPECTRAL_SIMULATION */
127 #endif				/* _SPECTRAL_SIM_H_ */
128