• Home
  • Raw
  • Download

Lines Matching full:ab

225 	struct ath12k_base *ab = pipe->ab;  in ath12k_ce_rx_buf_enqueue_pipe()  local
233 lockdep_assert_held(&ab->ce.ce_lock); in ath12k_ce_rx_buf_enqueue_pipe()
237 srng = &ab->hal.srng_list[ring->hal_ring_id]; in ath12k_ce_rx_buf_enqueue_pipe()
241 ath12k_hal_srng_access_begin(ab, srng); in ath12k_ce_rx_buf_enqueue_pipe()
243 if (unlikely(ath12k_hal_srng_src_num_free(ab, srng, false) < 1)) { in ath12k_ce_rx_buf_enqueue_pipe()
248 desc = ath12k_hal_srng_src_get_next_entry(ab, srng); in ath12k_ce_rx_buf_enqueue_pipe()
264 ath12k_hal_srng_access_end(ab, srng); in ath12k_ce_rx_buf_enqueue_pipe()
273 struct ath12k_base *ab = pipe->ab; in ath12k_ce_rx_post_pipe() local
281 spin_lock_bh(&ab->ce.ce_lock); in ath12k_ce_rx_post_pipe()
291 paddr = dma_map_single(ab->dev, skb->data, in ath12k_ce_rx_post_pipe()
294 if (unlikely(dma_mapping_error(ab->dev, paddr))) { in ath12k_ce_rx_post_pipe()
295 ath12k_warn(ab, "failed to dma map ce rx buf\n"); in ath12k_ce_rx_post_pipe()
305 ath12k_warn(ab, "failed to enqueue rx buf: %d\n", ret); in ath12k_ce_rx_post_pipe()
306 dma_unmap_single(ab->dev, paddr, in ath12k_ce_rx_post_pipe()
315 spin_unlock_bh(&ab->ce.ce_lock); in ath12k_ce_rx_post_pipe()
322 struct ath12k_base *ab = pipe->ab; in ath12k_ce_completed_recv_next() local
329 spin_lock_bh(&ab->ce.ce_lock); in ath12k_ce_completed_recv_next()
334 srng = &ab->hal.srng_list[pipe->status_ring->hal_ring_id]; in ath12k_ce_completed_recv_next()
338 ath12k_hal_srng_access_begin(ab, srng); in ath12k_ce_completed_recv_next()
340 desc = ath12k_hal_srng_dst_get_next_entry(ab, srng); in ath12k_ce_completed_recv_next()
359 ath12k_hal_srng_access_end(ab, srng); in ath12k_ce_completed_recv_next()
363 spin_unlock_bh(&ab->ce.ce_lock); in ath12k_ce_completed_recv_next()
370 struct ath12k_base *ab = pipe->ab; in ath12k_ce_recv_process_cb() local
379 dma_unmap_single(ab->dev, ATH12K_SKB_RXCB(skb)->paddr, in ath12k_ce_recv_process_cb()
383 ath12k_warn(ab, "unexpected rx length (nbytes %d, max %d)", in ath12k_ce_recv_process_cb()
394 ath12k_dbg(ab, ATH12K_DBG_AHB, "rx ce pipe %d len %d\n", in ath12k_ce_recv_process_cb()
396 pipe->recv_cb(ab, skb); in ath12k_ce_recv_process_cb()
401 ath12k_warn(ab, "failed to post rx buf to pipe: %d err: %d\n", in ath12k_ce_recv_process_cb()
403 mod_timer(&ab->rx_replenish_retry, in ath12k_ce_recv_process_cb()
410 struct ath12k_base *ab = pipe->ab; in ath12k_ce_completed_send_next() local
417 spin_lock_bh(&ab->ce.ce_lock); in ath12k_ce_completed_send_next()
422 srng = &ab->hal.srng_list[pipe->src_ring->hal_ring_id]; in ath12k_ce_completed_send_next()
426 ath12k_hal_srng_access_begin(ab, srng); in ath12k_ce_completed_send_next()
428 desc = ath12k_hal_srng_src_reap_next(ab, srng); in ath12k_ce_completed_send_next()
444 spin_unlock_bh(&ab->ce.ce_lock); in ath12k_ce_completed_send_next()
451 struct ath12k_base *ab = pipe->ab; in ath12k_ce_send_done_cb() local
458 dma_unmap_single(ab->dev, ATH12K_SKB_CB(skb)->paddr, skb->len, in ath12k_ce_send_done_cb()
464 static void ath12k_ce_srng_msi_ring_params_setup(struct ath12k_base *ab, u32 ce_id, in ath12k_ce_srng_msi_ring_params_setup() argument
474 ret = ath12k_hif_get_user_msi_vector(ab, "CE", in ath12k_ce_srng_msi_ring_params_setup()
481 ath12k_hif_get_msi_address(ab, &addr_lo, &addr_hi); in ath12k_ce_srng_msi_ring_params_setup()
482 ath12k_hif_get_ce_msi_idx(ab, ce_id, &msi_data_idx); in ath12k_ce_srng_msi_ring_params_setup()
490 static int ath12k_ce_init_ring(struct ath12k_base *ab, in ath12k_ce_init_ring() argument
501 if (!(CE_ATTR_DIS_INTR & ab->hw_params->host_ce_config[ce_id].flags)) in ath12k_ce_init_ring()
502 ath12k_ce_srng_msi_ring_params_setup(ab, ce_id, &params); in ath12k_ce_init_ring()
506 if (!(CE_ATTR_DIS_INTR & ab->hw_params->host_ce_config[ce_id].flags)) in ath12k_ce_init_ring()
510 params.max_buffer_len = ab->hw_params->host_ce_config[ce_id].src_sz_max; in ath12k_ce_init_ring()
511 if (!(ab->hw_params->host_ce_config[ce_id].flags & CE_ATTR_DIS_INTR)) { in ath12k_ce_init_ring()
518 if (!(ab->hw_params->host_ce_config[ce_id].flags & CE_ATTR_DIS_INTR)) { in ath12k_ce_init_ring()
524 ath12k_warn(ab, "Invalid CE ring type %d\n", type); in ath12k_ce_init_ring()
530 ret = ath12k_hal_srng_setup(ab, type, ce_id, 0, &params); in ath12k_ce_init_ring()
532 ath12k_warn(ab, "failed to setup srng: %d ring_id %d\n", in ath12k_ce_init_ring()
543 ath12k_ce_alloc_ring(struct ath12k_base *ab, int nentries, int desc_sz) in ath12k_ce_alloc_ring() argument
559 dma_alloc_coherent(ab->dev, in ath12k_ce_alloc_ring()
579 static int ath12k_ce_alloc_pipe(struct ath12k_base *ab, int ce_id) in ath12k_ce_alloc_pipe() argument
581 struct ath12k_ce_pipe *pipe = &ab->ce.ce_pipe[ce_id]; in ath12k_ce_alloc_pipe()
582 const struct ce_attr *attr = &ab->hw_params->host_ce_config[ce_id]; in ath12k_ce_alloc_pipe()
593 ring = ath12k_ce_alloc_ring(ab, nentries, desc_sz); in ath12k_ce_alloc_pipe()
603 ring = ath12k_ce_alloc_ring(ab, nentries, desc_sz); in ath12k_ce_alloc_pipe()
609 ring = ath12k_ce_alloc_ring(ab, nentries, desc_sz); in ath12k_ce_alloc_pipe()
618 void ath12k_ce_per_engine_service(struct ath12k_base *ab, u16 ce_id) in ath12k_ce_per_engine_service() argument
620 struct ath12k_ce_pipe *pipe = &ab->ce.ce_pipe[ce_id]; in ath12k_ce_per_engine_service()
629 void ath12k_ce_poll_send_completed(struct ath12k_base *ab, u8 pipe_id) in ath12k_ce_poll_send_completed() argument
631 struct ath12k_ce_pipe *pipe = &ab->ce.ce_pipe[pipe_id]; in ath12k_ce_poll_send_completed()
637 int ath12k_ce_send(struct ath12k_base *ab, struct sk_buff *skb, u8 pipe_id, in ath12k_ce_send() argument
640 struct ath12k_ce_pipe *pipe = &ab->ce.ce_pipe[pipe_id]; in ath12k_ce_send()
654 spin_lock_bh(&ab->ce.ce_lock); in ath12k_ce_send()
665 spin_unlock_bh(&ab->ce.ce_lock); in ath12k_ce_send()
668 ath12k_ce_poll_send_completed(ab, pipe->pipe_num); in ath12k_ce_send()
671 if (test_bit(ATH12K_FLAG_CRASH_FLUSH, &ab->dev_flags)) in ath12k_ce_send()
674 spin_lock_bh(&ab->ce.ce_lock); in ath12k_ce_send()
679 srng = &ab->hal.srng_list[pipe->src_ring->hal_ring_id]; in ath12k_ce_send()
683 ath12k_hal_srng_access_begin(ab, srng); in ath12k_ce_send()
685 if (unlikely(ath12k_hal_srng_src_num_free(ab, srng, false) < 1)) { in ath12k_ce_send()
686 ath12k_hal_srng_access_end(ab, srng); in ath12k_ce_send()
691 desc = ath12k_hal_srng_src_get_next_reaped(ab, srng); in ath12k_ce_send()
693 ath12k_hal_srng_access_end(ab, srng); in ath12k_ce_send()
708 ath12k_hal_srng_access_end(ab, srng); in ath12k_ce_send()
713 spin_unlock_bh(&ab->ce.ce_lock); in ath12k_ce_send()
720 struct ath12k_base *ab = pipe->ab; in ath12k_ce_rx_pipe_cleanup() local
734 dma_unmap_single(ab->dev, ATH12K_SKB_RXCB(skb)->paddr, in ath12k_ce_rx_pipe_cleanup()
740 void ath12k_ce_cleanup_pipes(struct ath12k_base *ab) in ath12k_ce_cleanup_pipes() argument
745 for (pipe_num = 0; pipe_num < ab->hw_params->ce_count; pipe_num++) { in ath12k_ce_cleanup_pipes()
746 pipe = &ab->ce.ce_pipe[pipe_num]; in ath12k_ce_cleanup_pipes()
750 ath12k_ce_poll_send_completed(ab, pipe_num); in ath12k_ce_cleanup_pipes()
756 void ath12k_ce_rx_post_buf(struct ath12k_base *ab) in ath12k_ce_rx_post_buf() argument
762 for (i = 0; i < ab->hw_params->ce_count; i++) { in ath12k_ce_rx_post_buf()
763 pipe = &ab->ce.ce_pipe[i]; in ath12k_ce_rx_post_buf()
769 ath12k_warn(ab, "failed to post rx buf to pipe: %d err: %d\n", in ath12k_ce_rx_post_buf()
771 mod_timer(&ab->rx_replenish_retry, in ath12k_ce_rx_post_buf()
781 struct ath12k_base *ab = from_timer(ab, t, rx_replenish_retry); in ath12k_ce_rx_replenish_retry() local
783 ath12k_ce_rx_post_buf(ab); in ath12k_ce_rx_replenish_retry()
786 static void ath12k_ce_shadow_config(struct ath12k_base *ab) in ath12k_ce_shadow_config() argument
790 for (i = 0; i < ab->hw_params->ce_count; i++) { in ath12k_ce_shadow_config()
791 if (ab->hw_params->host_ce_config[i].src_nentries) in ath12k_ce_shadow_config()
792 ath12k_hal_srng_update_shadow_config(ab, HAL_CE_SRC, i); in ath12k_ce_shadow_config()
794 if (ab->hw_params->host_ce_config[i].dest_nentries) { in ath12k_ce_shadow_config()
795 ath12k_hal_srng_update_shadow_config(ab, HAL_CE_DST, i); in ath12k_ce_shadow_config()
796 ath12k_hal_srng_update_shadow_config(ab, HAL_CE_DST_STATUS, i); in ath12k_ce_shadow_config()
801 void ath12k_ce_get_shadow_config(struct ath12k_base *ab, in ath12k_ce_get_shadow_config() argument
804 if (!ab->hw_params->supports_shadow_regs) in ath12k_ce_get_shadow_config()
807 ath12k_hal_srng_get_shadow_config(ab, shadow_cfg, shadow_cfg_len); in ath12k_ce_get_shadow_config()
817 ath12k_hal_srng_shadow_config(ab); in ath12k_ce_get_shadow_config()
818 ath12k_ce_shadow_config(ab); in ath12k_ce_get_shadow_config()
821 ath12k_hal_srng_get_shadow_config(ab, shadow_cfg, shadow_cfg_len); in ath12k_ce_get_shadow_config()
824 int ath12k_ce_init_pipes(struct ath12k_base *ab) in ath12k_ce_init_pipes() argument
830 ath12k_ce_get_shadow_config(ab, &ab->qmi.ce_cfg.shadow_reg_v3, in ath12k_ce_init_pipes()
831 &ab->qmi.ce_cfg.shadow_reg_v3_len); in ath12k_ce_init_pipes()
833 for (i = 0; i < ab->hw_params->ce_count; i++) { in ath12k_ce_init_pipes()
834 pipe = &ab->ce.ce_pipe[i]; in ath12k_ce_init_pipes()
837 ret = ath12k_ce_init_ring(ab, pipe->src_ring, i, in ath12k_ce_init_pipes()
840 ath12k_warn(ab, "failed to init src ring: %d\n", in ath12k_ce_init_pipes()
851 ret = ath12k_ce_init_ring(ab, pipe->dest_ring, i, in ath12k_ce_init_pipes()
854 ath12k_warn(ab, "failed to init dest ring: %d\n", in ath12k_ce_init_pipes()
868 ret = ath12k_ce_init_ring(ab, pipe->status_ring, i, in ath12k_ce_init_pipes()
871 ath12k_warn(ab, "failed to init dest status ing: %d\n", in ath12k_ce_init_pipes()
885 void ath12k_ce_free_pipes(struct ath12k_base *ab) in ath12k_ce_free_pipes() argument
891 for (i = 0; i < ab->hw_params->ce_count; i++) { in ath12k_ce_free_pipes()
892 pipe = &ab->ce.ce_pipe[i]; in ath12k_ce_free_pipes()
896 dma_free_coherent(ab->dev, in ath12k_ce_free_pipes()
907 dma_free_coherent(ab->dev, in ath12k_ce_free_pipes()
919 dma_free_coherent(ab->dev, in ath12k_ce_free_pipes()
930 int ath12k_ce_alloc_pipes(struct ath12k_base *ab) in ath12k_ce_alloc_pipes() argument
937 spin_lock_init(&ab->ce.ce_lock); in ath12k_ce_alloc_pipes()
939 for (i = 0; i < ab->hw_params->ce_count; i++) { in ath12k_ce_alloc_pipes()
940 attr = &ab->hw_params->host_ce_config[i]; in ath12k_ce_alloc_pipes()
941 pipe = &ab->ce.ce_pipe[i]; in ath12k_ce_alloc_pipes()
943 pipe->ab = ab; in ath12k_ce_alloc_pipes()
946 ret = ath12k_ce_alloc_pipe(ab, i); in ath12k_ce_alloc_pipes()
949 ath12k_ce_free_pipes(ab); in ath12k_ce_alloc_pipes()
957 int ath12k_ce_get_attr_flags(struct ath12k_base *ab, int ce_id) in ath12k_ce_get_attr_flags() argument
959 if (ce_id >= ab->hw_params->ce_count) in ath12k_ce_get_attr_flags()
962 return ab->hw_params->host_ce_config[ce_id].flags; in ath12k_ce_get_attr_flags()