Lines Matching refs:pipe
263 static int ath11k_ce_rx_buf_enqueue_pipe(struct ath11k_ce_pipe *pipe, in ath11k_ce_rx_buf_enqueue_pipe() argument
266 struct ath11k_base *ab = pipe->ab; in ath11k_ce_rx_buf_enqueue_pipe()
267 struct ath11k_ce_ring *ring = pipe->dest_ring; in ath11k_ce_rx_buf_enqueue_pipe()
301 pipe->rx_buf_needed--; in ath11k_ce_rx_buf_enqueue_pipe()
312 static int ath11k_ce_rx_post_pipe(struct ath11k_ce_pipe *pipe) in ath11k_ce_rx_post_pipe() argument
314 struct ath11k_base *ab = pipe->ab; in ath11k_ce_rx_post_pipe()
319 if (!(pipe->dest_ring || pipe->status_ring)) in ath11k_ce_rx_post_pipe()
323 while (pipe->rx_buf_needed) { in ath11k_ce_rx_post_pipe()
324 skb = dev_alloc_skb(pipe->buf_sz); in ath11k_ce_rx_post_pipe()
344 ret = ath11k_ce_rx_buf_enqueue_pipe(pipe, skb, paddr); in ath11k_ce_rx_post_pipe()
361 static int ath11k_ce_completed_recv_next(struct ath11k_ce_pipe *pipe, in ath11k_ce_completed_recv_next() argument
364 struct ath11k_base *ab = pipe->ab; in ath11k_ce_completed_recv_next()
373 sw_index = pipe->dest_ring->sw_index; in ath11k_ce_completed_recv_next()
374 nentries_mask = pipe->dest_ring->nentries_mask; in ath11k_ce_completed_recv_next()
376 srng = &ab->hal.srng_list[pipe->status_ring->hal_ring_id]; in ath11k_ce_completed_recv_next()
394 *skb = pipe->dest_ring->skb[sw_index]; in ath11k_ce_completed_recv_next()
395 pipe->dest_ring->skb[sw_index] = NULL; in ath11k_ce_completed_recv_next()
398 pipe->dest_ring->sw_index = sw_index; in ath11k_ce_completed_recv_next()
400 pipe->rx_buf_needed++; in ath11k_ce_completed_recv_next()
411 static void ath11k_ce_recv_process_cb(struct ath11k_ce_pipe *pipe) in ath11k_ce_recv_process_cb() argument
413 struct ath11k_base *ab = pipe->ab; in ath11k_ce_recv_process_cb()
420 while (ath11k_ce_completed_recv_next(pipe, &skb, &nbytes) == 0) { in ath11k_ce_recv_process_cb()
438 pipe->pipe_num, skb->len); in ath11k_ce_recv_process_cb()
439 pipe->recv_cb(ab, skb); in ath11k_ce_recv_process_cb()
442 ret = ath11k_ce_rx_post_pipe(pipe); in ath11k_ce_recv_process_cb()
445 pipe->pipe_num, ret); in ath11k_ce_recv_process_cb()
451 static struct sk_buff *ath11k_ce_completed_send_next(struct ath11k_ce_pipe *pipe) in ath11k_ce_completed_send_next() argument
453 struct ath11k_base *ab = pipe->ab; in ath11k_ce_completed_send_next()
462 sw_index = pipe->src_ring->sw_index; in ath11k_ce_completed_send_next()
463 nentries_mask = pipe->src_ring->nentries_mask; in ath11k_ce_completed_send_next()
465 srng = &ab->hal.srng_list[pipe->src_ring->hal_ring_id]; in ath11k_ce_completed_send_next()
477 skb = pipe->src_ring->skb[sw_index]; in ath11k_ce_completed_send_next()
479 pipe->src_ring->skb[sw_index] = NULL; in ath11k_ce_completed_send_next()
482 pipe->src_ring->sw_index = sw_index; in ath11k_ce_completed_send_next()
492 static void ath11k_ce_send_done_cb(struct ath11k_ce_pipe *pipe) in ath11k_ce_send_done_cb() argument
494 struct ath11k_base *ab = pipe->ab; in ath11k_ce_send_done_cb()
497 while (!IS_ERR(skb = ath11k_ce_completed_send_next(pipe))) { in ath11k_ce_send_done_cb()
630 struct ath11k_ce_pipe *pipe = &ab->ce.ce_pipe[ce_id]; in ath11k_ce_alloc_pipe() local
636 pipe->attr_flags = attr->flags; in ath11k_ce_alloc_pipe()
639 pipe->send_cb = ath11k_ce_send_done_cb; in ath11k_ce_alloc_pipe()
645 pipe->src_ring = ring; in ath11k_ce_alloc_pipe()
649 pipe->recv_cb = attr->recv_cb; in ath11k_ce_alloc_pipe()
655 pipe->dest_ring = ring; in ath11k_ce_alloc_pipe()
661 pipe->status_ring = ring; in ath11k_ce_alloc_pipe()
669 struct ath11k_ce_pipe *pipe = &ab->ce.ce_pipe[ce_id]; in ath11k_ce_per_engine_service() local
671 if (pipe->send_cb) in ath11k_ce_per_engine_service()
672 pipe->send_cb(pipe); in ath11k_ce_per_engine_service()
674 if (pipe->recv_cb) in ath11k_ce_per_engine_service()
675 ath11k_ce_recv_process_cb(pipe); in ath11k_ce_per_engine_service()
680 struct ath11k_ce_pipe *pipe = &ab->ce.ce_pipe[pipe_id]; in ath11k_ce_poll_send_completed() local
682 if ((pipe->attr_flags & CE_ATTR_DIS_INTR) && pipe->send_cb) in ath11k_ce_poll_send_completed()
683 pipe->send_cb(pipe); in ath11k_ce_poll_send_completed()
690 struct ath11k_ce_pipe *pipe = &ab->ce.ce_pipe[pipe_id]; in ath11k_ce_send() local
703 if (pipe->attr_flags & CE_ATTR_DIS_INTR) { in ath11k_ce_send()
705 write_index = pipe->src_ring->write_index; in ath11k_ce_send()
707 sw_index = pipe->src_ring->sw_index; in ath11k_ce_send()
712 num_used = pipe->src_ring->nentries - sw_index + in ath11k_ce_send()
718 ath11k_ce_poll_send_completed(ab, pipe->pipe_num); in ath11k_ce_send()
726 write_index = pipe->src_ring->write_index; in ath11k_ce_send()
727 nentries_mask = pipe->src_ring->nentries_mask; in ath11k_ce_send()
729 srng = &ab->hal.srng_list[pipe->src_ring->hal_ring_id]; in ath11k_ce_send()
748 if (pipe->attr_flags & CE_ATTR_BYTE_SWAP_DATA) in ath11k_ce_send()
754 pipe->src_ring->skb[write_index] = skb; in ath11k_ce_send()
755 pipe->src_ring->write_index = CE_RING_IDX_INCR(nentries_mask, in ath11k_ce_send()
777 static void ath11k_ce_rx_pipe_cleanup(struct ath11k_ce_pipe *pipe) in ath11k_ce_rx_pipe_cleanup() argument
779 struct ath11k_base *ab = pipe->ab; in ath11k_ce_rx_pipe_cleanup()
780 struct ath11k_ce_ring *ring = pipe->dest_ring; in ath11k_ce_rx_pipe_cleanup()
784 if (!(ring && pipe->buf_sz)) in ath11k_ce_rx_pipe_cleanup()
844 struct ath11k_ce_pipe *pipe; in ath11k_ce_cleanup_pipes() local
850 pipe = &ab->ce.ce_pipe[pipe_num]; in ath11k_ce_cleanup_pipes()
851 ath11k_ce_rx_pipe_cleanup(pipe); in ath11k_ce_cleanup_pipes()
863 struct ath11k_ce_pipe *pipe; in ath11k_ce_rx_post_buf() local
868 pipe = &ab->ce.ce_pipe[i]; in ath11k_ce_rx_post_buf()
869 ret = ath11k_ce_rx_post_pipe(pipe); in ath11k_ce_rx_post_buf()
894 struct ath11k_ce_pipe *pipe; in ath11k_ce_init_pipes() local
902 pipe = &ab->ce.ce_pipe[i]; in ath11k_ce_init_pipes()
904 if (pipe->src_ring) { in ath11k_ce_init_pipes()
905 ret = ath11k_ce_init_ring(ab, pipe->src_ring, i, in ath11k_ce_init_pipes()
914 pipe->src_ring->write_index = 0; in ath11k_ce_init_pipes()
915 pipe->src_ring->sw_index = 0; in ath11k_ce_init_pipes()
918 if (pipe->dest_ring) { in ath11k_ce_init_pipes()
919 ret = ath11k_ce_init_ring(ab, pipe->dest_ring, i, in ath11k_ce_init_pipes()
928 pipe->rx_buf_needed = pipe->dest_ring->nentries ? in ath11k_ce_init_pipes()
929 pipe->dest_ring->nentries - 2 : 0; in ath11k_ce_init_pipes()
931 pipe->dest_ring->write_index = 0; in ath11k_ce_init_pipes()
932 pipe->dest_ring->sw_index = 0; in ath11k_ce_init_pipes()
935 if (pipe->status_ring) { in ath11k_ce_init_pipes()
936 ret = ath11k_ce_init_ring(ab, pipe->status_ring, i, in ath11k_ce_init_pipes()
945 pipe->status_ring->write_index = 0; in ath11k_ce_init_pipes()
946 pipe->status_ring->sw_index = 0; in ath11k_ce_init_pipes()
955 struct ath11k_ce_pipe *pipe; in ath11k_ce_free_pipes() local
960 pipe = &ab->ce.ce_pipe[i]; in ath11k_ce_free_pipes()
965 if (pipe->src_ring) { in ath11k_ce_free_pipes()
968 pipe->src_ring->nentries * desc_sz + in ath11k_ce_free_pipes()
970 pipe->src_ring->base_addr_owner_space, in ath11k_ce_free_pipes()
971 pipe->src_ring->base_addr_ce_space); in ath11k_ce_free_pipes()
972 kfree(pipe->src_ring); in ath11k_ce_free_pipes()
973 pipe->src_ring = NULL; in ath11k_ce_free_pipes()
976 if (pipe->dest_ring) { in ath11k_ce_free_pipes()
979 pipe->dest_ring->nentries * desc_sz + in ath11k_ce_free_pipes()
981 pipe->dest_ring->base_addr_owner_space, in ath11k_ce_free_pipes()
982 pipe->dest_ring->base_addr_ce_space); in ath11k_ce_free_pipes()
983 kfree(pipe->dest_ring); in ath11k_ce_free_pipes()
984 pipe->dest_ring = NULL; in ath11k_ce_free_pipes()
987 if (pipe->status_ring) { in ath11k_ce_free_pipes()
991 pipe->status_ring->nentries * desc_sz + in ath11k_ce_free_pipes()
993 pipe->status_ring->base_addr_owner_space, in ath11k_ce_free_pipes()
994 pipe->status_ring->base_addr_ce_space); in ath11k_ce_free_pipes()
995 kfree(pipe->status_ring); in ath11k_ce_free_pipes()
996 pipe->status_ring = NULL; in ath11k_ce_free_pipes()
1004 struct ath11k_ce_pipe *pipe; in ath11k_ce_alloc_pipes() local
1013 pipe = &ab->ce.ce_pipe[i]; in ath11k_ce_alloc_pipes()
1014 pipe->pipe_num = i; in ath11k_ce_alloc_pipes()
1015 pipe->ab = ab; in ath11k_ce_alloc_pipes()
1016 pipe->buf_sz = attr->src_sz_max; in ath11k_ce_alloc_pipes()