xref: /wlan-dirver/qca-wifi-host-cmn/dp/wifi3.0/dp_tx.h (revision 77a23e8f71c7ca7f65185b02d0511610d22e9d61)
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 #ifndef __DP_TX_H
19 #define __DP_TX_H
20 
21 #include <qdf_types.h>
22 #include <qdf_nbuf.h>
23 #include "dp_types.h"
24 #if defined(MESH_MODE_SUPPORT) || defined(FEATURE_PERPKT_INFO)
25 #include "if_meta_hdr.h"
26 #endif
27 #include "dp_internal.h"
28 
29 #define DP_INVALID_VDEV_ID 0xFF
30 
31 #define DP_TX_MAX_NUM_FRAGS 6
32 
33 /*
34  * DP_TX_DESC_FLAG_FRAG flags should always be defined to 0x1
35  * please do not change this flag's definition
36  */
37 #define DP_TX_DESC_FLAG_FRAG		0x1
38 #define DP_TX_DESC_FLAG_TO_FW		0x2
39 #define DP_TX_DESC_FLAG_SIMPLE		0x4
40 #define DP_TX_DESC_FLAG_RAW		0x8
41 #define DP_TX_DESC_FLAG_MESH		0x10
42 #define DP_TX_DESC_FLAG_QUEUED_TX	0x20
43 #define DP_TX_DESC_FLAG_COMPLETED_TX	0x40
44 #define DP_TX_DESC_FLAG_ME		0x80
45 #define DP_TX_DESC_FLAG_TDLS_FRAME	0x100
46 #define DP_TX_DESC_FLAG_ALLOCATED	0x200
47 #define DP_TX_DESC_FLAG_MESH_MODE	0x400
48 
49 #define DP_TX_EXT_DESC_FLAG_METADATA_VALID 0x1
50 
51 #define DP_TX_FREE_SINGLE_BUF(soc, buf)                  \
52 do {                                                           \
53 	qdf_nbuf_unmap(soc->osdev, buf, QDF_DMA_TO_DEVICE);  \
54 	qdf_nbuf_free(buf);                                    \
55 } while (0)
56 
57 #define OCB_HEADER_VERSION	 1
58 
59 #ifdef TX_PER_PDEV_DESC_POOL
60 #ifdef QCA_LL_TX_FLOW_CONTROL_V2
61 #define DP_TX_GET_DESC_POOL_ID(vdev) (vdev->vdev_id)
62 #else /* QCA_LL_TX_FLOW_CONTROL_V2 */
63 #define DP_TX_GET_DESC_POOL_ID(vdev) (vdev->pdev->pdev_id)
64 #endif /* QCA_LL_TX_FLOW_CONTROL_V2 */
65 	#define DP_TX_GET_RING_ID(vdev) (vdev->pdev->pdev_id)
66 #else
67 	#ifdef TX_PER_VDEV_DESC_POOL
68 		#define DP_TX_GET_DESC_POOL_ID(vdev) (vdev->vdev_id)
69 		#define DP_TX_GET_RING_ID(vdev) (vdev->pdev->pdev_id)
70 	#endif /* TX_PER_VDEV_DESC_POOL */
71 #endif /* TX_PER_PDEV_DESC_POOL */
72 #define DP_TX_QUEUE_MASK 0x3
73 
74 /* number of dwords for htt_tx_msdu_desc_ext2_t */
75 #define DP_TX_MSDU_INFO_META_DATA_DWORDS 7
76 
77 #define dp_tx_alert(params...) QDF_TRACE_FATAL(QDF_MODULE_ID_DP_TX, params)
78 #define dp_tx_err(params...) QDF_TRACE_ERROR(QDF_MODULE_ID_DP_TX, params)
79 #define dp_tx_warn(params...) QDF_TRACE_WARN(QDF_MODULE_ID_DP_TX, params)
80 #define dp_tx_info(params...) \
81 	__QDF_TRACE_FL(QDF_TRACE_LEVEL_INFO_HIGH, QDF_MODULE_ID_DP_TX, ## params)
82 #define dp_tx_debug(params...) QDF_TRACE_DEBUG(QDF_MODULE_ID_DP_TX, params)
83 
84 #define dp_tx_comp_alert(params...) QDF_TRACE_FATAL(QDF_MODULE_ID_DP_TX_COMP, params)
85 #define dp_tx_comp_err(params...) QDF_TRACE_ERROR(QDF_MODULE_ID_DP_TX_COMP, params)
86 #define dp_tx_comp_warn(params...) QDF_TRACE_WARN(QDF_MODULE_ID_DP_TX_COMP, params)
87 #define dp_tx_comp_info(params...) \
88 	__QDF_TRACE_FL(QDF_TRACE_LEVEL_INFO_HIGH, QDF_MODULE_ID_DP_TX_COMP, ## params)
89 #define dp_tx_comp_debug(params...) QDF_TRACE_DEBUG(QDF_MODULE_ID_DP_TX_COMP, params)
90 
91 #ifndef QCA_HOST_MODE_WIFI_DISABLED
92 
93 /**
94  * struct dp_tx_frag_info_s
95  * @vaddr: hlos vritual address for buffer
96  * @paddr_lo: physical address lower 32bits
97  * @paddr_hi: physical address higher bits
98  * @len: length of the buffer
99  */
100 struct dp_tx_frag_info_s {
101 	uint8_t  *vaddr;
102 	uint32_t paddr_lo;
103 	uint16_t paddr_hi;
104 	uint16_t len;
105 };
106 
107 /**
108  * struct dp_tx_seg_info_s - Segmentation Descriptor
109  * @nbuf: NBUF pointer if segment corresponds to separate nbuf
110  * @frag_cnt: Fragment count in this segment
111  * @total_len: Total length of segment
112  * @frags: per-Fragment information
113  * @next: pointer to next MSDU segment
114  */
115 struct dp_tx_seg_info_s  {
116 	qdf_nbuf_t nbuf;
117 	uint16_t frag_cnt;
118 	uint16_t total_len;
119 	struct dp_tx_frag_info_s frags[DP_TX_MAX_NUM_FRAGS];
120 	struct dp_tx_seg_info_s *next;
121 };
122 
123 #endif /* QCA_HOST_MODE_WIFI_DISABLED */
124 
125 /**
126  * struct dp_tx_sg_info_s - Scatter Gather Descriptor
127  * @num_segs: Number of segments (TSO/ME) in the frame
128  * @total_len: Total length of the frame
129  * @curr_seg: Points to current segment descriptor to be processed. Chain of
130  * 	      descriptors for SG frames/multicast-unicast converted packets.
131  *
132  * Used for SG (802.3 or Raw) frames and Multicast-Unicast converted frames to
133  * carry fragmentation information
134  * Raw Frames will be handed over to driver as an SKB chain with MPDU boundaries
135  * indicated through flags in SKB CB (first_msdu and last_msdu). This will be
136  * converted into set of skb sg (nr_frags) structures.
137  */
138 struct dp_tx_sg_info_s {
139 	uint32_t num_segs;
140 	uint32_t total_len;
141 	struct dp_tx_seg_info_s *curr_seg;
142 };
143 
144 /**
145  * struct dp_tx_queue - Tx queue
146  * @desc_pool_id: Descriptor Pool to be used for the tx queue
147  * @ring_id: TCL descriptor ring ID corresponding to the tx queue
148  *
149  * Tx queue contains information of the software (Descriptor pool)
150  * and hardware resources (TCL ring id) to be used for a particular
151  * transmit queue (obtained from skb_queue_mapping in case of linux)
152  */
153 struct dp_tx_queue {
154 	uint8_t desc_pool_id;
155 	uint8_t ring_id;
156 };
157 
158 /**
159  * struct dp_tx_msdu_info_s - MSDU Descriptor
160  * @frm_type: Frame type - Regular/TSO/SG/Multicast enhancement
161  * @tx_queue: Tx queue on which this MSDU should be transmitted
162  * @num_seg: Number of segments (TSO)
163  * @tid: TID (override) that is sent from HLOS
164  * @u.tso_info: TSO information for TSO frame types
165  * 	     (chain of the TSO segments, number of segments)
166  * @u.sg_info: Scatter Gather information for non-TSO SG frames
167  * @meta_data: Mesh meta header information
168  * @exception_fw: Duplicate frame to be sent to firmware
169  * @ppdu_cookie: 16-bit ppdu_cookie that has to be replayed back in completions
170  * @ix_tx_sniffer: Indicates if the packet has to be sniffed
171  *
172  * This structure holds the complete MSDU information needed to program the
173  * Hardware TCL and MSDU extension descriptors for different frame types
174  *
175  */
176 struct dp_tx_msdu_info_s {
177 	enum dp_tx_frm_type frm_type;
178 	struct dp_tx_queue tx_queue;
179 	uint32_t num_seg;
180 	uint8_t tid;
181 	uint8_t exception_fw;
182 	uint8_t is_tx_sniffer;
183 	union {
184 		struct qdf_tso_info_t tso_info;
185 		struct dp_tx_sg_info_s sg_info;
186 	} u;
187 	uint32_t meta_data[DP_TX_MSDU_INFO_META_DATA_DWORDS];
188 	uint16_t ppdu_cookie;
189 };
190 
191 #ifndef QCA_HOST_MODE_WIFI_DISABLED
192 /**
193  * dp_tx_deinit_pair_by_index() - Deinit TX rings based on index
194  * @soc: core txrx context
195  * @index: index of ring to deinit
196  *
197  * Deinit 1 TCL and 1 WBM2SW release ring on as needed basis using
198  * index of the respective TCL/WBM2SW release in soc structure.
199  * For example, if the index is 2 then &soc->tcl_data_ring[2]
200  * and &soc->tx_comp_ring[2] will be deinitialized.
201  *
202  * Return: none
203  */
204 void dp_tx_deinit_pair_by_index(struct dp_soc *soc, int index);
205 #endif /* QCA_HOST_MODE_WIFI_DISABLED */
206 
207 void dp_tx_tso_cmn_desc_pool_deinit(struct dp_soc *soc, uint8_t num_pool);
208 void dp_tx_tso_cmn_desc_pool_free(struct dp_soc *soc, uint8_t num_pool);
209 QDF_STATUS dp_tx_tso_cmn_desc_pool_alloc(struct dp_soc *soc,
210 					 uint8_t num_pool,
211 					 uint16_t num_desc);
212 QDF_STATUS dp_tx_tso_cmn_desc_pool_init(struct dp_soc *soc,
213 					uint8_t num_pool,
214 					uint16_t num_desc);
215 
216 void dp_tx_tso_cmn_desc_pool_deinit(struct dp_soc *soc, uint8_t num_pool);
217 void dp_tx_tso_cmn_desc_pool_free(struct dp_soc *soc, uint8_t num_pool);
218 QDF_STATUS dp_tx_tso_cmn_desc_pool_alloc(struct dp_soc *soc,
219 					 uint8_t num_pool,
220 					 uint16_t num_desc);
221 QDF_STATUS dp_tx_tso_cmn_desc_pool_init(struct dp_soc *soc,
222 					uint8_t num_pool,
223 					uint16_t num_desc);
224 
225 #ifndef QCA_HOST_MODE_WIFI_DISABLED
226 /**
227  * dp_tso_attach() - TSO Attach handler
228  * @txrx_soc: Opaque Dp handle
229  *
230  * Reserve TSO descriptor buffers
231  *
232  * Return: QDF_STATUS_E_FAILURE on failure or
233  * QDF_STATUS_SUCCESS on success
234  */
235 QDF_STATUS dp_tso_soc_attach(struct cdp_soc_t *txrx_soc);
236 
237 /**
238  * dp_tso_detach() - TSO Detach handler
239  * @txrx_soc: Opaque Dp handle
240  *
241  * Deallocate TSO descriptor buffers
242  *
243  * Return: QDF_STATUS_E_FAILURE on failure or
244  * QDF_STATUS_SUCCESS on success
245  */
246 QDF_STATUS dp_tso_soc_detach(struct cdp_soc_t *txrx_soc);
247 
248 qdf_nbuf_t dp_tx_send(struct cdp_soc_t *soc, uint8_t vdev_id, qdf_nbuf_t nbuf);
249 
250 qdf_nbuf_t dp_tx_send_vdev_id_check(struct cdp_soc_t *soc, uint8_t vdev_id,
251 				    qdf_nbuf_t nbuf);
252 
253 qdf_nbuf_t dp_tx_send_exception(struct cdp_soc_t *soc, uint8_t vdev_id,
254 				qdf_nbuf_t nbuf,
255 				struct cdp_tx_exception_metadata *tx_exc);
256 
257 qdf_nbuf_t dp_tx_send_exception_vdev_id_check(struct cdp_soc_t *soc,
258 					      uint8_t vdev_id,
259 					      qdf_nbuf_t nbuf,
260 				struct cdp_tx_exception_metadata *tx_exc);
261 
262 qdf_nbuf_t dp_tx_send_mesh(struct cdp_soc_t *soc, uint8_t vdev_id,
263 			   qdf_nbuf_t nbuf);
264 qdf_nbuf_t
265 dp_tx_send_msdu_single(struct dp_vdev *vdev, qdf_nbuf_t nbuf,
266 		       struct dp_tx_msdu_info_s *msdu_info, uint16_t peer_id,
267 		       struct cdp_tx_exception_metadata *tx_exc_metadata);
268 
269 #if QDF_LOCK_STATS
270 noinline qdf_nbuf_t
271 dp_tx_send_msdu_multiple(struct dp_vdev *vdev, qdf_nbuf_t nbuf,
272 			 struct dp_tx_msdu_info_s *msdu_info);
273 #else
274 qdf_nbuf_t dp_tx_send_msdu_multiple(struct dp_vdev *vdev, qdf_nbuf_t nbuf,
275 				    struct dp_tx_msdu_info_s *msdu_info);
276 #endif
277 #ifdef FEATURE_WLAN_TDLS
278 /**
279  * dp_tx_non_std() - Allow the control-path SW to send data frames
280  * @soc_hdl: Datapath soc handle
281  * @vdev_id: id of vdev
282  * @tx_spec: what non-standard handling to apply to the tx data frames
283  * @msdu_list: NULL-terminated list of tx MSDUs
284  *
285  * Return: NULL on success,
286  *         nbuf when it fails to send
287  */
288 qdf_nbuf_t dp_tx_non_std(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
289 			 enum ol_tx_spec tx_spec, qdf_nbuf_t msdu_list);
290 #endif
291 int dp_tx_frame_is_drop(struct dp_vdev *vdev, uint8_t *srcmac, uint8_t *dstmac);
292 
293 /**
294  * dp_tx_comp_handler() - Tx completion handler
295  * @int_ctx: pointer to DP interrupt context
296  * @soc: core txrx main context
297  * @hal_srng: Opaque HAL SRNG pointer
298  * @ring_id: completion ring id
299  * @quota: No. of packets/descriptors that can be serviced in one loop
300  *
301  * This function will collect hardware release ring element contents and
302  * handle descriptor contents. Based on contents, free packet or handle error
303  * conditions
304  *
305  * Return: Number of TX completions processed
306  */
307 uint32_t dp_tx_comp_handler(struct dp_intr *int_ctx, struct dp_soc *soc,
308 			    hal_ring_handle_t hal_srng, uint8_t ring_id,
309 			    uint32_t quota);
310 
311 QDF_STATUS
312 dp_tx_prepare_send_me(struct dp_vdev *vdev, qdf_nbuf_t nbuf);
313 
314 QDF_STATUS
315 dp_tx_prepare_send_igmp_me(struct dp_vdev *vdev, qdf_nbuf_t nbuf);
316 
317 #endif /* QCA_HOST_MODE_WIFI_DISABLED */
318 
319 #if defined(QCA_HOST_MODE_WIFI_DISABLED) || !defined(ATH_SUPPORT_IQUE)
320 static inline void dp_tx_me_exit(struct dp_pdev *pdev)
321 {
322 	return;
323 }
324 #endif
325 
326 /**
327  * dp_tx_pdev_init() - dp tx pdev init
328  * @pdev: physical device instance
329  *
330  * Return: QDF_STATUS_SUCCESS: success
331  *         QDF_STATUS_E_RESOURCES: Error return
332  */
333 static inline QDF_STATUS dp_tx_pdev_init(struct dp_pdev *pdev)
334 {
335 	struct dp_soc *soc = pdev->soc;
336 
337 	/* Initialize Flow control counters */
338 	qdf_atomic_init(&pdev->num_tx_outstanding);
339 	pdev->tx_descs_max = 0;
340 	if (wlan_cfg_per_pdev_tx_ring(soc->wlan_cfg_ctx)) {
341 		/* Initialize descriptors in TCL Ring */
342 		hal_tx_init_data_ring(soc->hal_soc,
343 				soc->tcl_data_ring[pdev->pdev_id].hal_srng);
344 	}
345 
346 	return QDF_STATUS_SUCCESS;
347 }
348 
349 
350 #ifndef FEATURE_WDS
351 static inline void dp_tx_mec_handler(struct dp_vdev *vdev, uint8_t *status)
352 {
353 	return;
354 }
355 #endif
356 
357 #ifndef QCA_MULTIPASS_SUPPORT
358 static inline
359 bool dp_tx_multipass_process(struct dp_soc *soc, struct dp_vdev *vdev,
360 			     qdf_nbuf_t nbuf,
361 			     struct dp_tx_msdu_info_s *msdu_info)
362 {
363 	return true;
364 }
365 
366 static inline
367 void dp_tx_vdev_multipass_deinit(struct dp_vdev *vdev)
368 {
369 }
370 
371 #else
372 bool dp_tx_multipass_process(struct dp_soc *soc, struct dp_vdev *vdev,
373 			     qdf_nbuf_t nbuf,
374 			     struct dp_tx_msdu_info_s *msdu_info);
375 
376 void dp_tx_vdev_multipass_deinit(struct dp_vdev *vdev);
377 #endif
378 
379 /**
380  * dp_tx_hw_to_qdf()- convert hw status to qdf status
381  * @status: hw status
382  *
383  * Return: qdf tx rx status
384  */
385 static inline enum qdf_dp_tx_rx_status dp_tx_hw_to_qdf(uint16_t status)
386 {
387 	switch (status) {
388 	case HAL_TX_TQM_RR_FRAME_ACKED:
389 		return QDF_TX_RX_STATUS_OK;
390 	case HAL_TX_TQM_RR_REM_CMD_REM:
391 	case HAL_TX_TQM_RR_REM_CMD_TX:
392 	case HAL_TX_TQM_RR_REM_CMD_NOTX:
393 	case HAL_TX_TQM_RR_REM_CMD_AGED:
394 		return QDF_TX_RX_STATUS_FW_DISCARD;
395 	default:
396 		return QDF_TX_RX_STATUS_DEFAULT;
397 	}
398 }
399 
400 #ifndef QCA_HOST_MODE_WIFI_DISABLED
401 /**
402  * dp_tx_get_queue() - Returns Tx queue IDs to be used for this Tx frame
403  * @vdev: DP Virtual device handle
404  * @nbuf: Buffer pointer
405  * @queue: queue ids container for nbuf
406  *
407  * TX packet queue has 2 instances, software descriptors id and dma ring id
408  * Based on tx feature and hardware configuration queue id combination could be
409  * different.
410  * For example -
411  * With XPS enabled,all TX descriptor pools and dma ring are assigned per cpu id
412  * With no XPS,lock based resource protection, Descriptor pool ids are different
413  * for each vdev, dma ring id will be same as single pdev id
414  *
415  * Return: None
416  */
417 #ifdef QCA_OL_TX_MULTIQ_SUPPORT
418 static inline void dp_tx_get_queue(struct dp_vdev *vdev,
419 				   qdf_nbuf_t nbuf, struct dp_tx_queue *queue)
420 {
421 	uint16_t queue_offset = qdf_nbuf_get_queue_mapping(nbuf) &
422 				DP_TX_QUEUE_MASK;
423 
424 	queue->desc_pool_id = queue_offset;
425 	queue->ring_id = qdf_get_cpu();
426 
427 	QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
428 		  "%s, pool_id:%d ring_id: %d",
429 		  __func__, queue->desc_pool_id, queue->ring_id);
430 }
431 
432 /*
433  * dp_tx_get_hal_ring_hdl()- Get the hal_tx_ring_hdl for data transmission
434  * @dp_soc - DP soc structure pointer
435  * @ring_id - Transmit Queue/ring_id to be used when XPS is enabled
436  *
437  * Return - HAL ring handle
438  */
439 static inline hal_ring_handle_t dp_tx_get_hal_ring_hdl(struct dp_soc *soc,
440 						       uint8_t ring_id)
441 {
442 	if (ring_id == soc->num_tcl_data_rings)
443 		return soc->tcl_cmd_credit_ring.hal_srng;
444 
445 	return soc->tcl_data_ring[ring_id].hal_srng;
446 }
447 
448 /*
449  * dp_tx_get_rbm_id()- Get the RBM ID for data transmission completion.
450  * @dp_soc - DP soc structure pointer
451  * @ring_id - Transmit Queue/ring_id to be used when XPS is enabled
452  *
453  * Return - HAL ring handle
454  */
455 static inline uint8_t dp_tx_get_rbm_id(struct dp_soc *doc,
456 				       uint8_t ring_id)
457 {
458 	return (ring_id ? HAL_WBM_SW0_BM_ID + (ring_id - 1) :
459 			  HAL_WBM_SW2_BM_ID);
460 }
461 
462 #else /* QCA_OL_TX_MULTIQ_SUPPORT */
463 static inline void dp_tx_get_queue(struct dp_vdev *vdev,
464 				   qdf_nbuf_t nbuf, struct dp_tx_queue *queue)
465 {
466 	/* get flow id */
467 	queue->desc_pool_id = DP_TX_GET_DESC_POOL_ID(vdev);
468 	queue->ring_id = DP_TX_GET_RING_ID(vdev);
469 
470 	QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
471 		  "%s, pool_id:%d ring_id: %d",
472 		  __func__, queue->desc_pool_id, queue->ring_id);
473 }
474 
475 static inline hal_ring_handle_t dp_tx_get_hal_ring_hdl(struct dp_soc *soc,
476 						       uint8_t ring_id)
477 {
478 	return soc->tcl_data_ring[ring_id].hal_srng;
479 }
480 
481 static inline uint8_t dp_tx_get_rbm_id(struct dp_soc *soc,
482 				       uint8_t ring_id)
483 {
484 	return (ring_id + HAL_WBM_SW0_BM_ID);
485 }
486 #endif
487 
488 #ifdef QCA_OL_TX_LOCK_LESS_ACCESS
489 /*
490  * dp_tx_hal_ring_access_start()- hal_tx_ring access for data transmission
491  * @dp_soc - DP soc structure pointer
492  * @hal_ring_hdl - HAL ring handle
493  *
494  * Return - None
495  */
496 static inline int dp_tx_hal_ring_access_start(struct dp_soc *soc,
497 					      hal_ring_handle_t hal_ring_hdl)
498 {
499 	return hal_srng_access_start_unlocked(soc->hal_soc, hal_ring_hdl);
500 }
501 
502 /*
503  * dp_tx_hal_ring_access_end()- hal_tx_ring access for data transmission
504  * @dp_soc - DP soc structure pointer
505  * @hal_ring_hdl - HAL ring handle
506  *
507  * Return - None
508  */
509 static inline void dp_tx_hal_ring_access_end(struct dp_soc *soc,
510 					     hal_ring_handle_t hal_ring_hdl)
511 {
512 	hal_srng_access_end_unlocked(soc->hal_soc, hal_ring_hdl);
513 }
514 
515 /*
516  * dp_tx_hal_ring_access_reap()- hal_tx_ring access for data transmission
517  * @dp_soc - DP soc structure pointer
518  * @hal_ring_hdl - HAL ring handle
519  *
520  * Return - None
521  */
522 static inline void dp_tx_hal_ring_access_end_reap(struct dp_soc *soc,
523 						  hal_ring_handle_t
524 						  hal_ring_hdl)
525 {
526 }
527 
528 #else
529 static inline int dp_tx_hal_ring_access_start(struct dp_soc *soc,
530 					      hal_ring_handle_t hal_ring_hdl)
531 {
532 	return hal_srng_access_start(soc->hal_soc, hal_ring_hdl);
533 }
534 
535 static inline void dp_tx_hal_ring_access_end(struct dp_soc *soc,
536 					     hal_ring_handle_t hal_ring_hdl)
537 {
538 	hal_srng_access_end(soc->hal_soc, hal_ring_hdl);
539 }
540 
541 static inline void dp_tx_hal_ring_access_end_reap(struct dp_soc *soc,
542 						  hal_ring_handle_t
543 						  hal_ring_hdl)
544 {
545 	hal_srng_access_end_reap(soc->hal_soc, hal_ring_hdl);
546 }
547 #endif
548 
549 void  dp_iterate_update_peer_list(struct cdp_pdev *pdev_hdl);
550 
551 #ifdef ATH_TX_PRI_OVERRIDE
552 #define DP_TX_TID_OVERRIDE(_msdu_info, _nbuf) \
553 	((_msdu_info)->tid = qdf_nbuf_get_priority(_nbuf))
554 #else
555 #define DP_TX_TID_OVERRIDE(_msdu_info, _nbuf)
556 #endif
557 
558 /* TODO TX_FEATURE_NOT_YET */
559 static inline void dp_tx_comp_process_exception(struct dp_tx_desc_s *tx_desc)
560 {
561 	return;
562 }
563 /* TODO TX_FEATURE_NOT_YET */
564 
565 void dp_tx_desc_flush(struct dp_pdev *pdev, struct dp_vdev *vdev,
566 		      bool force_free);
567 QDF_STATUS dp_tx_vdev_attach(struct dp_vdev *vdev);
568 QDF_STATUS dp_tx_vdev_detach(struct dp_vdev *vdev);
569 void dp_tx_vdev_update_search_flags(struct dp_vdev *vdev);
570 QDF_STATUS dp_soc_tx_desc_sw_pools_alloc(struct dp_soc *soc);
571 QDF_STATUS dp_soc_tx_desc_sw_pools_init(struct dp_soc *soc);
572 void dp_soc_tx_desc_sw_pools_free(struct dp_soc *soc);
573 void dp_soc_tx_desc_sw_pools_deinit(struct dp_soc *soc);
574 void
575 dp_handle_wbm_internal_error(struct dp_soc *soc, void *hal_desc,
576 			     uint32_t buf_type);
577 #else /* QCA_HOST_MODE_WIFI_DISABLED */
578 
579 static inline
580 QDF_STATUS dp_soc_tx_desc_sw_pools_alloc(struct dp_soc *soc)
581 {
582 	return QDF_STATUS_SUCCESS;
583 }
584 
585 static inline
586 QDF_STATUS dp_soc_tx_desc_sw_pools_init(struct dp_soc *soc)
587 {
588 	return QDF_STATUS_SUCCESS;
589 }
590 
591 static inline void dp_soc_tx_desc_sw_pools_free(struct dp_soc *soc)
592 {
593 }
594 
595 static inline void dp_soc_tx_desc_sw_pools_deinit(struct dp_soc *soc)
596 {
597 }
598 
599 static inline
600 void dp_tx_desc_flush(struct dp_pdev *pdev, struct dp_vdev *vdev,
601 		      bool force_free)
602 {
603 }
604 
605 static inline QDF_STATUS dp_tx_vdev_attach(struct dp_vdev *vdev)
606 {
607 	return QDF_STATUS_SUCCESS;
608 }
609 
610 static inline QDF_STATUS dp_tx_vdev_detach(struct dp_vdev *vdev)
611 {
612 	return QDF_STATUS_SUCCESS;
613 }
614 
615 static inline void dp_tx_vdev_update_search_flags(struct dp_vdev *vdev)
616 {
617 }
618 
619 #endif /* QCA_HOST_MODE_WIFI_DISABLED */
620 
621 #ifdef FEATURE_PERPKT_INFO
622 QDF_STATUS
623 dp_get_completion_indication_for_stack(struct dp_soc *soc,
624 				       struct dp_pdev *pdev,
625 				       struct dp_peer *peer,
626 				       struct hal_tx_completion_status *ts,
627 				       qdf_nbuf_t netbuf,
628 				       uint64_t time_latency);
629 
630 void dp_send_completion_to_stack(struct dp_soc *soc,  struct dp_pdev *pdev,
631 			    uint16_t peer_id, uint32_t ppdu_id,
632 			    qdf_nbuf_t netbuf);
633 #else
634 static inline
635 QDF_STATUS dp_get_completion_indication_for_stack(struct dp_soc *soc,
636 				       struct dp_pdev *pdev,
637 				       struct dp_peer *peer,
638 				       struct hal_tx_completion_status *ts,
639 				       qdf_nbuf_t netbuf,
640 				       uint64_t time_latency)
641 {
642 	return QDF_STATUS_E_NOSUPPORT;
643 }
644 
645 static inline
646 void dp_send_completion_to_stack(struct dp_soc *soc,  struct dp_pdev *pdev,
647 			    uint16_t peer_id, uint32_t ppdu_id,
648 			    qdf_nbuf_t netbuf)
649 {
650 }
651 #endif
652 
653 #ifndef WLAN_TX_PKT_CAPTURE_ENH
654 static inline
655 QDF_STATUS dp_peer_set_tx_capture_enabled(struct dp_pdev *pdev,
656 					  struct dp_peer *peer_handle,
657 					  uint8_t value, uint8_t *peer_mac)
658 {
659 	return QDF_STATUS_SUCCESS;
660 }
661 #endif
662 
663 #ifdef WLAN_FEATURE_PKT_CAPTURE_LITHIUM
664 void dp_send_completion_to_pkt_capture(struct dp_soc *soc,
665 				       struct dp_tx_desc_s *desc,
666 				       struct hal_tx_completion_status *ts);
667 #else
668 static inline void
669 dp_send_completion_to_pkt_capture(struct dp_soc *soc,
670 				  struct dp_tx_desc_s *desc,
671 				  struct hal_tx_completion_status *ts)
672 {
673 }
674 #endif
675 #endif
676