1 /*
2 * Copyright (c) 2021, The Linux Foundation. All rights reserved.
3 * Copyright (c) 2022-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 /**
19 * DOC: target_if_mgmt_txrx_rx_reo.h
20 * This file contains declarations of management rx re-ordering related APIs.
21 */
22
23 #ifndef _TARGET_IF_MGMT_TXRX_RX_REO_H_
24 #define _TARGET_IF_MGMT_TXRX_RX_REO_H_
25
26 #include <qdf_types.h>
27 #include <wlan_objmgr_psoc_obj.h>
28 #include <wlan_mgmt_txrx_rx_reo_utils_api.h>
29 #include <wlan_mgmt_txrx_rx_reo_tgt_api.h>
30 #include <wlan_lmac_if_api.h>
31 #include <wlan_lmac_if_def.h>
32 #include <wmi_unified_param.h>
33
34 #ifdef WLAN_MGMT_RX_REO_SUPPORT
35 /**
36 * target_if_get_mgmt_rx_reo_low_level_ops() - Get low-level ops of management
37 * rx-reorder module
38 * @psoc: Pointer to psoc object
39 *
40 * Return: Pointer to management rx-reorder low-level ops
41 */
42 static inline struct wlan_lmac_if_mgmt_rx_reo_low_level_ops *
target_if_get_mgmt_rx_reo_low_level_ops(struct wlan_objmgr_psoc * psoc)43 target_if_get_mgmt_rx_reo_low_level_ops(struct wlan_objmgr_psoc *psoc)
44 {
45 struct wlan_lmac_if_mgmt_rx_reo_tx_ops *mgmt_rx_reo_tx_ops;
46
47 mgmt_rx_reo_tx_ops = wlan_psoc_get_mgmt_rx_reo_txops(psoc);
48 if (!mgmt_rx_reo_tx_ops) {
49 mgmt_txrx_err("txops is null for mgmt rx reo module");
50 return NULL;
51 }
52
53 return &mgmt_rx_reo_tx_ops->low_level_ops;
54 }
55
56 /**
57 * target_if_mgmt_rx_reo_register_event_handlers() - Register management
58 * rx-reordering related event handlers.
59 * @psoc: psoc object
60 *
61 * Return: QDF_STATUS
62 */
63 QDF_STATUS
64 target_if_mgmt_rx_reo_register_event_handlers(struct wlan_objmgr_psoc *psoc);
65
66 /**
67 * target_if_mgmt_rx_reo_unregister_event_handlers() - Unregister management
68 * rx-reordering related event handlers.
69 * @psoc: psoc object
70 *
71 * Return: QDF_STATUS
72 */
73 QDF_STATUS
74 target_if_mgmt_rx_reo_unregister_event_handlers(struct wlan_objmgr_psoc *psoc);
75
76 /**
77 * target_if_mgmt_rx_reo_tx_ops_register() - Register management rx-reordring
78 * txops
79 * @mgmt_txrx_tx_ops: Pointer to mgmt_txrx module's txops
80 *
81 * Return: QDF_STATUS
82 */
83 QDF_STATUS
84 target_if_mgmt_rx_reo_tx_ops_register(
85 struct wlan_lmac_if_mgmt_txrx_tx_ops *mgmt_txrx_tx_ops);
86
87 /**
88 * target_if_mgmt_rx_reo_get_rx_ops() - Retrieve rx_ops of MGMT Rx REO module
89 * @psoc:psoc context
90 *
91 * Return: Pointer to rx_ops of MGMT Rx REO module
92 */
93 static struct wlan_lmac_if_mgmt_rx_reo_rx_ops *
target_if_mgmt_rx_reo_get_rx_ops(struct wlan_objmgr_psoc * psoc)94 target_if_mgmt_rx_reo_get_rx_ops(struct wlan_objmgr_psoc *psoc)
95 {
96 struct wlan_lmac_if_mgmt_txrx_rx_ops *mgmt_rx_ops;
97
98 mgmt_rx_ops = wlan_lmac_if_get_mgmt_txrx_rx_ops(psoc);
99 if (!mgmt_rx_ops) {
100 mgmt_rx_reo_err("MGMT TxRx rx_ops is NULL");
101 return NULL;
102 }
103
104 return &mgmt_rx_ops->mgmt_rx_reo_rx_ops;
105 }
106
107 /**
108 * target_if_mgmt_rx_reo_extract_reo_params() - Extract MGMT Rx REO params from
109 * MGMT_RX_EVENT_ID
110 * @wmi_handle: wmi handle
111 * @evt_buf: pointer to event buffer
112 * @params: Pointer to MGMT Rx event parameters
113 *
114 * Return: QDF_STATUS of operation
115 */
116 QDF_STATUS
117 target_if_mgmt_rx_reo_extract_reo_params(wmi_unified_t wmi_handle,
118 void *evt_buf,
119 struct mgmt_rx_event_params *params);
120 /**
121 * target_if_mgmt_rx_reo_host_drop_handler() - MGMT Rx REO handler for the
122 * management Rx frames that gets dropped in the Host before entering
123 * MGMT Rx REO algorithm
124 * @pdev: pdev for which this frame was intended
125 * @params: MGMT Rx event parameters
126 *
127 * Return: QDF_STATUS of operation
128 */
129 QDF_STATUS
130 target_if_mgmt_rx_reo_host_drop_handler(struct wlan_objmgr_pdev *pdev,
131 struct mgmt_rx_event_params *params);
132 /**
133 * target_if_mgmt_rx_reo_release_frames() - API to release the management
134 * frames of a given psoc
135 * @arg: Pointer to void * argument
136 *
137 * Return: void
138 */
139 void target_if_mgmt_rx_reo_release_frames(void *arg);
140 #else
141 /**
142 * target_if_mgmt_rx_reo_register_event_handlers() - Register management
143 * rx-reordering related event handlers.
144 * @psoc: psoc object
145 *
146 * Return: QDF_STATUS
147 */
148 static inline QDF_STATUS
target_if_mgmt_rx_reo_register_event_handlers(struct wlan_objmgr_psoc * psoc)149 target_if_mgmt_rx_reo_register_event_handlers(struct wlan_objmgr_psoc *psoc)
150 {
151 return QDF_STATUS_SUCCESS;
152 }
153
154 /**
155 * target_if_mgmt_rx_reo_unregister_event_handlers() - Unregister management
156 * rx-reordering related event handlers.
157 * @psoc: psoc object
158 *
159 * Return: QDF_STATUS
160 */
161 static inline QDF_STATUS
target_if_mgmt_rx_reo_unregister_event_handlers(struct wlan_objmgr_psoc * psoc)162 target_if_mgmt_rx_reo_unregister_event_handlers(struct wlan_objmgr_psoc *psoc)
163 {
164 return QDF_STATUS_SUCCESS;
165 }
166
167 /**
168 * target_if_mgmt_rx_reo_tx_ops_register() - Register management rx-reordring
169 * txops
170 * @mgmt_txrx_tx_ops: Pointer to mgmt_txrx module's txops
171 *
172 * Return: QDF_STATUS
173 */
174 static inline QDF_STATUS
target_if_mgmt_rx_reo_tx_ops_register(struct wlan_lmac_if_mgmt_txrx_tx_ops * mgmt_txrx_tx_ops)175 target_if_mgmt_rx_reo_tx_ops_register(
176 struct wlan_lmac_if_mgmt_txrx_tx_ops *mgmt_txrx_tx_ops)
177 {
178 return QDF_STATUS_SUCCESS;
179 }
180
181 /**
182 * target_if_mgmt_rx_reo_extract_reo_params() - Extract MGMT Rx REO params from
183 * MGMT_RX_EVENT_ID
184 * @wmi_handle: wmi handle
185 * @evt_buf: pointer to event buffer
186 * @hdr: Pointer to MGMT Rx event parameters
187 *
188 * Return: QDF_STATUS of operation
189 */
190 static inline QDF_STATUS
target_if_mgmt_rx_reo_extract_reo_params(wmi_unified_t wmi_handle,void * evt_buf,struct mgmt_rx_event_params * hdr)191 target_if_mgmt_rx_reo_extract_reo_params(wmi_unified_t wmi_handle,
192 void *evt_buf,
193 struct mgmt_rx_event_params *hdr)
194 {
195 return QDF_STATUS_SUCCESS;
196 }
197
198 /**
199 * target_if_mgmt_rx_reo_host_drop_handler() - MGMT Rx REO handler for the
200 * management Rx frames that gets dropped in the Host before entering
201 * MGMT Rx REO algorithm
202 * @pdev: pdev for which this frame was intended
203 * @params: MGMT Rx event parameters
204 *
205 * Return: QDF_STATUS of operation
206 */
207 static inline QDF_STATUS
target_if_mgmt_rx_reo_host_drop_handler(struct wlan_objmgr_pdev * pdev,struct mgmt_rx_event_params * params)208 target_if_mgmt_rx_reo_host_drop_handler(struct wlan_objmgr_pdev *pdev,
209 struct mgmt_rx_event_params *params)
210 {
211 /* Nothing to do when REO is compiled off */
212 return QDF_STATUS_SUCCESS;
213 }
214
215 /**
216 * target_if_mgmt_rx_reo_release_frames() - API to release the management
217 * frames of a given psoc
218 * @arg: Pointer to void * argument
219 *
220 * Return: void
221 */
target_if_mgmt_rx_reo_release_frames(void * arg)222 static inline void target_if_mgmt_rx_reo_release_frames(void *arg)
223 {
224 }
225 #endif /* WLAN_MGMT_RX_REO_SUPPORT */
226 #endif /* _TARGET_IF_MGMT_TXRX_RX_REO_H_ */
227