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 19 #ifndef _DP_LI_RX_H_ 20 #define _DP_LI_RX_H_ 21 22 #include <dp_types.h> 23 #include <dp_rx.h> 24 #include "dp_li.h" 25 26 uint32_t dp_rx_process_li(struct dp_intr *int_ctx, 27 hal_ring_handle_t hal_ring_hdl, uint8_t reo_ring_num, 28 uint32_t quota); 29 30 /** 31 * dp_rx_desc_pool_init_li() - Initialize Rx Descriptor pool(s) 32 * @soc: Handle to DP Soc structure 33 * @rx_desc_pool: Rx descriptor pool handler 34 * @pool_id: Rx descriptor pool ID 35 * 36 * Return: None 37 */ 38 QDF_STATUS dp_rx_desc_pool_init_li(struct dp_soc *soc, 39 struct rx_desc_pool *rx_desc_pool, 40 uint32_t pool_id); 41 42 /** 43 * dp_rx_desc_pool_deinit_li() - De-initialize Rx Descriptor pool(s) 44 * @soc: Handle to DP Soc structure 45 * @rx_desc_pool: Rx descriptor pool handler 46 * @pool_id: Rx descriptor pool ID 47 * 48 * Return: None 49 */ 50 void dp_rx_desc_pool_deinit_li(struct dp_soc *soc, 51 struct rx_desc_pool *rx_desc_pool, 52 uint32_t pool_id); 53 54 /** 55 * dp_wbm_get_rx_desc_from_hal_desc_li() - Get corresponding Rx Desc 56 * address from WBM ring Desc 57 * @soc: Handle to DP Soc structure 58 * @ring_desc: ring descriptor structure pointer 59 * @r_rx_desc: pointer to a pointer of Rx Desc 60 * 61 * Return: QDF_STATUS_SUCCESS - succeeded, others - failed 62 */ 63 QDF_STATUS dp_wbm_get_rx_desc_from_hal_desc_li( 64 struct dp_soc *soc, 65 void *ring_desc, 66 struct dp_rx_desc **r_rx_desc); 67 68 /** 69 * dp_rx_desc_cookie_2_va_li() - Convert RX Desc cookie ID to VA 70 * @soc:Handle to DP Soc structure 71 * @cookie: cookie used to lookup virtual address 72 * 73 * Return: Rx descriptor virtual address 74 */ 75 static inline 76 struct dp_rx_desc *dp_rx_desc_cookie_2_va_li(struct dp_soc *soc, 77 uint32_t cookie) 78 { 79 return dp_rx_cookie_2_va_rxdma_buf(soc, cookie); 80 } 81 #endif 82