xref: /wlan-dirver/qca-wifi-host-cmn/target_if/dfs/inc/target_if_dfs_full_offload.h (revision dd4dc88b837a295134aa9869114a2efee0f4894b)
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: target_if_dfs_full_offload.h
22  * This file contains dfs target interface for full-offload.
23  */
24 
25 #ifndef _TARGET_IF_DFS_FULL_OFFLOAD_H_
26 #define _TARGET_IF_DFS_FULL_OFFLOAD_H_
27 
28 /**
29  * target_if_dfs_reg_offload_events() - registers dfs events for full offload.
30  * @psoc: Pointer to psoc object.
31  *
32  * Return: QDF_STATUS
33  */
34 #if defined(WLAN_DFS_FULL_OFFLOAD)
35 QDF_STATUS target_if_dfs_reg_offload_events(struct wlan_objmgr_psoc *psoc);
36 #else
37 static QDF_STATUS
38 target_if_dfs_reg_offload_events(struct wlan_objmgr_psoc *psoc)
39 {
40 	return QDF_STATUS_SUCCESS;
41 }
42 #endif
43 
44 /**
45  * target_process_bang_radar_cmd() - fill unit test args and send bangradar
46  * command to firmware.
47  * @pdev: Pointer to DFS pdev object.
48  * @dfs_unit_test: Pointer to dfs_unit_test structure.
49  *
50  * Return: QDF_STATUS
51  */
52 #if defined(WLAN_DFS_FULL_OFFLOAD)
53 QDF_STATUS target_process_bang_radar_cmd(struct wlan_objmgr_pdev *pdev,
54 		struct dfs_emulate_bang_radar_test_cmd *dfs_unit_test);
55 #else
56 static QDF_STATUS target_process_bang_radar_cmd(struct wlan_objmgr_pdev *pdev,
57 		struct dfs_emulate_bang_radar_test_cmd *dfs_unit_test)
58 {
59 	return QDF_STATUS_SUCCESS;
60 }
61 #endif
62 
63 #if defined(QCA_SUPPORT_AGILE_DFS)
64 /**
65  * target_send_ocac_abort_cmd() - Send off channel CAC abort to target for
66  * to cancel current offchannel CAC
67  * @pdev: Pointer to DFS pdev object.
68  *
69  * Return: QDF_STATUS
70  */
71 QDF_STATUS target_send_ocac_abort_cmd(struct wlan_objmgr_pdev *pdev);
72 /**
73  * target_send_agile_ch_cfg_cmd() - Send agile channel to target for
74  * off channel precac.
75  * @pdev: Pointer to DFS pdev object.
76  *
77  * Return: QDF_STATUS
78  */
79 QDF_STATUS target_send_agile_ch_cfg_cmd(struct wlan_objmgr_pdev *pdev,
80 					uint8_t *ch_freq);
81 #else
82 static inline QDF_STATUS
83 target_send_ocac_abort_cmd(struct wlan_objmgr_pdev *pdev)
84 {
85 	return QDF_STATUS_SUCCESS;
86 }
87 
88 static inline QDF_STATUS
89 target_send_agile_ch_cfg_cmd(struct wlan_objmgr_pdev *pdev,
90 			     uint8_t *ch_freq)
91 {
92 	return QDF_STATUS_SUCCESS;
93 }
94 #endif
95 
96 #if defined(WLAN_DFS_FULL_OFFLOAD) && defined(QCA_DFS_NOL_OFFLOAD)
97 /**
98  * target_send_usenol_pdev_param - send usenol pdev param to FW.
99  * @pdev: Pointer to pdev object.
100  * @usenol: Value of user configured usenol.
101  *
102  * Return: QDF_STATUS
103  */
104 QDF_STATUS target_send_usenol_pdev_param(struct wlan_objmgr_pdev *pdev,
105 					 bool usenol);
106 
107 /**
108  * target_send_subchan_marking_pdev_param - Send subchannel marking
109  * pdev param to FW.
110  * @pdev: Pointer to pdev object.
111  * @subchanmark: Value of user configured subchannel_marking.
112  *
113  * Return: QDF_STATUS
114  */
115 QDF_STATUS
116 target_send_subchan_marking_pdev_param(struct wlan_objmgr_pdev *pdev,
117 				       bool subchanmark);
118 
119 #else
120 static inline QDF_STATUS
121 target_send_usenol_pdev_param(struct wlan_objmgr_pdev *pdev,
122 			      bool usenol)
123 {
124 	return QDF_STATUS_SUCCESS;
125 }
126 
127 static inline QDF_STATUS
128 target_send_subchan_marking_pdev_param(struct wlan_objmgr_pdev *pdev,
129 				       bool subchanmark)
130 {
131 	return QDF_STATUS_SUCCESS;
132 }
133 #endif
134 #endif /* _TARGET_IF_DFS_FULL_OFFLOAD_H_ */
135 
136