xref: /wlan-dirver/qca-wifi-host-cmn/umac/dfs/dispatcher/inc/wlan_dfs_lmac_api.h (revision f28396d060cff5c6519f883cb28ae0116ce479f1)
1 /*
2  * Copyright (c) 2016-2020 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: These APIs are used by DFS core functions to call lmac/offload
22  * functions.
23  */
24 
25 #ifndef _WLAN_DFS_LMAC_API_H_
26 #define _WLAN_DFS_LMAC_API_H_
27 
28 #include <wlan_objmgr_psoc_obj.h>
29 #include <wlan_objmgr_pdev_obj.h>
30 
31 /**
32  * lmac_get_caps() - Get DFS capabilities.
33  * @pdev: Pointer to PDEV structure.
34  * @dfs_caps: Pointer to dfs_caps structure
35  */
36 void lmac_get_caps(struct wlan_objmgr_pdev *pdev,
37 		struct wlan_dfs_caps *dfs_caps);
38 
39 /**
40  * lmac_get_tsf64() - Get tsf64 value.
41  * @pdev: Pointer to PDEV structure.
42  *
43  * Return: tsf64 timer value.
44  */
45 uint64_t lmac_get_tsf64(struct wlan_objmgr_pdev *pdev);
46 
47 /**
48  * lmac_dfs_disable() - Disable DFS.
49  * @pdev: Pointer to PDEV structure.
50  * @no_cac: no_cac flag.
51  */
52 void lmac_dfs_disable(struct wlan_objmgr_pdev *pdev, int no_cac);
53 
54 /**
55  * lmac_dfs_enable() - Enable DFS.
56  * @pdev: Pointer to PDEV structure.
57  * @is_fastclk: fastclk value.
58  * @param: Pointer to wlan_dfs_phyerr_param structure.
59  * @dfsdomain:  DFS domain.
60  */
61 void lmac_dfs_enable(struct wlan_objmgr_pdev *pdev,
62 		int *is_fastclk,
63 		struct wlan_dfs_phyerr_param *param,
64 		int dfsdomain);
65 
66 /**
67  * lmac_dfs_get_thresholds() - Get thresholds.
68  * @pdev: Pointer to PDEV structure.
69  * @param: Pointer to wlan_dfs_phyerr_param structure.
70  */
71 void lmac_dfs_get_thresholds(struct wlan_objmgr_pdev *pdev,
72 		struct wlan_dfs_phyerr_param *param);
73 
74 /**
75  * lmac_get_ah_devid() - Get ah devid.
76  * @pdev: Pointer to PDEV structure.
77  */
78 uint16_t lmac_get_ah_devid(struct wlan_objmgr_pdev *pdev);
79 
80 /**
81  * lmac_get_ext_busy() - Get ext_busy.
82  * @pdev: Pointer to PDEV structure.
83  */
84 uint32_t lmac_get_ext_busy(struct wlan_objmgr_pdev *pdev);
85 
86 /**
87  * lmac_set_use_cac_prssi() - Set use_cac_prssi value.
88  * @pdev: Pointer to PDEV structure.
89  */
90 void lmac_set_use_cac_prssi(struct wlan_objmgr_pdev *pdev);
91 
92 /**
93  * lmac_get_target_type() - Get target type.
94  * @pdev: Pointer to PDEV structure.
95  */
96 uint32_t lmac_get_target_type(struct wlan_objmgr_pdev *pdev);
97 
98 /**
99  * lmac_get_phymode_info() - Get phymode info.
100  * @pdev: Pointer to PDEV structure.
101  */
102 uint32_t lmac_get_phymode_info(struct wlan_objmgr_pdev *pdev,
103 		uint32_t chan_mode);
104 
105 /**
106  * lmac_is_host_dfs_check_support_enabled() - Check if Host DFS confirmation
107  * feature is supported.
108  * @pdev: Pointer to PDEV structure.
109  *
110  * Return: true, host dfs check supported, else false.
111  */
112 #if defined(WLAN_DFS_PARTIAL_OFFLOAD) && defined(HOST_DFS_SPOOF_TEST)
113 bool lmac_is_host_dfs_check_support_enabled(struct wlan_objmgr_pdev *pdev);
114 #else
115 static inline bool lmac_is_host_dfs_check_support_enabled(
116 		struct wlan_objmgr_pdev *pdev)
117 {
118 	return false;
119 }
120 #endif
121 
122 /**
123  * lmac_dfs_is_hw_mode_switch_in_progress() - Check if HW mode switch is in
124  * progress.
125  * @pdev: Pointer to PDEV structure.
126  *
127  * Return: true if HW mode switch is in progress, else false.
128  */
129 bool lmac_dfs_is_hw_mode_switch_in_progress(struct wlan_objmgr_pdev *pdev);
130 #endif /* _WLAN_DFS_LMAC_API_H_ */
131