qcacmn: get HP of RXDMA ring without incrementing

get the HP of the RXDMA ring without incrementing
This will ensure in case of nbuf failures the ring
HP remains unchanged

Change-Id: I69ec9207a44a4c50484933797326e962ad2d4a5c
CRs-Fixed: 3309394
此提交包含在:
Tallapragada Kalyan
2022-10-10 23:21:01 +05:30
提交者 Madan Koyyalamudi
父節點 efff4ec854
當前提交 4c45f8a2ed
共有 2 個檔案被更改,包括 26 行新增2 行删除

查看文件

@@ -1975,6 +1975,29 @@ void *hal_srng_src_get_next_consumed(void *hal_soc,
}
#endif /* CLEAR_SW2TCL_CONSUMED_DESC */
/**
* hal_srng_src_peek - get the HP of the SRC ring
* @hal_soc: Opaque HAL SOC handle
* @hal_ring_hdl: Source ring pointer
*
* get the head pointer in the src ring but do not increment it
*/
static inline
void *hal_srng_src_peek(void *hal_soc, hal_ring_handle_t hal_ring_hdl)
{
struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl;
uint32_t *desc;
uint32_t next_hp = (srng->u.src_ring.hp + srng->entry_size) %
srng->ring_size;
if (next_hp != srng->u.src_ring.cached_tp) {
desc = &(srng->ring_base_vaddr[srng->u.src_ring.hp]);
return (void *)desc;
}
return NULL;
}
/**
* hal_srng_src_get_next - Get next entry from a source ring and move cached tail pointer
*