Lines Matching full:ab

24 static enum hal_encrypt_type ath12k_dp_rx_h_enctype(struct ath12k_base *ab,  in ath12k_dp_rx_h_enctype()  argument
27 if (!ab->hal_rx_ops->rx_desc_encrypt_valid(desc)) in ath12k_dp_rx_h_enctype()
30 return ab->hal_rx_ops->rx_desc_get_encrypt_type(desc); in ath12k_dp_rx_h_enctype()
33 u8 ath12k_dp_rx_h_decap_type(struct ath12k_base *ab, in ath12k_dp_rx_h_decap_type() argument
36 return ab->hal_rx_ops->rx_desc_get_decap_type(desc); in ath12k_dp_rx_h_decap_type()
39 static u8 ath12k_dp_rx_h_mesh_ctl_present(struct ath12k_base *ab, in ath12k_dp_rx_h_mesh_ctl_present() argument
42 return ab->hal_rx_ops->rx_desc_get_mesh_ctl(desc); in ath12k_dp_rx_h_mesh_ctl_present()
45 static bool ath12k_dp_rx_h_seq_ctrl_valid(struct ath12k_base *ab, in ath12k_dp_rx_h_seq_ctrl_valid() argument
48 return ab->hal_rx_ops->rx_desc_get_mpdu_seq_ctl_vld(desc); in ath12k_dp_rx_h_seq_ctrl_valid()
51 static bool ath12k_dp_rx_h_fc_valid(struct ath12k_base *ab, in ath12k_dp_rx_h_fc_valid() argument
54 return ab->hal_rx_ops->rx_desc_get_mpdu_fc_valid(desc); in ath12k_dp_rx_h_fc_valid()
57 static bool ath12k_dp_rx_h_more_frags(struct ath12k_base *ab, in ath12k_dp_rx_h_more_frags() argument
62 hdr = (struct ieee80211_hdr *)(skb->data + ab->hal.hal_desc_sz); in ath12k_dp_rx_h_more_frags()
66 static u16 ath12k_dp_rx_h_frag_no(struct ath12k_base *ab, in ath12k_dp_rx_h_frag_no() argument
71 hdr = (struct ieee80211_hdr *)(skb->data + ab->hal.hal_desc_sz); in ath12k_dp_rx_h_frag_no()
75 static u16 ath12k_dp_rx_h_seq_no(struct ath12k_base *ab, in ath12k_dp_rx_h_seq_no() argument
78 return ab->hal_rx_ops->rx_desc_get_mpdu_start_seq_no(desc); in ath12k_dp_rx_h_seq_no()
81 static bool ath12k_dp_rx_h_msdu_done(struct ath12k_base *ab, in ath12k_dp_rx_h_msdu_done() argument
84 return ab->hal_rx_ops->dp_rx_h_msdu_done(desc); in ath12k_dp_rx_h_msdu_done()
87 static bool ath12k_dp_rx_h_l4_cksum_fail(struct ath12k_base *ab, in ath12k_dp_rx_h_l4_cksum_fail() argument
90 return ab->hal_rx_ops->dp_rx_h_l4_cksum_fail(desc); in ath12k_dp_rx_h_l4_cksum_fail()
93 static bool ath12k_dp_rx_h_ip_cksum_fail(struct ath12k_base *ab, in ath12k_dp_rx_h_ip_cksum_fail() argument
96 return ab->hal_rx_ops->dp_rx_h_ip_cksum_fail(desc); in ath12k_dp_rx_h_ip_cksum_fail()
99 static bool ath12k_dp_rx_h_is_decrypted(struct ath12k_base *ab, in ath12k_dp_rx_h_is_decrypted() argument
102 return ab->hal_rx_ops->dp_rx_h_is_decrypted(desc); in ath12k_dp_rx_h_is_decrypted()
105 u32 ath12k_dp_rx_h_mpdu_err(struct ath12k_base *ab, in ath12k_dp_rx_h_mpdu_err() argument
108 return ab->hal_rx_ops->dp_rx_h_mpdu_err(desc); in ath12k_dp_rx_h_mpdu_err()
111 static u16 ath12k_dp_rx_h_msdu_len(struct ath12k_base *ab, in ath12k_dp_rx_h_msdu_len() argument
114 return ab->hal_rx_ops->rx_desc_get_msdu_len(desc); in ath12k_dp_rx_h_msdu_len()
117 static u8 ath12k_dp_rx_h_sgi(struct ath12k_base *ab, in ath12k_dp_rx_h_sgi() argument
120 return ab->hal_rx_ops->rx_desc_get_msdu_sgi(desc); in ath12k_dp_rx_h_sgi()
123 static u8 ath12k_dp_rx_h_rate_mcs(struct ath12k_base *ab, in ath12k_dp_rx_h_rate_mcs() argument
126 return ab->hal_rx_ops->rx_desc_get_msdu_rate_mcs(desc); in ath12k_dp_rx_h_rate_mcs()
129 static u8 ath12k_dp_rx_h_rx_bw(struct ath12k_base *ab, in ath12k_dp_rx_h_rx_bw() argument
132 return ab->hal_rx_ops->rx_desc_get_msdu_rx_bw(desc); in ath12k_dp_rx_h_rx_bw()
135 static u32 ath12k_dp_rx_h_freq(struct ath12k_base *ab, in ath12k_dp_rx_h_freq() argument
138 return ab->hal_rx_ops->rx_desc_get_msdu_freq(desc); in ath12k_dp_rx_h_freq()
141 static u8 ath12k_dp_rx_h_pkt_type(struct ath12k_base *ab, in ath12k_dp_rx_h_pkt_type() argument
144 return ab->hal_rx_ops->rx_desc_get_msdu_pkt_type(desc); in ath12k_dp_rx_h_pkt_type()
147 static u8 ath12k_dp_rx_h_nss(struct ath12k_base *ab, in ath12k_dp_rx_h_nss() argument
150 return hweight8(ab->hal_rx_ops->rx_desc_get_msdu_nss(desc)); in ath12k_dp_rx_h_nss()
153 static u8 ath12k_dp_rx_h_tid(struct ath12k_base *ab, in ath12k_dp_rx_h_tid() argument
156 return ab->hal_rx_ops->rx_desc_get_mpdu_tid(desc); in ath12k_dp_rx_h_tid()
159 static u16 ath12k_dp_rx_h_peer_id(struct ath12k_base *ab, in ath12k_dp_rx_h_peer_id() argument
162 return ab->hal_rx_ops->rx_desc_get_mpdu_peer_id(desc); in ath12k_dp_rx_h_peer_id()
165 u8 ath12k_dp_rx_h_l3pad(struct ath12k_base *ab, in ath12k_dp_rx_h_l3pad() argument
168 return ab->hal_rx_ops->rx_desc_get_l3_pad_bytes(desc); in ath12k_dp_rx_h_l3pad()
171 static bool ath12k_dp_rx_h_first_msdu(struct ath12k_base *ab, in ath12k_dp_rx_h_first_msdu() argument
174 return ab->hal_rx_ops->rx_desc_get_first_msdu(desc); in ath12k_dp_rx_h_first_msdu()
177 static bool ath12k_dp_rx_h_last_msdu(struct ath12k_base *ab, in ath12k_dp_rx_h_last_msdu() argument
180 return ab->hal_rx_ops->rx_desc_get_last_msdu(desc); in ath12k_dp_rx_h_last_msdu()
183 static void ath12k_dp_rx_desc_end_tlv_copy(struct ath12k_base *ab, in ath12k_dp_rx_desc_end_tlv_copy() argument
187 ab->hal_rx_ops->rx_desc_copy_end_tlv(fdesc, ldesc); in ath12k_dp_rx_desc_end_tlv_copy()
190 static void ath12k_dp_rxdesc_set_msdu_len(struct ath12k_base *ab, in ath12k_dp_rxdesc_set_msdu_len() argument
194 ab->hal_rx_ops->rx_desc_set_msdu_len(desc, len); in ath12k_dp_rxdesc_set_msdu_len()
197 static bool ath12k_dp_rx_h_is_da_mcbc(struct ath12k_base *ab, in ath12k_dp_rx_h_is_da_mcbc() argument
200 return (ath12k_dp_rx_h_first_msdu(ab, desc) && in ath12k_dp_rx_h_is_da_mcbc()
201 ab->hal_rx_ops->rx_desc_is_da_mcbc(desc)); in ath12k_dp_rx_h_is_da_mcbc()
204 static bool ath12k_dp_rxdesc_mac_addr2_valid(struct ath12k_base *ab, in ath12k_dp_rxdesc_mac_addr2_valid() argument
207 return ab->hal_rx_ops->rx_desc_mac_addr2_valid(desc); in ath12k_dp_rxdesc_mac_addr2_valid()
210 static u8 *ath12k_dp_rxdesc_get_mpdu_start_addr2(struct ath12k_base *ab, in ath12k_dp_rxdesc_get_mpdu_start_addr2() argument
213 return ab->hal_rx_ops->rx_desc_mpdu_start_addr2(desc); in ath12k_dp_rxdesc_get_mpdu_start_addr2()
216 static void ath12k_dp_rx_desc_get_dot11_hdr(struct ath12k_base *ab, in ath12k_dp_rx_desc_get_dot11_hdr() argument
220 ab->hal_rx_ops->rx_desc_get_dot11_hdr(desc, hdr); in ath12k_dp_rx_desc_get_dot11_hdr()
223 static void ath12k_dp_rx_desc_get_crypto_header(struct ath12k_base *ab, in ath12k_dp_rx_desc_get_crypto_header() argument
228 ab->hal_rx_ops->rx_desc_get_crypto_header(desc, crypto_hdr, enctype); in ath12k_dp_rx_desc_get_crypto_header()
231 static u16 ath12k_dp_rxdesc_get_mpdu_frame_ctrl(struct ath12k_base *ab, in ath12k_dp_rxdesc_get_mpdu_frame_ctrl() argument
234 return ab->hal_rx_ops->rx_desc_get_mpdu_frame_ctl(desc); in ath12k_dp_rxdesc_get_mpdu_frame_ctrl()
237 static inline u8 ath12k_dp_rx_get_msdu_src_link(struct ath12k_base *ab, in ath12k_dp_rx_get_msdu_src_link() argument
240 return ab->hal_rx_ops->rx_desc_get_msdu_src_link_id(desc); in ath12k_dp_rx_get_msdu_src_link()
295 int ath12k_dp_rx_bufs_replenish(struct ath12k_base *ab, in ath12k_dp_rx_bufs_replenish() argument
307 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_bufs_replenish()
309 enum hal_rx_buf_return_buf_manager mgr = ab->hw_params->hal_params->rx_buf_rbm; in ath12k_dp_rx_bufs_replenish()
313 srng = &ab->hal.srng_list[rx_ring->refill_buf_ring.ring_id]; in ath12k_dp_rx_bufs_replenish()
317 ath12k_hal_srng_access_begin(ab, srng); in ath12k_dp_rx_bufs_replenish()
319 num_free = ath12k_hal_srng_src_num_free(ab, srng, true); in ath12k_dp_rx_bufs_replenish()
352 paddr = dma_map_single(ab->dev, skb->data, in ath12k_dp_rx_bufs_replenish()
355 if (dma_mapping_error(ab->dev, paddr)) in ath12k_dp_rx_bufs_replenish()
367 desc = ath12k_hal_srng_src_get_next_entry(ab, srng); in ath12k_dp_rx_bufs_replenish()
382 dma_unmap_single(ab->dev, paddr, skb->len + skb_tailroom(skb), in ath12k_dp_rx_bufs_replenish()
387 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_bufs_replenish()
397 static int ath12k_dp_rxdma_mon_buf_ring_free(struct ath12k_base *ab, in ath12k_dp_rxdma_mon_buf_ring_free() argument
409 dma_unmap_single(ab->dev, ATH12K_SKB_RXCB(skb)->paddr, in ath12k_dp_rxdma_mon_buf_ring_free()
420 static int ath12k_dp_rxdma_buf_free(struct ath12k_base *ab) in ath12k_dp_rxdma_buf_free() argument
422 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rxdma_buf_free()
424 ath12k_dp_rxdma_mon_buf_ring_free(ab, &dp->rxdma_mon_buf_ring); in ath12k_dp_rxdma_buf_free()
429 static int ath12k_dp_rxdma_mon_ring_buf_setup(struct ath12k_base *ab, in ath12k_dp_rxdma_mon_ring_buf_setup() argument
436 ath12k_hal_srng_get_entrysize(ab, ringtype); in ath12k_dp_rxdma_mon_ring_buf_setup()
439 ath12k_dp_mon_buf_replenish(ab, rx_ring, num_entries); in ath12k_dp_rxdma_mon_ring_buf_setup()
444 static int ath12k_dp_rxdma_ring_buf_setup(struct ath12k_base *ab, in ath12k_dp_rxdma_ring_buf_setup() argument
450 ath12k_hal_srng_get_entrysize(ab, HAL_RXDMA_BUF); in ath12k_dp_rxdma_ring_buf_setup()
452 ath12k_dp_rx_bufs_replenish(ab, rx_ring, &list, 0); in ath12k_dp_rxdma_ring_buf_setup()
457 static int ath12k_dp_rxdma_buf_setup(struct ath12k_base *ab) in ath12k_dp_rxdma_buf_setup() argument
459 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rxdma_buf_setup()
462 ret = ath12k_dp_rxdma_ring_buf_setup(ab, &dp->rx_refill_buf_ring); in ath12k_dp_rxdma_buf_setup()
464 ath12k_warn(ab, in ath12k_dp_rxdma_buf_setup()
469 if (ab->hw_params->rxdma1_enable) { in ath12k_dp_rxdma_buf_setup()
470 ret = ath12k_dp_rxdma_mon_ring_buf_setup(ab, in ath12k_dp_rxdma_buf_setup()
474 ath12k_warn(ab, in ath12k_dp_rxdma_buf_setup()
486 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_pdev_srng_free() local
489 for (i = 0; i < ab->hw_params->num_rxdma_per_pdev; i++) in ath12k_dp_rx_pdev_srng_free()
490 ath12k_dp_srng_cleanup(ab, &dp->rxdma_mon_dst_ring[i]); in ath12k_dp_rx_pdev_srng_free()
493 void ath12k_dp_rx_pdev_reo_cleanup(struct ath12k_base *ab) in ath12k_dp_rx_pdev_reo_cleanup() argument
495 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_pdev_reo_cleanup()
499 ath12k_dp_srng_cleanup(ab, &dp->reo_dst_ring[i]); in ath12k_dp_rx_pdev_reo_cleanup()
502 int ath12k_dp_rx_pdev_reo_setup(struct ath12k_base *ab) in ath12k_dp_rx_pdev_reo_setup() argument
504 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_pdev_reo_setup()
509 ret = ath12k_dp_srng_setup(ab, &dp->reo_dst_ring[i], in ath12k_dp_rx_pdev_reo_setup()
513 ath12k_warn(ab, "failed to setup reo_dst_ring\n"); in ath12k_dp_rx_pdev_reo_setup()
521 ath12k_dp_rx_pdev_reo_cleanup(ab); in ath12k_dp_rx_pdev_reo_setup()
529 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_pdev_srng_alloc() local
534 for (i = 0; i < ab->hw_params->num_rxdma_per_pdev; i++) { in ath12k_dp_rx_pdev_srng_alloc()
535 ret = ath12k_dp_srng_setup(ar->ab, in ath12k_dp_rx_pdev_srng_alloc()
541 ath12k_warn(ar->ab, in ath12k_dp_rx_pdev_srng_alloc()
550 void ath12k_dp_rx_reo_cmd_list_cleanup(struct ath12k_base *ab) in ath12k_dp_rx_reo_cmd_list_cleanup() argument
552 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_reo_cmd_list_cleanup()
559 dma_unmap_single(ab->dev, cmd->data.paddr, in ath12k_dp_rx_reo_cmd_list_cleanup()
569 dma_unmap_single(ab->dev, cmd_cache->data.paddr, in ath12k_dp_rx_reo_cmd_list_cleanup()
583 ath12k_warn(dp->ab, "failed to flush rx tid hw desc, tid %d status %d\n", in ath12k_dp_reo_cmd_free()
586 dma_unmap_single(dp->ab->dev, rx_tid->paddr, rx_tid->size, in ath12k_dp_reo_cmd_free()
592 static int ath12k_dp_reo_cmd_send(struct ath12k_base *ab, struct ath12k_dp_rx_tid *rx_tid, in ath12k_dp_reo_cmd_send() argument
598 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_reo_cmd_send()
603 cmd_ring = &ab->hal.srng_list[dp->reo_cmd_ring.ring_id]; in ath12k_dp_reo_cmd_send()
604 cmd_num = ath12k_hal_reo_cmd_send(ab, cmd_ring, type, cmd); in ath12k_dp_reo_cmd_send()
637 static void ath12k_dp_reo_cache_flush(struct ath12k_base *ab, in ath12k_dp_reo_cache_flush() argument
651 ret = ath12k_dp_reo_cmd_send(ab, rx_tid, in ath12k_dp_reo_cache_flush()
655 ath12k_warn(ab, in ath12k_dp_reo_cache_flush()
664 ret = ath12k_dp_reo_cmd_send(ab, rx_tid, in ath12k_dp_reo_cache_flush()
668 ath12k_err(ab, "failed to send HAL_REO_CMD_FLUSH_CACHE cmd, tid %d (%d)\n", in ath12k_dp_reo_cache_flush()
670 dma_unmap_single(ab->dev, rx_tid->paddr, rx_tid->size, in ath12k_dp_reo_cache_flush()
680 struct ath12k_base *ab = dp->ab; in ath12k_dp_rx_tid_del_func() local
688 ath12k_warn(ab, "failed to delete rx tid %d hw descriptor %d\n", in ath12k_dp_rx_tid_del_func()
723 ath12k_dp_reo_cache_flush(ab, &elem->data); in ath12k_dp_rx_tid_del_func()
732 dma_unmap_single(ab->dev, rx_tid->paddr, rx_tid->size, in ath12k_dp_rx_tid_del_func()
738 static void ath12k_peer_rx_tid_qref_setup(struct ath12k_base *ab, u16 peer_id, u16 tid, in ath12k_peer_rx_tid_qref_setup() argument
742 struct ath12k_dp *dp = &ab->dp; in ath12k_peer_rx_tid_qref_setup()
744 if (!ab->hw_params->reoq_lut_support) in ath12k_peer_rx_tid_qref_setup()
760 static void ath12k_peer_rx_tid_qref_reset(struct ath12k_base *ab, u16 peer_id, u16 tid) in ath12k_peer_rx_tid_qref_reset() argument
763 struct ath12k_dp *dp = &ab->dp; in ath12k_peer_rx_tid_qref_reset()
765 if (!ab->hw_params->reoq_lut_support) in ath12k_peer_rx_tid_qref_reset()
793 ret = ath12k_dp_reo_cmd_send(ar->ab, rx_tid, in ath12k_dp_rx_peer_tid_delete()
797 ath12k_err(ar->ab, "failed to send HAL_REO_CMD_UPDATE_RX_QUEUE cmd, tid %d (%d)\n", in ath12k_dp_rx_peer_tid_delete()
799 dma_unmap_single(ar->ab->dev, rx_tid->paddr, rx_tid->size, in ath12k_dp_rx_peer_tid_delete()
805 ath12k_peer_rx_tid_qref_reset(ar->ab, peer->peer_id, tid); in ath12k_dp_rx_peer_tid_delete()
814 static int ath12k_dp_rx_link_desc_return(struct ath12k_base *ab, in ath12k_dp_rx_link_desc_return() argument
820 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_link_desc_return()
824 srng = &ab->hal.srng_list[dp->wbm_desc_rel_ring.ring_id]; in ath12k_dp_rx_link_desc_return()
828 ath12k_hal_srng_access_begin(ab, srng); in ath12k_dp_rx_link_desc_return()
830 desc = ath12k_hal_srng_src_get_next_entry(ab, srng); in ath12k_dp_rx_link_desc_return()
836 ath12k_hal_rx_msdu_link_desc_set(ab, desc, link_desc, action); in ath12k_dp_rx_link_desc_return()
839 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_link_desc_return()
849 struct ath12k_base *ab = rx_tid->ab; in ath12k_dp_rx_frags_cleanup() local
851 lockdep_assert_held(&ab->base_lock); in ath12k_dp_rx_frags_cleanup()
855 ath12k_dp_rx_link_desc_return(ab, rx_tid->dst_ring_desc, in ath12k_dp_rx_frags_cleanup()
872 lockdep_assert_held(&ar->ab->base_lock); in ath12k_dp_rx_peer_tid_cleanup()
880 spin_unlock_bh(&ar->ab->base_lock); in ath12k_dp_rx_peer_tid_cleanup()
882 spin_lock_bh(&ar->ab->base_lock); in ath12k_dp_rx_peer_tid_cleanup()
906 ret = ath12k_dp_reo_cmd_send(ar->ab, rx_tid, in ath12k_peer_rx_tid_reo_update()
910 ath12k_warn(ar->ab, "failed to update rx tid queue, tid %d (%d)\n", in ath12k_peer_rx_tid_reo_update()
924 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_peer_tid_setup() local
925 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_peer_tid_setup()
934 spin_lock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
936 peer = ath12k_peer_find(ab, vdev_id, peer_mac); in ath12k_dp_rx_peer_tid_setup()
938 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
939 ath12k_warn(ab, "failed to find the peer to set up rx tid\n"); in ath12k_dp_rx_peer_tid_setup()
943 if (ab->hw_params->reoq_lut_support && !dp->reoq_lut.vaddr) { in ath12k_dp_rx_peer_tid_setup()
944 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
945 ath12k_warn(ab, "reo qref table is not setup\n"); in ath12k_dp_rx_peer_tid_setup()
950 ath12k_warn(ab, "peer id of peer %d or tid %d doesn't allow reoq setup\n", in ath12k_dp_rx_peer_tid_setup()
952 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
962 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
964 ath12k_warn(ab, "failed to update reo for rx tid %d\n", tid); in ath12k_dp_rx_peer_tid_setup()
968 if (!ab->hw_params->reoq_lut_support) { in ath12k_dp_rx_peer_tid_setup()
974 ath12k_warn(ab, "failed to setup peer rx reorder queuefor tid %d: %d\n", in ath12k_dp_rx_peer_tid_setup()
997 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
1006 paddr = dma_map_single(ab->dev, addr_aligned, hw_desc_sz, in ath12k_dp_rx_peer_tid_setup()
1009 ret = dma_mapping_error(ab->dev, paddr); in ath12k_dp_rx_peer_tid_setup()
1011 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
1020 if (ab->hw_params->reoq_lut_support) { in ath12k_dp_rx_peer_tid_setup()
1024 ath12k_peer_rx_tid_qref_setup(ab, peer->peer_id, tid, paddr); in ath12k_dp_rx_peer_tid_setup()
1025 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
1027 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
1043 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_ampdu_start() local
1052 ath12k_warn(ab, "failed to setup rx tid %d\n", ret); in ath12k_dp_rx_ampdu_start()
1060 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_ampdu_stop() local
1067 spin_lock_bh(&ab->base_lock); in ath12k_dp_rx_ampdu_stop()
1069 peer = ath12k_peer_find(ab, vdev_id, params->sta->addr); in ath12k_dp_rx_ampdu_stop()
1071 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_ampdu_stop()
1072 ath12k_warn(ab, "failed to find the peer to stop rx aggregation\n"); in ath12k_dp_rx_ampdu_stop()
1079 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_ampdu_stop()
1084 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_ampdu_stop()
1086 ath12k_warn(ab, "failed to update reo for rx tid %d: %d\n", in ath12k_dp_rx_ampdu_stop()
1100 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_peer_pn_replay_config() local
1136 spin_lock_bh(&ab->base_lock); in ath12k_dp_rx_peer_pn_replay_config()
1138 peer = ath12k_peer_find(ab, arvif->vdev_id, peer_addr); in ath12k_dp_rx_peer_pn_replay_config()
1140 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_pn_replay_config()
1141 ath12k_warn(ab, "failed to find the peer %pM to configure pn replay detection\n", in ath12k_dp_rx_peer_pn_replay_config()
1152 ret = ath12k_dp_reo_cmd_send(ab, rx_tid, in ath12k_dp_rx_peer_pn_replay_config()
1156 ath12k_warn(ab, "failed to configure rx tid %d queue of peer %pM for pn replay detection %d\n", in ath12k_dp_rx_peer_pn_replay_config()
1162 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_pn_replay_config()
1184 static int ath12k_htt_tlv_ppdu_stats_parse(struct ath12k_base *ab, in ath12k_htt_tlv_ppdu_stats_parse() argument
1201 ath12k_warn(ab, "Invalid len %d for the tag 0x%x\n", in ath12k_htt_tlv_ppdu_stats_parse()
1210 ath12k_warn(ab, "Invalid len %d for the tag 0x%x\n", in ath12k_htt_tlv_ppdu_stats_parse()
1229 ath12k_warn(ab, "Invalid len %d for the tag 0x%x\n", in ath12k_htt_tlv_ppdu_stats_parse()
1250 ath12k_warn(ab, "Invalid len %d for the tag 0x%x\n", in ath12k_htt_tlv_ppdu_stats_parse()
1272 int ath12k_dp_htt_tlv_iter(struct ath12k_base *ab, const void *ptr, size_t len, in ath12k_dp_htt_tlv_iter() argument
1284 ath12k_err(ab, "htt tlv parse failure at byte %zd (%zu bytes left, %zu expected)\n", in ath12k_dp_htt_tlv_iter()
1295 ath12k_err(ab, "htt tlv parse failure of tag %u at byte %zd (%zu bytes left, %u expected)\n", in ath12k_dp_htt_tlv_iter()
1299 ret = iter(ab, tlv_tag, tlv_len, ptr, data); in ath12k_dp_htt_tlv_iter()
1313 struct ath12k_base *ab = ar->ab; in ath12k_update_per_peer_tx_stats() local
1362 ath12k_warn(ab, "Invalid HE mcs %d peer stats", mcs); in ath12k_update_per_peer_tx_stats()
1367 ath12k_warn(ab, "Invalid VHT mcs %d peer stats", mcs); in ath12k_update_per_peer_tx_stats()
1372 ath12k_warn(ab, "Invalid HT mcs %d nss %d peer stats", in ath12k_update_per_peer_tx_stats()
1387 spin_lock_bh(&ab->base_lock); in ath12k_update_per_peer_tx_stats()
1388 peer = ath12k_peer_find_by_id(ab, usr_stats->peer_id); in ath12k_update_per_peer_tx_stats()
1391 spin_unlock_bh(&ab->base_lock); in ath12k_update_per_peer_tx_stats()
1451 spin_unlock_bh(&ab->base_lock); in ath12k_update_per_peer_tx_stats()
1527 static int ath12k_htt_pull_ppdu_stats(struct ath12k_base *ab, in ath12k_htt_pull_ppdu_stats() argument
1543 ath12k_warn(ab, in ath12k_htt_pull_ppdu_stats()
1553 ar = ath12k_mac_get_ar_by_pdev_id(ab, pdev_id); in ath12k_htt_pull_ppdu_stats()
1568 ret = ath12k_dp_htt_tlv_iter(ab, msg->data, len, in ath12k_htt_pull_ppdu_stats()
1573 ath12k_warn(ab, "Failed to parse tlv %d\n", ret); in ath12k_htt_pull_ppdu_stats()
1579 ath12k_warn(ab, in ath12k_htt_pull_ppdu_stats()
1593 spin_lock_bh(&ab->base_lock); in ath12k_htt_pull_ppdu_stats()
1594 peer = ath12k_peer_find_by_id(ab, peer_id); in ath12k_htt_pull_ppdu_stats()
1596 spin_unlock_bh(&ab->base_lock); in ath12k_htt_pull_ppdu_stats()
1603 spin_unlock_bh(&ab->base_lock); in ath12k_htt_pull_ppdu_stats()
1612 spin_lock_bh(&ab->base_lock); in ath12k_htt_pull_ppdu_stats()
1613 peer = ath12k_peer_find_by_id(ab, peer_id); in ath12k_htt_pull_ppdu_stats()
1615 spin_unlock_bh(&ab->base_lock); in ath12k_htt_pull_ppdu_stats()
1622 spin_unlock_bh(&ab->base_lock); in ath12k_htt_pull_ppdu_stats()
1634 static void ath12k_htt_mlo_offset_event_handler(struct ath12k_base *ab, in ath12k_htt_mlo_offset_event_handler() argument
1647 ar = ath12k_mac_get_ar_by_pdev_id(ab, pdev_id); in ath12k_htt_mlo_offset_event_handler()
1649 ath12k_warn(ab, "invalid pdev id %d on htt mlo offset\n", pdev_id); in ath12k_htt_mlo_offset_event_handler()
1670 void ath12k_dp_htt_htc_t2h_msg_handler(struct ath12k_base *ab, in ath12k_dp_htt_htc_t2h_msg_handler() argument
1673 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_htt_htc_t2h_msg_handler()
1685 ath12k_dbg(ab, ATH12K_DBG_DP_HTT, "dp_htt rx msg type :0x%0x\n", type); in ath12k_dp_htt_htc_t2h_msg_handler()
1705 ath12k_peer_map_event(ab, vdev_id, peer_id, mac_addr, 0, 0); in ath12k_dp_htt_htc_t2h_msg_handler()
1720 ath12k_peer_map_event(ab, vdev_id, peer_id, mac_addr, ast_hash, in ath12k_dp_htt_htc_t2h_msg_handler()
1732 ath12k_peer_map_event(ab, vdev_id, peer_id, mac_addr, ast_hash, in ath12k_dp_htt_htc_t2h_msg_handler()
1739 ath12k_peer_unmap_event(ab, peer_id); in ath12k_dp_htt_htc_t2h_msg_handler()
1742 ath12k_htt_pull_ppdu_stats(ab, skb); in ath12k_dp_htt_htc_t2h_msg_handler()
1745 ath12k_debugfs_htt_ext_stats_handler(ab, skb); in ath12k_dp_htt_htc_t2h_msg_handler()
1748 ath12k_htt_mlo_offset_event_handler(ab, skb); in ath12k_dp_htt_htc_t2h_msg_handler()
1751 ath12k_dbg(ab, ATH12K_DBG_DP_HTT, "dp_htt event %d not handled\n", in ath12k_dp_htt_htc_t2h_msg_handler()
1764 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_msdu_coalesce() local
1770 u32 hal_rx_desc_sz = ar->ab->hal.hal_desc_sz; in ath12k_dp_rx_msdu_coalesce()
1786 rxcb->is_first_msdu = ath12k_dp_rx_h_first_msdu(ab, ldesc); in ath12k_dp_rx_msdu_coalesce()
1787 rxcb->is_last_msdu = ath12k_dp_rx_h_last_msdu(ab, ldesc); in ath12k_dp_rx_msdu_coalesce()
1799 ath12k_dp_rx_desc_end_tlv_copy(ab, rxcb->rx_desc, ldesc); in ath12k_dp_rx_msdu_coalesce()
1865 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_csum_offload() local
1868 ip_csum_fail = ath12k_dp_rx_h_ip_cksum_fail(ab, rxcb->rx_desc); in ath12k_dp_rx_h_csum_offload()
1869 l4_csum_fail = ath12k_dp_rx_h_l4_cksum_fail(ab, rxcb->rx_desc); in ath12k_dp_rx_h_csum_offload()
1898 ath12k_warn(ar->ab, "unsupported encryption type %d for mic len\n", enctype); in ath12k_dp_rx_crypto_mic_len()
1926 ath12k_warn(ar->ab, "unsupported encryption type %d\n", enctype); in ath12k_dp_rx_crypto_param_len()
1951 ath12k_warn(ar->ab, "unsupported encryption type %d\n", enctype); in ath12k_dp_rx_crypto_icv_len()
1960 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_undecap_nwifi() local
1981 if (ath12k_dp_rx_h_mesh_ctl_present(ab, rxcb->rx_desc)) in ath12k_dp_rx_h_undecap_nwifi()
1992 ath12k_dp_rx_desc_get_crypto_header(ar->ab, in ath12k_dp_rx_h_undecap_nwifi()
2068 struct ath12k_base *ab = ar->ab; in ath12k_get_dot11_hdr_from_rx_desc() local
2078 ath12k_dp_rx_desc_get_crypto_header(ab, rx_desc, crypto_hdr, enctype); in ath12k_get_dot11_hdr_from_rx_desc()
2081 fc = cpu_to_le16(ath12k_dp_rxdesc_get_mpdu_frame_ctrl(ab, rx_desc)); in ath12k_get_dot11_hdr_from_rx_desc()
2088 ath12k_dp_rx_desc_get_dot11_hdr(ab, rx_desc, hdr); in ath12k_get_dot11_hdr_from_rx_desc()
2096 if (ath12k_dp_rx_h_mesh_ctl_present(ab, rx_desc)) in ath12k_get_dot11_hdr_from_rx_desc()
2140 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_undecap() local
2144 decap = ath12k_dp_rx_h_decap_type(ab, rx_desc); in ath12k_dp_rx_h_undecap()
2177 ath12k_dp_rx_h_find_peer(struct ath12k_base *ab, struct sk_buff *msdu) in ath12k_dp_rx_h_find_peer() argument
2183 lockdep_assert_held(&ab->base_lock); in ath12k_dp_rx_h_find_peer()
2186 peer = ath12k_peer_find_by_id(ab, rxcb->peer_id); in ath12k_dp_rx_h_find_peer()
2191 if (!rx_desc || !(ath12k_dp_rxdesc_mac_addr2_valid(ab, rx_desc))) in ath12k_dp_rx_h_find_peer()
2194 peer = ath12k_peer_find_by_addr(ab, in ath12k_dp_rx_h_find_peer()
2195 ath12k_dp_rxdesc_get_mpdu_start_addr2(ab, in ath12k_dp_rx_h_find_peer()
2206 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_mpdu() local
2216 fill_crypto_hdr = ath12k_dp_rx_h_is_da_mcbc(ar->ab, rx_desc); in ath12k_dp_rx_h_mpdu()
2220 rxcb->peer_id = ath12k_dp_rx_h_peer_id(ar->ab, rx_desc); in ath12k_dp_rx_h_mpdu()
2222 spin_lock_bh(&ar->ab->base_lock); in ath12k_dp_rx_h_mpdu()
2223 peer = ath12k_dp_rx_h_find_peer(ar->ab, msdu); in ath12k_dp_rx_h_mpdu()
2232 spin_unlock_bh(&ar->ab->base_lock); in ath12k_dp_rx_h_mpdu()
2234 err_bitmap = ath12k_dp_rx_h_mpdu_err(ab, rx_desc); in ath12k_dp_rx_h_mpdu()
2236 is_decrypted = ath12k_dp_rx_h_is_decrypted(ab, rx_desc); in ath12k_dp_rx_h_mpdu()
2268 if (ath12k_dp_rx_h_decap_type(ar->ab, rx_desc) != in ath12k_dp_rx_h_mpdu()
2278 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_rate() local
2286 pkt_type = ath12k_dp_rx_h_pkt_type(ab, rx_desc); in ath12k_dp_rx_h_rate()
2287 bw = ath12k_dp_rx_h_rx_bw(ab, rx_desc); in ath12k_dp_rx_h_rate()
2288 rate_mcs = ath12k_dp_rx_h_rate_mcs(ab, rx_desc); in ath12k_dp_rx_h_rate()
2289 nss = ath12k_dp_rx_h_nss(ab, rx_desc); in ath12k_dp_rx_h_rate()
2290 sgi = ath12k_dp_rx_h_sgi(ab, rx_desc); in ath12k_dp_rx_h_rate()
2303 ath12k_warn(ar->ab, in ath12k_dp_rx_h_rate()
2317 ath12k_warn(ar->ab, in ath12k_dp_rx_h_rate()
2330 ath12k_warn(ar->ab, in ath12k_dp_rx_h_rate()
2346 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_ppdu() local
2360 meta_data = ath12k_dp_rx_h_freq(ab, rx_desc); in ath12k_dp_rx_h_ppdu()
2381 ath12k_dbg_dump(ar->ab, ATH12K_DBG_DATA, NULL, "rx_desc: ", in ath12k_dp_rx_h_ppdu()
2396 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_deliver_msdu() local
2419 decap = ath12k_dp_rx_h_decap_type(ab, rxcb->rx_desc); in ath12k_dp_rx_deliver_msdu()
2421 spin_lock_bh(&ab->base_lock); in ath12k_dp_rx_deliver_msdu()
2422 peer = ath12k_dp_rx_h_find_peer(ab, msdu); in ath12k_dp_rx_deliver_msdu()
2426 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_deliver_msdu()
2428 ath12k_dbg(ab, ATH12K_DBG_DATA, in ath12k_dp_rx_deliver_msdu()
2435 ath12k_dp_rx_h_seq_no(ab, rxcb->rx_desc), in ath12k_dp_rx_deliver_msdu()
2453 ath12k_dbg_dump(ab, ATH12K_DBG_DP_RX, NULL, "dp rx msdu: ", in ath12k_dp_rx_deliver_msdu()
2478 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_process_msdu() local
2485 u32 hal_rx_desc_sz = ar->ab->hal.hal_desc_sz; in ath12k_dp_rx_process_msdu()
2489 ath12k_warn(ab, in ath12k_dp_rx_process_msdu()
2497 if (!ath12k_dp_rx_h_msdu_done(ab, lrx_desc)) { in ath12k_dp_rx_process_msdu()
2498 ath12k_warn(ab, "msdu_done bit in msdu_end is not set\n"); in ath12k_dp_rx_process_msdu()
2505 msdu_len = ath12k_dp_rx_h_msdu_len(ab, lrx_desc); in ath12k_dp_rx_process_msdu()
2506 l3_pad_bytes = ath12k_dp_rx_h_l3pad(ab, lrx_desc); in ath12k_dp_rx_process_msdu()
2513 ath12k_warn(ab, "invalid msdu len %u\n", msdu_len); in ath12k_dp_rx_process_msdu()
2514 ath12k_dbg_dump(ab, ATH12K_DBG_DATA, NULL, "", rx_desc, in ath12k_dp_rx_process_msdu()
2525 ath12k_warn(ab, in ath12k_dp_rx_process_msdu()
2542 static void ath12k_dp_rx_process_received_packets(struct ath12k_base *ab, in ath12k_dp_rx_process_received_packets() argument
2562 pdev_id = ath12k_hw_mac_id_to_pdev_id(ab->hw_params, mac_id); in ath12k_dp_rx_process_received_packets()
2563 ar = ab->pdevs[pdev_id].ar; in ath12k_dp_rx_process_received_packets()
2564 if (!rcu_dereference(ab->pdevs_active[pdev_id])) { in ath12k_dp_rx_process_received_packets()
2576 ath12k_dbg(ab, ATH12K_DBG_DATA, in ath12k_dp_rx_process_received_packets()
2588 static u16 ath12k_dp_rx_get_peer_id(struct ath12k_base *ab, in ath12k_dp_rx_get_peer_id() argument
2594 ath12k_warn(ab, "Unknown peer metadata version: %d", ver); in ath12k_dp_rx_get_peer_id()
2611 int ath12k_dp_rx_process(struct ath12k_base *ab, int ring_id, in ath12k_dp_rx_process() argument
2616 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_process()
2631 srng = &ab->hal.srng_list[dp->reo_dst_ring[ring_id].ring_id]; in ath12k_dp_rx_process()
2636 ath12k_hal_srng_access_begin(ab, srng); in ath12k_dp_rx_process()
2638 while ((desc = ath12k_hal_srng_dst_get_next_entry(ab, srng))) { in ath12k_dp_rx_process()
2656 desc_info = ath12k_dp_get_rx_desc(ab, cookie); in ath12k_dp_rx_process()
2658 ath12k_warn(ab, "Invalid cookie in manual descriptor retrieval: 0x%x\n", in ath12k_dp_rx_process()
2665 ath12k_warn(ab, "Check HW CC implementation"); in ath12k_dp_rx_process()
2673 dma_unmap_single(ab->dev, rxcb->paddr, in ath12k_dp_rx_process()
2684 ab->soc_stats.hal_reo_error[ring_id]++; in ath12k_dp_rx_process()
2698 rxcb->peer_id = ath12k_dp_rx_get_peer_id(ab, dp->peer_metadata_ver, in ath12k_dp_rx_process()
2722 if (!done && ath12k_hal_srng_dst_num_free(ab, srng, true)) { in ath12k_dp_rx_process()
2723 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_process()
2727 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_process()
2734 ath12k_dp_rx_bufs_replenish(ab, rx_ring, &rx_desc_used_list, in ath12k_dp_rx_process()
2737 ath12k_dp_rx_process_received_packets(ab, napi, &msdu_list, in ath12k_dp_rx_process()
2748 spin_lock_bh(&rx_tid->ab->base_lock); in ath12k_dp_rx_frag_timer()
2751 spin_unlock_bh(&rx_tid->ab->base_lock); in ath12k_dp_rx_frag_timer()
2755 spin_unlock_bh(&rx_tid->ab->base_lock); in ath12k_dp_rx_frag_timer()
2760 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_peer_frag_setup() local
2770 spin_lock_bh(&ab->base_lock); in ath12k_dp_rx_peer_frag_setup()
2772 peer = ath12k_peer_find(ab, vdev_id, peer_mac); in ath12k_dp_rx_peer_frag_setup()
2774 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_frag_setup()
2776 ath12k_warn(ab, "failed to find the peer to set up fragment info\n"); in ath12k_dp_rx_peer_frag_setup()
2782 rx_tid->ab = ab; in ath12k_dp_rx_peer_frag_setup()
2789 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_frag_setup()
2838 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_verify_tkip_mic() local
2846 u32 hdr_len, hal_rx_desc_sz = ar->ab->hal.hal_desc_sz; in ath12k_dp_rx_h_verify_tkip_mic()
2850 if (ath12k_dp_rx_h_enctype(ab, rx_desc) != HAL_ENCRYPT_TYPE_TKIP_MIC) in ath12k_dp_rx_h_verify_tkip_mic()
2896 u32 hal_rx_desc_sz = ar->ab->hal.hal_desc_sz; in ath12k_dp_rx_h_undecap_frag()
2926 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_defrag() local
2934 u32 flags, hal_rx_desc_sz = ar->ab->hal.hal_desc_sz; in ath12k_dp_rx_h_defrag()
2944 enctype = ath12k_dp_rx_h_enctype(ab, rx_desc); in ath12k_dp_rx_h_defrag()
2946 is_decrypted = ath12k_dp_rx_h_is_decrypted(ab, in ath12k_dp_rx_h_defrag()
2994 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_defrag_reo_reinject() local
2995 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_h_defrag_reo_reinject()
3011 hal_rx_desc_sz = ab->hal.hal_desc_sz; in ath12k_dp_rx_h_defrag_reo_reinject()
3015 ath12k_hal_rx_reo_ent_paddr_get(ab, &reo_dest_ring->buf_addr_info, in ath12k_dp_rx_h_defrag_reo_reinject()
3038 ath12k_dp_rxdesc_set_msdu_len(ab, rx_desc, defrag_skb->len - hal_rx_desc_sz); in ath12k_dp_rx_h_defrag_reo_reinject()
3040 buf_paddr = dma_map_single(ab->dev, defrag_skb->data, in ath12k_dp_rx_h_defrag_reo_reinject()
3043 if (dma_mapping_error(ab->dev, buf_paddr)) in ath12k_dp_rx_h_defrag_reo_reinject()
3052 ath12k_warn(ab, "failed to find rx desc for reinject\n"); in ath12k_dp_rx_h_defrag_reo_reinject()
3070 srng = &ab->hal.srng_list[dp->reo_reinject_ring.ring_id]; in ath12k_dp_rx_h_defrag_reo_reinject()
3073 ath12k_hal_srng_access_begin(ab, srng); in ath12k_dp_rx_h_defrag_reo_reinject()
3075 reo_ent_ring = ath12k_hal_srng_src_get_next_entry(ab, srng); in ath12k_dp_rx_h_defrag_reo_reinject()
3077 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_h_defrag_reo_reinject()
3113 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_h_defrag_reo_reinject()
3125 dma_unmap_single(ab->dev, buf_paddr, defrag_skb->len + skb_tailroom(defrag_skb), in ath12k_dp_rx_h_defrag_reo_reinject()
3130 static int ath12k_dp_rx_h_cmp_frags(struct ath12k_base *ab, in ath12k_dp_rx_h_cmp_frags() argument
3135 frag1 = ath12k_dp_rx_h_frag_no(ab, a); in ath12k_dp_rx_h_cmp_frags()
3136 frag2 = ath12k_dp_rx_h_frag_no(ab, b); in ath12k_dp_rx_h_cmp_frags()
3141 static void ath12k_dp_rx_h_sort_frags(struct ath12k_base *ab, in ath12k_dp_rx_h_sort_frags() argument
3149 cmp = ath12k_dp_rx_h_cmp_frags(ab, skb, cur_frag); in ath12k_dp_rx_h_sort_frags()
3163 u32 hal_rx_desc_sz = ar->ab->hal.hal_desc_sz; in ath12k_dp_rx_h_get_pn()
3181 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_defrag_validate_incr_pn() local
3191 encrypt_type = ath12k_dp_rx_h_enctype(ab, desc); in ath12k_dp_rx_h_defrag_validate_incr_pn()
3215 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_frag_h_mpdu() local
3227 peer_id = ath12k_dp_rx_h_peer_id(ab, rx_desc); in ath12k_dp_rx_frag_h_mpdu()
3228 tid = ath12k_dp_rx_h_tid(ab, rx_desc); in ath12k_dp_rx_frag_h_mpdu()
3229 seqno = ath12k_dp_rx_h_seq_no(ab, rx_desc); in ath12k_dp_rx_frag_h_mpdu()
3230 frag_no = ath12k_dp_rx_h_frag_no(ab, msdu); in ath12k_dp_rx_frag_h_mpdu()
3231 more_frags = ath12k_dp_rx_h_more_frags(ab, msdu); in ath12k_dp_rx_frag_h_mpdu()
3233 if (!ath12k_dp_rx_h_seq_ctrl_valid(ab, rx_desc) || in ath12k_dp_rx_frag_h_mpdu()
3234 !ath12k_dp_rx_h_fc_valid(ab, rx_desc) || in ath12k_dp_rx_frag_h_mpdu()
3246 spin_lock_bh(&ab->base_lock); in ath12k_dp_rx_frag_h_mpdu()
3247 peer = ath12k_peer_find_by_id(ab, peer_id); in ath12k_dp_rx_frag_h_mpdu()
3249 ath12k_warn(ab, "failed to find the peer to de-fragment received fragment peer_id %d\n", in ath12k_dp_rx_frag_h_mpdu()
3256 ath12k_warn(ab, "The peer %pM [%d] has uninitialized datapath\n", in ath12k_dp_rx_frag_h_mpdu()
3280 ath12k_dp_rx_h_sort_frags(ab, &rx_tid->rx_frags, msdu); in ath12k_dp_rx_frag_h_mpdu()
3295 ath12k_dp_rx_link_desc_return(ab, ring_desc, in ath12k_dp_rx_frag_h_mpdu()
3306 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_frag_h_mpdu()
3308 spin_lock_bh(&ab->base_lock); in ath12k_dp_rx_frag_h_mpdu()
3310 peer = ath12k_peer_find_by_id(ab, peer_id); in ath12k_dp_rx_frag_h_mpdu()
3333 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_frag_h_mpdu()
3342 struct ath12k_base *ab = ar->ab; in ath12k_dp_process_rx_err_buf() local
3347 u32 hal_rx_desc_sz = ab->hal.hal_desc_sz; in ath12k_dp_process_rx_err_buf()
3357 desc_info = ath12k_dp_get_rx_desc(ab, cookie); in ath12k_dp_process_rx_err_buf()
3359 ath12k_warn(ab, "Invalid cookie in DP rx error descriptor retrieval: 0x%x\n", in ath12k_dp_process_rx_err_buf()
3366 ath12k_warn(ab, " RX Exception, Check HW CC implementation"); in ath12k_dp_process_rx_err_buf()
3374 dma_unmap_single(ar->ab->dev, rxcb->paddr, in ath12k_dp_process_rx_err_buf()
3384 if (!rcu_dereference(ar->ab->pdevs_active[ar->pdev_idx])) { in ath12k_dp_process_rx_err_buf()
3395 msdu_len = ath12k_dp_rx_h_msdu_len(ar->ab, rx_desc); in ath12k_dp_process_rx_err_buf()
3397 ath12k_warn(ar->ab, "invalid msdu leng %u", msdu_len); in ath12k_dp_process_rx_err_buf()
3398 ath12k_dbg_dump(ar->ab, ATH12K_DBG_DATA, NULL, "", rx_desc, in ath12k_dp_process_rx_err_buf()
3408 ath12k_dp_rx_link_desc_return(ar->ab, desc, in ath12k_dp_process_rx_err_buf()
3416 int ath12k_dp_rx_process_err(struct ath12k_base *ab, struct napi_struct *napi, in ath12k_dp_rx_process_err() argument
3441 dp = &ab->dp; in ath12k_dp_rx_process_err()
3445 srng = &ab->hal.srng_list[reo_except->ring_id]; in ath12k_dp_rx_process_err()
3449 ath12k_hal_srng_access_begin(ab, srng); in ath12k_dp_rx_process_err()
3452 (reo_desc = ath12k_hal_srng_dst_get_next_entry(ab, srng))) { in ath12k_dp_rx_process_err()
3454 ab->soc_stats.err_ring_pkts++; in ath12k_dp_rx_process_err()
3456 ret = ath12k_hal_desc_reo_parse_err(ab, reo_desc, &paddr, in ath12k_dp_rx_process_err()
3459 ath12k_warn(ab, "failed to parse error reo desc %d\n", in ath12k_dp_rx_process_err()
3469 rbm != ab->hw_params->hal_params->rx_buf_rbm) { in ath12k_dp_rx_process_err()
3470 ab->soc_stats.invalid_rbm++; in ath12k_dp_rx_process_err()
3471 ath12k_warn(ab, "invalid return buffer manager %d\n", rbm); in ath12k_dp_rx_process_err()
3472 ath12k_dp_rx_link_desc_return(ab, reo_desc, in ath12k_dp_rx_process_err()
3486 ath12k_dp_rx_link_desc_return(ab, reo_desc, in ath12k_dp_rx_process_err()
3494 pdev_id = ath12k_hw_mac_id_to_pdev_id(ab->hw_params, mac_id); in ath12k_dp_rx_process_err()
3495 ar = ab->pdevs[pdev_id].ar; in ath12k_dp_rx_process_err()
3513 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_process_err()
3519 ath12k_dp_rx_bufs_replenish(ab, rx_ring, &rx_desc_used_list, in ath12k_dp_rx_process_err()
3534 (DP_RX_BUFFER_SIZE - ar->ab->hal.hal_desc_sz)); in ath12k_dp_rx_null_q_desc_sg_drop()
3553 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_null_q_desc() local
3558 u32 hal_rx_desc_sz = ar->ab->hal.hal_desc_sz; in ath12k_dp_rx_h_null_q_desc()
3560 msdu_len = ath12k_dp_rx_h_msdu_len(ab, desc); in ath12k_dp_rx_h_null_q_desc()
3576 if (!ath12k_dp_rx_h_msdu_done(ab, desc)) { in ath12k_dp_rx_h_null_q_desc()
3577 ath12k_warn(ar->ab, in ath12k_dp_rx_h_null_q_desc()
3595 l3pad_bytes = ath12k_dp_rx_h_l3pad(ab, desc); in ath12k_dp_rx_h_null_q_desc()
3607 rxcb->tid = ath12k_dp_rx_h_tid(ab, desc); in ath12k_dp_rx_h_null_q_desc()
3623 ar->ab->soc_stats.reo_error[rxcb->err_code]++; in ath12k_dp_rx_h_reo_err()
3650 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_tkip_mic_err() local
3655 u32 hal_rx_desc_sz = ar->ab->hal.hal_desc_sz; in ath12k_dp_rx_h_tkip_mic_err()
3657 rxcb->is_first_msdu = ath12k_dp_rx_h_first_msdu(ab, desc); in ath12k_dp_rx_h_tkip_mic_err()
3658 rxcb->is_last_msdu = ath12k_dp_rx_h_last_msdu(ab, desc); in ath12k_dp_rx_h_tkip_mic_err()
3660 l3pad_bytes = ath12k_dp_rx_h_l3pad(ab, desc); in ath12k_dp_rx_h_tkip_mic_err()
3661 msdu_len = ath12k_dp_rx_h_msdu_len(ab, desc); in ath12k_dp_rx_h_tkip_mic_err()
3677 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_rxdma_err() local
3683 ar->ab->soc_stats.rxdma_error[rxcb->err_code]++; in ath12k_dp_rx_h_rxdma_err()
3688 err_bitmap = ath12k_dp_rx_h_mpdu_err(ab, rx_desc); in ath12k_dp_rx_h_rxdma_err()
3734 int ath12k_dp_rx_process_wbm_err(struct ath12k_base *ab, in ath12k_dp_rx_process_wbm_err() argument
3739 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_process_wbm_err()
3756 srng = &ab->hal.srng_list[dp->rx_rel_ring.ring_id]; in ath12k_dp_rx_process_wbm_err()
3760 ath12k_hal_srng_access_begin(ab, srng); in ath12k_dp_rx_process_wbm_err()
3763 rx_desc = ath12k_hal_srng_dst_get_next_entry(ab, srng); in ath12k_dp_rx_process_wbm_err()
3767 ret = ath12k_hal_wbm_desc_parse_err(ab, rx_desc, &err_info); in ath12k_dp_rx_process_wbm_err()
3769 ath12k_warn(ab, in ath12k_dp_rx_process_wbm_err()
3779 desc_info = ath12k_dp_get_rx_desc(ab, err_info.cookie); in ath12k_dp_rx_process_wbm_err()
3781 ath12k_warn(ab, "Invalid cookie in DP WBM rx error descriptor retrieval: 0x%x\n", in ath12k_dp_rx_process_wbm_err()
3788 ath12k_warn(ab, "WBM RX err, Check HW CC implementation"); in ath12k_dp_rx_process_wbm_err()
3796 dma_unmap_single(ab->dev, rxcb->paddr, in ath12k_dp_rx_process_wbm_err()
3824 mac_id = ath12k_dp_rx_get_msdu_src_link(ab, in ath12k_dp_rx_process_wbm_err()
3858 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_process_wbm_err()
3865 ath12k_dp_rx_bufs_replenish(ab, rx_ring, &rx_desc_used_list, in ath12k_dp_rx_process_wbm_err()
3873 pdev_id = ath12k_hw_mac_id_to_pdev_id(ab->hw_params, mac_id); in ath12k_dp_rx_process_wbm_err()
3874 ar = ab->pdevs[pdev_id].ar; in ath12k_dp_rx_process_wbm_err()
3876 if (!ar || !rcu_dereference(ar->ab->pdevs_active[mac_id])) { in ath12k_dp_rx_process_wbm_err()
3892 void ath12k_dp_rx_process_reo_status(struct ath12k_base *ab) in ath12k_dp_rx_process_reo_status() argument
3894 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_process_reo_status()
3902 srng = &ab->hal.srng_list[dp->reo_status_ring.ring_id]; in ath12k_dp_rx_process_reo_status()
3908 ath12k_hal_srng_access_begin(ab, srng); in ath12k_dp_rx_process_reo_status()
3910 while ((hdr = ath12k_hal_srng_dst_get_next_entry(ab, srng))) { in ath12k_dp_rx_process_reo_status()
3915 ath12k_hal_reo_status_queue_stats(ab, hdr, in ath12k_dp_rx_process_reo_status()
3919 ath12k_hal_reo_flush_queue_status(ab, hdr, in ath12k_dp_rx_process_reo_status()
3923 ath12k_hal_reo_flush_cache_status(ab, hdr, in ath12k_dp_rx_process_reo_status()
3927 ath12k_hal_reo_unblk_cache_status(ab, hdr, in ath12k_dp_rx_process_reo_status()
3931 ath12k_hal_reo_flush_timeout_list_status(ab, hdr, in ath12k_dp_rx_process_reo_status()
3935 ath12k_hal_reo_desc_thresh_reached_status(ab, hdr, in ath12k_dp_rx_process_reo_status()
3939 ath12k_hal_reo_update_rx_reo_queue_status(ab, hdr, in ath12k_dp_rx_process_reo_status()
3943 ath12k_warn(ab, "Unknown reo status type %d\n", tag); in ath12k_dp_rx_process_reo_status()
3966 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_process_reo_status()
3971 void ath12k_dp_rx_free(struct ath12k_base *ab) in ath12k_dp_rx_free() argument
3973 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_free()
3976 ath12k_dp_srng_cleanup(ab, &dp->rx_refill_buf_ring.refill_buf_ring); in ath12k_dp_rx_free()
3978 for (i = 0; i < ab->hw_params->num_rxdma_per_pdev; i++) { in ath12k_dp_rx_free()
3979 if (ab->hw_params->rx_mac_buf_ring) in ath12k_dp_rx_free()
3980 ath12k_dp_srng_cleanup(ab, &dp->rx_mac_buf_ring[i]); in ath12k_dp_rx_free()
3983 for (i = 0; i < ab->hw_params->num_rxdma_dst_ring; i++) in ath12k_dp_rx_free()
3984 ath12k_dp_srng_cleanup(ab, &dp->rxdma_err_dst_ring[i]); in ath12k_dp_rx_free()
3986 ath12k_dp_srng_cleanup(ab, &dp->rxdma_mon_buf_ring.refill_buf_ring); in ath12k_dp_rx_free()
3988 ath12k_dp_rxdma_buf_free(ab); in ath12k_dp_rx_free()
3991 void ath12k_dp_rx_pdev_free(struct ath12k_base *ab, int mac_id) in ath12k_dp_rx_pdev_free() argument
3993 struct ath12k *ar = ab->pdevs[mac_id].ar; in ath12k_dp_rx_pdev_free()
3998 int ath12k_dp_rxdma_ring_sel_config_qcn9274(struct ath12k_base *ab) in ath12k_dp_rxdma_ring_sel_config_qcn9274() argument
4000 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rxdma_ring_sel_config_qcn9274()
4004 u32 hal_rx_desc_sz = ab->hal.hal_desc_sz; in ath12k_dp_rxdma_ring_sel_config_qcn9274()
4017 ab->hal_rx_ops->rx_desc_get_mpdu_start_offset(); in ath12k_dp_rxdma_ring_sel_config_qcn9274()
4019 ab->hal_rx_ops->rx_desc_get_msdu_end_offset(); in ath12k_dp_rxdma_ring_sel_config_qcn9274()
4021 if (ath12k_dp_wmask_compaction_rx_tlv_supported(ab)) { in ath12k_dp_rxdma_ring_sel_config_qcn9274()
4023 ab->hw_params->hal_ops->rxdma_ring_wmask_rx_mpdu_start(); in ath12k_dp_rxdma_ring_sel_config_qcn9274()
4025 ab->hw_params->hal_ops->rxdma_ring_wmask_rx_msdu_end(); in ath12k_dp_rxdma_ring_sel_config_qcn9274()
4026 ath12k_dbg(ab, ATH12K_DBG_DATA, in ath12k_dp_rxdma_ring_sel_config_qcn9274()
4031 ret = ath12k_dp_tx_htt_rx_filter_setup(ab, ring_id, 0, in ath12k_dp_rxdma_ring_sel_config_qcn9274()
4039 int ath12k_dp_rxdma_ring_sel_config_wcn7850(struct ath12k_base *ab) in ath12k_dp_rxdma_ring_sel_config_wcn7850() argument
4041 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rxdma_ring_sel_config_wcn7850()
4045 u32 hal_rx_desc_sz = ab->hal.hal_desc_sz; in ath12k_dp_rxdma_ring_sel_config_wcn7850()
4061 ab->hal_rx_ops->rx_desc_get_mpdu_start_offset(); in ath12k_dp_rxdma_ring_sel_config_wcn7850()
4063 ab->hal_rx_ops->rx_desc_get_msdu_end_offset(); in ath12k_dp_rxdma_ring_sel_config_wcn7850()
4070 for (i = 0; i < ab->hw_params->num_rxdma_per_pdev; i++) { in ath12k_dp_rxdma_ring_sel_config_wcn7850()
4072 ret = ath12k_dp_tx_htt_rx_filter_setup(ab, ring_id, i, in ath12k_dp_rxdma_ring_sel_config_wcn7850()
4081 int ath12k_dp_rx_htt_setup(struct ath12k_base *ab) in ath12k_dp_rx_htt_setup() argument
4083 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_htt_setup()
4089 ret = ath12k_dp_tx_htt_srng_setup(ab, ring_id, 0, HAL_RXDMA_BUF); in ath12k_dp_rx_htt_setup()
4091 ath12k_warn(ab, "failed to configure rx_refill_buf_ring %d\n", in ath12k_dp_rx_htt_setup()
4096 if (ab->hw_params->rx_mac_buf_ring) { in ath12k_dp_rx_htt_setup()
4097 for (i = 0; i < ab->hw_params->num_rxdma_per_pdev; i++) { in ath12k_dp_rx_htt_setup()
4099 ret = ath12k_dp_tx_htt_srng_setup(ab, ring_id, in ath12k_dp_rx_htt_setup()
4102 ath12k_warn(ab, "failed to configure rx_mac_buf_ring%d %d\n", in ath12k_dp_rx_htt_setup()
4109 for (i = 0; i < ab->hw_params->num_rxdma_dst_ring; i++) { in ath12k_dp_rx_htt_setup()
4111 ret = ath12k_dp_tx_htt_srng_setup(ab, ring_id, in ath12k_dp_rx_htt_setup()
4114 ath12k_warn(ab, "failed to configure rxdma_err_dest_ring%d %d\n", in ath12k_dp_rx_htt_setup()
4120 if (ab->hw_params->rxdma1_enable) { in ath12k_dp_rx_htt_setup()
4122 ret = ath12k_dp_tx_htt_srng_setup(ab, ring_id, in ath12k_dp_rx_htt_setup()
4125 ath12k_warn(ab, "failed to configure rxdma_mon_buf_ring %d\n", in ath12k_dp_rx_htt_setup()
4131 ret = ab->hw_params->hw_ops->rxdma_ring_sel_config(ab); in ath12k_dp_rx_htt_setup()
4133 ath12k_warn(ab, "failed to setup rxdma ring selection config\n"); in ath12k_dp_rx_htt_setup()
4140 int ath12k_dp_rx_alloc(struct ath12k_base *ab) in ath12k_dp_rx_alloc() argument
4142 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_alloc()
4148 ret = ath12k_dp_srng_setup(ab, in ath12k_dp_rx_alloc()
4153 ath12k_warn(ab, "failed to setup rx_refill_buf_ring\n"); in ath12k_dp_rx_alloc()
4157 if (ab->hw_params->rx_mac_buf_ring) { in ath12k_dp_rx_alloc()
4158 for (i = 0; i < ab->hw_params->num_rxdma_per_pdev; i++) { in ath12k_dp_rx_alloc()
4159 ret = ath12k_dp_srng_setup(ab, in ath12k_dp_rx_alloc()
4164 ath12k_warn(ab, "failed to setup rx_mac_buf_ring %d\n", in ath12k_dp_rx_alloc()
4171 for (i = 0; i < ab->hw_params->num_rxdma_dst_ring; i++) { in ath12k_dp_rx_alloc()
4172 ret = ath12k_dp_srng_setup(ab, &dp->rxdma_err_dst_ring[i], in ath12k_dp_rx_alloc()
4176 ath12k_warn(ab, "failed to setup rxdma_err_dst_ring %d\n", i); in ath12k_dp_rx_alloc()
4181 if (ab->hw_params->rxdma1_enable) { in ath12k_dp_rx_alloc()
4182 ret = ath12k_dp_srng_setup(ab, in ath12k_dp_rx_alloc()
4187 ath12k_warn(ab, "failed to setup HAL_RXDMA_MONITOR_BUF\n"); in ath12k_dp_rx_alloc()
4192 ret = ath12k_dp_rxdma_buf_setup(ab); in ath12k_dp_rx_alloc()
4194 ath12k_warn(ab, "failed to setup rxdma ring\n"); in ath12k_dp_rx_alloc()
4201 int ath12k_dp_rx_pdev_alloc(struct ath12k_base *ab, int mac_id) in ath12k_dp_rx_pdev_alloc() argument
4203 struct ath12k *ar = ab->pdevs[mac_id].ar; in ath12k_dp_rx_pdev_alloc()
4209 if (!ab->hw_params->rxdma1_enable) in ath12k_dp_rx_pdev_alloc()
4214 ath12k_warn(ab, "failed to setup rx srngs\n"); in ath12k_dp_rx_pdev_alloc()
4218 for (i = 0; i < ab->hw_params->num_rxdma_per_pdev; i++) { in ath12k_dp_rx_pdev_alloc()
4220 ret = ath12k_dp_tx_htt_srng_setup(ab, ring_id, in ath12k_dp_rx_pdev_alloc()
4224 ath12k_warn(ab, in ath12k_dp_rx_pdev_alloc()
4256 ath12k_warn(ar->ab, "pdev_mon_status_attach() failed"); in ath12k_dp_rx_pdev_mon_attach()
4263 if (!ar->ab->hw_params->rxdma1_enable) in ath12k_dp_rx_pdev_mon_attach()