Lines Matching refs:srng
504 struct hal_srng *srng, in hal_srng_write_address_32_mb() argument
509 hal_srng_reg_his_add(srng, value); in hal_srng_write_address_32_mb()
513 struct hal_srng *srng, in hal_srng_write_address_32_mb() argument
517 hal_delayed_reg_write(hal_soc, srng, addr, value); in hal_srng_write_address_32_mb()
521 struct hal_srng *srng, in hal_srng_write_address_32_mb() argument
526 hal_srng_reg_his_add(srng, value); in hal_srng_write_address_32_mb()
891 struct hal_srng *srng,
895 hal_srng_check_and_update_hptp(struct hal_soc *hal_soc, struct hal_srng *srng, in hal_srng_check_and_update_hptp() argument
1010 void hal_srng_dump(struct hal_srng *srng);
1315 struct hal_srng *srng,
1339 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_initialized() local
1341 return !!srng->initialized; in hal_srng_initialized()
1357 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_dst_peek() local
1359 if (srng->u.dst_ring.tp != srng->u.dst_ring.cached_hp) in hal_srng_dst_peek()
1360 return (void *)(&srng->ring_base_vaddr[srng->u.dst_ring.tp]); in hal_srng_dst_peek()
1406 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_access_start_unlocked() local
1410 if (srng->ring_dir == HAL_SRNG_SRC_RING) in hal_srng_access_start_unlocked()
1411 srng->u.src_ring.cached_tp = in hal_srng_access_start_unlocked()
1412 *(volatile uint32_t *)(srng->u.src_ring.tp_addr); in hal_srng_access_start_unlocked()
1414 srng->u.dst_ring.cached_hp = in hal_srng_access_start_unlocked()
1415 *(volatile uint32_t *)(srng->u.dst_ring.hp_addr); in hal_srng_access_start_unlocked()
1417 if (srng->flags & HAL_SRNG_CACHED_DESC) { in hal_srng_access_start_unlocked()
1421 srng->entry_size); in hal_srng_access_start_unlocked()
1452 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_le_srng_access_start_unlocked_in_cpu_order() local
1456 if (srng->ring_dir == HAL_SRNG_SRC_RING) in hal_le_srng_access_start_unlocked_in_cpu_order()
1457 srng->u.src_ring.cached_tp = in hal_le_srng_access_start_unlocked_in_cpu_order()
1459 (srng->u.src_ring.tp_addr)); in hal_le_srng_access_start_unlocked_in_cpu_order()
1461 srng->u.dst_ring.cached_hp = in hal_le_srng_access_start_unlocked_in_cpu_order()
1463 (srng->u.dst_ring.hp_addr)); in hal_le_srng_access_start_unlocked_in_cpu_order()
1465 if (srng->flags & HAL_SRNG_CACHED_DESC) { in hal_le_srng_access_start_unlocked_in_cpu_order()
1469 srng->entry_size); in hal_le_srng_access_start_unlocked_in_cpu_order()
1488 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_try_access_start() local
1495 if (!SRNG_TRY_LOCK(&(srng->lock))) in hal_srng_try_access_start()
1516 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_access_start() local
1523 SRNG_LOCK(&(srng->lock)); in hal_srng_access_start()
1547 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_le_srng_access_start_in_cpu_order() local
1554 SRNG_LOCK(&(srng->lock)); in hal_le_srng_access_start_in_cpu_order()
1571 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_dst_get_next() local
1574 if (srng->u.dst_ring.tp == srng->u.dst_ring.cached_hp) in hal_srng_dst_get_next()
1577 desc = &srng->ring_base_vaddr[srng->u.dst_ring.tp]; in hal_srng_dst_get_next()
1584 srng->u.dst_ring.tp = (srng->u.dst_ring.tp + srng->entry_size); in hal_srng_dst_get_next()
1585 if (srng->u.dst_ring.tp == srng->ring_size) in hal_srng_dst_get_next()
1586 srng->u.dst_ring.tp = 0; in hal_srng_dst_get_next()
1588 if (srng->flags & HAL_SRNG_CACHED_DESC) { in hal_srng_dst_get_next()
1593 tp = srng->u.dst_ring.tp; in hal_srng_dst_get_next()
1594 desc_next = &srng->ring_base_vaddr[srng->u.dst_ring.tp]; in hal_srng_dst_get_next()
1595 hal_mem_dma_cache_sync(soc, desc_next, srng->entry_size); in hal_srng_dst_get_next()
1615 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_dst_get_next_cached() local
1619 if (srng->u.dst_ring.tp == srng->u.dst_ring.cached_hp) in hal_srng_dst_get_next_cached()
1622 desc = &srng->ring_base_vaddr[srng->u.dst_ring.tp]; in hal_srng_dst_get_next_cached()
1629 srng->u.dst_ring.tp = (srng->u.dst_ring.tp + srng->entry_size); in hal_srng_dst_get_next_cached()
1630 if (srng->u.dst_ring.tp == srng->ring_size) in hal_srng_dst_get_next_cached()
1631 srng->u.dst_ring.tp = 0; in hal_srng_dst_get_next_cached()
1633 desc_next = &srng->ring_base_vaddr[srng->u.dst_ring.tp]; in hal_srng_dst_get_next_cached()
1649 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_dst_dec_tp() local
1651 if (qdf_unlikely(!srng->u.dst_ring.tp)) in hal_srng_dst_dec_tp()
1652 srng->u.dst_ring.tp = (srng->ring_size - srng->entry_size); in hal_srng_dst_dec_tp()
1654 srng->u.dst_ring.tp -= srng->entry_size; in hal_srng_dst_dec_tp()
1659 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_lock() local
1666 SRNG_LOCK(&(srng->lock)); in hal_srng_lock()
1672 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_unlock() local
1679 SRNG_UNLOCK(&(srng->lock)); in hal_srng_unlock()
1695 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_dst_get_next_hp() local
1703 uint32_t next_hp = (srng->u.dst_ring.cached_hp + srng->entry_size) % in hal_srng_dst_get_next_hp()
1704 srng->ring_size; in hal_srng_dst_get_next_hp()
1706 if (next_hp != srng->u.dst_ring.tp) { in hal_srng_dst_get_next_hp()
1707 desc = &(srng->ring_base_vaddr[srng->u.dst_ring.cached_hp]); in hal_srng_dst_get_next_hp()
1708 srng->u.dst_ring.cached_hp = next_hp; in hal_srng_dst_get_next_hp()
1729 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_dst_peek_sync() local
1731 srng->u.dst_ring.cached_hp = in hal_srng_dst_peek_sync()
1732 *(volatile uint32_t *)(srng->u.dst_ring.hp_addr); in hal_srng_dst_peek_sync()
1734 if (srng->u.dst_ring.tp != srng->u.dst_ring.cached_hp) in hal_srng_dst_peek_sync()
1735 return (void *)(&(srng->ring_base_vaddr[srng->u.dst_ring.tp])); in hal_srng_dst_peek_sync()
1754 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_dst_peek_sync_locked() local
1762 SRNG_LOCK(&srng->lock); in hal_srng_dst_peek_sync_locked()
1766 SRNG_UNLOCK(&srng->lock); in hal_srng_dst_peek_sync_locked()
1788 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_dst_num_valid() local
1790 uint32_t tp = srng->u.dst_ring.tp; in hal_srng_dst_num_valid()
1793 hp = *(volatile uint32_t *)(srng->u.dst_ring.hp_addr); in hal_srng_dst_num_valid()
1794 srng->u.dst_ring.cached_hp = hp; in hal_srng_dst_num_valid()
1796 hp = srng->u.dst_ring.cached_hp; in hal_srng_dst_num_valid()
1800 return (hp - tp) / srng->entry_size; in hal_srng_dst_num_valid()
1802 return (srng->ring_size - tp + hp) / srng->entry_size; in hal_srng_dst_num_valid()
1820 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_dst_inv_cached_descs() local
1829 if (!(srng->flags & HAL_SRNG_CACHED_DESC)) in hal_srng_dst_inv_cached_descs()
1835 first_desc = &srng->ring_base_vaddr[srng->u.dst_ring.tp]; in hal_srng_dst_inv_cached_descs()
1837 last_desc_index = (srng->u.dst_ring.tp + in hal_srng_dst_inv_cached_descs()
1838 (entry_count * srng->entry_size)) % in hal_srng_dst_inv_cached_descs()
1839 srng->ring_size; in hal_srng_dst_inv_cached_descs()
1841 last_desc = &srng->ring_base_vaddr[last_desc_index]; in hal_srng_dst_inv_cached_descs()
1850 (void *)srng->ring_vaddr_end); in hal_srng_dst_inv_cached_descs()
1853 qdf_nbuf_dma_inv_range_no_dsb((void *)srng->ring_base_vaddr, in hal_srng_dst_inv_cached_descs()
1878 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_dst_num_valid_locked() local
1880 SRNG_LOCK(&srng->lock); in hal_srng_dst_num_valid_locked()
1882 SRNG_UNLOCK(&srng->lock); in hal_srng_dst_num_valid_locked()
1897 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_sync_cachedhp() local
1900 hp = *(volatile uint32_t *)(srng->u.dst_ring.hp_addr); in hal_srng_sync_cachedhp()
1901 srng->u.dst_ring.cached_hp = hp; in hal_srng_sync_cachedhp()
1921 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_src_reap_next() local
1930 uint32_t next_reap_hp = (srng->u.src_ring.reap_hp + srng->entry_size) % in hal_srng_src_reap_next()
1931 srng->ring_size; in hal_srng_src_reap_next()
1933 if (next_reap_hp != srng->u.src_ring.cached_tp) { in hal_srng_src_reap_next()
1934 desc = &(srng->ring_base_vaddr[next_reap_hp]); in hal_srng_src_reap_next()
1935 srng->u.src_ring.reap_hp = next_reap_hp; in hal_srng_src_reap_next()
1955 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_src_get_next_reaped() local
1958 if (srng->u.src_ring.hp != srng->u.src_ring.reap_hp) { in hal_srng_src_get_next_reaped()
1959 desc = &(srng->ring_base_vaddr[srng->u.src_ring.hp]); in hal_srng_src_get_next_reaped()
1960 srng->u.src_ring.hp = (srng->u.src_ring.hp + srng->entry_size) % in hal_srng_src_get_next_reaped()
1961 srng->ring_size; in hal_srng_src_get_next_reaped()
1983 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_src_pending_reap_next() local
1986 uint32_t next_reap_hp = (srng->u.src_ring.reap_hp + srng->entry_size) % in hal_srng_src_pending_reap_next()
1987 srng->ring_size; in hal_srng_src_pending_reap_next()
1989 if (next_reap_hp != srng->u.src_ring.hp) { in hal_srng_src_pending_reap_next()
1990 desc = &(srng->ring_base_vaddr[next_reap_hp]); in hal_srng_src_pending_reap_next()
1991 srng->u.src_ring.reap_hp = next_reap_hp; in hal_srng_src_pending_reap_next()
2008 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_src_done_val() local
2015 uint32_t next_reap_hp = (srng->u.src_ring.reap_hp + srng->entry_size) % in hal_srng_src_done_val()
2016 srng->ring_size; in hal_srng_src_done_val()
2018 if (next_reap_hp == srng->u.src_ring.cached_tp) in hal_srng_src_done_val()
2021 if (srng->u.src_ring.cached_tp > next_reap_hp) in hal_srng_src_done_val()
2022 return (srng->u.src_ring.cached_tp - next_reap_hp) / in hal_srng_src_done_val()
2023 srng->entry_size; in hal_srng_src_done_val()
2025 return ((srng->ring_size - next_reap_hp) + in hal_srng_src_done_val()
2026 srng->u.src_ring.cached_tp) / srng->entry_size; in hal_srng_src_done_val()
2041 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_get_entrysize_from_srng() local
2043 return srng->entry_size << 2; in hal_get_entrysize_from_srng()
2059 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_get_sw_hptp() local
2061 if (srng->ring_dir == HAL_SRNG_SRC_RING) { in hal_get_sw_hptp()
2062 *headp = srng->u.src_ring.hp; in hal_get_sw_hptp()
2063 *tailp = *srng->u.src_ring.tp_addr; in hal_get_sw_hptp()
2065 *tailp = srng->u.dst_ring.tp; in hal_get_sw_hptp()
2066 *headp = *srng->u.dst_ring.hp_addr; in hal_get_sw_hptp()
2082 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_src_get_next_consumed() local
2090 uint32_t next_entry = (srng->last_desc_cleared + srng->entry_size) % in hal_srng_src_get_next_consumed()
2091 srng->ring_size; in hal_srng_src_get_next_consumed()
2093 if (next_entry != srng->u.src_ring.cached_tp) { in hal_srng_src_get_next_consumed()
2094 desc = &srng->ring_base_vaddr[next_entry]; in hal_srng_src_get_next_consumed()
2095 srng->last_desc_cleared = next_entry; in hal_srng_src_get_next_consumed()
2122 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_src_peek() local
2124 uint32_t next_hp = (srng->u.src_ring.hp + srng->entry_size) % in hal_srng_src_peek()
2125 srng->ring_size; in hal_srng_src_peek()
2127 if (next_hp != srng->u.src_ring.cached_tp) { in hal_srng_src_peek()
2128 desc = &(srng->ring_base_vaddr[srng->u.src_ring.hp]); in hal_srng_src_peek()
2147 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_src_get_next() local
2155 uint32_t next_hp = (srng->u.src_ring.hp + srng->entry_size) % in hal_srng_src_get_next()
2156 srng->ring_size; in hal_srng_src_get_next()
2158 if (next_hp != srng->u.src_ring.cached_tp) { in hal_srng_src_get_next()
2159 desc = &(srng->ring_base_vaddr[srng->u.src_ring.hp]); in hal_srng_src_get_next()
2160 srng->u.src_ring.hp = next_hp; in hal_srng_src_get_next()
2166 srng->u.src_ring.reap_hp = next_hp; in hal_srng_src_get_next()
2187 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_src_peek_n_get_next() local
2196 if (((srng->u.src_ring.hp + srng->entry_size) % in hal_srng_src_peek_n_get_next()
2197 srng->ring_size) != srng->u.src_ring.cached_tp) { in hal_srng_src_peek_n_get_next()
2198 desc = &(srng->ring_base_vaddr[(srng->u.src_ring.hp + in hal_srng_src_peek_n_get_next()
2199 srng->entry_size) % in hal_srng_src_peek_n_get_next()
2200 srng->ring_size]); in hal_srng_src_peek_n_get_next()
2218 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_src_dec_hp() local
2219 uint32_t hp = srng->u.src_ring.hp; in hal_srng_src_dec_hp()
2225 if (hp == srng->u.src_ring.cached_tp) in hal_srng_src_dec_hp()
2228 hp = srng->ring_size - srng->entry_size; in hal_srng_src_dec_hp()
2230 hp = (hp - srng->entry_size) % srng->ring_size; in hal_srng_src_dec_hp()
2232 srng->u.src_ring.hp = hp; in hal_srng_src_dec_hp()
2247 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_src_peek_n_get_next_next() local
2256 if ((((srng->u.src_ring.hp + (srng->entry_size)) % in hal_srng_src_peek_n_get_next_next()
2257 srng->ring_size) != srng->u.src_ring.cached_tp) && in hal_srng_src_peek_n_get_next_next()
2258 (((srng->u.src_ring.hp + (srng->entry_size * 2)) % in hal_srng_src_peek_n_get_next_next()
2259 srng->ring_size) != srng->u.src_ring.cached_tp)) { in hal_srng_src_peek_n_get_next_next()
2260 desc = &(srng->ring_base_vaddr[(srng->u.src_ring.hp + in hal_srng_src_peek_n_get_next_next()
2261 (srng->entry_size * 2)) % in hal_srng_src_peek_n_get_next_next()
2262 srng->ring_size]); in hal_srng_src_peek_n_get_next_next()
2281 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_src_get_cur_hp_n_move_next() local
2285 cur_desc = &srng->ring_base_vaddr[(srng->u.src_ring.hp)]; in hal_srng_src_get_cur_hp_n_move_next()
2287 next_hp = (srng->u.src_ring.hp + srng->entry_size) % in hal_srng_src_get_cur_hp_n_move_next()
2288 srng->ring_size; in hal_srng_src_get_cur_hp_n_move_next()
2290 if (next_hp != srng->u.src_ring.cached_tp) in hal_srng_src_get_cur_hp_n_move_next()
2291 srng->u.src_ring.hp = next_hp; in hal_srng_src_get_cur_hp_n_move_next()
2308 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_src_num_avail() local
2310 uint32_t hp = srng->u.src_ring.hp; in hal_srng_src_num_avail()
2313 tp = *(srng->u.src_ring.tp_addr); in hal_srng_src_num_avail()
2314 srng->u.src_ring.cached_tp = tp; in hal_srng_src_num_avail()
2316 tp = srng->u.src_ring.cached_tp; in hal_srng_src_num_avail()
2320 return ((tp - hp) / srng->entry_size) - 1; in hal_srng_src_num_avail()
2322 return ((srng->ring_size - hp + tp) / srng->entry_size) - 1; in hal_srng_src_num_avail()
2340 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_clear_ring_usage_wm_locked() local
2342 SRNG_LOCK(&srng->lock); in hal_srng_clear_ring_usage_wm_locked()
2343 srng->high_wm.val = 0; in hal_srng_clear_ring_usage_wm_locked()
2344 srng->high_wm.timestamp = 0; in hal_srng_clear_ring_usage_wm_locked()
2345 qdf_mem_zero(&srng->high_wm.bins[0], sizeof(srng->high_wm.bins[0]) * in hal_srng_clear_ring_usage_wm_locked()
2347 SRNG_UNLOCK(&srng->lock); in hal_srng_clear_ring_usage_wm_locked()
2363 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_update_ring_usage_wm_no_lock() local
2366 if (srng->ring_dir == HAL_SRNG_SRC_RING) in hal_srng_update_ring_usage_wm_no_lock()
2373 if (curr_wm_val > srng->high_wm.val) { in hal_srng_update_ring_usage_wm_no_lock()
2374 srng->high_wm.val = curr_wm_val; in hal_srng_update_ring_usage_wm_no_lock()
2375 srng->high_wm.timestamp = qdf_get_system_timestamp(); in hal_srng_update_ring_usage_wm_no_lock()
2379 srng->high_wm.bin_thresh[HAL_SRNG_HIGH_WM_BIN_90_to_100]) in hal_srng_update_ring_usage_wm_no_lock()
2380 srng->high_wm.bins[HAL_SRNG_HIGH_WM_BIN_90_to_100]++; in hal_srng_update_ring_usage_wm_no_lock()
2382 srng->high_wm.bin_thresh[HAL_SRNG_HIGH_WM_BIN_80_to_90]) in hal_srng_update_ring_usage_wm_no_lock()
2383 srng->high_wm.bins[HAL_SRNG_HIGH_WM_BIN_80_to_90]++; in hal_srng_update_ring_usage_wm_no_lock()
2385 srng->high_wm.bin_thresh[HAL_SRNG_HIGH_WM_BIN_70_to_80]) in hal_srng_update_ring_usage_wm_no_lock()
2386 srng->high_wm.bins[HAL_SRNG_HIGH_WM_BIN_70_to_80]++; in hal_srng_update_ring_usage_wm_no_lock()
2388 srng->high_wm.bin_thresh[HAL_SRNG_HIGH_WM_BIN_60_to_70]) in hal_srng_update_ring_usage_wm_no_lock()
2389 srng->high_wm.bins[HAL_SRNG_HIGH_WM_BIN_60_to_70]++; in hal_srng_update_ring_usage_wm_no_lock()
2391 srng->high_wm.bin_thresh[HAL_SRNG_HIGH_WM_BIN_50_to_60]) in hal_srng_update_ring_usage_wm_no_lock()
2392 srng->high_wm.bins[HAL_SRNG_HIGH_WM_BIN_50_to_60]++; in hal_srng_update_ring_usage_wm_no_lock()
2394 srng->high_wm.bins[HAL_SRNG_HIGH_WM_BIN_BELOW_50_PERCENT]++; in hal_srng_update_ring_usage_wm_no_lock()
2402 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_dump_srng_high_wm_stats() local
2406 srng->ring_id, srng->high_wm.val, in hal_dump_srng_high_wm_stats()
2407 srng->high_wm.timestamp, in hal_dump_srng_high_wm_stats()
2408 srng->high_wm.bins[HAL_SRNG_HIGH_WM_BIN_BELOW_50_PERCENT], in hal_dump_srng_high_wm_stats()
2409 srng->high_wm.bins[HAL_SRNG_HIGH_WM_BIN_50_to_60], in hal_dump_srng_high_wm_stats()
2410 srng->high_wm.bins[HAL_SRNG_HIGH_WM_BIN_60_to_70], in hal_dump_srng_high_wm_stats()
2411 srng->high_wm.bins[HAL_SRNG_HIGH_WM_BIN_70_to_80], in hal_dump_srng_high_wm_stats()
2412 srng->high_wm.bins[HAL_SRNG_HIGH_WM_BIN_80_to_90], in hal_dump_srng_high_wm_stats()
2413 srng->high_wm.bins[HAL_SRNG_HIGH_WM_BIN_90_to_100]); in hal_dump_srng_high_wm_stats()
2472 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_access_end_unlocked() local
2475 if (srng->flags & HAL_SRNG_LMAC_RING) { in hal_srng_access_end_unlocked()
2479 if (srng->ring_dir == HAL_SRNG_SRC_RING) { in hal_srng_access_end_unlocked()
2480 *srng->u.src_ring.hp_addr = in hal_srng_access_end_unlocked()
2481 qdf_cpu_to_le32(srng->u.src_ring.hp); in hal_srng_access_end_unlocked()
2483 *srng->u.dst_ring.tp_addr = in hal_srng_access_end_unlocked()
2484 qdf_cpu_to_le32(srng->u.dst_ring.tp); in hal_srng_access_end_unlocked()
2487 if (srng->ring_dir == HAL_SRNG_SRC_RING) in hal_srng_access_end_unlocked()
2489 srng, in hal_srng_access_end_unlocked()
2490 srng->u.src_ring.hp_addr, in hal_srng_access_end_unlocked()
2491 srng->u.src_ring.hp); in hal_srng_access_end_unlocked()
2494 srng, in hal_srng_access_end_unlocked()
2495 srng->u.dst_ring.tp_addr, in hal_srng_access_end_unlocked()
2496 srng->u.dst_ring.tp); in hal_srng_access_end_unlocked()
2521 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_access_end() local
2529 SRNG_UNLOCK(&(srng->lock)); in hal_srng_access_end()
2575 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_access_end_reap() local
2577 SRNG_UNLOCK(&(srng->lock)); in hal_srng_access_end_reap()
2761 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_get_hp_addr() local
2764 if (srng->ring_dir == HAL_SRNG_SRC_RING) { in hal_srng_get_hp_addr()
2765 if (srng->flags & HAL_SRNG_LMAC_RING) in hal_srng_get_hp_addr()
2767 ((unsigned long)(srng->u.src_ring.hp_addr) - in hal_srng_get_hp_addr()
2770 return (qdf_dma_addr_t)srng->u.src_ring.hp_addr; in hal_srng_get_hp_addr()
2773 ((unsigned long)srng->u.src_ring.hp_addr - in hal_srng_get_hp_addr()
2778 ((unsigned long)(srng->u.dst_ring.hp_addr) - in hal_srng_get_hp_addr()
2793 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_get_tp_addr() local
2796 if (srng->ring_dir == HAL_SRNG_SRC_RING) { in hal_srng_get_tp_addr()
2798 ((unsigned long)(srng->u.src_ring.tp_addr) - in hal_srng_get_tp_addr()
2801 if (srng->flags & HAL_SRNG_LMAC_RING) in hal_srng_get_tp_addr()
2803 ((unsigned long)(srng->u.dst_ring.tp_addr) - in hal_srng_get_tp_addr()
2806 return (qdf_dma_addr_t)srng->u.dst_ring.tp_addr; in hal_srng_get_tp_addr()
2809 ((unsigned long)srng->u.dst_ring.tp_addr - in hal_srng_get_tp_addr()
2825 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_get_num_entries() local
2827 return srng->num_entries; in hal_srng_get_num_entries()
2864 struct hal_srng *srng, bool idle_check, in hal_srng_dst_hw_init() argument
2867 hal->ops->hal_srng_dst_hw_init(hal, srng, idle_check, idx); in hal_srng_dst_hw_init()
2879 struct hal_srng *srng, bool idle_check, in hal_srng_src_hw_init() argument
2882 hal->ops->hal_srng_src_hw_init(hal, srng, idle_check, idx); in hal_srng_src_hw_init()
2892 void hal_srng_hw_disable(struct hal_soc *hal_soc, struct hal_srng *srng) in hal_srng_hw_disable() argument
2895 hal_soc->ops->hal_srng_hw_disable(hal_soc, srng); in hal_srng_hw_disable()
3066 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_dump_ring_desc() local
3069 ring_desc, (srng->entry_size << 2)); in hal_srng_dump_ring_desc()
3080 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_dump_ring() local
3084 tp = srng->u.dst_ring.tp; in hal_srng_dump_ring()
3088 tp = srng->ring_size; in hal_srng_dump_ring()
3090 desc = &srng->ring_base_vaddr[tp - srng->entry_size]; in hal_srng_dump_ring()
3093 desc, (srng->entry_size << 2)); in hal_srng_dump_ring()
3095 tp -= srng->entry_size; in hal_srng_dump_ring()
3121 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_set_event() local
3123 qdf_atomic_set_bit(event, &srng->srng_event); in hal_srng_set_event()
3136 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_clear_event() local
3138 qdf_atomic_clear_bit(event, &srng->srng_event); in hal_srng_clear_event()
3151 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_get_clear_event() local
3153 return qdf_atomic_test_and_clear_bit(event, &srng->srng_event); in hal_srng_get_clear_event()
3164 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_set_flush_last_ts() local
3166 srng->last_flush_ts = qdf_get_log_timestamp(); in hal_srng_set_flush_last_ts()
3177 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_inc_flush_cnt() local
3179 srng->flush_count++; in hal_srng_inc_flush_cnt()
3317 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_get_ring_usage() local
3321 if (srng->ring_dir == HAL_SRNG_SRC_RING) { in hal_get_ring_usage()
3323 num_avail = ((*tailp - *headp) / srng->entry_size) - 1; in hal_get_ring_usage()
3325 num_avail = ((srng->ring_size - *headp + *tailp) / in hal_get_ring_usage()
3326 srng->entry_size) - 1; in hal_get_ring_usage()
3330 num_valid = srng->num_entries - num_avail; in hal_get_ring_usage()
3333 num_valid = ((*headp - *tailp) / srng->entry_size); in hal_get_ring_usage()
3335 num_valid = ((srng->ring_size - *tailp + *headp) / in hal_get_ring_usage()
3336 srng->entry_size); in hal_get_ring_usage()
3338 ring_usage = (100 * num_valid) / srng->num_entries; in hal_get_ring_usage()
3416 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_dst_prefetch() local
3428 if (srng->u.dst_ring.tp == srng->u.dst_ring.cached_hp) in hal_srng_dst_prefetch()
3431 desc = (uint8_t *)&srng->ring_base_vaddr[srng->u.dst_ring.tp]; in hal_srng_dst_prefetch()
3437 desc += srng->entry_size * sizeof(uint32_t); in hal_srng_dst_prefetch()
3438 if (desc == ((uint8_t *)srng->ring_vaddr_end)) in hal_srng_dst_prefetch()
3439 desc = (uint8_t *)&srng->ring_base_vaddr[0]; in hal_srng_dst_prefetch()
3459 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_dst_prefetch_next_cached_desc() local
3461 if (srng->u.dst_ring.tp == srng->u.dst_ring.cached_hp) in hal_srng_dst_prefetch_next_cached_desc()
3464 last_prefetched_hw_desc += srng->entry_size * sizeof(uint32_t); in hal_srng_dst_prefetch_next_cached_desc()
3465 if (last_prefetched_hw_desc == ((uint8_t *)srng->ring_vaddr_end)) in hal_srng_dst_prefetch_next_cached_desc()
3466 last_prefetched_hw_desc = (uint8_t *)&srng->ring_base_vaddr[0]; in hal_srng_dst_prefetch_next_cached_desc()
3486 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_dst_prefetch_32_byte_desc() local
3489 if (srng->u.dst_ring.tp == srng->u.dst_ring.cached_hp) in hal_srng_dst_prefetch_32_byte_desc()
3492 desc = (uint8_t *)&srng->ring_base_vaddr[srng->u.dst_ring.tp]; in hal_srng_dst_prefetch_32_byte_desc()
3495 desc += srng->entry_size * sizeof(uint32_t); in hal_srng_dst_prefetch_32_byte_desc()
3497 desc += (srng->entry_size * sizeof(uint32_t)) * 2; in hal_srng_dst_prefetch_32_byte_desc()
3499 if (desc == ((uint8_t *)srng->ring_vaddr_end)) in hal_srng_dst_prefetch_32_byte_desc()
3500 desc = (uint8_t *)&srng->ring_base_vaddr[0]; in hal_srng_dst_prefetch_32_byte_desc()
3504 return (void *)(desc + srng->entry_size * sizeof(uint32_t)); in hal_srng_dst_prefetch_32_byte_desc()
3520 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_dst_get_next_32_byte_desc() local
3522 if (srng->u.dst_ring.tp == srng->u.dst_ring.cached_hp) in hal_srng_dst_get_next_32_byte_desc()
3525 last_prefetched_hw_desc += srng->entry_size * sizeof(uint32_t); in hal_srng_dst_get_next_32_byte_desc()
3526 if (last_prefetched_hw_desc == ((uint8_t *)srng->ring_vaddr_end)) in hal_srng_dst_get_next_32_byte_desc()
3527 last_prefetched_hw_desc = (uint8_t *)&srng->ring_base_vaddr[0]; in hal_srng_dst_get_next_32_byte_desc()
3542 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_src_set_hp() local
3544 srng->u.src_ring.hp = idx * srng->entry_size; in hal_srng_src_set_hp()
3557 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_dst_set_tp() local
3559 srng->u.dst_ring.tp = idx * srng->entry_size; in hal_srng_dst_set_tp()
3571 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_src_get_tpidx() local
3572 uint32_t tp = *(volatile uint32_t *)(srng->u.src_ring.tp_addr); in hal_srng_src_get_tpidx()
3574 return tp / srng->entry_size; in hal_srng_src_get_tpidx()
3586 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_dst_get_hpidx() local
3587 uint32_t hp = *(volatile uint32_t *)(srng->u.dst_ring.hp_addr); in hal_srng_dst_get_hpidx()
3589 return hp / srng->entry_size; in hal_srng_dst_get_hpidx()
3602 struct hal_srng *srng = (struct hal_srng *)hal_ring_hdl; in hal_srng_batch_threshold_irq_enabled() local
3604 if (srng->intr_batch_cntr_thres_entries && in hal_srng_batch_threshold_irq_enabled()
3605 srng->flags & HAL_SRNG_MSI_INTR) in hal_srng_batch_threshold_irq_enabled()