xref: /wlan-dirver/qca-wifi-host-cmn/wmi/inc/wmi_unified_dfs_api.h (revision 11f5a63a6cbdda84849a730de22f0a71e635d58c)
1 /*
2  * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 /**
19  * DOC: This file contains the API definitions for the Unified Wireless Module
20  * Interface (WMI) which are specific to DFS module.
21  */
22 
23 #ifndef _WMI_UNIFIED_DFS_API_H_
24 #define _WMI_UNIFIED_DFS_API_H_
25 
26 #include <wlan_objmgr_vdev_obj.h>
27 #include <wlan_dfs_utils_api.h>
28 
29 /**
30  * wmi_extract_dfs_cac_complete_event() - function to handle cac complete event
31  * @wmi_handle: wmi handle
32  * @event_buf: event buffer
33  * @vdev_id: vdev id
34  * @len: length of buffer
35  *
36  * Return: 0 for success or error code
37  */
38 QDF_STATUS wmi_extract_dfs_cac_complete_event(
39 		wmi_unified_t wmi_handle,
40 		uint8_t *evt_buf,
41 		uint32_t *vdev_id,
42 		uint32_t len);
43 
44 /**
45  * wmi_extract_dfs_ocac_complete_event() - function to handle off channel
46  *						CAC complete event
47  * @wmi_handle: wmi handle
48  * @event_buf: event buffer
49  * @param: off channel cac  complete params
50  *
51  * Return: 0 for success or error code
52  */
53 QDF_STATUS
54 wmi_extract_dfs_ocac_complete_event(wmi_unified_t wmi_handle, uint8_t *evt_buf,
55 				    struct vdev_adfs_complete_status *param);
56 
57 /**
58  * wmi_extract_dfs_radar_detection_event() - function to handle radar event
59  * @wmi_handle: wmi handle
60  * @event_buf: event buffer
61  * @radar_found: radar found event info
62  * @len: length of buffer
63  *
64  * Return: 0 for success or error code
65  */
66 QDF_STATUS wmi_extract_dfs_radar_detection_event(
67 		wmi_unified_t wmi_handle,
68 		uint8_t *evt_buf,
69 		struct radar_found_info *radar_found,
70 		uint32_t len);
71 
72 #ifdef QCA_MCL_DFS_SUPPORT
73 /**
74  * wmi_extract_wlan_radar_event_info() - function to handle radar pulse event.
75  * @wmi_handle: wmi handle
76  * @evt_buf: event buffer
77  * @wlan_radar_event: pointer to radar event info structure
78  * @len: length of buffer
79  *
80  * Return: QDF_STATUS
81  */
82 QDF_STATUS wmi_extract_wlan_radar_event_info(
83 		wmi_unified_t wmi_handle,
84 		uint8_t *evt_buf,
85 		struct radar_event_info *wlan_radar_event,
86 		uint32_t len);
87 #endif
88 
89 #if defined(WLAN_DFS_FULL_OFFLOAD) && defined(QCA_DFS_NOL_OFFLOAD)
90 /**
91  * wmi_send_usenol_pdev_param() - function to send usenol pdev param.
92  * @wmi_handle: wmi handle
93  * @usenol: value of usenol
94  * @pdev: pointer to objmgr_pdev structure
95  *
96  * Return: QDF_STATUS
97  */
98 QDF_STATUS wmi_send_usenol_pdev_param(wmi_unified_t wmi_handle, bool usenol,
99 				      struct wlan_objmgr_pdev *pdev);
100 
101 /**
102  * wmi_send_subchan_marking_pdev_param() - Function to send subchannel
103  * marking pdev param.
104  * @wmi_handle: WMI handle.
105  * @subchanmark: Value of use subchannel marking.
106  * @pdev: Pointer to objmgr_pdev structure.
107  *
108  * Return: QDF_STATUS
109  */
110 QDF_STATUS
111 wmi_send_subchan_marking_pdev_param(wmi_unified_t wmi_handle,
112 				    bool subchanmark,
113 				    struct wlan_objmgr_pdev *pdev);
114 #else
115 static inline QDF_STATUS
116 wmi_send_usenol_pdev_param(wmi_unified_t wmi_hdl, bool usenol,
117 			   struct wlan_objmgr_pdev *pdev)
118 {
119 	return QDF_STATUS_SUCCESS;
120 }
121 
122 static inline QDF_STATUS
123 wmi_send_subchan_marking_pdev_param(wmi_unified_t wmi_handle,
124 				    bool subchanmark,
125 				    struct wlan_objmgr_pdev *pdev)
126 {
127 	return QDF_STATUS_SUCCESS;
128 }
129 #endif
130 #endif /* _WMI_UNIFIED_DFS_API_H_ */
131