Lines Matching refs:pipe

271 static int ath11k_ce_rx_buf_enqueue_pipe(struct ath11k_ce_pipe *pipe,  in ath11k_ce_rx_buf_enqueue_pipe()  argument
274 struct ath11k_base *ab = pipe->ab; in ath11k_ce_rx_buf_enqueue_pipe()
275 struct ath11k_ce_ring *ring = pipe->dest_ring; in ath11k_ce_rx_buf_enqueue_pipe()
309 pipe->rx_buf_needed--; in ath11k_ce_rx_buf_enqueue_pipe()
320 static int ath11k_ce_rx_post_pipe(struct ath11k_ce_pipe *pipe) in ath11k_ce_rx_post_pipe() argument
322 struct ath11k_base *ab = pipe->ab; in ath11k_ce_rx_post_pipe()
327 if (!(pipe->dest_ring || pipe->status_ring)) in ath11k_ce_rx_post_pipe()
331 while (pipe->rx_buf_needed) { in ath11k_ce_rx_post_pipe()
332 skb = dev_alloc_skb(pipe->buf_sz); in ath11k_ce_rx_post_pipe()
352 ret = ath11k_ce_rx_buf_enqueue_pipe(pipe, skb, paddr); in ath11k_ce_rx_post_pipe()
369 static int ath11k_ce_completed_recv_next(struct ath11k_ce_pipe *pipe, in ath11k_ce_completed_recv_next() argument
372 struct ath11k_base *ab = pipe->ab; in ath11k_ce_completed_recv_next()
381 sw_index = pipe->dest_ring->sw_index; in ath11k_ce_completed_recv_next()
382 nentries_mask = pipe->dest_ring->nentries_mask; in ath11k_ce_completed_recv_next()
384 srng = &ab->hal.srng_list[pipe->status_ring->hal_ring_id]; in ath11k_ce_completed_recv_next()
402 *skb = pipe->dest_ring->skb[sw_index]; in ath11k_ce_completed_recv_next()
403 pipe->dest_ring->skb[sw_index] = NULL; in ath11k_ce_completed_recv_next()
406 pipe->dest_ring->sw_index = sw_index; in ath11k_ce_completed_recv_next()
408 pipe->rx_buf_needed++; in ath11k_ce_completed_recv_next()
419 static void ath11k_ce_recv_process_cb(struct ath11k_ce_pipe *pipe) in ath11k_ce_recv_process_cb() argument
421 struct ath11k_base *ab = pipe->ab; in ath11k_ce_recv_process_cb()
428 while (ath11k_ce_completed_recv_next(pipe, &skb, &nbytes) == 0) { in ath11k_ce_recv_process_cb()
446 pipe->pipe_num, skb->len); in ath11k_ce_recv_process_cb()
447 pipe->recv_cb(ab, skb); in ath11k_ce_recv_process_cb()
450 ret = ath11k_ce_rx_post_pipe(pipe); in ath11k_ce_recv_process_cb()
453 pipe->pipe_num, ret); in ath11k_ce_recv_process_cb()
459 static struct sk_buff *ath11k_ce_completed_send_next(struct ath11k_ce_pipe *pipe) in ath11k_ce_completed_send_next() argument
461 struct ath11k_base *ab = pipe->ab; in ath11k_ce_completed_send_next()
470 sw_index = pipe->src_ring->sw_index; in ath11k_ce_completed_send_next()
471 nentries_mask = pipe->src_ring->nentries_mask; in ath11k_ce_completed_send_next()
473 srng = &ab->hal.srng_list[pipe->src_ring->hal_ring_id]; in ath11k_ce_completed_send_next()
485 skb = pipe->src_ring->skb[sw_index]; in ath11k_ce_completed_send_next()
487 pipe->src_ring->skb[sw_index] = NULL; in ath11k_ce_completed_send_next()
490 pipe->src_ring->sw_index = sw_index; in ath11k_ce_completed_send_next()
500 static void ath11k_ce_tx_process_cb(struct ath11k_ce_pipe *pipe) in ath11k_ce_tx_process_cb() argument
502 struct ath11k_base *ab = pipe->ab; in ath11k_ce_tx_process_cb()
507 while (!IS_ERR(skb = ath11k_ce_completed_send_next(pipe))) { in ath11k_ce_tx_process_cb()
514 if ((!pipe->send_cb) || ab->hw_params.credit_flow) { in ath11k_ce_tx_process_cb()
524 pipe->pipe_num, skb->len); in ath11k_ce_tx_process_cb()
525 pipe->send_cb(ab, skb); in ath11k_ce_tx_process_cb()
652 struct ath11k_ce_pipe *pipe = &ab->ce.ce_pipe[ce_id]; in ath11k_ce_alloc_pipe() local
658 pipe->attr_flags = attr->flags; in ath11k_ce_alloc_pipe()
661 pipe->send_cb = attr->send_cb; in ath11k_ce_alloc_pipe()
667 pipe->src_ring = ring; in ath11k_ce_alloc_pipe()
671 pipe->recv_cb = attr->recv_cb; in ath11k_ce_alloc_pipe()
677 pipe->dest_ring = ring; in ath11k_ce_alloc_pipe()
683 pipe->status_ring = ring; in ath11k_ce_alloc_pipe()
691 struct ath11k_ce_pipe *pipe = &ab->ce.ce_pipe[ce_id]; in ath11k_ce_per_engine_service() local
695 ath11k_ce_tx_process_cb(pipe); in ath11k_ce_per_engine_service()
697 if (pipe->recv_cb) in ath11k_ce_per_engine_service()
698 ath11k_ce_recv_process_cb(pipe); in ath11k_ce_per_engine_service()
703 struct ath11k_ce_pipe *pipe = &ab->ce.ce_pipe[pipe_id]; in ath11k_ce_poll_send_completed() local
706 if ((pipe->attr_flags & CE_ATTR_DIS_INTR) && attr->src_nentries) in ath11k_ce_poll_send_completed()
707 ath11k_ce_tx_process_cb(pipe); in ath11k_ce_poll_send_completed()
714 struct ath11k_ce_pipe *pipe = &ab->ce.ce_pipe[pipe_id]; in ath11k_ce_send() local
727 if (pipe->attr_flags & CE_ATTR_DIS_INTR) { in ath11k_ce_send()
729 write_index = pipe->src_ring->write_index; in ath11k_ce_send()
731 sw_index = pipe->src_ring->sw_index; in ath11k_ce_send()
736 num_used = pipe->src_ring->nentries - sw_index + in ath11k_ce_send()
742 ath11k_ce_poll_send_completed(ab, pipe->pipe_num); in ath11k_ce_send()
750 write_index = pipe->src_ring->write_index; in ath11k_ce_send()
751 nentries_mask = pipe->src_ring->nentries_mask; in ath11k_ce_send()
753 srng = &ab->hal.srng_list[pipe->src_ring->hal_ring_id]; in ath11k_ce_send()
772 if (pipe->attr_flags & CE_ATTR_BYTE_SWAP_DATA) in ath11k_ce_send()
778 pipe->src_ring->skb[write_index] = skb; in ath11k_ce_send()
779 pipe->src_ring->write_index = CE_RING_IDX_INCR(nentries_mask, in ath11k_ce_send()
801 static void ath11k_ce_rx_pipe_cleanup(struct ath11k_ce_pipe *pipe) in ath11k_ce_rx_pipe_cleanup() argument
803 struct ath11k_base *ab = pipe->ab; in ath11k_ce_rx_pipe_cleanup()
804 struct ath11k_ce_ring *ring = pipe->dest_ring; in ath11k_ce_rx_pipe_cleanup()
808 if (!(ring && pipe->buf_sz)) in ath11k_ce_rx_pipe_cleanup()
868 struct ath11k_ce_pipe *pipe; in ath11k_ce_cleanup_pipes() local
874 pipe = &ab->ce.ce_pipe[pipe_num]; in ath11k_ce_cleanup_pipes()
875 ath11k_ce_rx_pipe_cleanup(pipe); in ath11k_ce_cleanup_pipes()
887 struct ath11k_ce_pipe *pipe; in ath11k_ce_rx_post_buf() local
892 pipe = &ab->ce.ce_pipe[i]; in ath11k_ce_rx_post_buf()
893 ret = ath11k_ce_rx_post_pipe(pipe); in ath11k_ce_rx_post_buf()
918 struct ath11k_ce_pipe *pipe; in ath11k_ce_init_pipes() local
923 pipe = &ab->ce.ce_pipe[i]; in ath11k_ce_init_pipes()
925 if (pipe->src_ring) { in ath11k_ce_init_pipes()
926 ret = ath11k_ce_init_ring(ab, pipe->src_ring, i, in ath11k_ce_init_pipes()
935 pipe->src_ring->write_index = 0; in ath11k_ce_init_pipes()
936 pipe->src_ring->sw_index = 0; in ath11k_ce_init_pipes()
939 if (pipe->dest_ring) { in ath11k_ce_init_pipes()
940 ret = ath11k_ce_init_ring(ab, pipe->dest_ring, i, in ath11k_ce_init_pipes()
949 pipe->rx_buf_needed = pipe->dest_ring->nentries ? in ath11k_ce_init_pipes()
950 pipe->dest_ring->nentries - 2 : 0; in ath11k_ce_init_pipes()
952 pipe->dest_ring->write_index = 0; in ath11k_ce_init_pipes()
953 pipe->dest_ring->sw_index = 0; in ath11k_ce_init_pipes()
956 if (pipe->status_ring) { in ath11k_ce_init_pipes()
957 ret = ath11k_ce_init_ring(ab, pipe->status_ring, i, in ath11k_ce_init_pipes()
966 pipe->status_ring->write_index = 0; in ath11k_ce_init_pipes()
967 pipe->status_ring->sw_index = 0; in ath11k_ce_init_pipes()
976 struct ath11k_ce_pipe *pipe; in ath11k_ce_free_pipes() local
982 pipe = &ab->ce.ce_pipe[i]; in ath11k_ce_free_pipes()
987 if (pipe->src_ring) { in ath11k_ce_free_pipes()
989 ce_ring = pipe->src_ring; in ath11k_ce_free_pipes()
991 pipe->src_ring->nentries * desc_sz + in ath11k_ce_free_pipes()
995 kfree(pipe->src_ring); in ath11k_ce_free_pipes()
996 pipe->src_ring = NULL; in ath11k_ce_free_pipes()
999 if (pipe->dest_ring) { in ath11k_ce_free_pipes()
1001 ce_ring = pipe->dest_ring; in ath11k_ce_free_pipes()
1003 pipe->dest_ring->nentries * desc_sz + in ath11k_ce_free_pipes()
1007 kfree(pipe->dest_ring); in ath11k_ce_free_pipes()
1008 pipe->dest_ring = NULL; in ath11k_ce_free_pipes()
1011 if (pipe->status_ring) { in ath11k_ce_free_pipes()
1014 ce_ring = pipe->status_ring; in ath11k_ce_free_pipes()
1016 pipe->status_ring->nentries * desc_sz + in ath11k_ce_free_pipes()
1020 kfree(pipe->status_ring); in ath11k_ce_free_pipes()
1021 pipe->status_ring = NULL; in ath11k_ce_free_pipes()
1029 struct ath11k_ce_pipe *pipe; in ath11k_ce_alloc_pipes() local
1038 pipe = &ab->ce.ce_pipe[i]; in ath11k_ce_alloc_pipes()
1039 pipe->pipe_num = i; in ath11k_ce_alloc_pipes()
1040 pipe->ab = ab; in ath11k_ce_alloc_pipes()
1041 pipe->buf_sz = attr->src_sz_max; in ath11k_ce_alloc_pipes()