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