1 /*
2  * Copyright (c) 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 any
6  * purpose with or without fee is hereby granted, provided that the above
7  * copyright notice and this permission notice appear in all copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16  */
17 
18 #include "wmi_unified_priv.h"
19 #include "wmi_unified_cfr_api.h"
20 
21 #ifdef WLAN_CFR_ENABLE
22 
wmi_unified_send_peer_cfr_capture_cmd(wmi_unified_t wmi_handle,struct peer_cfr_params * param)23 QDF_STATUS wmi_unified_send_peer_cfr_capture_cmd(wmi_unified_t wmi_handle,
24 						 struct peer_cfr_params *param)
25 {
26 	if (wmi_handle->ops->send_peer_cfr_capture_cmd)
27 		return wmi_handle->ops->send_peer_cfr_capture_cmd(wmi_handle,
28 								  param);
29 
30 	return QDF_STATUS_E_FAILURE;
31 }
32 
33 QDF_STATUS
wmi_extract_cfr_peer_tx_event_param(wmi_unified_t wmi_handle,void * evt_buf,wmi_cfr_peer_tx_event_param * peer_tx_event)34 wmi_extract_cfr_peer_tx_event_param(wmi_unified_t wmi_handle, void *evt_buf,
35 				    wmi_cfr_peer_tx_event_param *peer_tx_event)
36 {
37 	if (wmi_handle->ops->extract_cfr_peer_tx_event_param)
38 		return wmi_handle->ops->extract_cfr_peer_tx_event_param(
39 							wmi_handle,
40 							evt_buf,
41 							peer_tx_event);
42 	return QDF_STATUS_E_FAILURE;
43 }
44 
45 #ifdef WLAN_ENH_CFR_ENABLE
wmi_unified_send_cfr_rcc_cmd(wmi_unified_t wmi_handle,struct cfr_rcc_param * cfg)46 QDF_STATUS wmi_unified_send_cfr_rcc_cmd(wmi_unified_t wmi_handle,
47 					struct cfr_rcc_param *cfg)
48 {
49 	if (wmi_handle->ops->send_cfr_rcc_cmd)
50 		return wmi_handle->ops->send_cfr_rcc_cmd(wmi_handle, cfg);
51 	return QDF_STATUS_E_FAILURE;
52 }
53 
54 QDF_STATUS
wmi_extract_cfr_pdev_phase_delta_event(wmi_unified_t wmi_handle,void * evt_buf,struct wmi_cfr_phase_delta_param * param)55 wmi_extract_cfr_pdev_phase_delta_event(wmi_unified_t wmi_handle,
56 				       void *evt_buf,
57 				       struct wmi_cfr_phase_delta_param *param)
58 {
59 	if (wmi_handle->ops->extract_cfr_phase_param)
60 		return wmi_handle->ops->extract_cfr_phase_param(wmi_handle,
61 								evt_buf,
62 								param);
63 	return QDF_STATUS_E_FAILURE;
64 }
65 
66 #ifdef WLAN_RCC_ENHANCED_AOA_SUPPORT
67 QDF_STATUS
wmi_extract_cfr_pdev_enhanced_aoa_phasedelta_event_fixed_param(wmi_unified_t wmi_handle,void * evt_buf,struct wmi_cfr_enh_phase_delta_param * param)68 wmi_extract_cfr_pdev_enhanced_aoa_phasedelta_event_fixed_param(
69 		wmi_unified_t wmi_handle,
70 		void *evt_buf,
71 		struct wmi_cfr_enh_phase_delta_param *param)
72 {
73 	if (wmi_handle->ops->extract_cfr_enh_phase_fixed_param)
74 		return wmi_handle->ops->extract_cfr_enh_phase_fixed_param
75 				(wmi_handle, evt_buf, param);
76 
77 	return QDF_STATUS_E_FAILURE;
78 }
79 
80 QDF_STATUS
wmi_extract_cfr_pdev_enhanced_aoa_phasedelta_event_data(wmi_unified_t wmi_handle,void * evt_buf,struct wmi_cfr_enh_phase_delta_param * param)81 wmi_extract_cfr_pdev_enhanced_aoa_phasedelta_event_data(
82 		wmi_unified_t wmi_handle, void *evt_buf,
83 		struct wmi_cfr_enh_phase_delta_param *param)
84 {
85 	if (wmi_handle->ops->extract_cfr_enh_phase_data)
86 		return wmi_handle->ops->extract_cfr_enh_phase_data(wmi_handle,
87 								   evt_buf,
88 								   param);
89 
90 	return QDF_STATUS_E_FAILURE;
91 }
92 #endif /* WLAN_RCC_ENHANCED_AOA_SUPPORT */
93 #endif /* WLAN_ENH_CFR_ENABLE */
94 #endif /* WLAN_CFR_ENABLE */
95