blob: 91742faf55961f696e4dc900f12b0844c5e6d4b8 [file] [log] [blame]
Dhanashri Atrefe5662c2016-03-25 12:57:53 -07001/*
Padma Raghunathanfe453df2019-10-08 10:35:06 +05302 * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved.
Dhanashri Atrefe5662c2016-03-25 12:57:53 -07003 *
Dhanashri Atrefe5662c2016-03-25 12:57:53 -07004 * 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
Yun Park29f74f12017-04-03 08:42:21 -070019/**
Dhanashri Atrefe5662c2016-03-25 12:57:53 -070020 * @file cdp_txrx_ctrl.h
21 * @brief Define the host data path control API functions
22 * called by the host control SW and the OS interface module
23 */
24
25#ifndef _CDP_TXRX_CTRL_H_
26#define _CDP_TXRX_CTRL_H_
Venkata Sharath Chandra Manchalaf2a125a2016-11-28 18:10:11 -080027#include "cdp_txrx_handle.h"
Pratik Gandhi78461502018-02-05 17:22:41 +053028#include "cdp_txrx_cmn_struct.h"
Karunakar Dasineni142f9ba2019-03-19 23:04:59 -070029#include "cdp_txrx_cmn.h"
Pratik Gandhi78461502018-02-05 17:22:41 +053030#include "cdp_txrx_ops.h"
Dhanashri Atrefe5662c2016-03-25 12:57:53 -070031
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +053032static inline int cdp_is_target_ar900b
Venkata Sharath Chandra Manchalaf2a125a2016-11-28 18:10:11 -080033 (ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +053034{
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -070035 if (!soc || !soc->ops) {
36 QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
37 "%s: Invalid Instance:", __func__);
38 QDF_BUG(0);
39 return 0;
40 }
41
42 if (!soc->ops->ctrl_ops ||
43 !soc->ops->ctrl_ops->txrx_is_target_ar900b)
44 return 0;
45
46 return soc->ops->ctrl_ops->txrx_is_target_ar900b(vdev);
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +053047}
Dhanashri Atrefe5662c2016-03-25 12:57:53 -070048
49
50/* WIN */
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +053051static inline int
52cdp_mempools_attach(ol_txrx_soc_handle soc, void *ctrl_pdev)
53{
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -070054 if (!soc || !soc->ops) {
55 QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
56 "%s: Invalid Instance:", __func__);
57 QDF_BUG(0);
58 return 0;
59 }
60
61 if (!soc->ops->ctrl_ops ||
62 !soc->ops->ctrl_ops->txrx_mempools_attach)
63 return 0;
64
65 return soc->ops->ctrl_ops->txrx_mempools_attach(ctrl_pdev);
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +053066}
67
Pratik Gandhi8b8334b2017-03-09 17:41:40 +053068/**
69 * @brief set filter neighbour peers
70 * @details
71 * This defines interface function to set neighbour peer filtering.
72 *
73 * @param soc - the pointer to soc object
74 * @param pdev - the pointer physical device object
75 * @param val - the enable/disable value
76 * @return - int
77 */
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +053078static inline int
79cdp_set_filter_neighbour_peers(ol_txrx_soc_handle soc,
Venkata Sharath Chandra Manchalaf2a125a2016-11-28 18:10:11 -080080 struct cdp_pdev *pdev, u_int32_t val)
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +053081{
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -070082 if (!soc || !soc->ops) {
83 QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
84 "%s: Invalid Instance:", __func__);
85 QDF_BUG(0);
86 return 0;
87 }
88
89 if (!soc->ops->ctrl_ops ||
90 !soc->ops->ctrl_ops->txrx_set_filter_neighbour_peers)
91 return 0;
92
93 return soc->ops->ctrl_ops->txrx_set_filter_neighbour_peers
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +053094 (pdev, val);
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +053095}
Pratik Gandhi8b8334b2017-03-09 17:41:40 +053096
97/**
98 * @brief update the neighbour peer addresses
99 * @details
100 * This defines interface function to update neighbour peers addresses
101 * which needs to be filtered
102 *
103 * @param soc - the pointer to soc object
Chaithanya Garrepalli95fc62f2018-07-24 18:52:27 +0530104 * @param vdev - the pointer to vdev
Pratik Gandhi8b8334b2017-03-09 17:41:40 +0530105 * @param cmd - add/del entry into peer table
106 * @param macaddr - the address of neighbour peer
107 * @return - int
108 */
109static inline int
110cdp_update_filter_neighbour_peers(ol_txrx_soc_handle soc,
Chaithanya Garrepalli95fc62f2018-07-24 18:52:27 +0530111 struct cdp_vdev *vdev, uint32_t cmd, uint8_t *macaddr)
Pratik Gandhi8b8334b2017-03-09 17:41:40 +0530112{
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -0700113 if (!soc || !soc->ops) {
114 QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
115 "%s: Invalid Instance:", __func__);
116 QDF_BUG(0);
117 return 0;
118 }
119
120 if (!soc->ops->ctrl_ops ||
121 !soc->ops->ctrl_ops->txrx_update_filter_neighbour_peers)
122 return 0;
123
124 return soc->ops->ctrl_ops->txrx_update_filter_neighbour_peers
Chaithanya Garrepalli95fc62f2018-07-24 18:52:27 +0530125 (vdev, cmd, macaddr);
Pratik Gandhi8b8334b2017-03-09 17:41:40 +0530126}
127
Dhanashri Atrefe5662c2016-03-25 12:57:53 -0700128/**
129 * @brief set the safemode of the device
130 * @details
131 * This flag is used to bypass the encrypt and decrypt processes when send and
132 * receive packets. It works like open AUTH mode, HW will treate all packets
133 * as non-encrypt frames because no key installed. For rx fragmented frames,
134 * it bypasses all the rx defragmentaion.
135 *
136 * @param vdev - the data virtual device object
137 * @param val - the safemode state
138 * @return - void
139 */
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530140static inline void
141cdp_set_safemode(ol_txrx_soc_handle soc,
Venkata Sharath Chandra Manchalaf2a125a2016-11-28 18:10:11 -0800142 struct cdp_vdev *vdev, u_int32_t val)
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530143{
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -0700144 if (!soc || !soc->ops) {
145 QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
146 "%s: Invalid Instance:", __func__);
147 QDF_BUG(0);
148 return;
149 }
150
151 if (!soc->ops->ctrl_ops ||
152 !soc->ops->ctrl_ops->txrx_set_safemode)
153 return;
154
155 soc->ops->ctrl_ops->txrx_set_safemode(vdev, val);
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530156}
Dhanashri Atrefe5662c2016-03-25 12:57:53 -0700157/**
158 * @brief configure the drop unencrypted frame flag
159 * @details
160 * Rx related. When set this flag, all the unencrypted frames
161 * received over a secure connection will be discarded
162 *
163 * @param vdev - the data virtual device object
164 * @param val - flag
165 * @return - void
166 */
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530167static inline void
168cdp_set_drop_unenc(ol_txrx_soc_handle soc,
Venkata Sharath Chandra Manchalaf2a125a2016-11-28 18:10:11 -0800169 struct cdp_vdev *vdev, u_int32_t val)
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530170{
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -0700171 if (!soc || !soc->ops) {
172 QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
173 "%s: Invalid Instance:", __func__);
174 QDF_BUG(0);
175 return;
176 }
177
178 if (!soc->ops->ctrl_ops ||
179 !soc->ops->ctrl_ops->txrx_set_drop_unenc)
180 return;
181
182 soc->ops->ctrl_ops->txrx_set_drop_unenc(vdev, val);
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530183}
Dhanashri Atrefe5662c2016-03-25 12:57:53 -0700184
185
186/**
187 * @brief set the Tx encapsulation type of the VDEV
188 * @details
189 * This will be used to populate the HTT desc packet type field during Tx
190 *
191 * @param vdev - the data virtual device object
Nandha Kishore Easwaranfb0a7e52017-02-03 21:18:49 +0530192 * @param val - the Tx encap type (htt_cmn_pkt_type)
Dhanashri Atrefe5662c2016-03-25 12:57:53 -0700193 * @return - void
194 */
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530195static inline void
196cdp_set_tx_encap_type(ol_txrx_soc_handle soc,
Venkata Sharath Chandra Manchalaf2a125a2016-11-28 18:10:11 -0800197 struct cdp_vdev *vdev, enum htt_cmn_pkt_type val)
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530198{
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -0700199 if (!soc || !soc->ops) {
200 QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
201 "%s: Invalid Instance:", __func__);
202 QDF_BUG(0);
203 return;
204 }
205
206 if (!soc->ops->ctrl_ops ||
207 !soc->ops->ctrl_ops->txrx_set_tx_encap_type)
208 return;
209
210 soc->ops->ctrl_ops->txrx_set_tx_encap_type(vdev, val);
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530211}
Dhanashri Atrefe5662c2016-03-25 12:57:53 -0700212
213/**
214 * @brief set the Rx decapsulation type of the VDEV
215 * @details
216 * This will be used to configure into firmware and hardware which format to
217 * decap all Rx packets into, for all peers under the VDEV.
218 *
219 * @param vdev - the data virtual device object
Nandha Kishore Easwaranfb0a7e52017-02-03 21:18:49 +0530220 * @param val - the Rx decap mode (htt_cmn_pkt_type)
Dhanashri Atrefe5662c2016-03-25 12:57:53 -0700221 * @return - void
222 */
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530223static inline void
224cdp_set_vdev_rx_decap_type(ol_txrx_soc_handle soc,
Venkata Sharath Chandra Manchalaf2a125a2016-11-28 18:10:11 -0800225 struct cdp_vdev *vdev, enum htt_cmn_pkt_type val)
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530226{
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -0700227 if (!soc || !soc->ops) {
228 QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
229 "%s: Invalid Instance:", __func__);
230 QDF_BUG(0);
231 return;
232 }
233
234 if (!soc->ops->ctrl_ops ||
235 !soc->ops->ctrl_ops->txrx_set_vdev_rx_decap_type)
236 return;
237
238 soc->ops->ctrl_ops->txrx_set_vdev_rx_decap_type
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530239 (vdev, val);
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530240}
Dhanashri Atrefe5662c2016-03-25 12:57:53 -0700241
242/**
243 * @brief get the Rx decapsulation type of the VDEV
244 *
245 * @param vdev - the data virtual device object
Nandha Kishore Easwaranfb0a7e52017-02-03 21:18:49 +0530246 * @return - the Rx decap type (htt_cmn_pkt_type)
Dhanashri Atrefe5662c2016-03-25 12:57:53 -0700247 */
Nandha Kishore Easwaranfb0a7e52017-02-03 21:18:49 +0530248static inline enum htt_cmn_pkt_type
Venkata Sharath Chandra Manchalaf2a125a2016-11-28 18:10:11 -0800249cdp_get_vdev_rx_decap_type(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530250{
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -0700251 if (!soc || !soc->ops) {
252 QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
253 "%s: Invalid Instance:", __func__);
254 QDF_BUG(0);
255 return 0;
256 }
257
258 if (!soc->ops->ctrl_ops ||
259 !soc->ops->ctrl_ops->txrx_get_vdev_rx_decap_type)
260 return 0;
261
262 return soc->ops->ctrl_ops->txrx_get_vdev_rx_decap_type(vdev);
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530263}
Dhanashri Atrefe5662c2016-03-25 12:57:53 -0700264
Tallapragada Kalyanfd1edcc2017-03-07 19:34:29 +0530265/**
266 * @brief set the Reo Destination ring for the pdev
267 * @details
268 * This will be used to configure the Reo Destination ring for this pdev.
269 *
270 * @param soc - pointer to the soc
271 * @param pdev - the data physical device object
272 * @param val - the Reo destination ring index (1 to 4)
273 * @return - void
274 */
275static inline void
276cdp_set_pdev_reo_dest(ol_txrx_soc_handle soc,
277 struct cdp_pdev *pdev, enum cdp_host_reo_dest_ring val)
278{
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -0700279 if (!soc || !soc->ops) {
280 QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
281 "%s: Invalid Instance:", __func__);
282 QDF_BUG(0);
283 return;
284 }
285
286 if (!soc->ops->ctrl_ops ||
287 !soc->ops->ctrl_ops->txrx_set_pdev_reo_dest)
288 return;
289
290 soc->ops->ctrl_ops->txrx_set_pdev_reo_dest
Tallapragada Kalyanfd1edcc2017-03-07 19:34:29 +0530291 (pdev, val);
Tallapragada Kalyanfd1edcc2017-03-07 19:34:29 +0530292}
293
294/**
295 * @brief get the Reo Destination ring for the pdev
296 *
297 * @param soc - pointer to the soc
298 * @param pdev - the data physical device object
299 * @return - the Reo destination ring index (1 to 4), 0 if not supported.
300 */
301static inline enum cdp_host_reo_dest_ring
302cdp_get_pdev_reo_dest(ol_txrx_soc_handle soc, struct cdp_pdev *pdev)
303{
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -0700304 if (!soc || !soc->ops) {
305 QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
306 "%s: Invalid Instance:", __func__);
307 QDF_BUG(0);
308 return cdp_host_reo_dest_ring_unknown;
309 }
310
311 if (!soc->ops->ctrl_ops ||
312 !soc->ops->ctrl_ops->txrx_get_pdev_reo_dest)
313 return cdp_host_reo_dest_ring_unknown;
314
315 return soc->ops->ctrl_ops->txrx_get_pdev_reo_dest(pdev);
Tallapragada Kalyanfd1edcc2017-03-07 19:34:29 +0530316}
317
Dhanashri Atrefe5662c2016-03-25 12:57:53 -0700318/* Is this similar to ol_txrx_peer_state_update() in MCL */
319/**
320 * @brief Update the authorize peer object at association time
321 * @details
322 * For the host-based implementation of rate-control, it
323 * updates the peer/node-related parameters within rate-control
324 * context of the peer at association.
325 *
326 * @param peer - pointer to the node's object
327 * @authorize - either to authorize or unauthorize peer
328 *
329 * @return none
330 */
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530331static inline void
332cdp_peer_authorize(ol_txrx_soc_handle soc,
c_cgodavbd5b3c22017-06-07 12:31:40 +0530333 struct cdp_peer *peer, u_int32_t authorize)
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530334{
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -0700335 if (!soc || !soc->ops) {
336 QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
337 "%s: Invalid Instance:", __func__);
338 QDF_BUG(0);
339 return;
340 }
341
342 if (!soc->ops->ctrl_ops ||
343 !soc->ops->ctrl_ops->txrx_peer_authorize)
344 return;
345
346 soc->ops->ctrl_ops->txrx_peer_authorize
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530347 (peer, authorize);
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530348}
Dhanashri Atrefe5662c2016-03-25 12:57:53 -0700349
Dhanashri Atrefe5662c2016-03-25 12:57:53 -0700350/* Should be ol_txrx_ctrl_api.h */
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530351static inline void cdp_set_mesh_mode
Venkata Sharath Chandra Manchalaf2a125a2016-11-28 18:10:11 -0800352(ol_txrx_soc_handle soc, struct cdp_vdev *vdev, u_int32_t val)
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530353{
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -0700354 if (!soc || !soc->ops) {
355 QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
356 "%s: Invalid Instance:", __func__);
357 QDF_BUG(0);
358 return;
359 }
360
361 if (!soc->ops->ctrl_ops ||
362 !soc->ops->ctrl_ops->txrx_set_mesh_mode)
363 return;
364
365 soc->ops->ctrl_ops->txrx_set_mesh_mode(vdev, val);
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530366}
Dhanashri Atrefe5662c2016-03-25 12:57:53 -0700367
Venkateswara Swamy Bandaruec4f8e62017-03-07 11:04:28 +0530368/**
369 * @brief set mesh rx filter
370 * @details based on the bits enabled in the filter packets has to be dropped.
371 *
372 * @param soc - pointer to the soc
373 * @param vdev - the data virtual device object
374 * @param val - value to be set
375 * @return - void
376 */
377static inline
378void cdp_set_mesh_rx_filter(ol_txrx_soc_handle soc,
379 struct cdp_vdev *vdev, uint32_t val)
380{
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -0700381 if (!soc || !soc->ops) {
382 QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
383 "%s: Invalid Instance:", __func__);
384 QDF_BUG(0);
385 return;
386 }
387
388 if (!soc->ops->ctrl_ops ||
389 !soc->ops->ctrl_ops->txrx_set_mesh_rx_filter)
390 return;
391
392 soc->ops->ctrl_ops->txrx_set_mesh_rx_filter(vdev, val);
Venkateswara Swamy Bandaruec4f8e62017-03-07 11:04:28 +0530393}
394
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530395static inline void cdp_tx_flush_buffers
Venkata Sharath Chandra Manchalaf2a125a2016-11-28 18:10:11 -0800396(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530397{
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -0700398 if (!soc || !soc->ops) {
399 QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
400 "%s: Invalid Instance:", __func__);
401 QDF_BUG(0);
402 return;
403 }
404
405 if (!soc->ops->ctrl_ops ||
406 !soc->ops->ctrl_ops->tx_flush_buffers)
407 return;
408
409 soc->ops->ctrl_ops->tx_flush_buffers(vdev);
Nandha Kishore Easwarane5444bc2016-10-20 13:23:23 +0530410}
Dhanashri Atrefe5662c2016-03-25 12:57:53 -0700411
phadiman4213e9c2018-10-29 12:50:02 +0530412static inline uint32_t cdp_txrx_get_vdev_param(ol_txrx_soc_handle soc,
413 struct cdp_vdev *vdev,
414 enum cdp_vdev_param_type type)
415{
416 if (!soc || !soc->ops) {
417 QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
418 "%s: Invalid Instance:", __func__);
419 QDF_BUG(0);
420 return -1;
421 }
422
423 if (!soc->ops->ctrl_ops ||
424 !soc->ops->ctrl_ops->txrx_get_vdev_param) {
425 QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
426 "%s: callback not registered:", __func__);
427 return -1;
428 }
429
430 return soc->ops->ctrl_ops->txrx_get_vdev_param(vdev, type);
431}
432
Ishank Jain9f174c62017-03-30 18:37:42 +0530433static inline void cdp_txrx_set_vdev_param(ol_txrx_soc_handle soc,
434 struct cdp_vdev *vdev, enum cdp_vdev_param_type type,
435 uint32_t val)
436{
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -0700437 if (!soc || !soc->ops) {
438 QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
439 "%s: Invalid Instance:", __func__);
440 QDF_BUG(0);
441 return;
442 }
443
444 if (!soc->ops->ctrl_ops ||
445 !soc->ops->ctrl_ops->txrx_set_vdev_param)
446 return;
447
448 soc->ops->ctrl_ops->txrx_set_vdev_param(vdev, type, val);
Ishank Jain9f174c62017-03-30 18:37:42 +0530449}
450
451static inline void
452cdp_peer_set_nawds(ol_txrx_soc_handle soc,
c_cgodavbd5b3c22017-06-07 12:31:40 +0530453 struct cdp_peer *peer, uint8_t value)
Ishank Jain9f174c62017-03-30 18:37:42 +0530454{
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -0700455 if (!soc || !soc->ops) {
456 QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
457 "%s: Invalid Instance:", __func__);
458 QDF_BUG(0);
459 return;
460 }
461
462 if (!soc->ops->ctrl_ops ||
463 !soc->ops->ctrl_ops->txrx_peer_set_nawds)
464 return;
465
466 soc->ops->ctrl_ops->txrx_peer_set_nawds
Ishank Jain9f174c62017-03-30 18:37:42 +0530467 (peer, value);
Ishank Jain9f174c62017-03-30 18:37:42 +0530468}
Nandha Kishore Easwaran26689942017-04-17 16:52:46 +0530469
Varsha Mishra6e1760c2019-07-27 22:51:42 +0530470#ifdef QCA_MULTIPASS_SUPPORT
471static inline void
472cdp_peer_set_vlan_id(ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
473 uint8_t *peer_mac, uint8_t vlan_id)
474{
475 if (!soc || !soc->ops) {
476 QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
477 "%s: Invalid Instance:", __func__);
478 QDF_BUG(0);
479 return;
480 }
481
482 if (!soc->ops->ctrl_ops ||
483 !soc->ops->ctrl_ops->txrx_peer_set_vlan_id)
484 return;
485
486 soc->ops->ctrl_ops->txrx_peer_set_vlan_id(soc, vdev, peer_mac, vlan_id);
487}
488#endif
489
Chaithanya Garrepalli7ab76ae2018-07-05 14:53:50 +0530490/**
491 * cdp_txrx_set_pdev_param() - set pdev parameter
492 * @soc: opaque soc handle
493 * @pdev: data path pdev handle
494 * @type: param type
495 * @val: value of pdev_tx_capture
496 *
497 * Return: status: 0 - Success, non-zero: Failure
498 */
499static inline QDF_STATUS cdp_txrx_set_pdev_param(ol_txrx_soc_handle soc,
500 struct cdp_pdev *pdev,
501 enum cdp_pdev_param_type type,
Kai Chen99efa0d2019-08-20 17:51:27 -0700502 uint32_t val)
Soumya Bhatcfbb8952017-10-03 15:04:09 +0530503{
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -0700504 if (!soc || !soc->ops) {
505 QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
506 "%s: Invalid Instance:", __func__);
507 QDF_BUG(0);
Chaithanya Garrepalli7ab76ae2018-07-05 14:53:50 +0530508 return QDF_STATUS_SUCCESS;
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -0700509 }
Soumya Bhatcfbb8952017-10-03 15:04:09 +0530510
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -0700511 if (!soc->ops->ctrl_ops ||
512 !soc->ops->ctrl_ops->txrx_set_pdev_param)
Chaithanya Garrepalli7ab76ae2018-07-05 14:53:50 +0530513 return QDF_STATUS_SUCCESS;
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -0700514
Chaithanya Garrepalli7ab76ae2018-07-05 14:53:50 +0530515 return soc->ops->ctrl_ops->txrx_set_pdev_param
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -0700516 (pdev, type, val);
Soumya Bhatcfbb8952017-10-03 15:04:09 +0530517}
518
Nandha Kishore Easwaran26689942017-04-17 16:52:46 +0530519/**
Keyur Parekhc28f8392018-11-21 02:50:56 -0800520 * cdp_enable_peer_based_pktlog()- Set flag in peer structure
521 *
522 * @soc: pointer to the soc
523 * @pdev: the data physical device object
524 * @enable: enable or disable peer based filter based pktlog
525 * @peer_macaddr: Mac address of peer which needs to be
526 * filtered
527 *
528 * This function will set flag in peer structure if peer based filtering
529 * is enabled for pktlog
530 *
531 * Return: int
532 */
533static inline int
534cdp_enable_peer_based_pktlog(ol_txrx_soc_handle soc,
535 struct cdp_pdev *pdev, char *peer_macaddr,
536 uint8_t enable)
537{
538 if (!soc || !soc->ops) {
539 QDF_TRACE_ERROR(QDF_MODULE_ID_DP,
540 "%s invalid instance", __func__);
541 QDF_BUG(0);
542 return 0;
543 }
544
545 if (!soc->ops->ctrl_ops ||
546 !soc->ops->ctrl_ops->enable_peer_based_pktlog)
547 return 0;
548
549 return soc->ops->ctrl_ops->enable_peer_based_pktlog
550 (pdev, peer_macaddr, enable);
551}
552
553/**
Varsha Mishraa331e6e2019-03-11 12:16:14 +0530554 * cdp_calculate_delay_stats()- get rx delay stats
555 *
556 * @soc: pointer to the soc
557 * @vdev: vdev handle
558 * @nbuf: nbuf which is passed
559 *
560 * This function will calculate rx delay statistics.
561 */
562static inline void
563cdp_calculate_delay_stats(ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
564 qdf_nbuf_t nbuf)
565{
566 if (!soc || !soc->ops) {
567 QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
568 "%s: Invalid Instance:", __func__);
569 QDF_BUG(0);
570 return;
571 }
572
573 if (!soc->ops->ctrl_ops ||
574 !soc->ops->ctrl_ops->calculate_delay_stats) {
575 QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
576 "%s: callback not registered:", __func__);
577 return;
578 }
579
580 return soc->ops->ctrl_ops->calculate_delay_stats(vdev, nbuf);
581}
582
583/**
Nandha Kishore Easwaran26689942017-04-17 16:52:46 +0530584 * @brief Subscribe to a specified WDI event.
585 * @details
586 * This function adds the provided wdi_event_subscribe object to a list of
587 * subscribers for the specified WDI event.
588 * When the event in question happens, each subscriber for the event will
589 * have their callback function invoked.
590 * The order in which callback functions from multiple subscribers are
591 * invoked is unspecified.
592 *
593 * @param soc - pointer to the soc
594 * @param pdev - the data physical device object
595 * @param event_cb_sub - the callback and context for the event subscriber
596 * @param event - which event's notifications are being subscribed to
597 * @return - int
598 */
599static inline int
600cdp_wdi_event_sub(ol_txrx_soc_handle soc,
601 struct cdp_pdev *pdev, void *event_cb_sub, uint32_t event)
602{
Venkata Sharath Chandra Manchala78e64782018-01-18 14:22:07 -0800603
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -0700604 if (!soc || !soc->ops) {
605 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
Nandha Kishore Easwaran26689942017-04-17 16:52:46 +0530606 "%s invalid instance", __func__);
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -0700607 QDF_BUG(0);
Nandha Kishore Easwaran26689942017-04-17 16:52:46 +0530608 return 0;
609 }
610
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -0700611 if (!soc->ops->ctrl_ops ||
612 !soc->ops->ctrl_ops->txrx_wdi_event_sub)
613 return 0;
614
615 return soc->ops->ctrl_ops->txrx_wdi_event_sub
Nandha Kishore Easwaran26689942017-04-17 16:52:46 +0530616 (pdev, event_cb_sub, event);
Nandha Kishore Easwaran26689942017-04-17 16:52:46 +0530617}
618
619/**
620 * @brief Unsubscribe from a specified WDI event.
621 * @details
622 * This function removes the provided event subscription object from the
623 * list of subscribers for its event.
624 * This function shall only be called if there was a successful prior call
625 * to event_sub() on the same wdi_event_subscribe object.
626 *
627 * @param soc - pointer to the soc
628 * @param pdev - the data physical device object
629 * @param event_cb_sub - the callback and context for the event subscriber
630 * @param event - which event's notifications are being subscribed to
631 * @return - int
632 */
633static inline int
634cdp_wdi_event_unsub(ol_txrx_soc_handle soc,
635 struct cdp_pdev *pdev, void *event_cb_sub, uint32_t event)
636{
Venkata Sharath Chandra Manchala78e64782018-01-18 14:22:07 -0800637
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -0700638 if (!soc || !soc->ops) {
639 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
Nandha Kishore Easwaran26689942017-04-17 16:52:46 +0530640 "%s invalid instance", __func__);
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -0700641 QDF_BUG(0);
Nandha Kishore Easwaran26689942017-04-17 16:52:46 +0530642 return 0;
643 }
644
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -0700645 if (!soc->ops->ctrl_ops ||
646 !soc->ops->ctrl_ops->txrx_wdi_event_unsub)
647 return 0;
648
649 return soc->ops->ctrl_ops->txrx_wdi_event_unsub
Nandha Kishore Easwaran26689942017-04-17 16:52:46 +0530650 (pdev, event_cb_sub, event);
Nandha Kishore Easwaran26689942017-04-17 16:52:46 +0530651}
c_cgodavbd5b3c22017-06-07 12:31:40 +0530652
653/**
654 * @brief Get security type from the from peer.
655 * @details
656 * This function gets the Security information from the peer handler.
657 * The security information is got from the rx descriptor and filled in
658 * to the peer handler.
659 *
660 * @param soc - pointer to the soc
661 * @param peer - peer handler
662 * @param sec_idx - mcast or ucast frame type.
663 * @return - int
664 */
665static inline int
666cdp_get_sec_type(ol_txrx_soc_handle soc, struct cdp_peer *peer, uint8_t sec_idx)
667{
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -0700668 if (!soc || !soc->ops) {
669 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
c_cgodavbd5b3c22017-06-07 12:31:40 +0530670 "%s invalid instance", __func__);
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -0700671 QDF_BUG(0);
c_cgodavbd5b3c22017-06-07 12:31:40 +0530672 return A_ERROR;
673 }
674
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -0700675 if (!soc->ops->ctrl_ops ||
676 !soc->ops->ctrl_ops->txrx_get_sec_type)
677 return A_ERROR;
c_cgodavbd5b3c22017-06-07 12:31:40 +0530678
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -0700679 return soc->ops->ctrl_ops->txrx_get_sec_type
680 (peer, sec_idx);
c_cgodavbd5b3c22017-06-07 12:31:40 +0530681}
Kiran Venkatappae2f43352017-08-23 22:14:44 +0530682
683/**
684 * cdp_set_mgmt_tx_power(): function to set tx power for mgmt frames
685 * @vdev_handle: vdev handle
686 * @subtype_index: subtype
687 * @tx_power: Tx power
688 * Return: None
689 */
690static inline int cdp_set_mgmt_tx_power(ol_txrx_soc_handle soc,
691 struct cdp_vdev *vdev, uint8_t subtype, uint8_t tx_power)
692{
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -0700693 if (!soc || !soc->ops) {
694 QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
695 "%s: Invalid Instance:", __func__);
696 QDF_BUG(0);
697 return 0;
698 }
Kiran Venkatappae2f43352017-08-23 22:14:44 +0530699
Venkata Sharath Chandra Manchalaaa62ae72017-10-20 00:00:54 -0700700 if (!soc->ops->ctrl_ops ||
701 !soc->ops->ctrl_ops->txrx_update_mgmt_txpow_vdev)
702 return 0;
703
704 soc->ops->ctrl_ops->txrx_update_mgmt_txpow_vdev(vdev,
705 subtype, tx_power);
Kiran Venkatappae2f43352017-08-23 22:14:44 +0530706 return 0;
707}
Venkata Sharath Chandra Manchala09adf532017-11-03 14:44:35 -0700708
709static inline void *
710cdp_get_pldev(ol_txrx_soc_handle soc,
711 struct cdp_pdev *pdev)
712{
713 if (!soc || !soc->ops) {
714 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
715 "%s invalid instance", __func__);
716 QDF_BUG(0);
717 return NULL;
718 }
719
720 if (!soc->ops->ctrl_ops || !soc->ops->ctrl_ops->txrx_get_pldev)
721 return NULL;
722
723 return soc->ops->ctrl_ops->txrx_get_pldev(pdev);
724}
725
Padma Raghunathanfe453df2019-10-08 10:35:06 +0530726#if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE)
727/**
728 * cdp_cfr_filter() - Configure Host RX monitor status ring for CFR
729 * @soc: SOC TXRX handle
730 * @pdev_id: ID of the physical device object
731 * @enable: Enable or disable CFR
732 * @filter_val: Flag to select filter for monitor mode
733 */
734static inline void
735cdp_cfr_filter(ol_txrx_soc_handle soc,
736 uint8_t pdev_id,
737 bool enable,
738 struct cdp_monitor_filter *filter_val)
739{
740 if (!soc || !soc->ops) {
741 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
742 "%s invalid instance", __func__);
743 QDF_BUG(0);
744 return;
745 }
746
747 if (!soc->ops->cfr_ops || !soc->ops->cfr_ops->txrx_cfr_filter)
748 return;
749
750 soc->ops->cfr_ops->txrx_cfr_filter(soc, pdev_id, enable, filter_val);
751}
752#endif
753
Sumeet Rao511db292019-07-22 11:42:48 -0700754#if defined(WLAN_TX_PKT_CAPTURE_ENH) || defined(WLAN_RX_PKT_CAPTURE_ENH)
755/**
756 * cdp_update_peer_pkt_capture_params() - Sets Rx & Tx Capture params for a peer
757 * @soc: SOC TXRX handle
758 * @pdev: CDP pdev pointer
759 * @is_rx_pkt_cap_enable: enable/disable rx pkt capture for this peer
760 * @is_tx_pkt_cap_enable: enable/disable tx pkt capture for this peer
761 * @peer_mac: MAC address of peer for which pkt_cap is to be enabled/disabled
762 *
763 * Return: Success when matching peer is found & flags are set, error otherwise
764 */
765static inline QDF_STATUS
766cdp_update_peer_pkt_capture_params(ol_txrx_soc_handle soc,
767 struct cdp_pdev *pdev,
768 bool is_rx_pkt_cap_enable,
769 bool is_tx_pkt_cap_enable,
770 uint8_t *peer_mac)
771{
772 if (!soc || !soc->ops) {
773 dp_err("Invalid SOC instance");
774 QDF_BUG(0);
775 return QDF_STATUS_E_FAILURE;
776 }
777
778 if (!soc->ops->ctrl_ops ||
779 !soc->ops->ctrl_ops->txrx_update_peer_pkt_capture_params)
780 return QDF_STATUS_E_FAILURE;
781
782 return soc->ops->ctrl_ops->txrx_update_peer_pkt_capture_params
783 (pdev, is_rx_pkt_cap_enable, is_tx_pkt_cap_enable,
784 peer_mac);
785}
786#endif /* WLAN_TX_PKT_CAPTURE_ENH || WLAN_RX_PKT_CAPTURE_ENH */
787
Karunakar Dasineni142f9ba2019-03-19 23:04:59 -0700788#ifdef WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG
789/**
790 * cdp_update_pdev_rx_protocol_tag() - wrapper function to set the protocol
791 * tag in CDP layer from cfg layer
792 * @soc: SOC TXRX handle
793 * @pdev: CDP pdev pointer
794 * @protocol_mask: Bitmap for protocol for which tagging is enabled
795 * @protocol_type: Protocol type for which the tag should be update
796 * @tag: Actual tag value for the given prototype
797 * Return: Returns QDF_STATUS_SUCCESS/FAILURE
798 */
799static inline QDF_STATUS
800cdp_update_pdev_rx_protocol_tag(ol_txrx_soc_handle soc,
801 struct cdp_pdev *pdev, uint32_t protocol_mask,
802 uint16_t protocol_type, uint16_t tag)
803{
804 if (!soc || !soc->ops) {
805 dp_err("Invalid SOC instance");
806 QDF_BUG(0);
807 return QDF_STATUS_E_FAILURE;
808 }
809
810 if (!soc->ops->ctrl_ops ||
811 !soc->ops->ctrl_ops->txrx_update_pdev_rx_protocol_tag)
812 return QDF_STATUS_E_FAILURE;
813
814 return soc->ops->ctrl_ops->txrx_update_pdev_rx_protocol_tag
815 (pdev, protocol_mask, protocol_type, tag);
816}
817
818#ifdef WLAN_SUPPORT_RX_TAG_STATISTICS
819/**
820 * cdp_dump_pdev_rx_protocol_tag_stats() - wrapper function to dump the protocol
821 tag statistics for given or all protocols
822 * @soc: SOC TXRX handle
823 * @pdev: CDP pdev pointer
824 * @protocol_type: Protocol type for which the tag should be update
825 * Return: Returns QDF_STATUS_SUCCESS/FAILURE
826 */
827static inline QDF_STATUS
828cdp_dump_pdev_rx_protocol_tag_stats(ol_txrx_soc_handle soc,
829 struct cdp_pdev *pdev,
830 uint16_t protocol_type)
831{
832 if (!soc || !soc->ops) {
833 dp_err("Invalid SOC instance");
834 QDF_BUG(0);
835 return QDF_STATUS_E_FAILURE;
836 }
837
838 if (!soc->ops->ctrl_ops ||
839 !soc->ops->ctrl_ops->txrx_dump_pdev_rx_protocol_tag_stats)
840 return QDF_STATUS_E_FAILURE;
841
842 soc->ops->ctrl_ops->txrx_dump_pdev_rx_protocol_tag_stats(pdev,
843 protocol_type);
844 return QDF_STATUS_SUCCESS;
845}
846#endif /* WLAN_SUPPORT_RX_TAG_STATISTICS */
847#endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG */
848
Soumya Bhatbc719e62018-02-18 18:21:25 +0530849#ifdef ATH_SUPPORT_NAC_RSSI
850/**
851 * cdp_vdev_config_for_nac_rssi(): To invoke dp callback for nac rssi config
852 * @soc: soc pointer
853 * @vdev: vdev pointer
854 * @nac_cmd: specfies nac_rss config action add, del, list
855 * @bssid: Neighbour bssid
856 * @client_macaddr: Non-Associated client MAC
857 * @chan_num: channel number to scan
858 *
859 * Return: QDF_STATUS
860 */
861static inline QDF_STATUS cdp_vdev_config_for_nac_rssi(ol_txrx_soc_handle soc,
862 struct cdp_vdev *vdev, enum cdp_nac_param_cmd nac_cmd,
863 char *bssid, char *client_macaddr, uint8_t chan_num)
864{
865 if (!soc || !soc->ops) {
866 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
867 "%s invalid instance", __func__);
868 QDF_BUG(0);
869 return QDF_STATUS_E_FAILURE;
870 }
871
872 if (!soc->ops->ctrl_ops ||
873 !soc->ops->ctrl_ops->txrx_vdev_config_for_nac_rssi)
874 return QDF_STATUS_E_FAILURE;
875
876 return soc->ops->ctrl_ops->txrx_vdev_config_for_nac_rssi(vdev,
877 nac_cmd, bssid, client_macaddr, chan_num);
878}
Chaithanya Garrepalli95fc62f2018-07-24 18:52:27 +0530879
880/*
881 * cdp_vdev_get_neighbour_rssi(): To invoke dp callback to get rssi value of nac
882 * @soc: soc pointer
883 * @vdev: vdev pointer
884 * @macaddr: Non-Associated client MAC
885 * @rssi: rssi
886 *
887 * Return: QDF_STATUS
888 */
889static inline QDF_STATUS cdp_vdev_get_neighbour_rssi(ol_txrx_soc_handle soc,
890 struct cdp_vdev *vdev,
891 char *macaddr,
892 uint8_t *rssi)
893{
894 if (!soc || !soc->ops) {
895 QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
896 "%s invalid instance", __func__);
897 QDF_BUG(0);
898 return QDF_STATUS_E_FAILURE;
899 }
900
901 if (!soc->ops->ctrl_ops ||
902 !soc->ops->ctrl_ops->txrx_vdev_get_neighbour_rssi)
903 return QDF_STATUS_E_FAILURE;
904
905 return soc->ops->ctrl_ops->txrx_vdev_get_neighbour_rssi(vdev, macaddr,
906 rssi);
907}
Soumya Bhatbc719e62018-02-18 18:21:25 +0530908#endif
Sumeet Raoc4fa4df2019-07-05 02:11:19 -0700909
910#ifdef WLAN_SUPPORT_RX_FLOW_TAG
911/**
912 * cdp_set_rx_flow_tag() - wrapper function to set the flow
913 * tag in CDP layer from cfg layer
914 * @soc: SOC TXRX handle
915 * @pdev: CDP pdev pointer
916 * @flow_info: Flow 5-tuple, along with tag, if any, that needs to added/deleted
917 *
918 * Return: Success when add/del operation is successful, error otherwise
919 */
920static inline QDF_STATUS
921cdp_set_rx_flow_tag(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
922 struct cdp_rx_flow_info *flow_info)
923{
924 if (!soc || !soc->ops) {
925 dp_err("Invalid SOC instance");
926 QDF_BUG(0);
927 return QDF_STATUS_E_FAILURE;
928 }
929
930 if (!soc->ops->ctrl_ops ||
931 !soc->ops->ctrl_ops->txrx_set_rx_flow_tag)
932 return QDF_STATUS_E_FAILURE;
933
934 return soc->ops->ctrl_ops->txrx_set_rx_flow_tag(pdev, flow_info);
935}
936
937/**
938 * cdp_dump_rx_flow_tag_stats() - wrapper function to dump the flow
939 * tag statistics for given flow
940 * @soc: SOC TXRX handle
941 * @pdev: CDP pdev pointer
942 * @flow_info: Flow tuple for which we want to print the statistics
943 *
944 * Return: Success when flow is found and stats are printed, error otherwise
945 */
946static inline QDF_STATUS
947cdp_dump_rx_flow_tag_stats(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
948 struct cdp_rx_flow_info *flow_info)
949{
950 if (!soc || !soc->ops) {
951 dp_err("Invalid SOC instance");
952 QDF_BUG(0);
953 return QDF_STATUS_E_FAILURE;
954 }
955
956 if (!soc->ops->ctrl_ops ||
957 !soc->ops->ctrl_ops->txrx_dump_rx_flow_tag_stats)
958 return QDF_STATUS_E_FAILURE;
959
960 return soc->ops->ctrl_ops->txrx_dump_rx_flow_tag_stats(pdev, flow_info);
961}
962#endif /* WLAN_SUPPORT_RX_FLOW_TAG */
963#endif /* _CDP_TXRX_CTRL_H_ */