xref: /wlan-dirver/qca-wifi-host-cmn/dp/inc/cdp_txrx_ctrl.h (revision 97f44cd39e4ff816eaa1710279d28cf6b9e65ad9)
1 /*
2  * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved.
3  *
4  * 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 
19 /**
20  * @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_
27 #include "cdp_txrx_handle.h"
28 #include "cdp_txrx_cmn_struct.h"
29 #include "cdp_txrx_cmn.h"
30 #include "cdp_txrx_ops.h"
31 
32 static inline int cdp_is_target_ar900b
33 	(ol_txrx_soc_handle soc)
34 {
35 	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(soc);
47 }
48 
49 
50 /* WIN */
51 static inline int
52 cdp_mempools_attach(ol_txrx_soc_handle soc)
53 {
54 	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(soc);
66 }
67 
68 
69 #if defined(ATH_SUPPORT_NAC) || defined(ATH_SUPPORT_NAC_RSSI)
70 /**
71  * @brief update the neighbour peer addresses
72  * @details
73  *  This defines interface function to update neighbour peers addresses
74  *  which needs to be filtered
75  *
76  * @param soc - the pointer to soc object
77  * @param vdev_id - id of the pointer to vdev
78  * @param cmd - add/del entry into peer table
79  * @param macaddr - the address of neighbour peer
80  * @return - int
81  */
82 static inline int
83 cdp_update_filter_neighbour_peers(ol_txrx_soc_handle soc,
84 	uint8_t vdev_id, uint32_t cmd, uint8_t *macaddr)
85 {
86 	if (!soc || !soc->ops) {
87 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
88 				"%s: Invalid Instance:", __func__);
89 		QDF_BUG(0);
90 		return 0;
91 	}
92 
93 	if (!soc->ops->ctrl_ops ||
94 	    !soc->ops->ctrl_ops->txrx_update_filter_neighbour_peers)
95 		return 0;
96 
97 	return soc->ops->ctrl_ops->txrx_update_filter_neighbour_peers
98 			(soc, vdev_id, cmd, macaddr);
99 }
100 #endif /* ATH_SUPPORT_NAC || ATH_SUPPORT_NAC_RSSI*/
101 
102 #ifdef WLAN_SUPPORT_MSCS
103 /**
104  * @brief record the MSCS data and send it to the Data path
105  * @details
106  *  This defines interface function to record the MSCS procedure
107  *  based data parameters so that the data path layer can access it
108  *
109  * @param soc - the pointer to soc object
110  * @param vdev_id - id of the pointer to vdev
111  * @param macaddr - the address of neighbour peer
112  * @param mscs_params - Structure having MSCS params
113  * obtained from handshake
114  * @return - QDF_STATUS
115  */
116 static inline QDF_STATUS
117 cdp_record_vdev_mscs_params(ol_txrx_soc_handle soc, uint8_t
118 		*macaddr, uint8_t vdev_id, struct cdp_mscs_params *mscs_params,
119 		bool active)
120 {
121 	if (!soc || !soc->ops) {
122 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
123 			  "%s: Invalid Instance:",
124 			  __func__);
125 		QDF_BUG(0);
126 		return QDF_STATUS_E_FAILURE;
127 	}
128 
129 	if (!soc->ops->ctrl_ops ||
130 	    !soc->ops->ctrl_ops->txrx_record_mscs_params)
131 		return QDF_STATUS_E_FAILURE;
132 	return soc->ops->ctrl_ops->txrx_record_mscs_params
133 			(soc, macaddr, vdev_id, mscs_params, active);
134 }
135 #endif
136 
137 /**
138  * @brief set the Reo Destination ring for the pdev
139  * @details
140  *  This will be used to configure the Reo Destination ring for this pdev.
141  *
142  * @param soc - pointer to the soc
143  * @param pdev_id - id of the data physical device object
144  * @param val - the Reo destination ring index (1 to 4)
145  * @return - QDF_STATUS
146  */
147 static inline QDF_STATUS
148 cdp_set_pdev_reo_dest(ol_txrx_soc_handle soc,
149 		      uint8_t pdev_id, enum cdp_host_reo_dest_ring val)
150 {
151 	if (!soc || !soc->ops) {
152 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
153 				"%s: Invalid Instance:", __func__);
154 		QDF_BUG(0);
155 		return QDF_STATUS_E_FAILURE;
156 	}
157 
158 	if (!soc->ops->ctrl_ops ||
159 	    !soc->ops->ctrl_ops->txrx_set_pdev_reo_dest)
160 		return QDF_STATUS_E_FAILURE;
161 
162 	return soc->ops->ctrl_ops->txrx_set_pdev_reo_dest
163 			(soc, pdev_id, val);
164 }
165 
166 /**
167  * @brief get the Reo Destination ring for the pdev
168  *
169  * @param soc - pointer to the soc
170  * @param pdev_id - id of physical device object
171  * @return - the Reo destination ring index (1 to 4), 0 if not supported.
172  */
173 static inline enum cdp_host_reo_dest_ring
174 cdp_get_pdev_reo_dest(ol_txrx_soc_handle soc, uint8_t pdev_id)
175 {
176 	if (!soc || !soc->ops) {
177 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
178 				"%s: Invalid Instance:", __func__);
179 		QDF_BUG(0);
180 		return cdp_host_reo_dest_ring_unknown;
181 	}
182 
183 	if (!soc->ops->ctrl_ops ||
184 	    !soc->ops->ctrl_ops->txrx_get_pdev_reo_dest)
185 		return cdp_host_reo_dest_ring_unknown;
186 
187 	return soc->ops->ctrl_ops->txrx_get_pdev_reo_dest(soc, pdev_id);
188 }
189 
190 /* Is this similar to ol_txrx_peer_state_update() in MCL */
191 /**
192  * @brief Update the authorize peer object at association time
193  * @details
194  *  For the host-based implementation of rate-control, it
195  *  updates the peer/node-related parameters within rate-control
196  *  context of the peer at association.
197  *
198  * @param soc - pointer to the soc
199  * @param vdev_id - id of the pointer to vdev
200  * @param peer_mac - mac address of the node's object
201  * @authorize - either to authorize or unauthorize peer
202  *
203  * @return QDF_STATUS
204  */
205 static inline QDF_STATUS
206 cdp_peer_authorize(ol_txrx_soc_handle soc, uint8_t vdev_id, uint8_t *peer_mac,
207 		   u_int32_t authorize)
208 {
209 	if (!soc || !soc->ops) {
210 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
211 				"%s: Invalid Instance:", __func__);
212 		QDF_BUG(0);
213 		return QDF_STATUS_E_FAILURE;
214 	}
215 
216 	if (!soc->ops->ctrl_ops ||
217 	    !soc->ops->ctrl_ops->txrx_peer_authorize)
218 		return QDF_STATUS_E_FAILURE;
219 
220 	return soc->ops->ctrl_ops->txrx_peer_authorize
221 			(soc, vdev_id, peer_mac, authorize);
222 }
223 
224 static inline void cdp_tx_flush_buffers
225 (ol_txrx_soc_handle soc, uint8_t vdev_id)
226 {
227 	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->tx_flush_buffers)
236 		return;
237 
238 	soc->ops->ctrl_ops->tx_flush_buffers(soc, vdev_id);
239 }
240 
241 static inline QDF_STATUS cdp_txrx_get_vdev_param(ol_txrx_soc_handle soc,
242 						 uint8_t vdev_id,
243 						 enum cdp_vdev_param_type type,
244 						 cdp_config_param_type *val)
245 {
246 	if (!soc || !soc->ops) {
247 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
248 			  "%s: Invalid Instance:", __func__);
249 		QDF_BUG(0);
250 		return QDF_STATUS_E_FAILURE;
251 	}
252 
253 	if (!soc->ops->ctrl_ops ||
254 	    !soc->ops->ctrl_ops->txrx_get_vdev_param) {
255 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
256 			  "%s: callback not registered:", __func__);
257 		return QDF_STATUS_E_FAILURE;
258 	}
259 
260 	return soc->ops->ctrl_ops->txrx_get_vdev_param(soc, vdev_id,
261 						       type, val);
262 }
263 
264 static inline QDF_STATUS
265 cdp_txrx_set_vdev_param(ol_txrx_soc_handle soc,
266 			uint8_t vdev_id, enum cdp_vdev_param_type type,
267 			cdp_config_param_type val)
268 {
269 	if (!soc || !soc->ops) {
270 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
271 				"%s: Invalid Instance:", __func__);
272 		QDF_BUG(0);
273 		return QDF_STATUS_E_FAILURE;
274 	}
275 
276 	if (!soc->ops->ctrl_ops ||
277 	    !soc->ops->ctrl_ops->txrx_set_vdev_param) {
278 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
279 			  "NULL vdev params callback");
280 		return QDF_STATUS_E_FAILURE;
281 	}
282 
283 	return soc->ops->ctrl_ops->txrx_set_vdev_param(soc, vdev_id,
284 						       type, val);
285 }
286 
287 static inline QDF_STATUS
288 cdp_txrx_set_psoc_param(ol_txrx_soc_handle soc,
289 			enum cdp_psoc_param_type type,
290 			cdp_config_param_type val)
291 {
292 	if (!soc || !soc->ops) {
293 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
294 				"%s: Invalid Instance:", __func__);
295 		QDF_BUG(0);
296 		return QDF_STATUS_E_FAILURE;
297 	}
298 
299 	if (!soc->ops->ctrl_ops ||
300 	    !soc->ops->ctrl_ops->txrx_set_psoc_param)
301 		return QDF_STATUS_E_FAILURE;
302 
303 	return soc->ops->ctrl_ops->txrx_set_psoc_param(soc, type, val);
304 }
305 
306 static inline QDF_STATUS
307 cdp_txrx_get_psoc_param(ol_txrx_soc_handle soc,
308 			enum cdp_psoc_param_type type,
309 			cdp_config_param_type *val)
310 {
311 	if (!soc || !soc->ops) {
312 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
313 				"%s: Invalid Instance:", __func__);
314 		QDF_BUG(0);
315 		return QDF_STATUS_E_FAILURE;
316 	}
317 
318 	if (!soc->ops->ctrl_ops ||
319 	    !soc->ops->ctrl_ops->txrx_get_psoc_param)
320 		return QDF_STATUS_E_FAILURE;
321 
322 	return soc->ops->ctrl_ops->txrx_get_psoc_param(soc, type, val);
323 }
324 
325 #ifdef VDEV_PEER_PROTOCOL_COUNT
326 /**
327  * cdp_set_vdev_peer_protocol_count() - set per-peer protocol count tracking
328  *
329  * @soc - pointer to the soc
330  * @vdev - the data virtual device object
331  * @enable - enable per-peer protocol count
332  *
333  * Set per-peer protocol count feature enable
334  *
335  * Return: void
336  */
337 static inline
338 void cdp_set_vdev_peer_protocol_count(ol_txrx_soc_handle soc, int8_t vdev_id,
339 				      bool enable)
340 {
341 	if (!soc || !soc->ops) {
342 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
343 			  "%s: Invalid Instance:", __func__);
344 		QDF_BUG(0);
345 		return;
346 	}
347 
348 	if (!soc->ops->ctrl_ops ||
349 	    !soc->ops->ctrl_ops->txrx_enable_peer_protocol_count)
350 		return;
351 
352 	soc->ops->ctrl_ops->txrx_enable_peer_protocol_count(soc, vdev_id,
353 							    enable);
354 }
355 
356 /**
357  * cdp_set_vdev_peer_protocol_drop_mask() - set per-peer protocol drop mask
358  *
359  * @soc - pointer to the soc
360  * @vdev - the data virtual device object
361  * @drop_mask - drop_mask
362  *
363  * Set per-peer protocol drop_mask
364  *
365  * Return - void
366  */
367 static inline
368 void cdp_set_vdev_peer_protocol_drop_mask(ol_txrx_soc_handle soc,
369 					  int8_t vdev_id, int drop_mask)
370 {
371 	if (!soc || !soc->ops) {
372 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
373 			  "%s: Invalid Instance:", __func__);
374 		QDF_BUG(0);
375 		return;
376 	}
377 
378 	if (!soc->ops->ctrl_ops ||
379 	    !soc->ops->ctrl_ops->txrx_set_peer_protocol_drop_mask)
380 		return;
381 
382 	soc->ops->ctrl_ops->txrx_set_peer_protocol_drop_mask(soc, vdev_id,
383 							 drop_mask);
384 }
385 
386 /**
387  * cdp_is_vdev_peer_protocol_count_enabled() - whether peer-protocol tracking
388  *                                             enabled
389  *
390  * @soc - pointer to the soc
391  * @vdev - the data virtual device object
392  *
393  * Get whether peer protocol count feature enabled or not
394  *
395  * Return: whether feature enabled or not
396  */
397 static inline
398 int cdp_is_vdev_peer_protocol_count_enabled(ol_txrx_soc_handle soc,
399 					    int8_t vdev_id)
400 {
401 	if (!soc || !soc->ops) {
402 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
403 			  "%s: Invalid Instance:", __func__);
404 		QDF_BUG(0);
405 		return 0;
406 	}
407 
408 	if (!soc->ops->ctrl_ops ||
409 	    !soc->ops->ctrl_ops->txrx_is_peer_protocol_count_enabled)
410 		return 0;
411 
412 	return soc->ops->ctrl_ops->txrx_is_peer_protocol_count_enabled(soc,
413 								   vdev_id);
414 }
415 
416 /**
417  * cdp_get_peer_protocol_drop_mask() - get per-peer protocol count drop-mask
418  *
419  * @soc - pointer to the soc
420  * @vdev - the data virtual device object
421  *
422  * Get peer-protocol-count drop-mask
423  *
424  * Return: peer-protocol-count drop-mask
425  */
426 static inline
427 int cdp_get_peer_protocol_drop_mask(ol_txrx_soc_handle soc, int8_t vdev_id)
428 {
429 	if (!soc || !soc->ops) {
430 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
431 			  "%s: Invalid Instance:", __func__);
432 		QDF_BUG(0);
433 		return 0;
434 	}
435 
436 	if (!soc->ops->ctrl_ops ||
437 	    !soc->ops->ctrl_ops->txrx_get_peer_protocol_drop_mask)
438 		return 0;
439 
440 	return soc->ops->ctrl_ops->txrx_get_peer_protocol_drop_mask(soc,
441 								    vdev_id);
442 }
443 
444 /*
445  * Rx-Ingress and Tx-Egress are in the lower level DP layer
446  * Rx-Egress and Tx-ingress are handled in osif layer for DP
447  * So
448  * Rx-Ingress and Tx-Egress definitions are in DP layer
449  * Rx-Egress and Tx-ingress mask definitions are here below
450  */
451 #define VDEV_PEER_PROTOCOL_RX_INGRESS_MASK 1
452 #define VDEV_PEER_PROTOCOL_TX_INGRESS_MASK 2
453 #define VDEV_PEER_PROTOCOL_RX_EGRESS_MASK 4
454 #define VDEV_PEER_PROTOCOL_TX_EGRESS_MASK 8
455 
456 #else
457 #define cdp_set_vdev_peer_protocol_count(soc, vdev_id, enable)
458 #define cdp_set_vdev_peer_protocol_drop_mask(soc, vdev_id, drop_mask)
459 #define cdp_is_vdev_peer_protocol_count_enabled(soc, vdev_id) 0
460 #define cdp_get_peer_protocol_drop_mask(soc, vdev_id) 0
461 #endif
462 
463 /**
464  * cdp_txrx_set_pdev_param() - set pdev parameter
465  * @soc: opaque soc handle
466  * @pdev_id: id of data path pdev handle
467  * @type: param type
468  * @val: value
469  *
470  * Return: status: 0 - Success, non-zero: Failure
471  */
472 static inline QDF_STATUS cdp_txrx_set_pdev_param(ol_txrx_soc_handle soc,
473 						 uint8_t pdev_id,
474 						 enum cdp_pdev_param_type type,
475 						 cdp_config_param_type val)
476 {
477 	if (!soc || !soc->ops) {
478 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
479 				"%s: Invalid Instance:", __func__);
480 		QDF_BUG(0);
481 		return QDF_STATUS_E_FAILURE;
482 	}
483 
484 	if (!soc->ops->ctrl_ops ||
485 	    !soc->ops->ctrl_ops->txrx_set_pdev_param)
486 		return QDF_STATUS_E_FAILURE;
487 
488 	return soc->ops->ctrl_ops->txrx_set_pdev_param
489 			(soc, pdev_id, type, val);
490 }
491 
492 /**
493  * cdp_txrx_set_peer_param() - set pdev parameter
494  * @soc: opaque soc handle
495  * @vdev_id: id of data path vdev handle
496  * @peer_mac: peer mac address
497  * @type: param type
498  * @val: value
499  *
500  * Return: status: 0 - Success, non-zero: Failure
501  */
502 static inline QDF_STATUS cdp_txrx_set_peer_param(ol_txrx_soc_handle soc,
503 						 uint8_t vdev_id,
504 						 uint8_t *peer_mac,
505 						 enum cdp_peer_param_type type,
506 						 cdp_config_param_type val)
507 {
508 	if (!soc || !soc->ops) {
509 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
510 				"%s: Invalid Instance:", __func__);
511 		QDF_BUG(0);
512 		return QDF_STATUS_E_FAILURE;
513 	}
514 
515 	if (!soc->ops->ctrl_ops ||
516 	    !soc->ops->ctrl_ops->txrx_set_peer_param)
517 		return QDF_STATUS_E_FAILURE;
518 
519 	return soc->ops->ctrl_ops->txrx_set_peer_param
520 			(soc, vdev_id, peer_mac, type, val);
521 }
522 
523 /**
524  * cdp_txrx_get_peer_param() - set pdev parameter
525  * @soc: opaque soc handle
526  * @vdev_id: id of data path vdev handle
527  * @peer_mac: peer mac address
528  * @type: param type
529  * @val: address of buffer
530  *
531  * Return: status
532  */
533 static inline QDF_STATUS cdp_txrx_get_peer_param(ol_txrx_soc_handle soc,
534 						 uint8_t vdev_id,
535 						 uint8_t *peer_mac,
536 						 enum cdp_peer_param_type type,
537 						 cdp_config_param_type *val)
538 {
539 	if (!soc || !soc->ops) {
540 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
541 				"%s: Invalid Instance:", __func__);
542 		QDF_BUG(0);
543 		return QDF_STATUS_E_FAILURE;
544 	}
545 
546 	if (!soc->ops->ctrl_ops ||
547 	    !soc->ops->ctrl_ops->txrx_get_peer_param)
548 		return QDF_STATUS_E_FAILURE;
549 
550 	return soc->ops->ctrl_ops->txrx_get_peer_param
551 			(soc, vdev_id, peer_mac, type, val);
552 }
553 
554 #ifdef QCA_MULTIPASS_SUPPORT
555 static inline void
556 cdp_peer_set_vlan_id(ol_txrx_soc_handle soc, uint8_t vdev_id,
557 		     uint8_t *peer_mac, uint8_t vlan_id)
558 {
559 	if (!soc || !soc->ops) {
560 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
561 			  "%s: Invalid Instance:", __func__);
562 		QDF_BUG(0);
563 		return;
564 	}
565 
566 	if (!soc->ops->ctrl_ops ||
567 	    !soc->ops->ctrl_ops->txrx_peer_set_vlan_id)
568 		return;
569 
570 	soc->ops->ctrl_ops->txrx_peer_set_vlan_id(soc, vdev_id, peer_mac,
571 						  vlan_id);
572 }
573 #endif
574 
575 /**
576  * cdp_txrx_get_pdev_param() - get pdev parameter
577  * @soc: opaque soc handle
578  * @pdev_id: id of data path pdev handle
579  * @type: param type
580  * @value: address of value buffer
581  *
582  * Return: status
583  */
584 static inline QDF_STATUS cdp_txrx_get_pdev_param(ol_txrx_soc_handle soc,
585 						 uint8_t pdev_id,
586 						 enum cdp_pdev_param_type type,
587 						 cdp_config_param_type *value)
588 {
589 	if (!soc || !soc->ops) {
590 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
591 				"%s: Invalid Instance:", __func__);
592 		QDF_BUG(0);
593 		return QDF_STATUS_E_FAILURE;
594 	}
595 
596 	if (!soc->ops->ctrl_ops ||
597 	    !soc->ops->ctrl_ops->txrx_get_pdev_param)
598 		return QDF_STATUS_E_FAILURE;
599 
600 	return soc->ops->ctrl_ops->txrx_get_pdev_param
601 			(soc, pdev_id, type, value);
602 }
603 
604 /**
605  * cdp_txrx_peer_protocol_cnt() - set peer protocol count
606  * @soc: opaque soc handle
607  * @vdev: opaque vdev handle
608  * @nbuf: data packet
609  * @is_egress: whether egress or ingress
610  * @is_rx: whether tx or rx
611  *
612  * Return: void
613  */
614 #ifdef VDEV_PEER_PROTOCOL_COUNT
615 static inline void
616 cdp_txrx_peer_protocol_cnt(ol_txrx_soc_handle soc,
617 			   int8_t vdev_id,
618 			   qdf_nbuf_t nbuf,
619 			   enum vdev_peer_protocol_enter_exit is_egress,
620 			   enum vdev_peer_protocol_tx_rx is_rx)
621 {
622 	if (!soc || !soc->ops) {
623 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
624 			  "%s: Invalid Instance:", __func__);
625 		QDF_BUG(0);
626 		return;
627 	}
628 
629 	if (!soc->ops->ctrl_ops ||
630 	    !soc->ops->ctrl_ops->txrx_peer_protocol_cnt)
631 		return;
632 
633 	soc->ops->ctrl_ops->txrx_peer_protocol_cnt(soc, vdev_id, nbuf,
634 						   is_egress, is_rx);
635 }
636 #else
637 #define cdp_txrx_peer_protocol_cnt(soc, vdev_id, nbuf, is_egress, is_rx)
638 #endif
639 
640 /**
641  * cdp_enable_peer_based_pktlog()- Set flag in peer structure
642  *
643  * @soc: pointer to the soc
644  * @pdev_id: id of the data physical device object
645  * @enable: enable or disable peer based filter based pktlog
646  * @peer_macaddr: Mac address of peer which needs to be
647  * filtered
648  *
649  * This function will set flag in peer structure if peer based filtering
650  * is enabled for pktlog
651  *
652  * Return: int
653  */
654 static inline int
655 cdp_enable_peer_based_pktlog(ol_txrx_soc_handle soc, uint8_t pdev_id,
656 			     char *peer_macaddr,
657 			     uint8_t enable)
658 {
659 	if (!soc || !soc->ops) {
660 		QDF_TRACE_ERROR(QDF_MODULE_ID_DP,
661 				"%s invalid instance", __func__);
662 		QDF_BUG(0);
663 		return 0;
664 	}
665 
666 	if (!soc->ops->ctrl_ops ||
667 	    !soc->ops->ctrl_ops->enable_peer_based_pktlog)
668 		return 0;
669 
670 	return soc->ops->ctrl_ops->enable_peer_based_pktlog
671 			(soc, pdev_id, peer_macaddr, enable);
672 }
673 
674 /**
675  * cdp_calculate_delay_stats()- get rx delay stats
676  *
677  * @soc: pointer to the soc
678  * @vdev_id: id of vdev handle
679  * @nbuf: nbuf which is passed
680  *
681  * This function will calculate rx delay statistics.
682  */
683 static inline QDF_STATUS
684 cdp_calculate_delay_stats(ol_txrx_soc_handle soc, uint8_t vdev_id,
685 			  qdf_nbuf_t nbuf)
686 {
687 	if (!soc || !soc->ops) {
688 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
689 			  "%s: Invalid Instance:", __func__);
690 		QDF_BUG(0);
691 		return QDF_STATUS_E_FAILURE;
692 	}
693 
694 	if (!soc->ops->ctrl_ops ||
695 	    !soc->ops->ctrl_ops->calculate_delay_stats) {
696 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
697 			  "%s: callback not registered:", __func__);
698 		return QDF_STATUS_E_FAILURE;
699 	}
700 
701 	return soc->ops->ctrl_ops->calculate_delay_stats(soc, vdev_id, nbuf);
702 }
703 
704 /**
705  * @brief Subscribe to a specified WDI event.
706  * @details
707  *  This function adds the provided wdi_event_subscribe object to a list of
708  *  subscribers for the specified WDI event.
709  *  When the event in question happens, each subscriber for the event will
710  *  have their callback function invoked.
711  *  The order in which callback functions from multiple subscribers are
712  *  invoked is unspecified.
713  *
714  * @param soc - pointer to the soc
715  * @param pdev_id - id of the data physical device object
716  * @param event_cb_sub - the callback and context for the event subscriber
717  * @param event - which event's notifications are being subscribed to
718  * @return - int
719  */
720 static inline int
721 cdp_wdi_event_sub(ol_txrx_soc_handle soc, uint8_t pdev_id,
722 		  wdi_event_subscribe *event_cb_sub, uint32_t event)
723 {
724 
725 	if (!soc || !soc->ops) {
726 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
727 			  "%s invalid instance", __func__);
728 		QDF_BUG(0);
729 		return 0;
730 	}
731 
732 	if (!soc->ops->ctrl_ops ||
733 	    !soc->ops->ctrl_ops->txrx_wdi_event_sub)
734 		return 0;
735 
736 	return soc->ops->ctrl_ops->txrx_wdi_event_sub
737 			(soc, pdev_id, event_cb_sub, event);
738 }
739 
740 /**
741  * @brief Unsubscribe from a specified WDI event.
742  * @details
743  *  This function removes the provided event subscription object from the
744  *  list of subscribers for its event.
745  *  This function shall only be called if there was a successful prior call
746  *  to event_sub() on the same wdi_event_subscribe object.
747  *
748  * @param soc - pointer to the soc
749  * @param pdev_id - id of the data physical device object
750  * @param event_cb_sub - the callback and context for the event subscriber
751  * @param event - which event's notifications are being subscribed to
752  * @return - int
753  */
754 static inline int
755 cdp_wdi_event_unsub(ol_txrx_soc_handle soc,
756 		    uint8_t pdev_id, wdi_event_subscribe *event_cb_sub,
757 		    uint32_t event)
758 {
759 
760 	if (!soc || !soc->ops) {
761 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
762 			"%s invalid instance", __func__);
763 		QDF_BUG(0);
764 		return 0;
765 	}
766 
767 	if (!soc->ops->ctrl_ops ||
768 	    !soc->ops->ctrl_ops->txrx_wdi_event_unsub)
769 		return 0;
770 
771 	return soc->ops->ctrl_ops->txrx_wdi_event_unsub
772 			(soc, pdev_id, event_cb_sub, event);
773 }
774 
775 /**
776  * @brief Get security type from the from peer.
777  * @details
778  * This function gets the Security information from the peer handler.
779  * The security information is got from the rx descriptor and filled in
780  * to the peer handler.
781  *
782  * @param soc - pointer to the soc
783  * @param vdev_id - id of vdev handle
784  * @param peer mac - peer mac address
785  * @param sec_idx - mcast or ucast frame type.
786  * @return - int
787  */
788 static inline int
789 cdp_get_sec_type(ol_txrx_soc_handle soc, uint8_t vdev_id, uint8_t *peer_mac,
790 		 uint8_t sec_idx)
791 {
792 	if (!soc || !soc->ops) {
793 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
794 			  "%s invalid instance", __func__);
795 		QDF_BUG(0);
796 		return A_ERROR;
797 	}
798 
799 	if (!soc->ops->ctrl_ops ||
800 	    !soc->ops->ctrl_ops->txrx_get_sec_type)
801 		return A_ERROR;
802 
803 	return soc->ops->ctrl_ops->txrx_get_sec_type
804 		(soc, vdev_id, peer_mac, sec_idx);
805 }
806 
807 /**
808   * cdp_set_mgmt_tx_power(): function to set tx power for mgmt frames
809   * @param soc - pointer to the soc
810   * @vdev_id : id of vdev handle
811   * @subtype_index: subtype
812   * @tx_power: Tx power
813   * Return: QDF_STATUS
814   */
815 static inline QDF_STATUS
816 cdp_set_mgmt_tx_power(ol_txrx_soc_handle soc,
817 		      uint8_t vdev_id, uint8_t subtype, uint8_t tx_power)
818 {
819 	if (!soc || !soc->ops) {
820 		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
821 				"%s: Invalid Instance:", __func__);
822 		QDF_BUG(0);
823 		return QDF_STATUS_E_FAILURE;
824 	}
825 
826 	if (!soc->ops->ctrl_ops ||
827 	    !soc->ops->ctrl_ops->txrx_update_mgmt_txpow_vdev)
828 		return QDF_STATUS_E_FAILURE;
829 
830 	return soc->ops->ctrl_ops->txrx_update_mgmt_txpow_vdev(soc, vdev_id,
831 							subtype, tx_power);
832 }
833 
834 /**
835  * cdp_get_pldev() - function to get pktlog device handle
836  * @soc: datapath soc handle
837  * @pdev_id: physical device id
838  *
839  * Return: pktlog device handle or NULL
840  */
841 static inline void *
842 cdp_get_pldev(ol_txrx_soc_handle soc, uint8_t pdev_id)
843 {
844 	if (!soc || !soc->ops) {
845 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
846 			"%s invalid instance", __func__);
847 		QDF_BUG(0);
848 		return NULL;
849 	}
850 
851 	if (!soc->ops->ctrl_ops || !soc->ops->ctrl_ops->txrx_get_pldev)
852 		return NULL;
853 
854 	return soc->ops->ctrl_ops->txrx_get_pldev(soc, pdev_id);
855 }
856 
857 #if defined(WLAN_CFR_ENABLE) && defined(WLAN_ENH_CFR_ENABLE)
858 /**
859  * cdp_cfr_filter() - Configure Host RX monitor status ring for CFR
860  * @soc: SOC TXRX handle
861  * @pdev_id: ID of the physical device object
862  * @enable: Enable or disable CFR
863  * @filter_val: Flag to select filter for monitor mode
864  */
865 static inline void
866 cdp_cfr_filter(ol_txrx_soc_handle soc,
867 	       uint8_t pdev_id,
868 	       bool enable,
869 	       struct cdp_monitor_filter *filter_val)
870 {
871 	if (!soc || !soc->ops) {
872 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
873 			  "%s invalid instance", __func__);
874 		QDF_BUG(0);
875 		return;
876 	}
877 
878 	if (!soc->ops->cfr_ops || !soc->ops->cfr_ops->txrx_cfr_filter)
879 		return;
880 
881 	soc->ops->cfr_ops->txrx_cfr_filter(soc, pdev_id, enable, filter_val);
882 }
883 
884 /**
885  * cdp_get_cfr_rcc() - get cfr rcc config
886  * @soc: Datapath soc handle
887  * @pdev_id: id of objmgr pdev
888  *
889  * Return: true/false based on cfr mode setting
890  */
891 static inline
892 bool cdp_get_cfr_rcc(ol_txrx_soc_handle soc, uint8_t pdev_id)
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 0;
899 	}
900 
901 	if (!soc->ops->cfr_ops || !soc->ops->cfr_ops->txrx_get_cfr_rcc)
902 		return 0;
903 
904 	return soc->ops->cfr_ops->txrx_get_cfr_rcc(soc, pdev_id);
905 }
906 
907 /**
908  * cdp_set_cfr_rcc() - enable/disable cfr rcc config
909  * @soc: Datapath soc handle
910  * @pdev_id: id of objmgr pdev
911  * @enable: Enable/Disable cfr rcc mode
912  *
913  * Return: none
914  */
915 static inline
916 void cdp_set_cfr_rcc(ol_txrx_soc_handle soc, uint8_t pdev_id, bool enable)
917 {
918 	if (!soc || !soc->ops) {
919 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
920 			  "%s invalid instance", __func__);
921 		QDF_BUG(0);
922 		return;
923 	}
924 
925 	if (!soc->ops->cfr_ops || !soc->ops->cfr_ops->txrx_set_cfr_rcc)
926 		return;
927 
928 	return soc->ops->cfr_ops->txrx_set_cfr_rcc(soc, pdev_id, enable);
929 }
930 
931 /**
932  * cdp_get_cfr_dbg_stats() - Get debug statistics for CFR
933  *
934  * @soc: SOC TXRX handle
935  * @pdev_id: ID of the physical device object
936  * @buf: CFR RCC debug statistics buffer
937  *
938  * Return: None
939  */
940 static inline void
941 cdp_get_cfr_dbg_stats(ol_txrx_soc_handle soc, uint8_t pdev_id,
942 		      struct cdp_cfr_rcc_stats *buf)
943 {
944 	if (!soc || !soc->ops) {
945 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
946 			  "%s invalid instance", __func__);
947 		QDF_BUG(0);
948 		return;
949 	}
950 
951 	if (!soc->ops->cfr_ops || !soc->ops->cfr_ops->txrx_get_cfr_dbg_stats)
952 		return;
953 
954 	soc->ops->cfr_ops->txrx_get_cfr_dbg_stats(soc, pdev_id, buf);
955 }
956 
957 /**
958  * cdp_cfr_clr_dbg_stats() - Clear debug statistics for CFR
959  *
960  * @soc: SOC TXRX handle
961  * @pdev_id: ID of the physical device object
962  */
963 static inline void
964 cdp_cfr_clr_dbg_stats(ol_txrx_soc_handle soc, uint8_t pdev_id)
965 {
966 	if (!soc || !soc->ops) {
967 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
968 			  "%s invalid instance", __func__);
969 		QDF_BUG(0);
970 		return;
971 	}
972 
973 	if (!soc->ops->cfr_ops || !soc->ops->cfr_ops->txrx_clear_cfr_dbg_stats)
974 		return;
975 
976 	soc->ops->cfr_ops->txrx_clear_cfr_dbg_stats(soc, pdev_id);
977 }
978 
979 /**
980  * cdp_enable_mon_reap_timer() - enable/disable reap timer
981  * @soc: Datapath soc handle
982  * @pdev_id: id of objmgr pdev
983  * @enable: enable/disable reap timer of monitor status ring
984  *
985  * Return: none
986  */
987 static inline void
988 cdp_enable_mon_reap_timer(ol_txrx_soc_handle soc, uint8_t pdev_id,
989 			  bool enable)
990 {
991 	if (!soc || !soc->ops) {
992 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
993 			  "%s invalid instance", __func__);
994 		QDF_BUG(0);
995 		return;
996 	}
997 
998 	if (!soc->ops->cfr_ops ||
999 	    !soc->ops->cfr_ops->txrx_enable_mon_reap_timer)
1000 		return;
1001 
1002 	return soc->ops->cfr_ops->txrx_enable_mon_reap_timer(soc, pdev_id,
1003 							     enable);
1004 }
1005 #endif
1006 
1007 #if defined(WLAN_TX_PKT_CAPTURE_ENH) || defined(WLAN_RX_PKT_CAPTURE_ENH)
1008 /**
1009  * cdp_update_peer_pkt_capture_params() - Sets Rx & Tx Capture params for a peer
1010  * @soc: SOC TXRX handle
1011  * @pdev_id: id of CDP pdev pointer
1012  * @is_rx_pkt_cap_enable: enable/disable rx pkt capture for this peer
1013  * @is_tx_pkt_cap_enable: enable/disable tx pkt capture for this peer
1014  * @peer_mac: MAC address of peer for which pkt_cap is to be enabled/disabled
1015  *
1016  * Return: Success when matching peer is found & flags are set, error otherwise
1017  */
1018 static inline QDF_STATUS
1019 cdp_update_peer_pkt_capture_params(ol_txrx_soc_handle soc,
1020 				   uint8_t pdev_id,
1021 				   bool is_rx_pkt_cap_enable,
1022 				   uint8_t is_tx_pkt_cap_enable,
1023 				   uint8_t *peer_mac)
1024 {
1025 	if (!soc || !soc->ops) {
1026 		dp_err("Invalid SOC instance");
1027 		QDF_BUG(0);
1028 		return QDF_STATUS_E_FAILURE;
1029 	}
1030 
1031 	if (!soc->ops->ctrl_ops ||
1032 	    !soc->ops->ctrl_ops->txrx_update_peer_pkt_capture_params)
1033 		return QDF_STATUS_E_FAILURE;
1034 
1035 	return soc->ops->ctrl_ops->txrx_update_peer_pkt_capture_params
1036 			(soc, pdev_id, is_rx_pkt_cap_enable,
1037 			 is_tx_pkt_cap_enable, peer_mac);
1038 }
1039 #endif /* WLAN_TX_PKT_CAPTURE_ENH || WLAN_RX_PKT_CAPTURE_ENH */
1040 
1041 #ifdef WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG
1042 /**
1043  * cdp_update_pdev_rx_protocol_tag() - wrapper function to set the protocol
1044  *                                    tag in CDP layer from cfg layer
1045  * @soc: SOC TXRX handle
1046  * @pdev_id: id of CDP pdev pointer
1047  * @protocol_mask: Bitmap for protocol for which tagging is enabled
1048  * @protocol_type: Protocol type for which the tag should be update
1049  * @tag: Actual tag value for the given prototype
1050  * Return: Returns QDF_STATUS_SUCCESS/FAILURE
1051  */
1052 static inline QDF_STATUS
1053 cdp_update_pdev_rx_protocol_tag(ol_txrx_soc_handle soc,
1054 				uint8_t pdev_id, uint32_t protocol_mask,
1055 				uint16_t protocol_type, uint16_t tag)
1056 {
1057 	if (!soc || !soc->ops) {
1058 		dp_err("Invalid SOC instance");
1059 		QDF_BUG(0);
1060 		return QDF_STATUS_E_FAILURE;
1061 	}
1062 
1063 	if (!soc->ops->ctrl_ops ||
1064 	    !soc->ops->ctrl_ops->txrx_update_pdev_rx_protocol_tag)
1065 		return QDF_STATUS_E_FAILURE;
1066 
1067 	return soc->ops->ctrl_ops->txrx_update_pdev_rx_protocol_tag
1068 			(soc, pdev_id, protocol_mask, protocol_type, tag);
1069 }
1070 
1071 #ifdef WLAN_SUPPORT_RX_TAG_STATISTICS
1072 /**
1073  * cdp_dump_pdev_rx_protocol_tag_stats() - wrapper function to dump the protocol
1074 				tag statistics for given or all protocols
1075  * @soc: SOC TXRX handle
1076  * @pdev_id: id of CDP pdev pointer
1077  * @protocol_type: Protocol type for which the tag should be update
1078  * Return: Returns QDF_STATUS_SUCCESS/FAILURE
1079  */
1080 static inline QDF_STATUS
1081 cdp_dump_pdev_rx_protocol_tag_stats(ol_txrx_soc_handle soc,
1082 				    uint8_t pdev_id,
1083 				    uint16_t protocol_type)
1084 {
1085 	if (!soc || !soc->ops) {
1086 		dp_err("Invalid SOC instance");
1087 		QDF_BUG(0);
1088 		return QDF_STATUS_E_FAILURE;
1089 	}
1090 
1091 	if (!soc->ops->ctrl_ops ||
1092 	    !soc->ops->ctrl_ops->txrx_dump_pdev_rx_protocol_tag_stats)
1093 		return QDF_STATUS_E_FAILURE;
1094 
1095 	soc->ops->ctrl_ops->txrx_dump_pdev_rx_protocol_tag_stats(soc, pdev_id,
1096 						protocol_type);
1097 	return QDF_STATUS_SUCCESS;
1098 }
1099 #endif /* WLAN_SUPPORT_RX_TAG_STATISTICS */
1100 #endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG */
1101 
1102 #ifdef ATH_SUPPORT_NAC_RSSI
1103 /**
1104   * cdp_vdev_config_for_nac_rssi(): To invoke dp callback for nac rssi config
1105   * @soc: soc pointer
1106   * @vdev_id: id of vdev
1107   * @nac_cmd: specfies nac_rss config action add, del, list
1108   * @bssid: Neighbour bssid
1109   * @client_macaddr: Non-Associated client MAC
1110   * @chan_num: channel number to scan
1111   *
1112   * Return: QDF_STATUS
1113   */
1114 static inline QDF_STATUS cdp_vdev_config_for_nac_rssi(ol_txrx_soc_handle soc,
1115 		uint8_t vdev_id, enum cdp_nac_param_cmd nac_cmd,
1116 		char *bssid, char *client_macaddr, uint8_t chan_num)
1117 {
1118 	if (!soc || !soc->ops) {
1119 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
1120 			"%s invalid instance", __func__);
1121 		QDF_BUG(0);
1122 		return QDF_STATUS_E_FAILURE;
1123 	}
1124 
1125 	if (!soc->ops->ctrl_ops ||
1126 			!soc->ops->ctrl_ops->txrx_vdev_config_for_nac_rssi)
1127 		return QDF_STATUS_E_FAILURE;
1128 
1129 	return soc->ops->ctrl_ops->txrx_vdev_config_for_nac_rssi(soc, vdev_id,
1130 			nac_cmd, bssid, client_macaddr, chan_num);
1131 }
1132 
1133 /*
1134  * cdp_vdev_get_neighbour_rssi(): To invoke dp callback to get rssi value of nac
1135  * @soc: soc pointer
1136  * @vdev_id: id of vdev
1137  * @macaddr: Non-Associated client MAC
1138  * @rssi: rssi
1139  *
1140  * Return: QDF_STATUS
1141  */
1142 static inline QDF_STATUS cdp_vdev_get_neighbour_rssi(ol_txrx_soc_handle soc,
1143 						     uint8_t vdev_id,
1144 						     char *macaddr,
1145 						     uint8_t *rssi)
1146 {
1147 	if (!soc || !soc->ops) {
1148 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
1149 			  "%s invalid instance", __func__);
1150 		QDF_BUG(0);
1151 		return QDF_STATUS_E_FAILURE;
1152 	}
1153 
1154 	if (!soc->ops->ctrl_ops ||
1155 	    !soc->ops->ctrl_ops->txrx_vdev_get_neighbour_rssi)
1156 		return QDF_STATUS_E_FAILURE;
1157 
1158 	return soc->ops->ctrl_ops->txrx_vdev_get_neighbour_rssi(soc, vdev_id,
1159 								macaddr,
1160 								rssi);
1161 }
1162 #endif
1163 
1164 #ifdef WLAN_SUPPORT_RX_FLOW_TAG
1165 /**
1166  * cdp_set_rx_flow_tag() - wrapper function to set the flow
1167  *                         tag in CDP layer from cfg layer
1168  * @soc: SOC TXRX handle
1169  * @pdev_id: id of CDP pdev pointer
1170  * @flow_info: Flow 5-tuple, along with tag, if any, that needs to added/deleted
1171  *
1172  * Return: Success when add/del operation is successful, error otherwise
1173  */
1174 static inline QDF_STATUS
1175 cdp_set_rx_flow_tag(ol_txrx_soc_handle soc, uint8_t pdev_id,
1176 		    struct cdp_rx_flow_info *flow_info)
1177 {
1178 	if (!soc || !soc->ops) {
1179 		dp_err("Invalid SOC instance");
1180 		QDF_BUG(0);
1181 		return QDF_STATUS_E_FAILURE;
1182 	}
1183 
1184 	if (!soc->ops->ctrl_ops ||
1185 	    !soc->ops->ctrl_ops->txrx_set_rx_flow_tag)
1186 		return QDF_STATUS_E_FAILURE;
1187 
1188 	return soc->ops->ctrl_ops->txrx_set_rx_flow_tag(soc, pdev_id,
1189 				   flow_info);
1190 }
1191 
1192 /**
1193  * cdp_dump_rx_flow_tag_stats() - wrapper function to dump the flow
1194  *                                tag statistics for given flow
1195  * @soc: SOC TXRX handle
1196  * @pdev_id: id of CDP pdev
1197  * @flow_info: Flow tuple for which we want to print the statistics
1198  *
1199  * Return: Success when flow is found and stats are printed, error otherwise
1200  */
1201 static inline QDF_STATUS
1202 cdp_dump_rx_flow_tag_stats(ol_txrx_soc_handle soc, uint8_t pdev_id,
1203 			   struct cdp_rx_flow_info *flow_info)
1204 {
1205 	if (!soc || !soc->ops) {
1206 		dp_err("Invalid SOC instance");
1207 		QDF_BUG(0);
1208 		return QDF_STATUS_E_FAILURE;
1209 	}
1210 
1211 	if (!soc->ops->ctrl_ops ||
1212 	    !soc->ops->ctrl_ops->txrx_dump_rx_flow_tag_stats)
1213 		return QDF_STATUS_E_FAILURE;
1214 
1215 	return soc->ops->ctrl_ops->txrx_dump_rx_flow_tag_stats(soc,
1216 								pdev_id,
1217 								flow_info);
1218 }
1219 #endif /* WLAN_SUPPORT_RX_FLOW_TAG */
1220 #endif /* _CDP_TXRX_CTRL_H_ */
1221