Lines Matching refs:ar

62 static inline void ath10k_ce_dest_ring_write_index_set(struct ath10k *ar,  in ath10k_ce_dest_ring_write_index_set()  argument
66 ath10k_pci_write32(ar, ce_ctrl_addr + DST_WR_INDEX_ADDRESS, n); in ath10k_ce_dest_ring_write_index_set()
69 static inline u32 ath10k_ce_dest_ring_write_index_get(struct ath10k *ar, in ath10k_ce_dest_ring_write_index_get() argument
72 return ath10k_pci_read32(ar, ce_ctrl_addr + DST_WR_INDEX_ADDRESS); in ath10k_ce_dest_ring_write_index_get()
75 static inline void ath10k_ce_src_ring_write_index_set(struct ath10k *ar, in ath10k_ce_src_ring_write_index_set() argument
79 ath10k_pci_write32(ar, ce_ctrl_addr + SR_WR_INDEX_ADDRESS, n); in ath10k_ce_src_ring_write_index_set()
82 static inline u32 ath10k_ce_src_ring_write_index_get(struct ath10k *ar, in ath10k_ce_src_ring_write_index_get() argument
85 return ath10k_pci_read32(ar, ce_ctrl_addr + SR_WR_INDEX_ADDRESS); in ath10k_ce_src_ring_write_index_get()
88 static inline u32 ath10k_ce_src_ring_read_index_get(struct ath10k *ar, in ath10k_ce_src_ring_read_index_get() argument
91 return ath10k_pci_read32(ar, ce_ctrl_addr + CURRENT_SRRI_ADDRESS); in ath10k_ce_src_ring_read_index_get()
94 static inline void ath10k_ce_src_ring_base_addr_set(struct ath10k *ar, in ath10k_ce_src_ring_base_addr_set() argument
98 ath10k_pci_write32(ar, ce_ctrl_addr + SR_BA_ADDRESS, addr); in ath10k_ce_src_ring_base_addr_set()
101 static inline void ath10k_ce_src_ring_size_set(struct ath10k *ar, in ath10k_ce_src_ring_size_set() argument
105 ath10k_pci_write32(ar, ce_ctrl_addr + SR_SIZE_ADDRESS, n); in ath10k_ce_src_ring_size_set()
108 static inline void ath10k_ce_src_ring_dmax_set(struct ath10k *ar, in ath10k_ce_src_ring_dmax_set() argument
112 u32 ctrl1_addr = ath10k_pci_read32((ar), in ath10k_ce_src_ring_dmax_set()
115 ath10k_pci_write32(ar, ce_ctrl_addr + CE_CTRL1_ADDRESS, in ath10k_ce_src_ring_dmax_set()
120 static inline void ath10k_ce_src_ring_byte_swap_set(struct ath10k *ar, in ath10k_ce_src_ring_byte_swap_set() argument
124 u32 ctrl1_addr = ath10k_pci_read32(ar, ce_ctrl_addr + CE_CTRL1_ADDRESS); in ath10k_ce_src_ring_byte_swap_set()
126 ath10k_pci_write32(ar, ce_ctrl_addr + CE_CTRL1_ADDRESS, in ath10k_ce_src_ring_byte_swap_set()
131 static inline void ath10k_ce_dest_ring_byte_swap_set(struct ath10k *ar, in ath10k_ce_dest_ring_byte_swap_set() argument
135 u32 ctrl1_addr = ath10k_pci_read32(ar, ce_ctrl_addr + CE_CTRL1_ADDRESS); in ath10k_ce_dest_ring_byte_swap_set()
137 ath10k_pci_write32(ar, ce_ctrl_addr + CE_CTRL1_ADDRESS, in ath10k_ce_dest_ring_byte_swap_set()
142 static inline u32 ath10k_ce_dest_ring_read_index_get(struct ath10k *ar, in ath10k_ce_dest_ring_read_index_get() argument
145 return ath10k_pci_read32(ar, ce_ctrl_addr + CURRENT_DRRI_ADDRESS); in ath10k_ce_dest_ring_read_index_get()
148 static inline void ath10k_ce_dest_ring_base_addr_set(struct ath10k *ar, in ath10k_ce_dest_ring_base_addr_set() argument
152 ath10k_pci_write32(ar, ce_ctrl_addr + DR_BA_ADDRESS, addr); in ath10k_ce_dest_ring_base_addr_set()
155 static inline void ath10k_ce_dest_ring_size_set(struct ath10k *ar, in ath10k_ce_dest_ring_size_set() argument
159 ath10k_pci_write32(ar, ce_ctrl_addr + DR_SIZE_ADDRESS, n); in ath10k_ce_dest_ring_size_set()
162 static inline void ath10k_ce_src_ring_highmark_set(struct ath10k *ar, in ath10k_ce_src_ring_highmark_set() argument
166 u32 addr = ath10k_pci_read32(ar, ce_ctrl_addr + SRC_WATERMARK_ADDRESS); in ath10k_ce_src_ring_highmark_set()
168 ath10k_pci_write32(ar, ce_ctrl_addr + SRC_WATERMARK_ADDRESS, in ath10k_ce_src_ring_highmark_set()
173 static inline void ath10k_ce_src_ring_lowmark_set(struct ath10k *ar, in ath10k_ce_src_ring_lowmark_set() argument
177 u32 addr = ath10k_pci_read32(ar, ce_ctrl_addr + SRC_WATERMARK_ADDRESS); in ath10k_ce_src_ring_lowmark_set()
179 ath10k_pci_write32(ar, ce_ctrl_addr + SRC_WATERMARK_ADDRESS, in ath10k_ce_src_ring_lowmark_set()
184 static inline void ath10k_ce_dest_ring_highmark_set(struct ath10k *ar, in ath10k_ce_dest_ring_highmark_set() argument
188 u32 addr = ath10k_pci_read32(ar, ce_ctrl_addr + DST_WATERMARK_ADDRESS); in ath10k_ce_dest_ring_highmark_set()
190 ath10k_pci_write32(ar, ce_ctrl_addr + DST_WATERMARK_ADDRESS, in ath10k_ce_dest_ring_highmark_set()
195 static inline void ath10k_ce_dest_ring_lowmark_set(struct ath10k *ar, in ath10k_ce_dest_ring_lowmark_set() argument
199 u32 addr = ath10k_pci_read32(ar, ce_ctrl_addr + DST_WATERMARK_ADDRESS); in ath10k_ce_dest_ring_lowmark_set()
201 ath10k_pci_write32(ar, ce_ctrl_addr + DST_WATERMARK_ADDRESS, in ath10k_ce_dest_ring_lowmark_set()
206 static inline void ath10k_ce_copy_complete_inter_enable(struct ath10k *ar, in ath10k_ce_copy_complete_inter_enable() argument
209 u32 host_ie_addr = ath10k_pci_read32(ar, in ath10k_ce_copy_complete_inter_enable()
212 ath10k_pci_write32(ar, ce_ctrl_addr + HOST_IE_ADDRESS, in ath10k_ce_copy_complete_inter_enable()
216 static inline void ath10k_ce_copy_complete_intr_disable(struct ath10k *ar, in ath10k_ce_copy_complete_intr_disable() argument
219 u32 host_ie_addr = ath10k_pci_read32(ar, in ath10k_ce_copy_complete_intr_disable()
222 ath10k_pci_write32(ar, ce_ctrl_addr + HOST_IE_ADDRESS, in ath10k_ce_copy_complete_intr_disable()
226 static inline void ath10k_ce_watermark_intr_disable(struct ath10k *ar, in ath10k_ce_watermark_intr_disable() argument
229 u32 host_ie_addr = ath10k_pci_read32(ar, in ath10k_ce_watermark_intr_disable()
232 ath10k_pci_write32(ar, ce_ctrl_addr + HOST_IE_ADDRESS, in ath10k_ce_watermark_intr_disable()
236 static inline void ath10k_ce_error_intr_enable(struct ath10k *ar, in ath10k_ce_error_intr_enable() argument
239 u32 misc_ie_addr = ath10k_pci_read32(ar, in ath10k_ce_error_intr_enable()
242 ath10k_pci_write32(ar, ce_ctrl_addr + MISC_IE_ADDRESS, in ath10k_ce_error_intr_enable()
246 static inline void ath10k_ce_error_intr_disable(struct ath10k *ar, in ath10k_ce_error_intr_disable() argument
249 u32 misc_ie_addr = ath10k_pci_read32(ar, in ath10k_ce_error_intr_disable()
252 ath10k_pci_write32(ar, ce_ctrl_addr + MISC_IE_ADDRESS, in ath10k_ce_error_intr_disable()
256 static inline void ath10k_ce_engine_int_status_clear(struct ath10k *ar, in ath10k_ce_engine_int_status_clear() argument
260 ath10k_pci_write32(ar, ce_ctrl_addr + HOST_IS_ADDRESS, mask); in ath10k_ce_engine_int_status_clear()
275 struct ath10k *ar = ce_state->ar; in ath10k_ce_send_nolock() local
286 ath10k_warn(ar, "%s: send more we can (nbytes: %d, max: %d)\n", in ath10k_ce_send_nolock()
318 ath10k_ce_src_ring_write_index_set(ar, ctrl_addr, write_index); in ath10k_ce_send_nolock()
327 struct ath10k *ar = pipe->ar; in __ath10k_ce_send_revert() local
328 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); in __ath10k_ce_send_revert()
343 ath10k_ce_src_ring_write_index_get(ar, ctrl_addr))) in __ath10k_ce_send_revert()
359 struct ath10k *ar = ce_state->ar; in ath10k_ce_send() local
360 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); in ath10k_ce_send()
373 struct ath10k *ar = pipe->ar; in ath10k_ce_num_free_src_entries() local
374 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); in ath10k_ce_num_free_src_entries()
388 struct ath10k *ar = pipe->ar; in __ath10k_ce_rx_num_free_bufs() local
389 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); in __ath10k_ce_rx_num_free_bufs()
402 struct ath10k *ar = pipe->ar; in __ath10k_ce_rx_post_buf() local
403 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); in __ath10k_ce_rx_post_buf()
422 ath10k_ce_dest_ring_write_index_set(ar, ctrl_addr, write_index); in __ath10k_ce_rx_post_buf()
430 struct ath10k *ar = pipe->ar; in ath10k_ce_rx_post_buf() local
431 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); in ath10k_ce_rx_post_buf()
454 struct ath10k *ar = ce_state->ar; in ath10k_ce_completed_recv_next_nolock() local
509 struct ath10k *ar = ce_state->ar; in ath10k_ce_completed_recv_next() local
510 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); in ath10k_ce_completed_recv_next()
532 struct ath10k *ar; in ath10k_ce_revoke_recv_next() local
540 ar = ce_state->ar; in ath10k_ce_revoke_recv_next()
541 ar_pci = ath10k_pci_priv(ar); in ath10k_ce_revoke_recv_next()
585 struct ath10k *ar = ce_state->ar; in ath10k_ce_completed_send_next_nolock() local
599 read_index = ath10k_ce_src_ring_read_index_get(ar, ctrl_addr); in ath10k_ce_completed_send_next_nolock()
638 struct ath10k *ar; in ath10k_ce_cancel_send_next() local
646 ar = ce_state->ar; in ath10k_ce_cancel_send_next()
647 ar_pci = ath10k_pci_priv(ar); in ath10k_ce_cancel_send_next()
688 struct ath10k *ar = ce_state->ar; in ath10k_ce_completed_send_next() local
689 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); in ath10k_ce_completed_send_next()
706 void ath10k_ce_per_engine_service(struct ath10k *ar, unsigned int ce_id) in ath10k_ce_per_engine_service() argument
708 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); in ath10k_ce_per_engine_service()
715 ath10k_ce_engine_int_status_clear(ar, ctrl_addr, in ath10k_ce_per_engine_service()
732 ath10k_ce_engine_int_status_clear(ar, ctrl_addr, CE_WATERMARK_MASK); in ath10k_ce_per_engine_service()
743 void ath10k_ce_per_engine_service_any(struct ath10k *ar) in ath10k_ce_per_engine_service_any() argument
748 intr_summary = CE_INTERRUPT_SUMMARY(ar); in ath10k_ce_per_engine_service_any()
757 ath10k_ce_per_engine_service(ar, ce_id); in ath10k_ce_per_engine_service_any()
771 struct ath10k *ar = ce_state->ar; in ath10k_ce_per_engine_handler_adjust() local
776 ath10k_ce_copy_complete_inter_enable(ar, ctrl_addr); in ath10k_ce_per_engine_handler_adjust()
778 ath10k_ce_copy_complete_intr_disable(ar, ctrl_addr); in ath10k_ce_per_engine_handler_adjust()
780 ath10k_ce_watermark_intr_disable(ar, ctrl_addr); in ath10k_ce_per_engine_handler_adjust()
783 int ath10k_ce_disable_interrupts(struct ath10k *ar) in ath10k_ce_disable_interrupts() argument
788 u32 ctrl_addr = ath10k_ce_base_address(ar, ce_id); in ath10k_ce_disable_interrupts()
790 ath10k_ce_copy_complete_intr_disable(ar, ctrl_addr); in ath10k_ce_disable_interrupts()
791 ath10k_ce_error_intr_disable(ar, ctrl_addr); in ath10k_ce_disable_interrupts()
792 ath10k_ce_watermark_intr_disable(ar, ctrl_addr); in ath10k_ce_disable_interrupts()
798 void ath10k_ce_enable_interrupts(struct ath10k *ar) in ath10k_ce_enable_interrupts() argument
800 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); in ath10k_ce_enable_interrupts()
810 static int ath10k_ce_init_src_ring(struct ath10k *ar, in ath10k_ce_init_src_ring() argument
814 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); in ath10k_ce_init_src_ring()
817 u32 nentries, ctrl_addr = ath10k_ce_base_address(ar, ce_id); 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()
829 ath10k_ce_src_ring_write_index_get(ar, ctrl_addr); in ath10k_ce_init_src_ring()
832 ath10k_ce_src_ring_base_addr_set(ar, ctrl_addr, in ath10k_ce_init_src_ring()
834 ath10k_ce_src_ring_size_set(ar, ctrl_addr, nentries); in ath10k_ce_init_src_ring()
835 ath10k_ce_src_ring_dmax_set(ar, ctrl_addr, attr->src_sz_max); in ath10k_ce_init_src_ring()
836 ath10k_ce_src_ring_byte_swap_set(ar, ctrl_addr, 0); in ath10k_ce_init_src_ring()
837 ath10k_ce_src_ring_lowmark_set(ar, ctrl_addr, 0); in ath10k_ce_init_src_ring()
838 ath10k_ce_src_ring_highmark_set(ar, ctrl_addr, nentries); in ath10k_ce_init_src_ring()
840 ath10k_dbg(ar, ATH10K_DBG_BOOT, in ath10k_ce_init_src_ring()
847 static int ath10k_ce_init_dest_ring(struct ath10k *ar, in ath10k_ce_init_dest_ring() argument
851 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); in ath10k_ce_init_dest_ring()
854 u32 nentries, ctrl_addr = ath10k_ce_base_address(ar, ce_id); in ath10k_ce_init_dest_ring()
861 dest_ring->sw_index = ath10k_ce_dest_ring_read_index_get(ar, ctrl_addr); in ath10k_ce_init_dest_ring()
864 ath10k_ce_dest_ring_write_index_get(ar, ctrl_addr); in ath10k_ce_init_dest_ring()
867 ath10k_ce_dest_ring_base_addr_set(ar, ctrl_addr, in ath10k_ce_init_dest_ring()
869 ath10k_ce_dest_ring_size_set(ar, ctrl_addr, nentries); in ath10k_ce_init_dest_ring()
870 ath10k_ce_dest_ring_byte_swap_set(ar, ctrl_addr, 0); in ath10k_ce_init_dest_ring()
871 ath10k_ce_dest_ring_lowmark_set(ar, ctrl_addr, 0); in ath10k_ce_init_dest_ring()
872 ath10k_ce_dest_ring_highmark_set(ar, ctrl_addr, nentries); in ath10k_ce_init_dest_ring()
874 ath10k_dbg(ar, ATH10K_DBG_BOOT, in ath10k_ce_init_dest_ring()
882 ath10k_ce_alloc_src_ring(struct ath10k *ar, unsigned int ce_id, in ath10k_ce_alloc_src_ring() argument
906 dma_alloc_coherent(ar->dev, in ath10k_ce_alloc_src_ring()
928 ath10k_ce_alloc_dest_ring(struct ath10k *ar, unsigned int ce_id, in ath10k_ce_alloc_dest_ring() argument
952 dma_alloc_coherent(ar->dev, in ath10k_ce_alloc_dest_ring()
987 int ath10k_ce_init_pipe(struct ath10k *ar, unsigned int ce_id, in ath10k_ce_init_pipe() argument
993 ret = ath10k_ce_init_src_ring(ar, ce_id, attr); in ath10k_ce_init_pipe()
995 ath10k_err(ar, "Failed to initialize CE src ring for ID: %d (%d)\n", in ath10k_ce_init_pipe()
1002 ret = ath10k_ce_init_dest_ring(ar, ce_id, attr); in ath10k_ce_init_pipe()
1004 ath10k_err(ar, "Failed to initialize CE dest ring for ID: %d (%d)\n", in ath10k_ce_init_pipe()
1013 static void ath10k_ce_deinit_src_ring(struct ath10k *ar, unsigned int ce_id) in ath10k_ce_deinit_src_ring() argument
1015 u32 ctrl_addr = ath10k_ce_base_address(ar, ce_id); in ath10k_ce_deinit_src_ring()
1017 ath10k_ce_src_ring_base_addr_set(ar, ctrl_addr, 0); in ath10k_ce_deinit_src_ring()
1018 ath10k_ce_src_ring_size_set(ar, ctrl_addr, 0); in ath10k_ce_deinit_src_ring()
1019 ath10k_ce_src_ring_dmax_set(ar, ctrl_addr, 0); in ath10k_ce_deinit_src_ring()
1020 ath10k_ce_src_ring_highmark_set(ar, ctrl_addr, 0); in ath10k_ce_deinit_src_ring()
1023 static void ath10k_ce_deinit_dest_ring(struct ath10k *ar, unsigned int ce_id) in ath10k_ce_deinit_dest_ring() argument
1025 u32 ctrl_addr = ath10k_ce_base_address(ar, ce_id); in ath10k_ce_deinit_dest_ring()
1027 ath10k_ce_dest_ring_base_addr_set(ar, ctrl_addr, 0); in ath10k_ce_deinit_dest_ring()
1028 ath10k_ce_dest_ring_size_set(ar, ctrl_addr, 0); in ath10k_ce_deinit_dest_ring()
1029 ath10k_ce_dest_ring_highmark_set(ar, ctrl_addr, 0); in ath10k_ce_deinit_dest_ring()
1032 void ath10k_ce_deinit_pipe(struct ath10k *ar, unsigned int ce_id) in ath10k_ce_deinit_pipe() argument
1034 ath10k_ce_deinit_src_ring(ar, ce_id); in ath10k_ce_deinit_pipe()
1035 ath10k_ce_deinit_dest_ring(ar, ce_id); in ath10k_ce_deinit_pipe()
1038 int ath10k_ce_alloc_pipe(struct ath10k *ar, int ce_id, in ath10k_ce_alloc_pipe() argument
1041 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); in ath10k_ce_alloc_pipe()
1058 ce_state->ar = ar; in ath10k_ce_alloc_pipe()
1060 ce_state->ctrl_addr = ath10k_ce_base_address(ar, ce_id); in ath10k_ce_alloc_pipe()
1071 ce_state->src_ring = ath10k_ce_alloc_src_ring(ar, ce_id, attr); in ath10k_ce_alloc_pipe()
1074 ath10k_err(ar, "failed to allocate copy engine source ring %d: %d\n", in ath10k_ce_alloc_pipe()
1082 ce_state->dest_ring = ath10k_ce_alloc_dest_ring(ar, ce_id, in ath10k_ce_alloc_pipe()
1086 ath10k_err(ar, "failed to allocate copy engine destination ring %d: %d\n", in ath10k_ce_alloc_pipe()
1096 void ath10k_ce_free_pipe(struct ath10k *ar, int ce_id) in ath10k_ce_free_pipe() argument
1098 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); in ath10k_ce_free_pipe()
1102 dma_free_coherent(ar->dev, in ath10k_ce_free_pipe()
1112 dma_free_coherent(ar->dev, in ath10k_ce_free_pipe()