xref: /wlan-dirver/qca-wifi-host-cmn/wmi/inc/wmi_unified_dfs_api.h (revision 1397a33f48ea6455be40871470b286e535820eb8)
1 /*
2  * Copyright (c) 2017-2018 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_dfs_utils_api.h>
27 
28 /**
29  * wmi_extract_dfs_cac_complete_event() - function to handle cac complete event
30  * @handle: wma handle
31  * @event_buf: event buffer
32  * @vdev_id: vdev id
33  * @len: length of buffer
34  *
35  * Return: 0 for success or error code
36  */
37 QDF_STATUS wmi_extract_dfs_cac_complete_event(void *wmi_hdl,
38 		uint8_t *evt_buf,
39 		uint32_t *vdev_id,
40 		uint32_t len);
41 
42 /**
43  * wmi_extract_dfs_radar_detection_event() - function to handle radar event
44  * @handle: wma handle
45  * @event_buf: event buffer
46  * @radar_found: radar found event info
47  * @vdev_id: vdev id
48  * @len: length of buffer
49  *
50  * Return: 0 for success or error code
51  */
52 QDF_STATUS wmi_extract_dfs_radar_detection_event(void *wmi_hdl,
53 		uint8_t *evt_buf,
54 		struct radar_found_info *radar_found,
55 		uint32_t len);
56 
57 #ifdef QCA_MCL_DFS_SUPPORT
58 /**
59  * wmi_extract_wlan_radar_event_info() - function to handle radar pulse event.
60  * @wmi_hdl: wmi handle
61  * @evt_buf: event buffer
62  * @wlan_radar_event: pointer to radar event info structure
63  * @len: length of buffer
64  *
65  * Return: QDF_STATUS
66  */
67 QDF_STATUS wmi_extract_wlan_radar_event_info(void *wmi_hdl,
68 		uint8_t *evt_buf,
69 		struct radar_event_info *wlan_radar_event,
70 		uint32_t len);
71 #endif
72 
73 #if defined(WLAN_DFS_FULL_OFFLOAD) && defined(QCA_DFS_NOL_OFFLOAD)
74 /**
75  * wmi_send_usenol_pdev_param() - function to send usenol pdev param.
76  * @wmi_hdl: wmi handle
77  * @usenol: value of usenol
78  * @pdev: pointer to objmgr_pdev structure
79  *
80  * Return: QDF_STATUS
81  */
82 QDF_STATUS wmi_send_usenol_pdev_param(void *wmi_hdl, bool usenol,
83 				      struct wlan_objmgr_pdev *pdev);
84 
85 /**
86  * wmi_send_subchan_marking_pdev_param() - Function to send subchannel
87  * marking pdev param.
88  * @wmi_hdl: WMI handle.
89  * @subchanmark: Value of use subchannel marking.
90  * @pdev: Pointer to objmgr_pdev structure.
91  *
92  * Return: QDF_STATUS
93  */
94 QDF_STATUS
95 wmi_send_subchan_marking_pdev_param(void *wmi_hdl,
96 				    bool subchanmark,
97 				    struct wlan_objmgr_pdev *pdev);
98 #else
99 static inline QDF_STATUS
100 wmi_send_usenol_pdev_param(void *wmi_hdl, bool usenol,
101 			   struct wlan_objmgr_pdev *pdev)
102 {
103 	return QDF_STATUS_SUCCESS;
104 }
105 
106 static inline QDF_STATUS
107 wmi_send_subchan_marking_pdev_param(void *wmi_hdl,
108 				    bool subchanmark,
109 				    struct wlan_objmgr_pdev *pdev)
110 {
111 	return QDF_STATUS_SUCCESS;
112 }
113 #endif
114 #endif /* _WMI_UNIFIED_DFS_API_H_ */
115