xref: /wlan-dirver/qca-wifi-host-cmn/wmi/src/wmi_unified_dfs_api.c (revision 3149adf58a329e17232a4c0e58d460d025edd55a)
1 /*
2  * Copyright (c) 2017-2018 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: Implement API's specific to DFS component.
22  */
23 
24 #include <qdf_status.h>
25 #include <wmi_unified_api.h>
26 #include <wmi_unified_priv.h>
27 #include <wlan_dfs_utils_api.h>
28 #include <wmi_unified_dfs_api.h>
29 
30 QDF_STATUS wmi_extract_dfs_cac_complete_event(void *wmi_hdl,
31 		uint8_t *evt_buf,
32 		uint32_t *vdev_id,
33 		uint32_t len)
34 {
35 	struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl;
36 
37 	if (wmi_handle->ops->extract_dfs_cac_complete_event)
38 		return wmi_handle->ops->extract_dfs_cac_complete_event(
39 				wmi_handle, evt_buf, vdev_id, len);
40 
41 	return QDF_STATUS_E_FAILURE;
42 }
43 EXPORT_SYMBOL(wmi_extract_dfs_cac_complete_event);
44 
45 QDF_STATUS wmi_extract_dfs_radar_detection_event(void *wmi_hdl,
46 		uint8_t *evt_buf,
47 		struct radar_found_info *radar_found,
48 		uint32_t len)
49 {
50 	struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl;
51 
52 	if (wmi_handle->ops->extract_dfs_radar_detection_event)
53 		return wmi_handle->ops->extract_dfs_radar_detection_event(
54 				wmi_handle, evt_buf, radar_found, len);
55 
56 	return QDF_STATUS_E_FAILURE;
57 }
58 
59 #ifdef QCA_MCL_DFS_SUPPORT
60 QDF_STATUS wmi_extract_wlan_radar_event_info(void *wmi_hdl,
61 		uint8_t *evt_buf,
62 		struct radar_event_info *wlan_radar_event,
63 		uint32_t len)
64 {
65 	struct wmi_unified *wmi_handle = (struct wmi_unified *)wmi_hdl;
66 
67 	if (wmi_handle->ops->extract_wlan_radar_event_info)
68 		return wmi_handle->ops->extract_wlan_radar_event_info(
69 				wmi_handle, evt_buf, wlan_radar_event, len);
70 
71 	return QDF_STATUS_E_FAILURE;
72 }
73 #endif
74 EXPORT_SYMBOL(wmi_extract_dfs_radar_detection_event);
75