Lines Matching defs:pipe

222 static int ath12k_ce_rx_buf_enqueue_pipe(struct ath12k_ce_pipe *pipe,
225 struct ath12k_base *ab = pipe->ab;
226 struct ath12k_ce_ring *ring = pipe->dest_ring;
260 pipe->rx_buf_needed--;
271 static int ath12k_ce_rx_post_pipe(struct ath12k_ce_pipe *pipe)
273 struct ath12k_base *ab = pipe->ab;
278 if (!(pipe->dest_ring || pipe->status_ring))
282 while (pipe->rx_buf_needed) {
283 skb = dev_alloc_skb(pipe->buf_sz);
303 ret = ath12k_ce_rx_buf_enqueue_pipe(pipe, skb, paddr);
319 static int ath12k_ce_completed_recv_next(struct ath12k_ce_pipe *pipe,
322 struct ath12k_base *ab = pipe->ab;
331 sw_index = pipe->dest_ring->sw_index;
332 nentries_mask = pipe->dest_ring->nentries_mask;
334 srng = &ab->hal.srng_list[pipe->status_ring->hal_ring_id];
352 *skb = pipe->dest_ring->skb[sw_index];
353 pipe->dest_ring->skb[sw_index] = NULL;
356 pipe->dest_ring->sw_index = sw_index;
358 pipe->rx_buf_needed++;
369 static void ath12k_ce_recv_process_cb(struct ath12k_ce_pipe *pipe)
371 struct ath12k_base *ab = pipe->ab;
378 while (ath12k_ce_completed_recv_next(pipe, &skb, &nbytes) == 0) {
395 ath12k_dbg(ab, ATH12K_DBG_AHB, "rx ce pipe %d len %d\n",
396 pipe->pipe_num, skb->len);
397 pipe->recv_cb(ab, skb);
400 ret = ath12k_ce_rx_post_pipe(pipe);
402 ath12k_warn(ab, "failed to post rx buf to pipe: %d err: %d\n",
403 pipe->pipe_num, ret);
409 static struct sk_buff *ath12k_ce_completed_send_next(struct ath12k_ce_pipe *pipe)
411 struct ath12k_base *ab = pipe->ab;
420 sw_index = pipe->src_ring->sw_index;
421 nentries_mask = pipe->src_ring->nentries_mask;
423 srng = &ab->hal.srng_list[pipe->src_ring->hal_ring_id];
435 skb = pipe->src_ring->skb[sw_index];
437 pipe->src_ring->skb[sw_index] = NULL;
440 pipe->src_ring->sw_index = sw_index;
450 static void ath12k_ce_send_done_cb(struct ath12k_ce_pipe *pipe)
452 struct ath12k_base *ab = pipe->ab;
455 while (!IS_ERR(skb = ath12k_ce_completed_send_next(pipe))) {
582 struct ath12k_ce_pipe *pipe = &ab->ce.ce_pipe[ce_id];
588 pipe->attr_flags = attr->flags;
591 pipe->send_cb = ath12k_ce_send_done_cb;
597 pipe->src_ring = ring;
601 pipe->recv_cb = attr->recv_cb;
607 pipe->dest_ring = ring;
613 pipe->status_ring = ring;
621 struct ath12k_ce_pipe *pipe = &ab->ce.ce_pipe[ce_id];
623 if (pipe->send_cb)
624 pipe->send_cb(pipe);
626 if (pipe->recv_cb)
627 ath12k_ce_recv_process_cb(pipe);
632 struct ath12k_ce_pipe *pipe = &ab->ce.ce_pipe[pipe_id];
634 if ((pipe->attr_flags & CE_ATTR_DIS_INTR) && pipe->send_cb)
635 pipe->send_cb(pipe);
641 struct ath12k_ce_pipe *pipe = &ab->ce.ce_pipe[pipe_id];
654 if (pipe->attr_flags & CE_ATTR_DIS_INTR) {
656 write_index = pipe->src_ring->write_index;
658 sw_index = pipe->src_ring->sw_index;
663 num_used = pipe->src_ring->nentries - sw_index +
669 ath12k_ce_poll_send_completed(ab, pipe->pipe_num);
677 write_index = pipe->src_ring->write_index;
678 nentries_mask = pipe->src_ring->nentries_mask;
680 srng = &ab->hal.srng_list[pipe->src_ring->hal_ring_id];
699 if (pipe->attr_flags & CE_ATTR_BYTE_SWAP_DATA)
705 pipe->src_ring->skb[write_index] = skb;
706 pipe->src_ring->write_index = CE_RING_IDX_INCR(nentries_mask,
719 static void ath12k_ce_rx_pipe_cleanup(struct ath12k_ce_pipe *pipe)
721 struct ath12k_base *ab = pipe->ab;
722 struct ath12k_ce_ring *ring = pipe->dest_ring;
726 if (!(ring && pipe->buf_sz))
743 struct ath12k_ce_pipe *pipe;
747 pipe = &ab->ce.ce_pipe[pipe_num];
748 ath12k_ce_rx_pipe_cleanup(pipe);
759 struct ath12k_ce_pipe *pipe;
764 pipe = &ab->ce.ce_pipe[i];
765 ret = ath12k_ce_rx_post_pipe(pipe);
770 ath12k_warn(ab, "failed to post rx buf to pipe: %d err: %d\n",
827 struct ath12k_ce_pipe *pipe;
835 pipe = &ab->ce.ce_pipe[i];
837 if (pipe->src_ring) {
838 ret = ath12k_ce_init_ring(ab, pipe->src_ring, i,
847 pipe->src_ring->write_index = 0;
848 pipe->src_ring->sw_index = 0;
851 if (pipe->dest_ring) {
852 ret = ath12k_ce_init_ring(ab, pipe->dest_ring, i,
861 pipe->rx_buf_needed = pipe->dest_ring->nentries ?
862 pipe->dest_ring->nentries - 2 : 0;
864 pipe->dest_ring->write_index = 0;
865 pipe->dest_ring->sw_index = 0;
868 if (pipe->status_ring) {
869 ret = ath12k_ce_init_ring(ab, pipe->status_ring, i,
878 pipe->status_ring->write_index = 0;
879 pipe->status_ring->sw_index = 0;
888 struct ath12k_ce_pipe *pipe;
893 pipe = &ab->ce.ce_pipe[i];
895 if (pipe->src_ring) {
898 pipe->src_ring->nentries * desc_sz +
900 pipe->src_ring->base_addr_owner_space,
901 pipe->src_ring->base_addr_ce_space);
902 kfree(pipe->src_ring);
903 pipe->src_ring = NULL;
906 if (pipe->dest_ring) {
909 pipe->dest_ring->nentries * desc_sz +
911 pipe->dest_ring->base_addr_owner_space,
912 pipe->dest_ring->base_addr_ce_space);
913 kfree(pipe->dest_ring);
914 pipe->dest_ring = NULL;
917 if (pipe->status_ring) {
921 pipe->status_ring->nentries * desc_sz +
923 pipe->status_ring->base_addr_owner_space,
924 pipe->status_ring->base_addr_ce_space);
925 kfree(pipe->status_ring);
926 pipe->status_ring = NULL;
933 struct ath12k_ce_pipe *pipe;
942 pipe = &ab->ce.ce_pipe[i];
943 pipe->pipe_num = i;
944 pipe->ab = ab;
945 pipe->buf_sz = attr->src_sz_max;