xref: /wlan-dirver/qca-wifi-host-cmn/umac/dfs/core/src/dfs_partial_offload_radar.h (revision 87a8e4458319c60b618522e263ed900e36aab528)
1 /*
2  * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
3  *
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 /**
21  * DOC: dfs_partial_offload_radar.h
22  * This file contains partial offload specific dfs interfaces
23  */
24 
25 #ifndef _DFS_PARTIAL_OFFLOAD_RADAR_H_
26 #define _DFS_PARTIAL_OFFLOAD_RADAR_H_
27 
28 /**
29  * dfs_get_po_radars() - Initialize the RADAR table for PO.
30  * @dfs: Pointer to wlan_dfs structure.
31  */
32 #if defined(WLAN_DFS_PARTIAL_OFFLOAD)
33 void dfs_get_po_radars(struct wlan_dfs *dfs);
34 #else
35 static inline void dfs_get_po_radars(struct wlan_dfs *dfs)
36 {
37 }
38 #endif
39 
40 /**
41  * dfs_send_avg_params_to_fw - send avg radar parameters to FW.
42  * @dfs: Pointer to wlan_dfs structure.
43  * @params: Pointer to dfs_radar_found_params.
44  *
45  * Return: None
46  */
47 #if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST)
48 void dfs_send_avg_params_to_fw(struct wlan_dfs *dfs,
49 			       struct dfs_radar_found_params *params);
50 #else
51 static inline
52 void dfs_send_avg_params_to_fw(struct wlan_dfs *dfs,
53 			       struct dfs_radar_found_params *params)
54 {
55 }
56 #endif
57 
58 /**
59  * dfs_host_wait_timer_init() - Initialize dfs host status wait timer.
60  * @dfs: Pointer to wlan_dfs structure.
61  */
62 #if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST)
63 void dfs_host_wait_timer_init(struct wlan_dfs *dfs);
64 #else
65 static inline void dfs_host_wait_timer_init(struct wlan_dfs *dfs)
66 {
67 }
68 #endif
69 
70 /**
71  * dfs_host_wait_timer_detach() - Free dfs host status wait timer.
72  * @dfs: Pointer to wlan_dfs structure.
73  */
74 #if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST)
75 void dfs_host_wait_timer_detach(struct wlan_dfs *dfs);
76 #else
77 static inline void dfs_host_wait_timer_detach(struct wlan_dfs *dfs)
78 {
79 }
80 #endif
81 
82 /**
83  * dfs_set_override_status_timeout() - Change the dfs host status timeout.
84  * @dfs: Pointer to wlan_dfs structure.
85  * @status_timeout: timeout value.
86  *
87  * Return: QDF_STATUS
88  */
89 #if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST)
90 QDF_STATUS dfs_set_override_status_timeout(struct wlan_dfs *dfs,
91 				       int status_timeout);
92 #else
93 static inline QDF_STATUS dfs_set_override_status_timeout(struct wlan_dfs *dfs,
94 						     int status_timeout)
95 {
96 	return QDF_STATUS_SUCCESS;
97 }
98 #endif
99 
100 /**
101  * dfs_get_override_status_timeout() - Get the dfs host status timeout value.
102  * @dfs: Pointer to wlan_dfs structure.
103  * @status_timeout: Pointer to  timeout value.
104  *
105  * Return: QDF_STATUS
106  */
107 #if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST)
108 QDF_STATUS dfs_get_override_status_timeout(struct wlan_dfs *dfs,
109 					   int *status_timeout);
110 #else
111 static inline
112 QDF_STATUS dfs_get_override_status_timeout(struct wlan_dfs *dfs,
113 					   int *status_timeout)
114 {
115 	return QDF_STATUS_SUCCESS;
116 }
117 #endif
118 
119 /**
120  * dfs_radarfound_action_fcc() - The dfs action on radar detection by host for
121  * FCC domain.
122  * @dfs: Pointer to wlan_dfs structure.
123  * @seg_id: segment id.
124  *
125  * Return: None
126  */
127 #if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST)
128 void dfs_radarfound_action_fcc(struct wlan_dfs *dfs, uint8_t seg_id);
129 #else
130 static inline void dfs_radarfound_action_fcc(struct wlan_dfs *dfs,
131 					     uint8_t seg_id)
132 {
133 }
134 #endif
135 
136 /**
137  * dfs_host_wait_timer_reset() - Stop dfs host wait timer.
138  * @dfs: Pointer to wlan_dfs structure.
139  */
140 #if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST)
141 void dfs_host_wait_timer_reset(struct wlan_dfs *dfs);
142 #else
143 static inline void dfs_host_wait_timer_reset(struct wlan_dfs *dfs)
144 {
145 }
146 #endif
147 
148 /**
149  * dfs_remove_spoof_channel_from_nol() - Remove the spoofed radar hit channel
150  * from NOL.
151  * @dfs: Pointer to wlan_dfs structure.
152  */
153 #if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST)
154 void dfs_remove_spoof_channel_from_nol(struct wlan_dfs *dfs);
155 #else
156 static inline void dfs_remove_spoof_channel_from_nol(struct wlan_dfs *dfs)
157 {
158 }
159 #endif
160 
161 /**
162  * dfs_reset_spoof_test() - reset the spoof test variables.
163  * @dfs: Pointer to wlan_dfs structure.
164  *
165  * Return: None.
166  */
167 #if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST)
168 void dfs_reset_spoof_test(struct wlan_dfs *dfs);
169 #else
170 static inline void dfs_reset_spoof_test(struct wlan_dfs *dfs)
171 {
172 }
173 #endif
174 
175 /**
176  * dfs_action_on_fw_radar_status_check() - The dfs action on host dfs
177  * confirmation by fw.
178  * @dfs: Pointer to wlan_dfs structure.
179  * @status: pointer to host dfs status.
180  *
181  * Return: None
182  */
183 #if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST)
184 void dfs_action_on_fw_radar_status_check(struct wlan_dfs *dfs,
185 					 uint32_t *status);
186 #else
187 static inline void dfs_action_on_fw_radar_status_check(struct wlan_dfs *dfs,
188 						       uint32_t *status)
189 {
190 }
191 #endif
192 #endif /*  _DFS_PARTIAL_OFFLOAD_RADAR_H_ */
193