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()
745 if (!ab->hw_params->reoq_lut_support) in ath12k_peer_rx_tid_qref_setup()
767 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
770 struct ath12k_dp *dp = &ab->dp; in ath12k_peer_rx_tid_qref_reset()
773 if (!ab->hw_params->reoq_lut_support) in ath12k_peer_rx_tid_qref_reset()
807 ret = ath12k_dp_reo_cmd_send(ar->ab, rx_tid, in ath12k_dp_rx_peer_tid_delete()
811 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()
813 dma_unmap_single(ar->ab->dev, rx_tid->paddr, rx_tid->size, in ath12k_dp_rx_peer_tid_delete()
820 ath12k_peer_rx_tid_qref_reset(ar->ab, peer->ml_id, tid); in ath12k_dp_rx_peer_tid_delete()
822 ath12k_peer_rx_tid_qref_reset(ar->ab, peer->peer_id, tid); in ath12k_dp_rx_peer_tid_delete()
831 static int ath12k_dp_rx_link_desc_return(struct ath12k_base *ab, in ath12k_dp_rx_link_desc_return() argument
837 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_link_desc_return()
841 srng = &ab->hal.srng_list[dp->wbm_desc_rel_ring.ring_id]; in ath12k_dp_rx_link_desc_return()
845 ath12k_hal_srng_access_begin(ab, srng); in ath12k_dp_rx_link_desc_return()
847 desc = ath12k_hal_srng_src_get_next_entry(ab, srng); in ath12k_dp_rx_link_desc_return()
853 ath12k_hal_rx_msdu_link_desc_set(ab, desc, link_desc, action); in ath12k_dp_rx_link_desc_return()
856 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_link_desc_return()
866 struct ath12k_base *ab = rx_tid->ab; in ath12k_dp_rx_frags_cleanup() local
868 lockdep_assert_held(&ab->base_lock); in ath12k_dp_rx_frags_cleanup()
872 ath12k_dp_rx_link_desc_return(ab, rx_tid->dst_ring_desc, in ath12k_dp_rx_frags_cleanup()
889 lockdep_assert_held(&ar->ab->base_lock); in ath12k_dp_rx_peer_tid_cleanup()
897 spin_unlock_bh(&ar->ab->base_lock); in ath12k_dp_rx_peer_tid_cleanup()
899 spin_lock_bh(&ar->ab->base_lock); in ath12k_dp_rx_peer_tid_cleanup()
923 ret = ath12k_dp_reo_cmd_send(ar->ab, rx_tid, in ath12k_peer_rx_tid_reo_update()
927 ath12k_warn(ar->ab, "failed to update rx tid queue, tid %d (%d)\n", in ath12k_peer_rx_tid_reo_update()
941 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_peer_tid_setup() local
942 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_peer_tid_setup()
951 spin_lock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
953 peer = ath12k_peer_find(ab, vdev_id, peer_mac); in ath12k_dp_rx_peer_tid_setup()
955 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
956 ath12k_warn(ab, "failed to find the peer to set up rx tid\n"); in ath12k_dp_rx_peer_tid_setup()
961 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
965 if (ab->hw_params->reoq_lut_support && in ath12k_dp_rx_peer_tid_setup()
967 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
968 ath12k_warn(ab, "reo qref table is not setup\n"); in ath12k_dp_rx_peer_tid_setup()
973 ath12k_warn(ab, "peer id of peer %d or tid %d doesn't allow reoq setup\n", in ath12k_dp_rx_peer_tid_setup()
975 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
985 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
987 ath12k_warn(ab, "failed to update reo for rx tid %d\n", tid); in ath12k_dp_rx_peer_tid_setup()
991 if (!ab->hw_params->reoq_lut_support) { in ath12k_dp_rx_peer_tid_setup()
997 ath12k_warn(ab, "failed to setup peer rx reorder queuefor tid %d: %d\n", in ath12k_dp_rx_peer_tid_setup()
1020 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
1029 paddr = dma_map_single(ab->dev, addr_aligned, hw_desc_sz, in ath12k_dp_rx_peer_tid_setup()
1032 ret = dma_mapping_error(ab->dev, paddr); in ath12k_dp_rx_peer_tid_setup()
1034 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
1043 if (ab->hw_params->reoq_lut_support) { in ath12k_dp_rx_peer_tid_setup()
1048 ath12k_peer_rx_tid_qref_setup(ab, peer->ml_id, tid, paddr); in ath12k_dp_rx_peer_tid_setup()
1050 ath12k_peer_rx_tid_qref_setup(ab, peer->peer_id, tid, paddr); in ath12k_dp_rx_peer_tid_setup()
1052 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
1054 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
1071 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_ampdu_start() local
1090 ath12k_warn(ab, "failed to setup rx tid %d\n", ret); in ath12k_dp_rx_ampdu_start()
1099 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_ampdu_stop() local
1116 spin_lock_bh(&ab->base_lock); in ath12k_dp_rx_ampdu_stop()
1118 peer = ath12k_peer_find(ab, vdev_id, arsta->addr); in ath12k_dp_rx_ampdu_stop()
1120 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_ampdu_stop()
1121 ath12k_warn(ab, "failed to find the peer to stop rx aggregation\n"); in ath12k_dp_rx_ampdu_stop()
1128 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_ampdu_stop()
1133 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_ampdu_stop()
1135 ath12k_warn(ab, "failed to update reo for rx tid %d: %d\n", in ath12k_dp_rx_ampdu_stop()
1149 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_peer_pn_replay_config() local
1185 spin_lock_bh(&ab->base_lock); in ath12k_dp_rx_peer_pn_replay_config()
1187 peer = ath12k_peer_find(ab, arvif->vdev_id, peer_addr); in ath12k_dp_rx_peer_pn_replay_config()
1189 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_pn_replay_config()
1190 ath12k_warn(ab, "failed to find the peer %pM to configure pn replay detection\n", in ath12k_dp_rx_peer_pn_replay_config()
1201 ret = ath12k_dp_reo_cmd_send(ab, rx_tid, in ath12k_dp_rx_peer_pn_replay_config()
1205 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()
1211 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_pn_replay_config()
1233 static int ath12k_htt_tlv_ppdu_stats_parse(struct ath12k_base *ab, in ath12k_htt_tlv_ppdu_stats_parse() argument
1250 ath12k_warn(ab, "Invalid len %d for the tag 0x%x\n", in ath12k_htt_tlv_ppdu_stats_parse()
1259 ath12k_warn(ab, "Invalid len %d for the tag 0x%x\n", in ath12k_htt_tlv_ppdu_stats_parse()
1278 ath12k_warn(ab, "Invalid len %d for the tag 0x%x\n", in ath12k_htt_tlv_ppdu_stats_parse()
1299 ath12k_warn(ab, "Invalid len %d for the tag 0x%x\n", in ath12k_htt_tlv_ppdu_stats_parse()
1321 int ath12k_dp_htt_tlv_iter(struct ath12k_base *ab, const void *ptr, size_t len, in ath12k_dp_htt_tlv_iter() argument
1333 ath12k_err(ab, "htt tlv parse failure at byte %zd (%zu bytes left, %zu expected)\n", in ath12k_dp_htt_tlv_iter()
1344 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()
1348 ret = iter(ab, tlv_tag, tlv_len, ptr, data); in ath12k_dp_htt_tlv_iter()
1362 struct ath12k_base *ab = ar->ab; in ath12k_update_per_peer_tx_stats() local
1412 ath12k_warn(ab, "Invalid HE mcs %d peer stats", mcs); in ath12k_update_per_peer_tx_stats()
1417 ath12k_warn(ab, "Invalid VHT mcs %d peer stats", mcs); in ath12k_update_per_peer_tx_stats()
1422 ath12k_warn(ab, "Invalid HT mcs %d nss %d peer stats", in ath12k_update_per_peer_tx_stats()
1437 spin_lock_bh(&ab->base_lock); in ath12k_update_per_peer_tx_stats()
1438 peer = ath12k_peer_find_by_id(ab, usr_stats->peer_id); in ath12k_update_per_peer_tx_stats()
1441 spin_unlock_bh(&ab->base_lock); in ath12k_update_per_peer_tx_stats()
1502 spin_unlock_bh(&ab->base_lock); in ath12k_update_per_peer_tx_stats()
1578 static int ath12k_htt_pull_ppdu_stats(struct ath12k_base *ab, in ath12k_htt_pull_ppdu_stats() argument
1594 ath12k_warn(ab, in ath12k_htt_pull_ppdu_stats()
1604 ar = ath12k_mac_get_ar_by_pdev_id(ab, pdev_id); in ath12k_htt_pull_ppdu_stats()
1619 ret = ath12k_dp_htt_tlv_iter(ab, msg->data, len, in ath12k_htt_pull_ppdu_stats()
1624 ath12k_warn(ab, "Failed to parse tlv %d\n", ret); in ath12k_htt_pull_ppdu_stats()
1630 ath12k_warn(ab, in ath12k_htt_pull_ppdu_stats()
1644 spin_lock_bh(&ab->base_lock); in ath12k_htt_pull_ppdu_stats()
1645 peer = ath12k_peer_find_by_id(ab, peer_id); in ath12k_htt_pull_ppdu_stats()
1647 spin_unlock_bh(&ab->base_lock); in ath12k_htt_pull_ppdu_stats()
1654 spin_unlock_bh(&ab->base_lock); in ath12k_htt_pull_ppdu_stats()
1663 spin_lock_bh(&ab->base_lock); in ath12k_htt_pull_ppdu_stats()
1664 peer = ath12k_peer_find_by_id(ab, peer_id); in ath12k_htt_pull_ppdu_stats()
1666 spin_unlock_bh(&ab->base_lock); in ath12k_htt_pull_ppdu_stats()
1673 spin_unlock_bh(&ab->base_lock); in ath12k_htt_pull_ppdu_stats()
1685 static void ath12k_htt_mlo_offset_event_handler(struct ath12k_base *ab, in ath12k_htt_mlo_offset_event_handler() argument
1698 ar = ath12k_mac_get_ar_by_pdev_id(ab, pdev_id); in ath12k_htt_mlo_offset_event_handler()
1725 void ath12k_dp_htt_htc_t2h_msg_handler(struct ath12k_base *ab, in ath12k_dp_htt_htc_t2h_msg_handler() argument
1728 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_htt_htc_t2h_msg_handler()
1740 ath12k_dbg(ab, ATH12K_DBG_DP_HTT, "dp_htt rx msg type :0x%0x\n", type); in ath12k_dp_htt_htc_t2h_msg_handler()
1760 ath12k_peer_map_event(ab, vdev_id, peer_id, mac_addr, 0, 0); in ath12k_dp_htt_htc_t2h_msg_handler()
1775 ath12k_peer_map_event(ab, vdev_id, peer_id, mac_addr, ast_hash, in ath12k_dp_htt_htc_t2h_msg_handler()
1787 ath12k_peer_map_event(ab, vdev_id, peer_id, mac_addr, ast_hash, in ath12k_dp_htt_htc_t2h_msg_handler()
1794 ath12k_peer_unmap_event(ab, peer_id); in ath12k_dp_htt_htc_t2h_msg_handler()
1797 ath12k_htt_pull_ppdu_stats(ab, skb); in ath12k_dp_htt_htc_t2h_msg_handler()
1800 ath12k_debugfs_htt_ext_stats_handler(ab, skb); in ath12k_dp_htt_htc_t2h_msg_handler()
1803 ath12k_htt_mlo_offset_event_handler(ab, skb); in ath12k_dp_htt_htc_t2h_msg_handler()
1806 ath12k_dbg(ab, ATH12K_DBG_DP_HTT, "dp_htt event %d not handled\n", in ath12k_dp_htt_htc_t2h_msg_handler()
1819 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_msdu_coalesce() local
1825 u32 hal_rx_desc_sz = ar->ab->hal.hal_desc_sz; in ath12k_dp_rx_msdu_coalesce()
1841 rxcb->is_first_msdu = ath12k_dp_rx_h_first_msdu(ab, ldesc); in ath12k_dp_rx_msdu_coalesce()
1842 rxcb->is_last_msdu = ath12k_dp_rx_h_last_msdu(ab, ldesc); in ath12k_dp_rx_msdu_coalesce()
1854 ath12k_dp_rx_desc_end_tlv_copy(ab, rxcb->rx_desc, ldesc); in ath12k_dp_rx_msdu_coalesce()
1920 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_csum_offload() local
1923 ip_csum_fail = ath12k_dp_rx_h_ip_cksum_fail(ab, rxcb->rx_desc); in ath12k_dp_rx_h_csum_offload()
1924 l4_csum_fail = ath12k_dp_rx_h_l4_cksum_fail(ab, rxcb->rx_desc); in ath12k_dp_rx_h_csum_offload()
1953 ath12k_warn(ar->ab, "unsupported encryption type %d for mic len\n", enctype); in ath12k_dp_rx_crypto_mic_len()
1981 ath12k_warn(ar->ab, "unsupported encryption type %d\n", enctype); in ath12k_dp_rx_crypto_param_len()
2006 ath12k_warn(ar->ab, "unsupported encryption type %d\n", enctype); in ath12k_dp_rx_crypto_icv_len()
2015 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_undecap_nwifi() local
2036 if (ath12k_dp_rx_h_mesh_ctl_present(ab, rxcb->rx_desc)) in ath12k_dp_rx_h_undecap_nwifi()
2047 ath12k_dp_rx_desc_get_crypto_header(ar->ab, in ath12k_dp_rx_h_undecap_nwifi()
2123 struct ath12k_base *ab = ar->ab; in ath12k_get_dot11_hdr_from_rx_desc() local
2133 ath12k_dp_rx_desc_get_crypto_header(ab, rx_desc, crypto_hdr, enctype); in ath12k_get_dot11_hdr_from_rx_desc()
2136 fc = cpu_to_le16(ath12k_dp_rxdesc_get_mpdu_frame_ctrl(ab, rx_desc)); in ath12k_get_dot11_hdr_from_rx_desc()
2143 ath12k_dp_rx_desc_get_dot11_hdr(ab, rx_desc, hdr); in ath12k_get_dot11_hdr_from_rx_desc()
2151 if (ath12k_dp_rx_h_mesh_ctl_present(ab, rx_desc)) in ath12k_get_dot11_hdr_from_rx_desc()
2195 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_undecap() local
2199 decap = ath12k_dp_rx_h_decap_type(ab, rx_desc); in ath12k_dp_rx_h_undecap()
2232 ath12k_dp_rx_h_find_peer(struct ath12k_base *ab, struct sk_buff *msdu) in ath12k_dp_rx_h_find_peer() argument
2238 lockdep_assert_held(&ab->base_lock); in ath12k_dp_rx_h_find_peer()
2241 peer = ath12k_peer_find_by_id(ab, rxcb->peer_id); in ath12k_dp_rx_h_find_peer()
2246 if (!rx_desc || !(ath12k_dp_rxdesc_mac_addr2_valid(ab, rx_desc))) in ath12k_dp_rx_h_find_peer()
2249 peer = ath12k_peer_find_by_addr(ab, in ath12k_dp_rx_h_find_peer()
2250 ath12k_dp_rxdesc_get_mpdu_start_addr2(ab, in ath12k_dp_rx_h_find_peer()
2261 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_mpdu() local
2271 fill_crypto_hdr = ath12k_dp_rx_h_is_da_mcbc(ar->ab, rx_desc); in ath12k_dp_rx_h_mpdu()
2275 rxcb->peer_id = ath12k_dp_rx_h_peer_id(ar->ab, rx_desc); in ath12k_dp_rx_h_mpdu()
2277 spin_lock_bh(&ar->ab->base_lock); in ath12k_dp_rx_h_mpdu()
2278 peer = ath12k_dp_rx_h_find_peer(ar->ab, msdu); in ath12k_dp_rx_h_mpdu()
2287 spin_unlock_bh(&ar->ab->base_lock); in ath12k_dp_rx_h_mpdu()
2289 err_bitmap = ath12k_dp_rx_h_mpdu_err(ab, rx_desc); in ath12k_dp_rx_h_mpdu()
2291 is_decrypted = ath12k_dp_rx_h_is_decrypted(ab, rx_desc); in ath12k_dp_rx_h_mpdu()
2323 if (ath12k_dp_rx_h_decap_type(ar->ab, rx_desc) != in ath12k_dp_rx_h_mpdu()
2333 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_rate() local
2341 pkt_type = ath12k_dp_rx_h_pkt_type(ab, rx_desc); in ath12k_dp_rx_h_rate()
2342 bw = ath12k_dp_rx_h_rx_bw(ab, rx_desc); in ath12k_dp_rx_h_rate()
2343 rate_mcs = ath12k_dp_rx_h_rate_mcs(ab, rx_desc); in ath12k_dp_rx_h_rate()
2344 nss = ath12k_dp_rx_h_nss(ab, rx_desc); in ath12k_dp_rx_h_rate()
2345 sgi = ath12k_dp_rx_h_sgi(ab, rx_desc); in ath12k_dp_rx_h_rate()
2358 ath12k_warn(ar->ab, in ath12k_dp_rx_h_rate()
2372 ath12k_warn(ar->ab, in ath12k_dp_rx_h_rate()
2385 ath12k_warn(ar->ab, in ath12k_dp_rx_h_rate()
2401 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_ppdu() local
2415 meta_data = ath12k_dp_rx_h_freq(ab, rx_desc); in ath12k_dp_rx_h_ppdu()
2436 ath12k_dbg_dump(ar->ab, ATH12K_DBG_DATA, NULL, "rx_desc: ", in ath12k_dp_rx_h_ppdu()
2451 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_deliver_msdu() local
2474 decap = ath12k_dp_rx_h_decap_type(ab, rxcb->rx_desc); in ath12k_dp_rx_deliver_msdu()
2476 spin_lock_bh(&ab->base_lock); in ath12k_dp_rx_deliver_msdu()
2477 peer = ath12k_dp_rx_h_find_peer(ab, msdu); in ath12k_dp_rx_deliver_msdu()
2486 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_deliver_msdu()
2488 ath12k_dbg(ab, ATH12K_DBG_DATA, in ath12k_dp_rx_deliver_msdu()
2495 ath12k_dp_rx_h_seq_no(ab, rxcb->rx_desc), in ath12k_dp_rx_deliver_msdu()
2513 ath12k_dbg_dump(ab, ATH12K_DBG_DP_RX, NULL, "dp rx msdu: ", in ath12k_dp_rx_deliver_msdu()
2533 static bool ath12k_dp_rx_check_nwifi_hdr_len_valid(struct ath12k_base *ab, in ath12k_dp_rx_check_nwifi_hdr_len_valid() argument
2541 decap_type = ath12k_dp_rx_h_decap_type(ab, rx_desc); in ath12k_dp_rx_check_nwifi_hdr_len_valid()
2551 ab->soc_stats.invalid_rbm++; in ath12k_dp_rx_check_nwifi_hdr_len_valid()
2561 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_process_msdu() local
2568 u32 hal_rx_desc_sz = ar->ab->hal.hal_desc_sz; in ath12k_dp_rx_process_msdu()
2572 ath12k_warn(ab, in ath12k_dp_rx_process_msdu()
2580 if (!ath12k_dp_rx_h_msdu_done(ab, lrx_desc)) { in ath12k_dp_rx_process_msdu()
2581 ath12k_warn(ab, "msdu_done bit in msdu_end is not set\n"); in ath12k_dp_rx_process_msdu()
2588 msdu_len = ath12k_dp_rx_h_msdu_len(ab, lrx_desc); in ath12k_dp_rx_process_msdu()
2589 l3_pad_bytes = ath12k_dp_rx_h_l3pad(ab, lrx_desc); in ath12k_dp_rx_process_msdu()
2596 ath12k_warn(ab, "invalid msdu len %u\n", msdu_len); in ath12k_dp_rx_process_msdu()
2597 ath12k_dbg_dump(ab, ATH12K_DBG_DATA, NULL, "", rx_desc, in ath12k_dp_rx_process_msdu()
2608 ath12k_warn(ab, in ath12k_dp_rx_process_msdu()
2614 if (unlikely(!ath12k_dp_rx_check_nwifi_hdr_len_valid(ab, rx_desc, msdu))) { in ath12k_dp_rx_process_msdu()
2630 static void ath12k_dp_rx_process_received_packets(struct ath12k_base *ab, in ath12k_dp_rx_process_received_packets() argument
2635 struct ath12k_hw_group *ag = ab->ag; in ath12k_dp_rx_process_received_packets()
2670 ath12k_dbg(ab, ATH12K_DBG_DATA, in ath12k_dp_rx_process_received_packets()
2682 static u16 ath12k_dp_rx_get_peer_id(struct ath12k_base *ab, in ath12k_dp_rx_get_peer_id() argument
2688 ath12k_warn(ab, "Unknown peer metadata version: %d", ver); in ath12k_dp_rx_get_peer_id()
2705 int ath12k_dp_rx_process(struct ath12k_base *ab, int ring_id, in ath12k_dp_rx_process() argument
2708 struct ath12k_hw_group *ag = ab->ag; in ath12k_dp_rx_process()
2713 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_process()
2731 srng = &ab->hal.srng_list[dp->reo_dst_ring[ring_id].ring_id]; in ath12k_dp_rx_process()
2736 ath12k_hal_srng_access_begin(ab, srng); in ath12k_dp_rx_process()
2738 while ((desc = ath12k_hal_srng_dst_get_next_entry(ab, srng))) { in ath12k_dp_rx_process()
2776 ath12k_warn(ab, "Check HW CC implementation"); in ath12k_dp_rx_process()
2795 ab->soc_stats.hal_reo_error[ring_id]++; in ath12k_dp_rx_process()
2809 rxcb->peer_id = ath12k_dp_rx_get_peer_id(ab, dp->peer_metadata_ver, in ath12k_dp_rx_process()
2833 if (!done && ath12k_hal_srng_dst_num_free(ab, srng, true)) { in ath12k_dp_rx_process()
2834 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_process()
2838 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_process()
2857 ath12k_dp_rx_process_received_packets(ab, napi, &msdu_list, in ath12k_dp_rx_process()
2868 spin_lock_bh(&rx_tid->ab->base_lock); in ath12k_dp_rx_frag_timer()
2871 spin_unlock_bh(&rx_tid->ab->base_lock); in ath12k_dp_rx_frag_timer()
2875 spin_unlock_bh(&rx_tid->ab->base_lock); in ath12k_dp_rx_frag_timer()
2880 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_peer_frag_setup() local
2890 spin_lock_bh(&ab->base_lock); in ath12k_dp_rx_peer_frag_setup()
2892 peer = ath12k_peer_find(ab, vdev_id, peer_mac); in ath12k_dp_rx_peer_frag_setup()
2894 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_frag_setup()
2896 ath12k_warn(ab, "failed to find the peer to set up fragment info\n"); in ath12k_dp_rx_peer_frag_setup()
2901 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_frag_setup()
2908 rx_tid->ab = ab; in ath12k_dp_rx_peer_frag_setup()
2915 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_frag_setup()
2964 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_verify_tkip_mic() local
2972 u32 hdr_len, hal_rx_desc_sz = ar->ab->hal.hal_desc_sz; in ath12k_dp_rx_h_verify_tkip_mic()
2976 if (ath12k_dp_rx_h_enctype(ab, rx_desc) != HAL_ENCRYPT_TYPE_TKIP_MIC) in ath12k_dp_rx_h_verify_tkip_mic()
3009 if (unlikely(!ath12k_dp_rx_check_nwifi_hdr_len_valid(ab, rx_desc, msdu))) in ath12k_dp_rx_h_verify_tkip_mic()
3025 u32 hal_rx_desc_sz = ar->ab->hal.hal_desc_sz; in ath12k_dp_rx_h_undecap_frag()
3055 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_defrag() local
3063 u32 flags, hal_rx_desc_sz = ar->ab->hal.hal_desc_sz; in ath12k_dp_rx_h_defrag()
3073 enctype = ath12k_dp_rx_h_enctype(ab, rx_desc); in ath12k_dp_rx_h_defrag()
3075 is_decrypted = ath12k_dp_rx_h_is_decrypted(ab, in ath12k_dp_rx_h_defrag()
3123 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_defrag_reo_reinject() local
3124 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_h_defrag_reo_reinject()
3140 hal_rx_desc_sz = ab->hal.hal_desc_sz; in ath12k_dp_rx_h_defrag_reo_reinject()
3144 ath12k_hal_rx_reo_ent_paddr_get(ab, &reo_dest_ring->buf_addr_info, in ath12k_dp_rx_h_defrag_reo_reinject()
3167 ath12k_dp_rxdesc_set_msdu_len(ab, rx_desc, defrag_skb->len - hal_rx_desc_sz); in ath12k_dp_rx_h_defrag_reo_reinject()
3169 buf_paddr = dma_map_single(ab->dev, defrag_skb->data, in ath12k_dp_rx_h_defrag_reo_reinject()
3172 if (dma_mapping_error(ab->dev, buf_paddr)) in ath12k_dp_rx_h_defrag_reo_reinject()
3181 ath12k_warn(ab, "failed to find rx desc for reinject\n"); in ath12k_dp_rx_h_defrag_reo_reinject()
3199 srng = &ab->hal.srng_list[dp->reo_reinject_ring.ring_id]; in ath12k_dp_rx_h_defrag_reo_reinject()
3202 ath12k_hal_srng_access_begin(ab, srng); in ath12k_dp_rx_h_defrag_reo_reinject()
3204 reo_ent_ring = ath12k_hal_srng_src_get_next_entry(ab, srng); in ath12k_dp_rx_h_defrag_reo_reinject()
3206 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_h_defrag_reo_reinject()
3242 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_h_defrag_reo_reinject()
3254 dma_unmap_single(ab->dev, buf_paddr, defrag_skb->len + skb_tailroom(defrag_skb), in ath12k_dp_rx_h_defrag_reo_reinject()
3259 static int ath12k_dp_rx_h_cmp_frags(struct ath12k_base *ab, in ath12k_dp_rx_h_cmp_frags() argument
3264 frag1 = ath12k_dp_rx_h_frag_no(ab, a); in ath12k_dp_rx_h_cmp_frags()
3265 frag2 = ath12k_dp_rx_h_frag_no(ab, b); in ath12k_dp_rx_h_cmp_frags()
3270 static void ath12k_dp_rx_h_sort_frags(struct ath12k_base *ab, in ath12k_dp_rx_h_sort_frags() argument
3278 cmp = ath12k_dp_rx_h_cmp_frags(ab, skb, cur_frag); in ath12k_dp_rx_h_sort_frags()
3292 u32 hal_rx_desc_sz = ar->ab->hal.hal_desc_sz; in ath12k_dp_rx_h_get_pn()
3310 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_defrag_validate_incr_pn() local
3320 encrypt_type = ath12k_dp_rx_h_enctype(ab, desc); in ath12k_dp_rx_h_defrag_validate_incr_pn()
3344 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_frag_h_mpdu() local
3356 peer_id = ath12k_dp_rx_h_peer_id(ab, rx_desc); in ath12k_dp_rx_frag_h_mpdu()
3357 tid = ath12k_dp_rx_h_tid(ab, rx_desc); in ath12k_dp_rx_frag_h_mpdu()
3358 seqno = ath12k_dp_rx_h_seq_no(ab, rx_desc); in ath12k_dp_rx_frag_h_mpdu()
3359 frag_no = ath12k_dp_rx_h_frag_no(ab, msdu); in ath12k_dp_rx_frag_h_mpdu()
3360 more_frags = ath12k_dp_rx_h_more_frags(ab, msdu); in ath12k_dp_rx_frag_h_mpdu()
3362 if (!ath12k_dp_rx_h_seq_ctrl_valid(ab, rx_desc) || in ath12k_dp_rx_frag_h_mpdu()
3363 !ath12k_dp_rx_h_fc_valid(ab, rx_desc) || in ath12k_dp_rx_frag_h_mpdu()
3375 spin_lock_bh(&ab->base_lock); in ath12k_dp_rx_frag_h_mpdu()
3376 peer = ath12k_peer_find_by_id(ab, peer_id); in ath12k_dp_rx_frag_h_mpdu()
3378 ath12k_warn(ab, "failed to find the peer to de-fragment received fragment peer_id %d\n", in ath12k_dp_rx_frag_h_mpdu()
3385 ath12k_warn(ab, "The peer %pM [%d] has uninitialized datapath\n", in ath12k_dp_rx_frag_h_mpdu()
3409 ath12k_dp_rx_h_sort_frags(ab, &rx_tid->rx_frags, msdu); in ath12k_dp_rx_frag_h_mpdu()
3424 ath12k_dp_rx_link_desc_return(ab, ring_desc, in ath12k_dp_rx_frag_h_mpdu()
3435 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_frag_h_mpdu()
3437 spin_lock_bh(&ab->base_lock); in ath12k_dp_rx_frag_h_mpdu()
3439 peer = ath12k_peer_find_by_id(ab, peer_id); in ath12k_dp_rx_frag_h_mpdu()
3462 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_frag_h_mpdu()
3471 struct ath12k_base *ab = ar->ab; in ath12k_dp_process_rx_err_buf() local
3476 u32 hal_rx_desc_sz = ab->hal.hal_desc_sz; in ath12k_dp_process_rx_err_buf()
3486 desc_info = ath12k_dp_get_rx_desc(ab, cookie); in ath12k_dp_process_rx_err_buf()
3488 ath12k_warn(ab, "Invalid cookie in DP rx error descriptor retrieval: 0x%x\n", in ath12k_dp_process_rx_err_buf()
3495 ath12k_warn(ab, " RX Exception, Check HW CC implementation"); in ath12k_dp_process_rx_err_buf()
3503 dma_unmap_single(ar->ab->dev, rxcb->paddr, in ath12k_dp_process_rx_err_buf()
3513 if (!rcu_dereference(ar->ab->pdevs_active[ar->pdev_idx])) { in ath12k_dp_process_rx_err_buf()
3524 msdu_len = ath12k_dp_rx_h_msdu_len(ar->ab, rx_desc); in ath12k_dp_process_rx_err_buf()
3526 ath12k_warn(ar->ab, "invalid msdu leng %u", msdu_len); in ath12k_dp_process_rx_err_buf()
3527 ath12k_dbg_dump(ar->ab, ATH12K_DBG_DATA, NULL, "", rx_desc, in ath12k_dp_process_rx_err_buf()
3537 ath12k_dp_rx_link_desc_return(ar->ab, desc, in ath12k_dp_process_rx_err_buf()
3545 int ath12k_dp_rx_process_err(struct ath12k_base *ab, struct napi_struct *napi, in ath12k_dp_rx_process_err() argument
3548 struct ath12k_hw_group *ag = ab->ag; in ath12k_dp_rx_process_err()
3576 reo_except = &ab->dp.reo_except_ring; in ath12k_dp_rx_process_err()
3578 srng = &ab->hal.srng_list[reo_except->ring_id]; in ath12k_dp_rx_process_err()
3582 ath12k_hal_srng_access_begin(ab, srng); in ath12k_dp_rx_process_err()
3585 (reo_desc = ath12k_hal_srng_dst_get_next_entry(ab, srng))) { in ath12k_dp_rx_process_err()
3587 ab->soc_stats.err_ring_pkts++; in ath12k_dp_rx_process_err()
3589 ret = ath12k_hal_desc_reo_parse_err(ab, reo_desc, &paddr, in ath12k_dp_rx_process_err()
3592 ath12k_warn(ab, "failed to parse error reo desc %d\n", in ath12k_dp_rx_process_err()
3614 ab->soc_stats.invalid_rbm++; in ath12k_dp_rx_process_err()
3615 ath12k_warn(ab, "invalid return buffer manager %d\n", rbm); in ath12k_dp_rx_process_err()
3630 partner_ab->device_id != ab->device_id) { in ath12k_dp_rx_process_err()
3657 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_process_err()
3685 (DP_RX_BUFFER_SIZE - ar->ab->hal.hal_desc_sz)); in ath12k_dp_rx_null_q_desc_sg_drop()
3704 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_null_q_desc() local
3709 u32 hal_rx_desc_sz = ar->ab->hal.hal_desc_sz; in ath12k_dp_rx_h_null_q_desc()
3711 msdu_len = ath12k_dp_rx_h_msdu_len(ab, desc); in ath12k_dp_rx_h_null_q_desc()
3727 if (!ath12k_dp_rx_h_msdu_done(ab, desc)) { in ath12k_dp_rx_h_null_q_desc()
3728 ath12k_warn(ar->ab, in ath12k_dp_rx_h_null_q_desc()
3746 l3pad_bytes = ath12k_dp_rx_h_l3pad(ab, desc); in ath12k_dp_rx_h_null_q_desc()
3754 if (unlikely(!ath12k_dp_rx_check_nwifi_hdr_len_valid(ab, desc, msdu))) in ath12k_dp_rx_h_null_q_desc()
3761 rxcb->tid = ath12k_dp_rx_h_tid(ab, desc); in ath12k_dp_rx_h_null_q_desc()
3777 ar->ab->soc_stats.reo_error[rxcb->err_code]++; in ath12k_dp_rx_h_reo_err()
3804 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_tkip_mic_err() local
3809 u32 hal_rx_desc_sz = ar->ab->hal.hal_desc_sz; in ath12k_dp_rx_h_tkip_mic_err()
3811 rxcb->is_first_msdu = ath12k_dp_rx_h_first_msdu(ab, desc); in ath12k_dp_rx_h_tkip_mic_err()
3812 rxcb->is_last_msdu = ath12k_dp_rx_h_last_msdu(ab, desc); in ath12k_dp_rx_h_tkip_mic_err()
3814 l3pad_bytes = ath12k_dp_rx_h_l3pad(ab, desc); in ath12k_dp_rx_h_tkip_mic_err()
3815 msdu_len = ath12k_dp_rx_h_msdu_len(ab, desc); in ath12k_dp_rx_h_tkip_mic_err()
3819 if (unlikely(!ath12k_dp_rx_check_nwifi_hdr_len_valid(ab, desc, msdu))) in ath12k_dp_rx_h_tkip_mic_err()
3835 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_rxdma_err() local
3841 ar->ab->soc_stats.rxdma_error[rxcb->err_code]++; in ath12k_dp_rx_h_rxdma_err()
3846 err_bitmap = ath12k_dp_rx_h_mpdu_err(ab, rx_desc); in ath12k_dp_rx_h_rxdma_err()
3892 int ath12k_dp_rx_process_wbm_err(struct ath12k_base *ab, in ath12k_dp_rx_process_wbm_err() argument
3896 struct ath12k_hw_group *ag = ab->ag; in ath12k_dp_rx_process_wbm_err()
3898 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_process_wbm_err()
3921 srng = &ab->hal.srng_list[dp->rx_rel_ring.ring_id]; in ath12k_dp_rx_process_wbm_err()
3924 ath12k_hal_srng_access_begin(ab, srng); in ath12k_dp_rx_process_wbm_err()
3927 rx_desc = ath12k_hal_srng_dst_get_next_entry(ab, srng); in ath12k_dp_rx_process_wbm_err()
3931 ret = ath12k_hal_wbm_desc_parse_err(ab, rx_desc, &err_info); in ath12k_dp_rx_process_wbm_err()
3933 ath12k_warn(ab, in ath12k_dp_rx_process_wbm_err()
3943 desc_info = ath12k_dp_get_rx_desc(ab, err_info.cookie); in ath12k_dp_rx_process_wbm_err()
3945 ath12k_warn(ab, "Invalid cookie in DP WBM rx error descriptor retrieval: 0x%x\n", in ath12k_dp_rx_process_wbm_err()
3952 ath12k_warn(ab, "WBM RX err, Check HW CC implementation"); in ath12k_dp_rx_process_wbm_err()
4035 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_process_wbm_err()
4049 ath12k_dp_rx_bufs_replenish(ab, rx_ring, in ath12k_dp_rx_process_wbm_err()
4062 ath12k_dbg(ab, ATH12K_DBG_DATA, in ath12k_dp_rx_process_wbm_err()
4073 if (!ar || !rcu_dereference(ar->ab->pdevs_active[pdev_id])) { in ath12k_dp_rx_process_wbm_err()
4089 void ath12k_dp_rx_process_reo_status(struct ath12k_base *ab) in ath12k_dp_rx_process_reo_status() argument
4091 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_process_reo_status()
4099 srng = &ab->hal.srng_list[dp->reo_status_ring.ring_id]; in ath12k_dp_rx_process_reo_status()
4105 ath12k_hal_srng_access_begin(ab, srng); in ath12k_dp_rx_process_reo_status()
4107 while ((hdr = ath12k_hal_srng_dst_get_next_entry(ab, srng))) { in ath12k_dp_rx_process_reo_status()
4112 ath12k_hal_reo_status_queue_stats(ab, hdr, in ath12k_dp_rx_process_reo_status()
4116 ath12k_hal_reo_flush_queue_status(ab, hdr, in ath12k_dp_rx_process_reo_status()
4120 ath12k_hal_reo_flush_cache_status(ab, hdr, in ath12k_dp_rx_process_reo_status()
4124 ath12k_hal_reo_unblk_cache_status(ab, hdr, in ath12k_dp_rx_process_reo_status()
4128 ath12k_hal_reo_flush_timeout_list_status(ab, hdr, in ath12k_dp_rx_process_reo_status()
4132 ath12k_hal_reo_desc_thresh_reached_status(ab, hdr, in ath12k_dp_rx_process_reo_status()
4136 ath12k_hal_reo_update_rx_reo_queue_status(ab, hdr, in ath12k_dp_rx_process_reo_status()
4140 ath12k_warn(ab, "Unknown reo status type %d\n", tag); in ath12k_dp_rx_process_reo_status()
4163 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_process_reo_status()
4168 void ath12k_dp_rx_free(struct ath12k_base *ab) in ath12k_dp_rx_free() argument
4170 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_free()
4173 ath12k_dp_srng_cleanup(ab, &dp->rx_refill_buf_ring.refill_buf_ring); in ath12k_dp_rx_free()
4175 for (i = 0; i < ab->hw_params->num_rxdma_per_pdev; i++) { in ath12k_dp_rx_free()
4176 if (ab->hw_params->rx_mac_buf_ring) in ath12k_dp_rx_free()
4177 ath12k_dp_srng_cleanup(ab, &dp->rx_mac_buf_ring[i]); in ath12k_dp_rx_free()
4180 for (i = 0; i < ab->hw_params->num_rxdma_dst_ring; i++) in ath12k_dp_rx_free()
4181 ath12k_dp_srng_cleanup(ab, &dp->rxdma_err_dst_ring[i]); in ath12k_dp_rx_free()
4183 ath12k_dp_srng_cleanup(ab, &dp->rxdma_mon_buf_ring.refill_buf_ring); in ath12k_dp_rx_free()
4185 ath12k_dp_rxdma_buf_free(ab); in ath12k_dp_rx_free()
4188 void ath12k_dp_rx_pdev_free(struct ath12k_base *ab, int mac_id) in ath12k_dp_rx_pdev_free() argument
4190 struct ath12k *ar = ab->pdevs[mac_id].ar; in ath12k_dp_rx_pdev_free()
4195 int ath12k_dp_rxdma_ring_sel_config_qcn9274(struct ath12k_base *ab) in ath12k_dp_rxdma_ring_sel_config_qcn9274() argument
4197 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rxdma_ring_sel_config_qcn9274()
4201 u32 hal_rx_desc_sz = ab->hal.hal_desc_sz; in ath12k_dp_rxdma_ring_sel_config_qcn9274()
4214 ab->hal_rx_ops->rx_desc_get_mpdu_start_offset(); in ath12k_dp_rxdma_ring_sel_config_qcn9274()
4216 ab->hal_rx_ops->rx_desc_get_msdu_end_offset(); in ath12k_dp_rxdma_ring_sel_config_qcn9274()
4218 if (ath12k_dp_wmask_compaction_rx_tlv_supported(ab)) { in ath12k_dp_rxdma_ring_sel_config_qcn9274()
4220 ab->hw_params->hal_ops->rxdma_ring_wmask_rx_mpdu_start(); in ath12k_dp_rxdma_ring_sel_config_qcn9274()
4222 ab->hw_params->hal_ops->rxdma_ring_wmask_rx_msdu_end(); in ath12k_dp_rxdma_ring_sel_config_qcn9274()
4223 ath12k_dbg(ab, ATH12K_DBG_DATA, in ath12k_dp_rxdma_ring_sel_config_qcn9274()
4228 ret = ath12k_dp_tx_htt_rx_filter_setup(ab, ring_id, 0, in ath12k_dp_rxdma_ring_sel_config_qcn9274()
4236 int ath12k_dp_rxdma_ring_sel_config_wcn7850(struct ath12k_base *ab) in ath12k_dp_rxdma_ring_sel_config_wcn7850() argument
4238 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rxdma_ring_sel_config_wcn7850()
4242 u32 hal_rx_desc_sz = ab->hal.hal_desc_sz; in ath12k_dp_rxdma_ring_sel_config_wcn7850()
4258 ab->hal_rx_ops->rx_desc_get_mpdu_start_offset(); in ath12k_dp_rxdma_ring_sel_config_wcn7850()
4260 ab->hal_rx_ops->rx_desc_get_msdu_end_offset(); in ath12k_dp_rxdma_ring_sel_config_wcn7850()
4267 for (i = 0; i < ab->hw_params->num_rxdma_per_pdev; i++) { in ath12k_dp_rxdma_ring_sel_config_wcn7850()
4269 ret = ath12k_dp_tx_htt_rx_filter_setup(ab, ring_id, i, in ath12k_dp_rxdma_ring_sel_config_wcn7850()
4278 int ath12k_dp_rx_htt_setup(struct ath12k_base *ab) in ath12k_dp_rx_htt_setup() argument
4280 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_htt_setup()
4286 ret = ath12k_dp_tx_htt_srng_setup(ab, ring_id, 0, HAL_RXDMA_BUF); in ath12k_dp_rx_htt_setup()
4288 ath12k_warn(ab, "failed to configure rx_refill_buf_ring %d\n", in ath12k_dp_rx_htt_setup()
4293 if (ab->hw_params->rx_mac_buf_ring) { in ath12k_dp_rx_htt_setup()
4294 for (i = 0; i < ab->hw_params->num_rxdma_per_pdev; i++) { in ath12k_dp_rx_htt_setup()
4296 ret = ath12k_dp_tx_htt_srng_setup(ab, ring_id, in ath12k_dp_rx_htt_setup()
4299 ath12k_warn(ab, "failed to configure rx_mac_buf_ring%d %d\n", in ath12k_dp_rx_htt_setup()
4306 for (i = 0; i < ab->hw_params->num_rxdma_dst_ring; i++) { in ath12k_dp_rx_htt_setup()
4308 ret = ath12k_dp_tx_htt_srng_setup(ab, ring_id, in ath12k_dp_rx_htt_setup()
4311 ath12k_warn(ab, "failed to configure rxdma_err_dest_ring%d %d\n", in ath12k_dp_rx_htt_setup()
4317 if (ab->hw_params->rxdma1_enable) { in ath12k_dp_rx_htt_setup()
4319 ret = ath12k_dp_tx_htt_srng_setup(ab, ring_id, in ath12k_dp_rx_htt_setup()
4322 ath12k_warn(ab, "failed to configure rxdma_mon_buf_ring %d\n", in ath12k_dp_rx_htt_setup()
4328 ret = ab->hw_params->hw_ops->rxdma_ring_sel_config(ab); in ath12k_dp_rx_htt_setup()
4330 ath12k_warn(ab, "failed to setup rxdma ring selection config\n"); in ath12k_dp_rx_htt_setup()
4337 int ath12k_dp_rx_alloc(struct ath12k_base *ab) in ath12k_dp_rx_alloc() argument
4339 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_alloc()
4345 ret = ath12k_dp_srng_setup(ab, in ath12k_dp_rx_alloc()
4350 ath12k_warn(ab, "failed to setup rx_refill_buf_ring\n"); in ath12k_dp_rx_alloc()
4354 if (ab->hw_params->rx_mac_buf_ring) { in ath12k_dp_rx_alloc()
4355 for (i = 0; i < ab->hw_params->num_rxdma_per_pdev; i++) { in ath12k_dp_rx_alloc()
4356 ret = ath12k_dp_srng_setup(ab, in ath12k_dp_rx_alloc()
4361 ath12k_warn(ab, "failed to setup rx_mac_buf_ring %d\n", in ath12k_dp_rx_alloc()
4368 for (i = 0; i < ab->hw_params->num_rxdma_dst_ring; i++) { in ath12k_dp_rx_alloc()
4369 ret = ath12k_dp_srng_setup(ab, &dp->rxdma_err_dst_ring[i], in ath12k_dp_rx_alloc()
4373 ath12k_warn(ab, "failed to setup rxdma_err_dst_ring %d\n", i); in ath12k_dp_rx_alloc()
4378 if (ab->hw_params->rxdma1_enable) { in ath12k_dp_rx_alloc()
4379 ret = ath12k_dp_srng_setup(ab, in ath12k_dp_rx_alloc()
4384 ath12k_warn(ab, "failed to setup HAL_RXDMA_MONITOR_BUF\n"); in ath12k_dp_rx_alloc()
4389 ret = ath12k_dp_rxdma_buf_setup(ab); in ath12k_dp_rx_alloc()
4391 ath12k_warn(ab, "failed to setup rxdma ring\n"); in ath12k_dp_rx_alloc()
4398 int ath12k_dp_rx_pdev_alloc(struct ath12k_base *ab, int mac_id) in ath12k_dp_rx_pdev_alloc() argument
4400 struct ath12k *ar = ab->pdevs[mac_id].ar; in ath12k_dp_rx_pdev_alloc()
4406 if (!ab->hw_params->rxdma1_enable) in ath12k_dp_rx_pdev_alloc()
4411 ath12k_warn(ab, "failed to setup rx srngs\n"); in ath12k_dp_rx_pdev_alloc()
4415 for (i = 0; i < ab->hw_params->num_rxdma_per_pdev; i++) { in ath12k_dp_rx_pdev_alloc()
4417 ret = ath12k_dp_tx_htt_srng_setup(ab, ring_id, in ath12k_dp_rx_pdev_alloc()
4421 ath12k_warn(ab, in ath12k_dp_rx_pdev_alloc()
4453 ath12k_warn(ar->ab, "pdev_mon_status_attach() failed"); in ath12k_dp_rx_pdev_mon_attach()
4460 if (!ar->ab->hw_params->rxdma1_enable) in ath12k_dp_rx_pdev_mon_attach()