1*5113495bSYour Name /* 2*5113495bSYour Name * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. 3*5113495bSYour Name * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved. 4*5113495bSYour Name * 5*5113495bSYour Name * Permission to use, copy, modify, and/or distribute this software for 6*5113495bSYour Name * any purpose with or without fee is hereby granted, provided that the 7*5113495bSYour Name * above copyright notice and this permission notice appear in all 8*5113495bSYour Name * copies. 9*5113495bSYour Name * 10*5113495bSYour Name * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 11*5113495bSYour Name * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 12*5113495bSYour Name * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE 13*5113495bSYour Name * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL 14*5113495bSYour Name * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR 15*5113495bSYour Name * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER 16*5113495bSYour Name * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 17*5113495bSYour Name * PERFORMANCE OF THIS SOFTWARE. 18*5113495bSYour Name */ 19*5113495bSYour Name #ifndef __DP_LI_TX_H 20*5113495bSYour Name #define __DP_LI_TX_H 21*5113495bSYour Name 22*5113495bSYour Name #include <dp_types.h> 23*5113495bSYour Name 24*5113495bSYour Name /** 25*5113495bSYour Name * dp_tx_hw_enqueue_li() - Enqueue to TCL HW for transmit 26*5113495bSYour Name * @soc: DP Soc Handle 27*5113495bSYour Name * @vdev: DP vdev handle 28*5113495bSYour Name * @tx_desc: Tx Descriptor Handle 29*5113495bSYour Name * @fw_metadata: Metadata to send to Target Firmware along with frame 30*5113495bSYour Name * @tx_exc_metadata: Handle that holds exception path meta data 31*5113495bSYour Name * @msdu_info: MSDU information 32*5113495bSYour Name * 33*5113495bSYour Name * Gets the next free TCL HW DMA descriptor and sets up required parameters 34*5113495bSYour Name * from software Tx descriptor 35*5113495bSYour Name * 36*5113495bSYour Name * Return: QDF_STATUS_SUCCESS: success 37*5113495bSYour Name * QDF_STATUS_E_RESOURCES: Error return 38*5113495bSYour Name */ 39*5113495bSYour Name QDF_STATUS 40*5113495bSYour Name dp_tx_hw_enqueue_li(struct dp_soc *soc, struct dp_vdev *vdev, 41*5113495bSYour Name struct dp_tx_desc_s *tx_desc, uint16_t fw_metadata, 42*5113495bSYour Name struct cdp_tx_exception_metadata *tx_exc_metadata, 43*5113495bSYour Name struct dp_tx_msdu_info_s *msdu_info); 44*5113495bSYour Name /** 45*5113495bSYour Name * dp_tx_comp_get_params_from_hal_desc_li() - Get TX desc from HAL comp desc 46*5113495bSYour Name * @soc: DP soc handle 47*5113495bSYour Name * @tx_comp_hal_desc: HAL TX Comp Descriptor 48*5113495bSYour Name * @r_tx_desc: SW Tx Descriptor retrieved from HAL desc. 49*5113495bSYour Name * 50*5113495bSYour Name * Return: QDF_STATUS 51*5113495bSYour Name */ 52*5113495bSYour Name QDF_STATUS 53*5113495bSYour Name dp_tx_comp_get_params_from_hal_desc_li(struct dp_soc *soc, 54*5113495bSYour Name void *tx_comp_hal_desc, 55*5113495bSYour Name struct dp_tx_desc_s **r_tx_desc); 56*5113495bSYour Name 57*5113495bSYour Name /** 58*5113495bSYour Name * dp_tx_process_htt_completion_li() - Tx HTT Completion Indication Handler 59*5113495bSYour Name * @soc: Handle to DP soc structure 60*5113495bSYour Name * @tx_desc: software descriptor head pointer 61*5113495bSYour Name * @status: Tx completion status from HTT descriptor 62*5113495bSYour Name * @ring_id: ring number 63*5113495bSYour Name * 64*5113495bSYour Name * This function will process HTT Tx indication messages from Target 65*5113495bSYour Name * 66*5113495bSYour Name * Return: none 67*5113495bSYour Name */ 68*5113495bSYour Name void dp_tx_process_htt_completion_li(struct dp_soc *soc, 69*5113495bSYour Name struct dp_tx_desc_s *tx_desc, 70*5113495bSYour Name uint8_t *status, 71*5113495bSYour Name uint8_t ring_id); 72*5113495bSYour Name 73*5113495bSYour Name /** 74*5113495bSYour Name * dp_tx_desc_pool_init_li() - Initialize Tx Descriptor pool(s) 75*5113495bSYour Name * @soc: Handle to DP Soc structure 76*5113495bSYour Name * @num_elem: pool descriptor number 77*5113495bSYour Name * @pool_id: pool to allocate 78*5113495bSYour Name * @spcl_tx_desc: if special desc 79*5113495bSYour Name * 80*5113495bSYour Name * Return: QDF_STATUS_SUCCESS - success, others - failure 81*5113495bSYour Name */ 82*5113495bSYour Name QDF_STATUS dp_tx_desc_pool_init_li(struct dp_soc *soc, 83*5113495bSYour Name uint32_t num_elem, 84*5113495bSYour Name uint8_t pool_id, 85*5113495bSYour Name bool spcl_tx_desc); 86*5113495bSYour Name 87*5113495bSYour Name /** 88*5113495bSYour Name * dp_tx_desc_pool_deinit_li() - De-initialize Tx Descriptor pool(s) 89*5113495bSYour Name * @soc: Handle to DP Soc structure 90*5113495bSYour Name * @tx_desc_pool: Tx descriptor pool handler 91*5113495bSYour Name * @pool_id: pool to deinit 92*5113495bSYour Name * @spcl_tx_desc: if special desc 93*5113495bSYour Name * 94*5113495bSYour Name * Return: None. 95*5113495bSYour Name */ 96*5113495bSYour Name void dp_tx_desc_pool_deinit_li(struct dp_soc *soc, 97*5113495bSYour Name struct dp_tx_desc_pool_s *tx_desc_pool, 98*5113495bSYour Name uint8_t pool_id, bool spcl_tx_desc); 99*5113495bSYour Name 100*5113495bSYour Name /** 101*5113495bSYour Name * dp_tx_compute_tx_delay_li() - Compute HW Tx completion delay 102*5113495bSYour Name * @soc: Handle to DP Soc structure 103*5113495bSYour Name * @vdev: vdev 104*5113495bSYour Name * @ts: Tx completion status 105*5113495bSYour Name * @delay_us: Delay to be calculated in microseconds 106*5113495bSYour Name * 107*5113495bSYour Name * Return: QDF_STATUS 108*5113495bSYour Name */ 109*5113495bSYour Name QDF_STATUS dp_tx_compute_tx_delay_li(struct dp_soc *soc, 110*5113495bSYour Name struct dp_vdev *vdev, 111*5113495bSYour Name struct hal_tx_completion_status *ts, 112*5113495bSYour Name uint32_t *delay_us); 113*5113495bSYour Name 114*5113495bSYour Name /** 115*5113495bSYour Name * dp_tx_desc_pool_alloc_li() - Allocate TX descriptor pool 116*5113495bSYour Name * @soc: Handle to DP Soc structure 117*5113495bSYour Name * @num_elem: Number of elements to allocate 118*5113495bSYour Name * @pool_id: TCL descriptor pool ID 119*5113495bSYour Name * 120*5113495bSYour Name * Return: QDF_STATUS 121*5113495bSYour Name */ 122*5113495bSYour Name QDF_STATUS dp_tx_desc_pool_alloc_li(struct dp_soc *soc, uint32_t num_elem, 123*5113495bSYour Name uint8_t pool_id); 124*5113495bSYour Name 125*5113495bSYour Name /** 126*5113495bSYour Name * dp_tx_desc_pool_free_li() - Free TX descriptor pool 127*5113495bSYour Name * @soc: Handle to DP Soc structure 128*5113495bSYour Name * @pool_id: TCL descriptor pool ID 129*5113495bSYour Name * 130*5113495bSYour Name * Return: none 131*5113495bSYour Name */ 132*5113495bSYour Name void dp_tx_desc_pool_free_li(struct dp_soc *soc, uint8_t pool_id); 133*5113495bSYour Name #endif 134