xref: /wlan-driver/qca-wifi-host-cmn/wmi/src/wmi_unified_dbr_api.c (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2016-2019 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 #include "wmi_unified_priv.h"
21 #include "qdf_module.h"
22 
wmi_unified_dbr_ring_cfg(wmi_unified_t wmi_handle,struct direct_buf_rx_cfg_req * cfg)23 QDF_STATUS wmi_unified_dbr_ring_cfg(wmi_unified_t wmi_handle,
24 				    struct direct_buf_rx_cfg_req *cfg)
25 {
26 	if (wmi_handle->ops->send_dbr_cfg_cmd)
27 		return wmi_handle->ops->send_dbr_cfg_cmd(wmi_handle, cfg);
28 
29 	return QDF_STATUS_E_FAILURE;
30 }
31 
wmi_extract_dbr_buf_release_fixed(wmi_unified_t wmi_handle,uint8_t * evt_buf,struct direct_buf_rx_rsp * param)32 QDF_STATUS wmi_extract_dbr_buf_release_fixed(
33 			wmi_unified_t wmi_handle,
34 			uint8_t *evt_buf,
35 			struct direct_buf_rx_rsp *param)
36 {
37 	if (wmi_handle->ops->extract_dbr_buf_release_fixed)
38 		return wmi_handle->ops->extract_dbr_buf_release_fixed(
39 				wmi_handle,
40 				evt_buf, param);
41 
42 	return QDF_STATUS_E_FAILURE;
43 }
44 
wmi_extract_dbr_buf_release_entry(wmi_unified_t wmi_handle,uint8_t * evt_buf,uint8_t idx,struct direct_buf_rx_entry * param)45 QDF_STATUS wmi_extract_dbr_buf_release_entry(
46 			wmi_unified_t wmi_handle,
47 			uint8_t *evt_buf, uint8_t idx,
48 			struct direct_buf_rx_entry *param)
49 {
50 	if (wmi_handle->ops->extract_dbr_buf_release_entry)
51 		return wmi_handle->ops->extract_dbr_buf_release_entry(
52 				wmi_handle,
53 				evt_buf, idx, param);
54 
55 	return QDF_STATUS_E_FAILURE;
56 }
57 
wmi_extract_dbr_buf_metadata(wmi_unified_t wmi_handle,uint8_t * evt_buf,uint8_t idx,struct direct_buf_rx_metadata * param)58 QDF_STATUS wmi_extract_dbr_buf_metadata(
59 			wmi_unified_t wmi_handle,
60 			uint8_t *evt_buf, uint8_t idx,
61 			struct direct_buf_rx_metadata *param)
62 {
63 	if (wmi_handle->ops->extract_dbr_buf_metadata)
64 		return wmi_handle->ops->extract_dbr_buf_metadata(
65 				wmi_handle,
66 				evt_buf, idx, param);
67 
68 	return QDF_STATUS_E_FAILURE;
69 }
70 
wmi_extract_dbr_buf_cv_metadata(wmi_unified_t wmi_handle,uint8_t * evt_buf,uint8_t idx,struct direct_buf_rx_cv_metadata * param)71 QDF_STATUS wmi_extract_dbr_buf_cv_metadata(
72 			wmi_unified_t wmi_handle,
73 			uint8_t *evt_buf, uint8_t idx,
74 			struct direct_buf_rx_cv_metadata *param)
75 {
76 	if (wmi_handle->ops->extract_dbr_buf_cv_metadata)
77 		return wmi_handle->ops->extract_dbr_buf_cv_metadata(
78 				wmi_handle,
79 				evt_buf, idx, param);
80 
81 	return QDF_STATUS_E_FAILURE;
82 }
83 
wmi_extract_dbr_buf_cqi_metadata(wmi_unified_t wmi_handle,uint8_t * evt_buf,uint8_t idx,struct direct_buf_rx_cqi_metadata * param)84 QDF_STATUS wmi_extract_dbr_buf_cqi_metadata(
85 			wmi_unified_t wmi_handle,
86 			uint8_t *evt_buf, uint8_t idx,
87 			struct direct_buf_rx_cqi_metadata *param)
88 {
89 	if (wmi_handle->ops->extract_dbr_buf_cqi_metadata)
90 		return wmi_handle->ops->extract_dbr_buf_cqi_metadata(
91 				wmi_handle,
92 				evt_buf, idx, param);
93 
94 	return QDF_STATUS_E_FAILURE;
95 }
96