xref: /wlan-dirver/qca-wifi-host-cmn/umac/dfs/core/src/dfs_filter_init.h (revision 11f5a63a6cbdda84849a730de22f0a71e635d58c)
1 /*
2  * Copyright (c) 2017-2019 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: umac/dfs/core/src/dfs_filter_init.h
22  * This file contains dfs interfaces
23  */
24 
25 #ifndef _DFS_FILTER_INIT_H_
26 #define _DFS_FILTER_INIT_H_
27 
28 /**
29  * dfs_main_attach() - Allocates memory for wlan_dfs members.
30  * @dfs: Pointer to wlan_dfs structure.
31  */
32 #if defined(WLAN_DFS_DIRECT_ATTACH) || defined(WLAN_DFS_PARTIAL_OFFLOAD)
33 int dfs_main_attach(struct wlan_dfs *dfs);
34 #else
35 static inline int dfs_main_attach(struct wlan_dfs *dfs)
36 {
37 	return 0;
38 }
39 #endif
40 
41 /**
42  * dfs_main_detach() - Free dfs variables.
43  * @dfs: Pointer to wlan_dfs structure.
44  */
45 #if defined(WLAN_DFS_DIRECT_ATTACH) || defined(WLAN_DFS_PARTIAL_OFFLOAD)
46 void dfs_main_detach(struct wlan_dfs *dfs);
47 #else
48 static inline void dfs_main_detach(struct wlan_dfs *dfs)
49 {
50 }
51 #endif
52 
53 /**
54  * dfs_start_host_based_bangradar() - Mark as bangradar and start
55  * wlan_dfs_task_timer.
56  * @dfs: Pointer to wlan_dfs structure.
57  */
58 #if defined(WLAN_DFS_DIRECT_ATTACH) || defined(WLAN_DFS_PARTIAL_OFFLOAD)
59 int dfs_start_host_based_bangradar(struct wlan_dfs *dfs);
60 #else
61 static inline int dfs_start_host_based_bangradar(struct wlan_dfs *dfs)
62 {
63 	return 0;
64 }
65 #endif
66 
67 /**
68  * dfs_main_timer_reset() - Stop dfs timers.
69  * @dfs: Pointer to wlan_dfs structure.
70  */
71 #if defined(WLAN_DFS_DIRECT_ATTACH) || defined(WLAN_DFS_PARTIAL_OFFLOAD)
72 void dfs_main_timer_reset(struct wlan_dfs *dfs);
73 #else
74 static inline void dfs_main_timer_reset(struct wlan_dfs *dfs)
75 {
76 }
77 #endif
78 
79 /**
80  * dfs_main_timer_detach() - Free dfs timers.
81  * @dfs: Pointer to wlan_dfs structure.
82  */
83 #if defined(WLAN_DFS_DIRECT_ATTACH) || defined(WLAN_DFS_PARTIAL_OFFLOAD)
84 void dfs_main_timer_detach(struct wlan_dfs *dfs);
85 #else
86 static inline void dfs_main_timer_detach(struct wlan_dfs *dfs)
87 {
88 }
89 #endif
90 
91 #if defined(DA_SUPPORT) && defined(WLAN_DFS_DIRECT_ATTACH)
92 void dfs_get_da_radars(struct wlan_dfs *dfs);
93 #else
94 static inline void dfs_get_da_radars(struct wlan_dfs *dfs)
95 {
96 }
97 #endif
98 
99 #endif /* _DFS_FILTER_INIT_H_ */
100