xref: /wlan-dirver/qca-wifi-host-cmn/dp/wifi3.0/li/dp_li_tx.h (revision 2f4b444fb7e689b83a4ab0e7b3b38f0bf4def8e0)
1 /*
2  * Copyright (c) 2016-2021 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_LI_TX_H
19 #define __DP_LI_TX_H
20 
21 #include <dp_types.h>
22 
23 /**
24  * dp_tx_hw_enqueue_li() - Enqueue to TCL HW for transmit
25  * @soc: DP Soc Handle
26  * @vdev: DP vdev handle
27  * @tx_desc: Tx Descriptor Handle
28  * @tid: TID from HLOS for overriding default DSCP-TID mapping
29  * @fw_metadata: Metadata to send to Target Firmware along with frame
30  * @ring_id: Ring ID of H/W ring to which we enqueue the packet
31  * @tx_exc_metadata: Handle that holds exception path meta data
32  *
33  *  Gets the next free TCL HW DMA descriptor and sets up required parameters
34  *  from software Tx descriptor
35  *
36  * Return: QDF_STATUS_SUCCESS: success
37  *         QDF_STATUS_E_RESOURCES: Error return
38  */
39 QDF_STATUS
40 dp_tx_hw_enqueue_li(struct dp_soc *soc, struct dp_vdev *vdev,
41 		    struct dp_tx_desc_s *tx_desc, uint16_t fw_metadata,
42 		    struct cdp_tx_exception_metadata *tx_exc_metadata,
43 		    struct dp_tx_msdu_info_s *msdu_info);
44 /**
45  * dp_tx_comp_get_params_from_hal_desc_li() - Get TX desc from HAL comp desc
46  * @soc: DP soc handle
47  * @tx_comp_hal_desc: HAL TX Comp Descriptor
48  * @r_tx_desc: SW Tx Descriptor retrieved from HAL desc.
49  *
50  * Return: None
51  */
52 void dp_tx_comp_get_params_from_hal_desc_li(struct dp_soc *soc,
53 					    void *tx_comp_hal_desc,
54 					    struct dp_tx_desc_s **r_tx_desc);
55 
56 /**
57  * dp_tx_desc_pool_init_li() - Initialize Tx Descriptor pool(s)
58  * @soc: Handle to DP Soc structure
59  * @num_elem: pool descriptor number
60  * @pool_id: pool to allocate
61  *
62  * Return: QDF_STATUS_SUCCESS - success, others - failure
63  */
64 QDF_STATUS dp_tx_desc_pool_init_li(struct dp_soc *soc,
65 				   uint16_t num_elem,
66 				   uint8_t pool_id);
67 
68 /**
69  * dp_tx_desc_pool_deinit_li() - De-initialize Tx Descriptor pool(s)
70  * @soc: Handle to DP Soc structure
71  * @tx_desc_pool: Tx descriptor pool handler
72  * @pool_id: pool to deinit
73  *
74  * Return: None.
75  */
76 void dp_tx_desc_pool_deinit_li(struct dp_soc *soc,
77 			       struct dp_tx_desc_pool_s *tx_desc_pool,
78 			       uint8_t pool_id);
79 #endif
80