qcacmn: Fix calculation of getting head/tail pointer
The current calculation of head/tail pointer for srng gives an index in the array by skipping entry_size dwords. The head/tail pointers are preffered to be the index values like in the srng registers, which brings them in alignment with the other usage of head/tail pointers. Fix the calculation of head/tail pointers for srng by avoiding the division by srng entry size. CRs-Fixed: 2469332 Change-Id: If9a167f3fac3cb39ebe59618e9ad2224d9e54bcc
This commit is contained in:
@@ -895,11 +895,11 @@ static inline void hal_get_sw_hptp(void *hal_soc, void *hal_ring,
|
||||
struct hal_srng *srng = (struct hal_srng *)hal_ring;
|
||||
|
||||
if (srng->ring_dir == HAL_SRNG_SRC_RING) {
|
||||
*headp = srng->u.src_ring.hp / srng->entry_size;
|
||||
*tailp = *(srng->u.src_ring.tp_addr) / srng->entry_size;
|
||||
*headp = srng->u.src_ring.hp;
|
||||
*tailp = *srng->u.src_ring.tp_addr;
|
||||
} else {
|
||||
*tailp = srng->u.dst_ring.tp / srng->entry_size;
|
||||
*headp = *(srng->u.dst_ring.hp_addr) / srng->entry_size;
|
||||
*tailp = srng->u.dst_ring.tp;
|
||||
*headp = *srng->u.dst_ring.hp_addr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1530,15 +1530,11 @@ void hal_get_hw_hptp_generic(struct hal_soc *soc, void *hal_ring,
|
||||
ring_config = HAL_SRNG_CONFIG(soc, ring_type);
|
||||
if (!ring_config->lmac_ring) {
|
||||
if (srng->ring_dir == HAL_SRNG_SRC_RING) {
|
||||
*headp =
|
||||
(SRNG_SRC_REG_READ(srng, HP)) / srng->entry_size;
|
||||
*tailp =
|
||||
(SRNG_SRC_REG_READ(srng, TP)) / srng->entry_size;
|
||||
*headp = SRNG_SRC_REG_READ(srng, HP);
|
||||
*tailp = SRNG_SRC_REG_READ(srng, TP);
|
||||
} else {
|
||||
*headp =
|
||||
(SRNG_DST_REG_READ(srng, HP)) / srng->entry_size;
|
||||
*tailp =
|
||||
(SRNG_DST_REG_READ(srng, TP)) / srng->entry_size;
|
||||
*headp = SRNG_DST_REG_READ(srng, HP);
|
||||
*tailp = SRNG_DST_REG_READ(srng, TP);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user