1 /*
2  * Copyright (c) 2017-2019, 2021 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
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  * DOC: This file contains the API definitions for the Unified Wireless Module
21  * Interface (WMI) which are specific to DFS module.
22  */
23 
24 #ifndef _WMI_UNIFIED_DFS_API_H_
25 #define _WMI_UNIFIED_DFS_API_H_
26 
27 #include <wlan_objmgr_vdev_obj.h>
28 #include <wlan_dfs_utils_api.h>
29 
30 /**
31  * wmi_extract_dfs_cac_complete_event() - function to handle cac complete event
32  * @wmi_handle: wmi handle
33  * @evt_buf: event buffer
34  * @vdev_id: vdev id
35  * @len: length of buffer
36  *
37  * Return: 0 for success or error code
38  */
39 QDF_STATUS wmi_extract_dfs_cac_complete_event(
40 		wmi_unified_t wmi_handle,
41 		uint8_t *evt_buf,
42 		uint32_t *vdev_id,
43 		uint32_t len);
44 
45 /**
46  * wmi_extract_dfs_ocac_complete_event() - function to handle off channel
47  *						CAC complete event
48  * @wmi_handle: wmi handle
49  * @evt_buf: event buffer
50  * @param: off channel cac  complete params
51  *
52  * Return: 0 for success or error code
53  */
54 QDF_STATUS
55 wmi_extract_dfs_ocac_complete_event(wmi_unified_t wmi_handle, uint8_t *evt_buf,
56 				    struct vdev_adfs_complete_status *param);
57 
58 /**
59  * wmi_extract_dfs_radar_detection_event() - function to handle radar event
60  * @wmi_handle: wmi handle
61  * @evt_buf: event buffer
62  * @radar_found: radar found event info
63  * @len: length of buffer
64  *
65  * Return: 0 for success or error code
66  */
67 QDF_STATUS wmi_extract_dfs_radar_detection_event(
68 		wmi_unified_t wmi_handle,
69 		uint8_t *evt_buf,
70 		struct radar_found_info *radar_found,
71 		uint32_t len);
72 
73 #ifdef MOBILE_DFS_SUPPORT
74 /**
75  * wmi_extract_wlan_radar_event_info() - function to handle radar pulse event.
76  * @wmi_handle: wmi handle
77  * @evt_buf: event buffer
78  * @wlan_radar_event: pointer to radar event info structure
79  * @len: length of buffer
80  *
81  * Return: QDF_STATUS
82  */
83 QDF_STATUS wmi_extract_wlan_radar_event_info(
84 		wmi_unified_t wmi_handle,
85 		uint8_t *evt_buf,
86 		struct radar_event_info *wlan_radar_event,
87 		uint32_t len);
88 #endif
89 
90 #if defined(WLAN_DFS_FULL_OFFLOAD) && defined(QCA_DFS_NOL_OFFLOAD)
91 /**
92  * wmi_send_usenol_pdev_param() - function to send usenol pdev param.
93  * @wmi_handle: wmi handle
94  * @usenol: value of usenol
95  * @pdev: pointer to objmgr_pdev structure
96  *
97  * Return: QDF_STATUS
98  */
99 QDF_STATUS wmi_send_usenol_pdev_param(wmi_unified_t wmi_handle, bool usenol,
100 				      struct wlan_objmgr_pdev *pdev);
101 
102 /**
103  * wmi_send_subchan_marking_pdev_param() - Function to send subchannel
104  * marking pdev param.
105  * @wmi_handle: WMI handle.
106  * @subchanmark: Value of use subchannel marking.
107  * @pdev: Pointer to objmgr_pdev structure.
108  *
109  * Return: QDF_STATUS
110  */
111 QDF_STATUS
112 wmi_send_subchan_marking_pdev_param(wmi_unified_t wmi_handle,
113 				    bool subchanmark,
114 				    struct wlan_objmgr_pdev *pdev);
115 #else
116 static inline QDF_STATUS
wmi_send_usenol_pdev_param(wmi_unified_t wmi_hdl,bool usenol,struct wlan_objmgr_pdev * pdev)117 wmi_send_usenol_pdev_param(wmi_unified_t wmi_hdl, bool usenol,
118 			   struct wlan_objmgr_pdev *pdev)
119 {
120 	return QDF_STATUS_SUCCESS;
121 }
122 
123 static inline QDF_STATUS
wmi_send_subchan_marking_pdev_param(wmi_unified_t wmi_handle,bool subchanmark,struct wlan_objmgr_pdev * pdev)124 wmi_send_subchan_marking_pdev_param(wmi_unified_t wmi_handle,
125 				    bool subchanmark,
126 				    struct wlan_objmgr_pdev *pdev)
127 {
128 	return QDF_STATUS_SUCCESS;
129 }
130 #endif
131 #endif /* _WMI_UNIFIED_DFS_API_H_ */
132