Lines Matching refs:src_ring
276 struct ath10k_ce_ring *src_ring = ce_state->src_ring; in ath10k_ce_send_nolock() local
278 unsigned int nentries_mask = src_ring->nentries_mask; in ath10k_ce_send_nolock()
279 unsigned int sw_index = src_ring->sw_index; in ath10k_ce_send_nolock()
280 unsigned int write_index = src_ring->write_index; in ath10k_ce_send_nolock()
295 desc = CE_SRC_RING_TO_DESC(src_ring->base_addr_owner_space, in ath10k_ce_send_nolock()
311 src_ring->per_transfer_context[write_index] = per_transfer_context; in ath10k_ce_send_nolock()
320 src_ring->write_index = write_index; in ath10k_ce_send_nolock()
329 struct ath10k_ce_ring *src_ring = pipe->src_ring; in __ath10k_ce_send_revert() local
339 if (WARN_ON_ONCE(src_ring->write_index == src_ring->sw_index)) in __ath10k_ce_send_revert()
342 if (WARN_ON_ONCE(src_ring->write_index == in __ath10k_ce_send_revert()
346 src_ring->write_index--; in __ath10k_ce_send_revert()
347 src_ring->write_index &= src_ring->nentries_mask; in __ath10k_ce_send_revert()
349 src_ring->per_transfer_context[src_ring->write_index] = NULL; in __ath10k_ce_send_revert()
378 delta = CE_RING_DELTA(pipe->src_ring->nentries_mask, in ath10k_ce_num_free_src_entries()
379 pipe->src_ring->write_index, in ath10k_ce_num_free_src_entries()
380 pipe->src_ring->sw_index - 1); in ath10k_ce_num_free_src_entries()
583 struct ath10k_ce_ring *src_ring = ce_state->src_ring; in ath10k_ce_completed_send_next_nolock() local
586 unsigned int nentries_mask = src_ring->nentries_mask; in ath10k_ce_completed_send_next_nolock()
587 unsigned int sw_index = src_ring->sw_index; in ath10k_ce_completed_send_next_nolock()
590 if (src_ring->hw_index == sw_index) { in ath10k_ce_completed_send_next_nolock()
604 src_ring->hw_index = read_index; in ath10k_ce_completed_send_next_nolock()
607 read_index = src_ring->hw_index; in ath10k_ce_completed_send_next_nolock()
614 src_ring->per_transfer_context[sw_index]; in ath10k_ce_completed_send_next_nolock()
617 src_ring->per_transfer_context[sw_index] = NULL; in ath10k_ce_completed_send_next_nolock()
621 src_ring->sw_index = sw_index; in ath10k_ce_completed_send_next_nolock()
633 struct ath10k_ce_ring *src_ring; in ath10k_ce_cancel_send_next() local
641 src_ring = ce_state->src_ring; in ath10k_ce_cancel_send_next()
643 if (!src_ring) in ath10k_ce_cancel_send_next()
651 nentries_mask = src_ring->nentries_mask; in ath10k_ce_cancel_send_next()
652 sw_index = src_ring->sw_index; in ath10k_ce_cancel_send_next()
653 write_index = src_ring->write_index; in ath10k_ce_cancel_send_next()
656 struct ce_desc *base = src_ring->base_addr_owner_space; in ath10k_ce_cancel_send_next()
667 src_ring->per_transfer_context[sw_index]; in ath10k_ce_cancel_send_next()
670 src_ring->per_transfer_context[sw_index] = NULL; in ath10k_ce_cancel_send_next()
674 src_ring->sw_index = sw_index; in ath10k_ce_cancel_send_next()
816 struct ath10k_ce_ring *src_ring = ce_state->src_ring; in ath10k_ce_init_src_ring() local
821 memset(src_ring->base_addr_owner_space, 0, in ath10k_ce_init_src_ring()
824 src_ring->sw_index = ath10k_ce_src_ring_read_index_get(ar, ctrl_addr); in ath10k_ce_init_src_ring()
825 src_ring->sw_index &= src_ring->nentries_mask; in ath10k_ce_init_src_ring()
826 src_ring->hw_index = src_ring->sw_index; in ath10k_ce_init_src_ring()
828 src_ring->write_index = in ath10k_ce_init_src_ring()
830 src_ring->write_index &= src_ring->nentries_mask; in ath10k_ce_init_src_ring()
833 src_ring->base_addr_ce_space); in ath10k_ce_init_src_ring()
842 ce_id, nentries, src_ring->base_addr_owner_space); in ath10k_ce_init_src_ring()
885 struct ath10k_ce_ring *src_ring; in ath10k_ce_alloc_src_ring() local
891 src_ring = kzalloc(sizeof(*src_ring) + in ath10k_ce_alloc_src_ring()
893 sizeof(*src_ring->per_transfer_context)), in ath10k_ce_alloc_src_ring()
895 if (src_ring == NULL) in ath10k_ce_alloc_src_ring()
898 src_ring->nentries = nentries; in ath10k_ce_alloc_src_ring()
899 src_ring->nentries_mask = nentries - 1; in ath10k_ce_alloc_src_ring()
905 src_ring->base_addr_owner_space_unaligned = in ath10k_ce_alloc_src_ring()
910 if (!src_ring->base_addr_owner_space_unaligned) { in ath10k_ce_alloc_src_ring()
911 kfree(src_ring); in ath10k_ce_alloc_src_ring()
915 src_ring->base_addr_ce_space_unaligned = base_addr; in ath10k_ce_alloc_src_ring()
917 src_ring->base_addr_owner_space = PTR_ALIGN( in ath10k_ce_alloc_src_ring()
918 src_ring->base_addr_owner_space_unaligned, in ath10k_ce_alloc_src_ring()
920 src_ring->base_addr_ce_space = ALIGN( in ath10k_ce_alloc_src_ring()
921 src_ring->base_addr_ce_space_unaligned, in ath10k_ce_alloc_src_ring()
924 return src_ring; in ath10k_ce_alloc_src_ring()
1071 ce_state->src_ring = ath10k_ce_alloc_src_ring(ar, ce_id, attr); in ath10k_ce_alloc_pipe()
1072 if (IS_ERR(ce_state->src_ring)) { in ath10k_ce_alloc_pipe()
1073 ret = PTR_ERR(ce_state->src_ring); in ath10k_ce_alloc_pipe()
1076 ce_state->src_ring = NULL; in ath10k_ce_alloc_pipe()
1101 if (ce_state->src_ring) { in ath10k_ce_free_pipe()
1103 (ce_state->src_ring->nentries * in ath10k_ce_free_pipe()
1106 ce_state->src_ring->base_addr_owner_space, in ath10k_ce_free_pipe()
1107 ce_state->src_ring->base_addr_ce_space); in ath10k_ce_free_pipe()
1108 kfree(ce_state->src_ring); in ath10k_ce_free_pipe()
1121 ce_state->src_ring = NULL; in ath10k_ce_free_pipe()