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()
319 ath10k_ce_src_ring_write_index_set(ar, ctrl_addr, write_index); in ath10k_ce_send_nolock()
328 struct ath10k *ar = pipe->ar; in __ath10k_ce_send_revert() local
329 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); in __ath10k_ce_send_revert()
344 ath10k_ce_src_ring_write_index_get(ar, ctrl_addr))) in __ath10k_ce_send_revert()
360 struct ath10k *ar = ce_state->ar; in ath10k_ce_send() local
361 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); in ath10k_ce_send()
374 struct ath10k *ar = pipe->ar; in ath10k_ce_num_free_src_entries() local
375 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); in ath10k_ce_num_free_src_entries()
389 struct ath10k *ar = pipe->ar; in __ath10k_ce_rx_num_free_bufs() local
390 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); in __ath10k_ce_rx_num_free_bufs()
403 struct ath10k *ar = pipe->ar; in __ath10k_ce_rx_post_buf() local
404 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); in __ath10k_ce_rx_post_buf()
423 ath10k_ce_dest_ring_write_index_set(ar, ctrl_addr, write_index); in __ath10k_ce_rx_post_buf()
431 struct ath10k *ar = pipe->ar; in ath10k_ce_rx_post_buf() local
432 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); in ath10k_ce_rx_post_buf()
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()
588 struct ath10k *ar = ce_state->ar; in ath10k_ce_completed_send_next_nolock() local
603 read_index = ath10k_ce_src_ring_read_index_get(ar, ctrl_addr); in ath10k_ce_completed_send_next_nolock()
651 struct ath10k *ar; in ath10k_ce_cancel_send_next() local
659 ar = ce_state->ar; in ath10k_ce_cancel_send_next()
660 ar_pci = ath10k_pci_priv(ar); in ath10k_ce_cancel_send_next()
704 struct ath10k *ar = ce_state->ar; in ath10k_ce_completed_send_next() local
705 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); in ath10k_ce_completed_send_next()
724 void ath10k_ce_per_engine_service(struct ath10k *ar, unsigned int ce_id) in ath10k_ce_per_engine_service() argument
726 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); in ath10k_ce_per_engine_service()
733 ath10k_ce_engine_int_status_clear(ar, ctrl_addr, in ath10k_ce_per_engine_service()
750 ath10k_ce_engine_int_status_clear(ar, ctrl_addr, CE_WATERMARK_MASK); in ath10k_ce_per_engine_service()
761 void ath10k_ce_per_engine_service_any(struct ath10k *ar) in ath10k_ce_per_engine_service_any() argument
766 intr_summary = CE_INTERRUPT_SUMMARY(ar); in ath10k_ce_per_engine_service_any()
775 ath10k_ce_per_engine_service(ar, ce_id); in ath10k_ce_per_engine_service_any()
789 struct ath10k *ar = ce_state->ar; in ath10k_ce_per_engine_handler_adjust() local
794 ath10k_ce_copy_complete_inter_enable(ar, ctrl_addr); in ath10k_ce_per_engine_handler_adjust()
796 ath10k_ce_copy_complete_intr_disable(ar, ctrl_addr); in ath10k_ce_per_engine_handler_adjust()
798 ath10k_ce_watermark_intr_disable(ar, ctrl_addr); in ath10k_ce_per_engine_handler_adjust()
801 int ath10k_ce_disable_interrupts(struct ath10k *ar) in ath10k_ce_disable_interrupts() argument
806 u32 ctrl_addr = ath10k_ce_base_address(ar, ce_id); in ath10k_ce_disable_interrupts()
808 ath10k_ce_copy_complete_intr_disable(ar, ctrl_addr); in ath10k_ce_disable_interrupts()
809 ath10k_ce_error_intr_disable(ar, ctrl_addr); in ath10k_ce_disable_interrupts()
810 ath10k_ce_watermark_intr_disable(ar, ctrl_addr); in ath10k_ce_disable_interrupts()
816 void ath10k_ce_enable_interrupts(struct ath10k *ar) in ath10k_ce_enable_interrupts() argument
818 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); in ath10k_ce_enable_interrupts()
828 static int ath10k_ce_init_src_ring(struct ath10k *ar, in ath10k_ce_init_src_ring() argument
832 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); in ath10k_ce_init_src_ring()
835 u32 nentries, ctrl_addr = ath10k_ce_base_address(ar, ce_id); in ath10k_ce_init_src_ring()
842 src_ring->sw_index = ath10k_ce_src_ring_read_index_get(ar, ctrl_addr); in ath10k_ce_init_src_ring()
847 ath10k_ce_src_ring_write_index_get(ar, ctrl_addr); in ath10k_ce_init_src_ring()
850 ath10k_ce_src_ring_base_addr_set(ar, ctrl_addr, in ath10k_ce_init_src_ring()
852 ath10k_ce_src_ring_size_set(ar, ctrl_addr, nentries); in ath10k_ce_init_src_ring()
853 ath10k_ce_src_ring_dmax_set(ar, ctrl_addr, attr->src_sz_max); in ath10k_ce_init_src_ring()
854 ath10k_ce_src_ring_byte_swap_set(ar, ctrl_addr, 0); in ath10k_ce_init_src_ring()
855 ath10k_ce_src_ring_lowmark_set(ar, ctrl_addr, 0); in ath10k_ce_init_src_ring()
856 ath10k_ce_src_ring_highmark_set(ar, ctrl_addr, nentries); in ath10k_ce_init_src_ring()
858 ath10k_dbg(ar, ATH10K_DBG_BOOT, in ath10k_ce_init_src_ring()
865 static int ath10k_ce_init_dest_ring(struct ath10k *ar, in ath10k_ce_init_dest_ring() argument
869 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); in ath10k_ce_init_dest_ring()
872 u32 nentries, ctrl_addr = ath10k_ce_base_address(ar, ce_id); in ath10k_ce_init_dest_ring()
879 dest_ring->sw_index = ath10k_ce_dest_ring_read_index_get(ar, ctrl_addr); in ath10k_ce_init_dest_ring()
882 ath10k_ce_dest_ring_write_index_get(ar, ctrl_addr); in ath10k_ce_init_dest_ring()
885 ath10k_ce_dest_ring_base_addr_set(ar, ctrl_addr, in ath10k_ce_init_dest_ring()
887 ath10k_ce_dest_ring_size_set(ar, ctrl_addr, nentries); in ath10k_ce_init_dest_ring()
888 ath10k_ce_dest_ring_byte_swap_set(ar, ctrl_addr, 0); in ath10k_ce_init_dest_ring()
889 ath10k_ce_dest_ring_lowmark_set(ar, ctrl_addr, 0); in ath10k_ce_init_dest_ring()
890 ath10k_ce_dest_ring_highmark_set(ar, ctrl_addr, nentries); in ath10k_ce_init_dest_ring()
892 ath10k_dbg(ar, ATH10K_DBG_BOOT, in ath10k_ce_init_dest_ring()
900 ath10k_ce_alloc_src_ring(struct ath10k *ar, unsigned int ce_id, in ath10k_ce_alloc_src_ring() argument
924 dma_alloc_coherent(ar->dev, in ath10k_ce_alloc_src_ring()
950 dma_free_coherent(ar->dev, in ath10k_ce_alloc_src_ring()
967 ath10k_ce_alloc_dest_ring(struct ath10k *ar, unsigned int ce_id, in ath10k_ce_alloc_dest_ring() argument
991 dma_alloc_coherent(ar->dev, in ath10k_ce_alloc_dest_ring()
1026 int ath10k_ce_init_pipe(struct ath10k *ar, unsigned int ce_id, in ath10k_ce_init_pipe() argument
1032 ret = ath10k_ce_init_src_ring(ar, ce_id, attr); in ath10k_ce_init_pipe()
1034 ath10k_err(ar, "Failed to initialize CE src ring for ID: %d (%d)\n", in ath10k_ce_init_pipe()
1041 ret = ath10k_ce_init_dest_ring(ar, ce_id, attr); in ath10k_ce_init_pipe()
1043 ath10k_err(ar, "Failed to initialize CE dest ring for ID: %d (%d)\n", in ath10k_ce_init_pipe()
1052 static void ath10k_ce_deinit_src_ring(struct ath10k *ar, unsigned int ce_id) in ath10k_ce_deinit_src_ring() argument
1054 u32 ctrl_addr = ath10k_ce_base_address(ar, ce_id); in ath10k_ce_deinit_src_ring()
1056 ath10k_ce_src_ring_base_addr_set(ar, ctrl_addr, 0); in ath10k_ce_deinit_src_ring()
1057 ath10k_ce_src_ring_size_set(ar, ctrl_addr, 0); in ath10k_ce_deinit_src_ring()
1058 ath10k_ce_src_ring_dmax_set(ar, ctrl_addr, 0); in ath10k_ce_deinit_src_ring()
1059 ath10k_ce_src_ring_highmark_set(ar, ctrl_addr, 0); in ath10k_ce_deinit_src_ring()
1062 static void ath10k_ce_deinit_dest_ring(struct ath10k *ar, unsigned int ce_id) in ath10k_ce_deinit_dest_ring() argument
1064 u32 ctrl_addr = ath10k_ce_base_address(ar, ce_id); in ath10k_ce_deinit_dest_ring()
1066 ath10k_ce_dest_ring_base_addr_set(ar, ctrl_addr, 0); in ath10k_ce_deinit_dest_ring()
1067 ath10k_ce_dest_ring_size_set(ar, ctrl_addr, 0); in ath10k_ce_deinit_dest_ring()
1068 ath10k_ce_dest_ring_highmark_set(ar, ctrl_addr, 0); in ath10k_ce_deinit_dest_ring()
1071 void ath10k_ce_deinit_pipe(struct ath10k *ar, unsigned int ce_id) in ath10k_ce_deinit_pipe() argument
1073 ath10k_ce_deinit_src_ring(ar, ce_id); in ath10k_ce_deinit_pipe()
1074 ath10k_ce_deinit_dest_ring(ar, ce_id); in ath10k_ce_deinit_pipe()
1077 int ath10k_ce_alloc_pipe(struct ath10k *ar, int ce_id, in ath10k_ce_alloc_pipe() argument
1082 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); in ath10k_ce_alloc_pipe()
1099 ce_state->ar = ar; in ath10k_ce_alloc_pipe()
1101 ce_state->ctrl_addr = ath10k_ce_base_address(ar, ce_id); in ath10k_ce_alloc_pipe()
1112 ce_state->src_ring = ath10k_ce_alloc_src_ring(ar, ce_id, attr); in ath10k_ce_alloc_pipe()
1115 ath10k_err(ar, "failed to allocate copy engine source ring %d: %d\n", in ath10k_ce_alloc_pipe()
1123 ce_state->dest_ring = ath10k_ce_alloc_dest_ring(ar, ce_id, in ath10k_ce_alloc_pipe()
1127 ath10k_err(ar, "failed to allocate copy engine destination ring %d: %d\n", in ath10k_ce_alloc_pipe()
1137 void ath10k_ce_free_pipe(struct ath10k *ar, int ce_id) in ath10k_ce_free_pipe() argument
1139 struct ath10k_pci *ar_pci = ath10k_pci_priv(ar); in ath10k_ce_free_pipe()
1144 dma_free_coherent(ar->dev, in ath10k_ce_free_pipe()
1154 dma_free_coherent(ar->dev, in ath10k_ce_free_pipe()