Lines Matching full:ab
25 u8 *ath11k_dp_rx_h_80211_hdr(struct ath11k_base *ab, struct hal_rx_desc *desc) in ath11k_dp_rx_h_80211_hdr() argument
27 return ab->hw_params.hw_ops->rx_desc_get_hdr_status(desc); in ath11k_dp_rx_h_80211_hdr()
31 enum hal_encrypt_type ath11k_dp_rx_h_mpdu_start_enctype(struct ath11k_base *ab, in ath11k_dp_rx_h_mpdu_start_enctype() argument
34 if (!ab->hw_params.hw_ops->rx_desc_encrypt_valid(desc)) in ath11k_dp_rx_h_mpdu_start_enctype()
37 return ab->hw_params.hw_ops->rx_desc_get_encrypt_type(desc); in ath11k_dp_rx_h_mpdu_start_enctype()
40 static inline u8 ath11k_dp_rx_h_msdu_start_decap_type(struct ath11k_base *ab, in ath11k_dp_rx_h_msdu_start_decap_type() argument
43 return ab->hw_params.hw_ops->rx_desc_get_decap_type(desc); in ath11k_dp_rx_h_msdu_start_decap_type()
47 bool ath11k_dp_rx_h_msdu_start_ldpc_support(struct ath11k_base *ab, in ath11k_dp_rx_h_msdu_start_ldpc_support() argument
50 return ab->hw_params.hw_ops->rx_desc_get_ldpc_support(desc); in ath11k_dp_rx_h_msdu_start_ldpc_support()
54 u8 ath11k_dp_rx_h_msdu_start_mesh_ctl_present(struct ath11k_base *ab, in ath11k_dp_rx_h_msdu_start_mesh_ctl_present() argument
57 return ab->hw_params.hw_ops->rx_desc_get_mesh_ctl(desc); in ath11k_dp_rx_h_msdu_start_mesh_ctl_present()
61 bool ath11k_dp_rx_h_mpdu_start_seq_ctrl_valid(struct ath11k_base *ab, in ath11k_dp_rx_h_mpdu_start_seq_ctrl_valid() argument
64 return ab->hw_params.hw_ops->rx_desc_get_mpdu_seq_ctl_vld(desc); in ath11k_dp_rx_h_mpdu_start_seq_ctrl_valid()
67 static inline bool ath11k_dp_rx_h_mpdu_start_fc_valid(struct ath11k_base *ab, in ath11k_dp_rx_h_mpdu_start_fc_valid() argument
70 return ab->hw_params.hw_ops->rx_desc_get_mpdu_fc_valid(desc); in ath11k_dp_rx_h_mpdu_start_fc_valid()
73 static inline bool ath11k_dp_rx_h_mpdu_start_more_frags(struct ath11k_base *ab, in ath11k_dp_rx_h_mpdu_start_more_frags() argument
78 hdr = (struct ieee80211_hdr *)(skb->data + ab->hw_params.hal_desc_sz); in ath11k_dp_rx_h_mpdu_start_more_frags()
82 static inline u16 ath11k_dp_rx_h_mpdu_start_frag_no(struct ath11k_base *ab, in ath11k_dp_rx_h_mpdu_start_frag_no() argument
87 hdr = (struct ieee80211_hdr *)(skb->data + ab->hw_params.hal_desc_sz); in ath11k_dp_rx_h_mpdu_start_frag_no()
91 static inline u16 ath11k_dp_rx_h_mpdu_start_seq_no(struct ath11k_base *ab, in ath11k_dp_rx_h_mpdu_start_seq_no() argument
94 return ab->hw_params.hw_ops->rx_desc_get_mpdu_start_seq_no(desc); in ath11k_dp_rx_h_mpdu_start_seq_no()
97 static inline void *ath11k_dp_rx_get_attention(struct ath11k_base *ab, in ath11k_dp_rx_get_attention() argument
100 return ab->hw_params.hw_ops->rx_desc_get_attention(desc); in ath11k_dp_rx_get_attention()
157 static bool ath11k_dp_rx_h_attn_msdu_len_err(struct ath11k_base *ab, in ath11k_dp_rx_h_attn_msdu_len_err() argument
163 rx_attention = ath11k_dp_rx_get_attention(ab, desc); in ath11k_dp_rx_h_attn_msdu_len_err()
169 static inline u16 ath11k_dp_rx_h_msdu_start_msdu_len(struct ath11k_base *ab, in ath11k_dp_rx_h_msdu_start_msdu_len() argument
172 return ab->hw_params.hw_ops->rx_desc_get_msdu_len(desc); in ath11k_dp_rx_h_msdu_start_msdu_len()
175 static inline u8 ath11k_dp_rx_h_msdu_start_sgi(struct ath11k_base *ab, in ath11k_dp_rx_h_msdu_start_sgi() argument
178 return ab->hw_params.hw_ops->rx_desc_get_msdu_sgi(desc); in ath11k_dp_rx_h_msdu_start_sgi()
181 static inline u8 ath11k_dp_rx_h_msdu_start_rate_mcs(struct ath11k_base *ab, in ath11k_dp_rx_h_msdu_start_rate_mcs() argument
184 return ab->hw_params.hw_ops->rx_desc_get_msdu_rate_mcs(desc); in ath11k_dp_rx_h_msdu_start_rate_mcs()
187 static inline u8 ath11k_dp_rx_h_msdu_start_rx_bw(struct ath11k_base *ab, in ath11k_dp_rx_h_msdu_start_rx_bw() argument
190 return ab->hw_params.hw_ops->rx_desc_get_msdu_rx_bw(desc); in ath11k_dp_rx_h_msdu_start_rx_bw()
193 static inline u32 ath11k_dp_rx_h_msdu_start_freq(struct ath11k_base *ab, in ath11k_dp_rx_h_msdu_start_freq() argument
196 return ab->hw_params.hw_ops->rx_desc_get_msdu_freq(desc); in ath11k_dp_rx_h_msdu_start_freq()
199 static inline u8 ath11k_dp_rx_h_msdu_start_pkt_type(struct ath11k_base *ab, in ath11k_dp_rx_h_msdu_start_pkt_type() argument
202 return ab->hw_params.hw_ops->rx_desc_get_msdu_pkt_type(desc); in ath11k_dp_rx_h_msdu_start_pkt_type()
205 static inline u8 ath11k_dp_rx_h_msdu_start_nss(struct ath11k_base *ab, in ath11k_dp_rx_h_msdu_start_nss() argument
208 return hweight8(ab->hw_params.hw_ops->rx_desc_get_msdu_nss(desc)); in ath11k_dp_rx_h_msdu_start_nss()
211 static inline u8 ath11k_dp_rx_h_mpdu_start_tid(struct ath11k_base *ab, in ath11k_dp_rx_h_mpdu_start_tid() argument
214 return ab->hw_params.hw_ops->rx_desc_get_mpdu_tid(desc); in ath11k_dp_rx_h_mpdu_start_tid()
217 static inline u16 ath11k_dp_rx_h_mpdu_start_peer_id(struct ath11k_base *ab, in ath11k_dp_rx_h_mpdu_start_peer_id() argument
220 return ab->hw_params.hw_ops->rx_desc_get_mpdu_peer_id(desc); in ath11k_dp_rx_h_mpdu_start_peer_id()
223 static inline u8 ath11k_dp_rx_h_msdu_end_l3pad(struct ath11k_base *ab, in ath11k_dp_rx_h_msdu_end_l3pad() argument
226 return ab->hw_params.hw_ops->rx_desc_get_l3_pad_bytes(desc); in ath11k_dp_rx_h_msdu_end_l3pad()
229 static inline bool ath11k_dp_rx_h_msdu_end_first_msdu(struct ath11k_base *ab, in ath11k_dp_rx_h_msdu_end_first_msdu() argument
232 return ab->hw_params.hw_ops->rx_desc_get_first_msdu(desc); in ath11k_dp_rx_h_msdu_end_first_msdu()
235 static bool ath11k_dp_rx_h_msdu_end_last_msdu(struct ath11k_base *ab, in ath11k_dp_rx_h_msdu_end_last_msdu() argument
238 return ab->hw_params.hw_ops->rx_desc_get_last_msdu(desc); in ath11k_dp_rx_h_msdu_end_last_msdu()
241 static void ath11k_dp_rx_desc_end_tlv_copy(struct ath11k_base *ab, in ath11k_dp_rx_desc_end_tlv_copy() argument
245 ab->hw_params.hw_ops->rx_desc_copy_attn_end_tlv(fdesc, ldesc); in ath11k_dp_rx_desc_end_tlv_copy()
254 static inline u8 *ath11k_dp_rxdesc_get_80211hdr(struct ath11k_base *ab, in ath11k_dp_rxdesc_get_80211hdr() argument
259 rx_pkt_hdr = ab->hw_params.hw_ops->rx_desc_get_msdu_payload(rx_desc); in ath11k_dp_rxdesc_get_80211hdr()
264 static inline bool ath11k_dp_rxdesc_mpdu_valid(struct ath11k_base *ab, in ath11k_dp_rxdesc_mpdu_valid() argument
269 tlv_tag = ab->hw_params.hw_ops->rx_desc_get_mpdu_start_tag(rx_desc); in ath11k_dp_rxdesc_mpdu_valid()
274 static inline u32 ath11k_dp_rxdesc_get_ppduid(struct ath11k_base *ab, in ath11k_dp_rxdesc_get_ppduid() argument
277 return ab->hw_params.hw_ops->rx_desc_get_mpdu_ppdu_id(rx_desc); in ath11k_dp_rxdesc_get_ppduid()
280 static inline void ath11k_dp_rxdesc_set_msdu_len(struct ath11k_base *ab, in ath11k_dp_rxdesc_set_msdu_len() argument
284 ab->hw_params.hw_ops->rx_desc_set_msdu_len(desc, len); in ath11k_dp_rxdesc_set_msdu_len()
287 static bool ath11k_dp_rx_h_attn_is_mcbc(struct ath11k_base *ab, in ath11k_dp_rx_h_attn_is_mcbc() argument
290 struct rx_attention *attn = ath11k_dp_rx_get_attention(ab, desc); in ath11k_dp_rx_h_attn_is_mcbc()
292 return ath11k_dp_rx_h_msdu_end_first_msdu(ab, desc) && in ath11k_dp_rx_h_attn_is_mcbc()
297 static bool ath11k_dp_rxdesc_mac_addr2_valid(struct ath11k_base *ab, in ath11k_dp_rxdesc_mac_addr2_valid() argument
300 return ab->hw_params.hw_ops->rx_desc_mac_addr2_valid(desc); in ath11k_dp_rxdesc_mac_addr2_valid()
303 static u8 *ath11k_dp_rxdesc_mpdu_start_addr2(struct ath11k_base *ab, in ath11k_dp_rxdesc_mpdu_start_addr2() argument
306 return ab->hw_params.hw_ops->rx_desc_mpdu_start_addr2(desc); in ath11k_dp_rxdesc_mpdu_start_addr2()
311 struct ath11k_base *ab = from_timer(ab, t, mon_reap_timer); in ath11k_dp_service_mon_ring() local
314 for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) in ath11k_dp_service_mon_ring()
315 ath11k_dp_rx_process_mon_rings(ab, i, NULL, DP_MON_SERVICE_BUDGET); in ath11k_dp_service_mon_ring()
317 mod_timer(&ab->mon_reap_timer, jiffies + in ath11k_dp_service_mon_ring()
321 static int ath11k_dp_purge_mon_ring(struct ath11k_base *ab) in ath11k_dp_purge_mon_ring() argument
327 for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) in ath11k_dp_purge_mon_ring()
328 reaped += ath11k_dp_rx_process_mon_rings(ab, i, in ath11k_dp_purge_mon_ring()
338 ath11k_warn(ab, "dp mon ring purge timeout"); in ath11k_dp_purge_mon_ring()
344 int ath11k_dp_rxbufs_replenish(struct ath11k_base *ab, int mac_id, in ath11k_dp_rxbufs_replenish() argument
360 srng = &ab->hal.srng_list[rx_ring->refill_buf_ring.ring_id]; in ath11k_dp_rxbufs_replenish()
364 ath11k_hal_srng_access_begin(ab, srng); in ath11k_dp_rxbufs_replenish()
366 num_free = ath11k_hal_srng_src_num_free(ab, srng, true); in ath11k_dp_rxbufs_replenish()
386 paddr = dma_map_single(ab->dev, skb->data, in ath11k_dp_rxbufs_replenish()
389 if (dma_mapping_error(ab->dev, paddr)) in ath11k_dp_rxbufs_replenish()
399 desc = ath11k_hal_srng_src_get_next_entry(ab, srng); in ath11k_dp_rxbufs_replenish()
413 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_rxbufs_replenish()
424 dma_unmap_single(ab->dev, paddr, skb->len + skb_tailroom(skb), in ath11k_dp_rxbufs_replenish()
429 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_rxbufs_replenish()
448 dma_unmap_single(ar->ab->dev, ATH11K_SKB_RXCB(skb)->paddr, in ath11k_dp_rxdma_buf_ring_free()
462 struct ath11k_base *ab = ar->ab; in ath11k_dp_rxdma_pdev_buf_free() local
471 for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { in ath11k_dp_rxdma_pdev_buf_free()
487 ath11k_hal_srng_get_entrysize(ar->ab, ringtype); in ath11k_dp_rxdma_ring_buf_setup()
490 ath11k_dp_rxbufs_replenish(ar->ab, dp->mac_id, rx_ring, num_entries, in ath11k_dp_rxdma_ring_buf_setup()
491 ar->ab->hw_params.hal_params->rx_buf_rbm); in ath11k_dp_rxdma_ring_buf_setup()
498 struct ath11k_base *ab = ar->ab; in ath11k_dp_rxdma_pdev_buf_setup() local
504 if (ar->ab->hw_params.rxdma1_enable) { in ath11k_dp_rxdma_pdev_buf_setup()
509 for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { in ath11k_dp_rxdma_pdev_buf_setup()
520 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_pdev_srng_free() local
523 ath11k_dp_srng_cleanup(ab, &dp->rx_refill_buf_ring.refill_buf_ring); in ath11k_dp_rx_pdev_srng_free()
525 for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { in ath11k_dp_rx_pdev_srng_free()
526 if (ab->hw_params.rx_mac_buf_ring) in ath11k_dp_rx_pdev_srng_free()
527 ath11k_dp_srng_cleanup(ab, &dp->rx_mac_buf_ring[i]); in ath11k_dp_rx_pdev_srng_free()
529 ath11k_dp_srng_cleanup(ab, &dp->rxdma_err_dst_ring[i]); in ath11k_dp_rx_pdev_srng_free()
530 ath11k_dp_srng_cleanup(ab, in ath11k_dp_rx_pdev_srng_free()
534 ath11k_dp_srng_cleanup(ab, &dp->rxdma_mon_buf_ring.refill_buf_ring); in ath11k_dp_rx_pdev_srng_free()
537 void ath11k_dp_pdev_reo_cleanup(struct ath11k_base *ab) in ath11k_dp_pdev_reo_cleanup() argument
539 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_pdev_reo_cleanup()
543 ath11k_dp_srng_cleanup(ab, &dp->reo_dst_ring[i]); in ath11k_dp_pdev_reo_cleanup()
546 int ath11k_dp_pdev_reo_setup(struct ath11k_base *ab) in ath11k_dp_pdev_reo_setup() argument
548 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_pdev_reo_setup()
553 ret = ath11k_dp_srng_setup(ab, &dp->reo_dst_ring[i], in ath11k_dp_pdev_reo_setup()
557 ath11k_warn(ab, "failed to setup reo_dst_ring\n"); in ath11k_dp_pdev_reo_setup()
565 ath11k_dp_pdev_reo_cleanup(ab); in ath11k_dp_pdev_reo_setup()
573 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_pdev_srng_alloc() local
578 ret = ath11k_dp_srng_setup(ar->ab, in ath11k_dp_rx_pdev_srng_alloc()
583 ath11k_warn(ar->ab, "failed to setup rx_refill_buf_ring\n"); in ath11k_dp_rx_pdev_srng_alloc()
587 if (ar->ab->hw_params.rx_mac_buf_ring) { in ath11k_dp_rx_pdev_srng_alloc()
588 for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { in ath11k_dp_rx_pdev_srng_alloc()
589 ret = ath11k_dp_srng_setup(ar->ab, in ath11k_dp_rx_pdev_srng_alloc()
594 ath11k_warn(ar->ab, "failed to setup rx_mac_buf_ring %d\n", in ath11k_dp_rx_pdev_srng_alloc()
601 for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { in ath11k_dp_rx_pdev_srng_alloc()
602 ret = ath11k_dp_srng_setup(ar->ab, &dp->rxdma_err_dst_ring[i], in ath11k_dp_rx_pdev_srng_alloc()
606 ath11k_warn(ar->ab, "failed to setup rxdma_err_dst_ring %d\n", i); in ath11k_dp_rx_pdev_srng_alloc()
611 for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { in ath11k_dp_rx_pdev_srng_alloc()
613 ret = ath11k_dp_srng_setup(ar->ab, in ath11k_dp_rx_pdev_srng_alloc()
618 ath11k_warn(ar->ab, in ath11k_dp_rx_pdev_srng_alloc()
629 if (!ar->ab->hw_params.rxdma1_enable) { in ath11k_dp_rx_pdev_srng_alloc()
631 timer_setup(&ar->ab->mon_reap_timer, in ath11k_dp_rx_pdev_srng_alloc()
636 ret = ath11k_dp_srng_setup(ar->ab, in ath11k_dp_rx_pdev_srng_alloc()
641 ath11k_warn(ar->ab, in ath11k_dp_rx_pdev_srng_alloc()
646 ret = ath11k_dp_srng_setup(ar->ab, &dp->rxdma_mon_dst_ring, in ath11k_dp_rx_pdev_srng_alloc()
650 ath11k_warn(ar->ab, in ath11k_dp_rx_pdev_srng_alloc()
655 ret = ath11k_dp_srng_setup(ar->ab, &dp->rxdma_mon_desc_ring, in ath11k_dp_rx_pdev_srng_alloc()
659 ath11k_warn(ar->ab, in ath11k_dp_rx_pdev_srng_alloc()
667 void ath11k_dp_reo_cmd_list_cleanup(struct ath11k_base *ab) in ath11k_dp_reo_cmd_list_cleanup() argument
669 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_reo_cmd_list_cleanup()
679 dma_unmap_single(ab->dev, rx_tid->paddr, in ath11k_dp_reo_cmd_list_cleanup()
693 dma_unmap_single(ab->dev, rx_tid->paddr, in ath11k_dp_reo_cmd_list_cleanup()
709 ath11k_warn(dp->ab, "failed to flush rx tid hw desc, tid %d status %d\n", in ath11k_dp_reo_cmd_free()
712 dma_unmap_single(dp->ab->dev, rx_tid->paddr, rx_tid->size, in ath11k_dp_reo_cmd_free()
719 static void ath11k_dp_reo_cache_flush(struct ath11k_base *ab, in ath11k_dp_reo_cache_flush() argument
733 ret = ath11k_dp_tx_send_reo_cmd(ab, rx_tid, in ath11k_dp_reo_cache_flush()
737 ath11k_warn(ab, in ath11k_dp_reo_cache_flush()
746 ret = ath11k_dp_tx_send_reo_cmd(ab, rx_tid, in ath11k_dp_reo_cache_flush()
750 ath11k_err(ab, "failed to send HAL_REO_CMD_FLUSH_CACHE cmd, tid %d (%d)\n", in ath11k_dp_reo_cache_flush()
752 dma_unmap_single(ab->dev, rx_tid->paddr, rx_tid->size, in ath11k_dp_reo_cache_flush()
762 struct ath11k_base *ab = dp->ab; in ath11k_dp_rx_tid_del_func() local
770 ath11k_warn(ab, "failed to delete rx tid %d hw descriptor %d\n", in ath11k_dp_rx_tid_del_func()
796 ath11k_dp_reo_cache_flush(ab, &elem->data); in ath11k_dp_rx_tid_del_func()
805 dma_unmap_single(ab->dev, rx_tid->paddr, rx_tid->size, in ath11k_dp_rx_tid_del_func()
827 ret = ath11k_dp_tx_send_reo_cmd(ar->ab, rx_tid, in ath11k_peer_rx_tid_delete()
832 ath11k_err(ar->ab, "failed to send HAL_REO_CMD_UPDATE_RX_QUEUE cmd, tid %d (%d)\n", in ath11k_peer_rx_tid_delete()
834 dma_unmap_single(ar->ab->dev, rx_tid->paddr, rx_tid->size, in ath11k_peer_rx_tid_delete()
844 static int ath11k_dp_rx_link_desc_return(struct ath11k_base *ab, in ath11k_dp_rx_link_desc_return() argument
848 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_rx_link_desc_return()
853 srng = &ab->hal.srng_list[dp->wbm_desc_rel_ring.ring_id]; in ath11k_dp_rx_link_desc_return()
857 ath11k_hal_srng_access_begin(ab, srng); in ath11k_dp_rx_link_desc_return()
859 desc = ath11k_hal_srng_src_get_next_entry(ab, srng); in ath11k_dp_rx_link_desc_return()
865 ath11k_hal_rx_msdu_link_desc_set(ab, (void *)desc, (void *)link_desc, in ath11k_dp_rx_link_desc_return()
869 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_rx_link_desc_return()
878 struct ath11k_base *ab = rx_tid->ab; in ath11k_dp_rx_frags_cleanup() local
880 lockdep_assert_held(&ab->base_lock); in ath11k_dp_rx_frags_cleanup()
884 ath11k_dp_rx_link_desc_return(ab, (u32 *)rx_tid->dst_ring_desc, in ath11k_dp_rx_frags_cleanup()
901 lockdep_assert_held(&ar->ab->base_lock); in ath11k_peer_frags_flush()
906 spin_unlock_bh(&ar->ab->base_lock); in ath11k_peer_frags_flush()
908 spin_lock_bh(&ar->ab->base_lock); in ath11k_peer_frags_flush()
919 lockdep_assert_held(&ar->ab->base_lock); in ath11k_peer_rx_tid_cleanup()
927 spin_unlock_bh(&ar->ab->base_lock); in ath11k_peer_rx_tid_cleanup()
929 spin_lock_bh(&ar->ab->base_lock); in ath11k_peer_rx_tid_cleanup()
953 ret = ath11k_dp_tx_send_reo_cmd(ar->ab, rx_tid, in ath11k_peer_rx_tid_reo_update()
957 ath11k_warn(ar->ab, "failed to update rx tid queue, tid %d (%d)\n", in ath11k_peer_rx_tid_reo_update()
967 static void ath11k_dp_rx_tid_mem_free(struct ath11k_base *ab, in ath11k_dp_rx_tid_mem_free() argument
973 spin_lock_bh(&ab->base_lock); in ath11k_dp_rx_tid_mem_free()
975 peer = ath11k_peer_find(ab, vdev_id, peer_mac); in ath11k_dp_rx_tid_mem_free()
977 ath11k_warn(ab, "failed to find the peer to free up rx tid mem\n"); in ath11k_dp_rx_tid_mem_free()
985 dma_unmap_single(ab->dev, rx_tid->paddr, rx_tid->size, in ath11k_dp_rx_tid_mem_free()
993 spin_unlock_bh(&ab->base_lock); in ath11k_dp_rx_tid_mem_free()
1000 struct ath11k_base *ab = ar->ab; in ath11k_peer_rx_tid_setup() local
1009 spin_lock_bh(&ab->base_lock); in ath11k_peer_rx_tid_setup()
1011 peer = ath11k_peer_find(ab, vdev_id, peer_mac); in ath11k_peer_rx_tid_setup()
1013 ath11k_warn(ab, "failed to find the peer %pM to set up rx tid\n", in ath11k_peer_rx_tid_setup()
1015 spin_unlock_bh(&ab->base_lock); in ath11k_peer_rx_tid_setup()
1025 spin_unlock_bh(&ab->base_lock); in ath11k_peer_rx_tid_setup()
1027 ath11k_warn(ab, "failed to update reo for peer %pM rx tid %d\n: %d", in ath11k_peer_rx_tid_setup()
1036 ath11k_warn(ab, "failed to send wmi rx reorder queue for peer %pM tid %d: %d\n", in ath11k_peer_rx_tid_setup()
1055 spin_unlock_bh(&ab->base_lock); in ath11k_peer_rx_tid_setup()
1064 paddr = dma_map_single(ab->dev, addr_aligned, hw_desc_sz, in ath11k_peer_rx_tid_setup()
1067 ret = dma_mapping_error(ab->dev, paddr); in ath11k_peer_rx_tid_setup()
1069 spin_unlock_bh(&ab->base_lock); in ath11k_peer_rx_tid_setup()
1070 ath11k_warn(ab, "failed to setup dma map for peer %pM rx tid %d: %d\n", in ath11k_peer_rx_tid_setup()
1080 spin_unlock_bh(&ab->base_lock); in ath11k_peer_rx_tid_setup()
1085 ath11k_warn(ar->ab, "failed to setup rx reorder queue for peer %pM tid %d: %d\n", in ath11k_peer_rx_tid_setup()
1087 ath11k_dp_rx_tid_mem_free(ab, peer_mac, vdev_id, tid); in ath11k_peer_rx_tid_setup()
1102 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_ampdu_start() local
1111 ath11k_warn(ab, "failed to setup rx tid %d\n", ret); in ath11k_dp_rx_ampdu_start()
1119 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_ampdu_stop() local
1127 spin_lock_bh(&ab->base_lock); in ath11k_dp_rx_ampdu_stop()
1129 peer = ath11k_peer_find(ab, vdev_id, params->sta->addr); in ath11k_dp_rx_ampdu_stop()
1131 ath11k_warn(ab, "failed to find the peer to stop rx aggregation\n"); in ath11k_dp_rx_ampdu_stop()
1132 spin_unlock_bh(&ab->base_lock); in ath11k_dp_rx_ampdu_stop()
1140 spin_unlock_bh(&ab->base_lock); in ath11k_dp_rx_ampdu_stop()
1145 spin_unlock_bh(&ab->base_lock); in ath11k_dp_rx_ampdu_stop()
1147 ath11k_warn(ab, "failed to update reo for rx tid %d: %d\n", in ath11k_dp_rx_ampdu_stop()
1156 ath11k_warn(ab, "failed to send wmi to delete rx tid %d\n", in ath11k_dp_rx_ampdu_stop()
1168 struct ath11k_base *ab = ar->ab; in ath11k_dp_peer_rx_pn_replay_config() local
1204 spin_lock_bh(&ab->base_lock); in ath11k_dp_peer_rx_pn_replay_config()
1206 peer = ath11k_peer_find(ab, arvif->vdev_id, peer_addr); in ath11k_dp_peer_rx_pn_replay_config()
1208 ath11k_warn(ab, "failed to find the peer to configure pn replay detection\n"); in ath11k_dp_peer_rx_pn_replay_config()
1209 spin_unlock_bh(&ab->base_lock); in ath11k_dp_peer_rx_pn_replay_config()
1219 ret = ath11k_dp_tx_send_reo_cmd(ab, rx_tid, in ath11k_dp_peer_rx_pn_replay_config()
1223 ath11k_warn(ab, "failed to configure rx tid %d queue for pn replay detection %d\n", in ath11k_dp_peer_rx_pn_replay_config()
1229 spin_unlock_bh(&ab->base_lock); in ath11k_dp_peer_rx_pn_replay_config()
1251 static int ath11k_htt_tlv_ppdu_stats_parse(struct ath11k_base *ab, in ath11k_htt_tlv_ppdu_stats_parse() argument
1265 ath11k_warn(ab, "Invalid len %d for the tag 0x%x\n", in ath11k_htt_tlv_ppdu_stats_parse()
1274 ath11k_warn(ab, "Invalid len %d for the tag 0x%x\n", in ath11k_htt_tlv_ppdu_stats_parse()
1293 ath11k_warn(ab, "Invalid len %d for the tag 0x%x\n", in ath11k_htt_tlv_ppdu_stats_parse()
1313 ath11k_warn(ab, "Invalid len %d for the tag 0x%x\n", in ath11k_htt_tlv_ppdu_stats_parse()
1335 int ath11k_dp_htt_tlv_iter(struct ath11k_base *ab, const void *ptr, size_t len, in ath11k_dp_htt_tlv_iter() argument
1347 ath11k_err(ab, "htt tlv parse failure at byte %zd (%zu bytes left, %zu expected)\n", in ath11k_dp_htt_tlv_iter()
1358 ath11k_err(ab, "htt tlv parse failure of tag %u at byte %zd (%zu bytes left, %u expected)\n", in ath11k_dp_htt_tlv_iter()
1362 ret = iter(ab, tlv_tag, tlv_len, ptr, data); in ath11k_dp_htt_tlv_iter()
1376 struct ath11k_base *ab = ar->ab; in ath11k_update_per_peer_tx_stats() local
1428 ath11k_warn(ab, "Invalid HE mcs %d peer stats", mcs); in ath11k_update_per_peer_tx_stats()
1433 ath11k_warn(ab, "Invalid VHT mcs %d peer stats", mcs); in ath11k_update_per_peer_tx_stats()
1438 ath11k_warn(ab, "Invalid HT mcs %d nss %d peer stats", in ath11k_update_per_peer_tx_stats()
1453 spin_lock_bh(&ab->base_lock); in ath11k_update_per_peer_tx_stats()
1454 peer = ath11k_peer_find_by_id(ab, usr_stats->peer_id); in ath11k_update_per_peer_tx_stats()
1457 spin_unlock_bh(&ab->base_lock); in ath11k_update_per_peer_tx_stats()
1520 spin_unlock_bh(&ab->base_lock); in ath11k_update_per_peer_tx_stats()
1567 static int ath11k_htt_pull_ppdu_stats(struct ath11k_base *ab, in ath11k_htt_pull_ppdu_stats() argument
1583 ar = ath11k_mac_get_ar_by_pdev_id(ab, pdev_id); in ath11k_htt_pull_ppdu_stats()
1600 ret = ath11k_dp_htt_tlv_iter(ab, msg->data, len, in ath11k_htt_pull_ppdu_stats()
1604 ath11k_warn(ab, "Failed to parse tlv %d\n", ret); in ath11k_htt_pull_ppdu_stats()
1617 static void ath11k_htt_pktlog(struct ath11k_base *ab, struct sk_buff *skb) in ath11k_htt_pktlog() argument
1628 ar = ath11k_mac_get_ar_by_pdev_id(ab, pdev_id); in ath11k_htt_pktlog()
1630 ath11k_warn(ab, "invalid pdev id %d on htt pktlog\n", pdev_id); in ath11k_htt_pktlog()
1635 ar->ab->pktlog_defs_checksum); in ath11k_htt_pktlog()
1641 static void ath11k_htt_backpressure_event_handler(struct ath11k_base *ab, in ath11k_htt_backpressure_event_handler() argument
1661 …ath11k_dbg(ab, ATH11K_DBG_DP_HTT, "backpressure event, pdev %d, ring type %d,ring id %d, hp %d tp … in ath11k_htt_backpressure_event_handler()
1668 bp_stats = &ab->soc_stats.bp_stats.umac_ring_bp_stats[ring_id]; in ath11k_htt_backpressure_event_handler()
1675 bp_stats = &ab->soc_stats.bp_stats.lmac_ring_bp_stats[ring_id][pdev_idx]; in ath11k_htt_backpressure_event_handler()
1677 ath11k_warn(ab, "unknown ring type received in htt bp event %d\n", in ath11k_htt_backpressure_event_handler()
1682 spin_lock_bh(&ab->base_lock); in ath11k_htt_backpressure_event_handler()
1687 spin_unlock_bh(&ab->base_lock); in ath11k_htt_backpressure_event_handler()
1690 void ath11k_dp_htt_htc_t2h_msg_handler(struct ath11k_base *ab, in ath11k_dp_htt_htc_t2h_msg_handler() argument
1693 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_htt_htc_t2h_msg_handler()
1703 ath11k_dbg(ab, ATH11K_DBG_DP_HTT, "dp_htt rx msg type :0x%0x\n", type); in ath11k_dp_htt_htc_t2h_msg_handler()
1722 ath11k_peer_map_event(ab, vdev_id, peer_id, mac_addr, 0, 0); in ath11k_dp_htt_htc_t2h_msg_handler()
1737 ath11k_peer_map_event(ab, vdev_id, peer_id, mac_addr, ast_hash, in ath11k_dp_htt_htc_t2h_msg_handler()
1744 ath11k_peer_unmap_event(ab, peer_id); in ath11k_dp_htt_htc_t2h_msg_handler()
1747 ath11k_htt_pull_ppdu_stats(ab, skb); in ath11k_dp_htt_htc_t2h_msg_handler()
1750 ath11k_debugfs_htt_ext_stats_handler(ab, skb); in ath11k_dp_htt_htc_t2h_msg_handler()
1753 ath11k_htt_pktlog(ab, skb); in ath11k_dp_htt_htc_t2h_msg_handler()
1756 ath11k_htt_backpressure_event_handler(ab, skb); in ath11k_dp_htt_htc_t2h_msg_handler()
1759 ath11k_warn(ab, "htt event %d not handled\n", type); in ath11k_dp_htt_htc_t2h_msg_handler()
1771 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_msdu_coalesce() local
1777 u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_msdu_coalesce()
1793 rxcb->is_first_msdu = ath11k_dp_rx_h_msdu_end_first_msdu(ab, ldesc); in ath11k_dp_rx_msdu_coalesce()
1794 rxcb->is_last_msdu = ath11k_dp_rx_h_msdu_end_last_msdu(ab, ldesc); in ath11k_dp_rx_msdu_coalesce()
1806 ath11k_dp_rx_desc_end_tlv_copy(ab, rxcb->rx_desc, ldesc); in ath11k_dp_rx_msdu_coalesce()
1875 rx_attention = ath11k_dp_rx_get_attention(ar->ab, rxcb->rx_desc); in ath11k_dp_rx_h_csum_offload()
1905 ath11k_warn(ar->ab, "unsupported encryption type %d for mic len\n", enctype); in ath11k_dp_rx_crypto_mic_len()
1933 ath11k_warn(ar->ab, "unsupported encryption type %d\n", enctype); in ath11k_dp_rx_crypto_param_len()
1958 ath11k_warn(ar->ab, "unsupported encryption type %d\n", enctype); in ath11k_dp_rx_crypto_icv_len()
2007 if (ath11k_dp_rx_h_msdu_start_mesh_ctl_present(ar->ab, rxcb->rx_desc)) in ath11k_dp_rx_h_undecap_nwifi()
2111 hdr = (struct ieee80211_hdr *)ath11k_dp_rx_h_80211_hdr(ar->ab, rxcb->rx_desc); in ath11k_dp_rx_h_find_rfc1042()
2185 first_hdr = ath11k_dp_rx_h_80211_hdr(ar->ab, rx_desc); in ath11k_dp_rx_h_undecap()
2186 decap = ath11k_dp_rx_h_msdu_start_decap_type(ar->ab, rx_desc); in ath11k_dp_rx_h_undecap()
2222 ath11k_dp_rx_h_find_peer(struct ath11k_base *ab, struct sk_buff *msdu) in ath11k_dp_rx_h_find_peer() argument
2228 lockdep_assert_held(&ab->base_lock); in ath11k_dp_rx_h_find_peer()
2231 peer = ath11k_peer_find_by_id(ab, rxcb->peer_id); in ath11k_dp_rx_h_find_peer()
2236 if (!rx_desc || !(ath11k_dp_rxdesc_mac_addr2_valid(ab, rx_desc))) in ath11k_dp_rx_h_find_peer()
2239 peer = ath11k_peer_find_by_addr(ab, in ath11k_dp_rx_h_find_peer()
2240 ath11k_dp_rxdesc_mpdu_start_addr2(ab, rx_desc)); in ath11k_dp_rx_h_find_peer()
2260 fill_crypto_hdr = ath11k_dp_rx_h_attn_is_mcbc(ar->ab, rx_desc); in ath11k_dp_rx_h_mpdu()
2264 rxcb->peer_id = ath11k_dp_rx_h_mpdu_start_peer_id(ar->ab, rx_desc); in ath11k_dp_rx_h_mpdu()
2265 rxcb->seq_no = ath11k_dp_rx_h_mpdu_start_seq_no(ar->ab, rx_desc); in ath11k_dp_rx_h_mpdu()
2268 spin_lock_bh(&ar->ab->base_lock); in ath11k_dp_rx_h_mpdu()
2269 peer = ath11k_dp_rx_h_find_peer(ar->ab, msdu); in ath11k_dp_rx_h_mpdu()
2276 enctype = ath11k_dp_rx_h_mpdu_start_enctype(ar->ab, rx_desc); in ath11k_dp_rx_h_mpdu()
2278 spin_unlock_bh(&ar->ab->base_lock); in ath11k_dp_rx_h_mpdu()
2280 rx_attention = ath11k_dp_rx_get_attention(ar->ab, rx_desc); in ath11k_dp_rx_h_mpdu()
2315 if (ath11k_dp_rx_h_msdu_start_decap_type(ar->ab, rx_desc) != in ath11k_dp_rx_h_mpdu()
2332 pkt_type = ath11k_dp_rx_h_msdu_start_pkt_type(ar->ab, rx_desc); in ath11k_dp_rx_h_rate()
2333 bw = ath11k_dp_rx_h_msdu_start_rx_bw(ar->ab, rx_desc); in ath11k_dp_rx_h_rate()
2334 rate_mcs = ath11k_dp_rx_h_msdu_start_rate_mcs(ar->ab, rx_desc); in ath11k_dp_rx_h_rate()
2335 nss = ath11k_dp_rx_h_msdu_start_nss(ar->ab, rx_desc); in ath11k_dp_rx_h_rate()
2336 sgi = ath11k_dp_rx_h_msdu_start_sgi(ar->ab, rx_desc); in ath11k_dp_rx_h_rate()
2349 ath11k_warn(ar->ab, in ath11k_dp_rx_h_rate()
2363 ath11k_warn(ar->ab, in ath11k_dp_rx_h_rate()
2372 is_ldpc = ath11k_dp_rx_h_msdu_start_ldpc_support(ar->ab, rx_desc); in ath11k_dp_rx_h_rate()
2379 ath11k_warn(ar->ab, in ath11k_dp_rx_h_rate()
2407 meta_data = ath11k_dp_rx_h_msdu_start_freq(ar->ab, rx_desc); in ath11k_dp_rx_h_ppdu()
2428 ath11k_dbg_dump(ar->ab, ATH11K_DBG_DATA, NULL, "rx_desc: ", in ath11k_dp_rx_h_ppdu()
2466 decap = ath11k_dp_rx_h_msdu_start_decap_type(ar->ab, rxcb->rx_desc); in ath11k_dp_rx_deliver_msdu()
2468 spin_lock_bh(&ar->ab->base_lock); in ath11k_dp_rx_deliver_msdu()
2469 peer = ath11k_dp_rx_h_find_peer(ar->ab, msdu); in ath11k_dp_rx_deliver_msdu()
2472 spin_unlock_bh(&ar->ab->base_lock); in ath11k_dp_rx_deliver_msdu()
2474 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_deliver_msdu()
2498 ath11k_dbg_dump(ar->ab, ATH11K_DBG_DP_RX, NULL, "dp rx msdu: ", in ath11k_dp_rx_deliver_msdu()
2523 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_process_msdu() local
2532 u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_process_msdu()
2536 ath11k_warn(ab, in ath11k_dp_rx_process_msdu()
2543 if (ath11k_dp_rx_h_attn_msdu_len_err(ab, rx_desc)) { in ath11k_dp_rx_process_msdu()
2544 ath11k_warn(ar->ab, "msdu len not valid\n"); in ath11k_dp_rx_process_msdu()
2550 rx_attention = ath11k_dp_rx_get_attention(ab, lrx_desc); in ath11k_dp_rx_process_msdu()
2552 ath11k_warn(ab, "msdu_done bit in attention is not set\n"); in ath11k_dp_rx_process_msdu()
2559 msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(ab, rx_desc); in ath11k_dp_rx_process_msdu()
2560 l3_pad_bytes = ath11k_dp_rx_h_msdu_end_l3pad(ab, lrx_desc); in ath11k_dp_rx_process_msdu()
2566 hdr_status = ath11k_dp_rx_h_80211_hdr(ab, rx_desc); in ath11k_dp_rx_process_msdu()
2568 ath11k_warn(ab, "invalid msdu len %u\n", msdu_len); in ath11k_dp_rx_process_msdu()
2569 ath11k_dbg_dump(ab, ATH11K_DBG_DATA, NULL, "", hdr_status, in ath11k_dp_rx_process_msdu()
2571 ath11k_dbg_dump(ab, ATH11K_DBG_DATA, NULL, "", rx_desc, in ath11k_dp_rx_process_msdu()
2582 ath11k_warn(ab, in ath11k_dp_rx_process_msdu()
2599 static void ath11k_dp_rx_process_received_packets(struct ath11k_base *ab, in ath11k_dp_rx_process_received_packets() argument
2612 if (unlikely(!rcu_access_pointer(ab->pdevs_active[mac_id]))) { in ath11k_dp_rx_process_received_packets()
2617 ar = ab->pdevs[mac_id].ar; in ath11k_dp_rx_process_received_packets()
2626 ath11k_dbg(ab, ATH11K_DBG_DATA, in ath11k_dp_rx_process_received_packets()
2636 int ath11k_dp_process_rx(struct ath11k_base *ab, int ring_id, in ath11k_dp_process_rx() argument
2639 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_process_rx()
2658 srng = &ab->hal.srng_list[dp->reo_dst_ring[ring_id].ring_id]; in ath11k_dp_process_rx()
2663 ath11k_hal_srng_access_begin(ab, srng); in ath11k_dp_process_rx()
2666 (struct hal_reo_dest_ring *)ath11k_hal_srng_dst_get_next_entry(ab, in ath11k_dp_process_rx()
2677 ar = ab->pdevs[mac_id].ar; in ath11k_dp_process_rx()
2682 ath11k_warn(ab, "frame rx with invalid buf_id %d\n", in ath11k_dp_process_rx()
2692 dma_unmap_single(ab->dev, rxcb->paddr, in ath11k_dp_process_rx()
2703 ab->soc_stats.hal_reo_error[ring_id]++; in ath11k_dp_process_rx()
2740 if (unlikely(!done && ath11k_hal_srng_dst_num_free(ab, srng, true))) { in ath11k_dp_process_rx()
2741 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_process_rx()
2745 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_process_rx()
2752 for (i = 0; i < ab->num_radios; i++) { in ath11k_dp_process_rx()
2756 ath11k_dp_rx_process_received_packets(ab, napi, &msdu_list[i], i); in ath11k_dp_process_rx()
2758 ar = ab->pdevs[i].ar; in ath11k_dp_process_rx()
2761 ath11k_dp_rxbufs_replenish(ab, i, rx_ring, num_buffs_reaped[i], in ath11k_dp_process_rx()
2762 ab->hw_params.hal_params->rx_buf_rbm); in ath11k_dp_process_rx()
2849 static struct sk_buff *ath11k_dp_rx_alloc_mon_status_buf(struct ath11k_base *ab, in ath11k_dp_rx_alloc_mon_status_buf() argument
2868 paddr = dma_map_single(ab->dev, skb->data, in ath11k_dp_rx_alloc_mon_status_buf()
2871 if (unlikely(dma_mapping_error(ab->dev, paddr))) in ath11k_dp_rx_alloc_mon_status_buf()
2885 dma_unmap_single(ab->dev, paddr, skb->len + skb_tailroom(skb), in ath11k_dp_rx_alloc_mon_status_buf()
2893 int ath11k_dp_rx_mon_status_bufs_replenish(struct ath11k_base *ab, int mac_id, in ath11k_dp_rx_mon_status_bufs_replenish() argument
2909 srng = &ab->hal.srng_list[rx_ring->refill_buf_ring.ring_id]; in ath11k_dp_rx_mon_status_bufs_replenish()
2913 ath11k_hal_srng_access_begin(ab, srng); in ath11k_dp_rx_mon_status_bufs_replenish()
2915 num_free = ath11k_hal_srng_src_num_free(ab, srng, true); in ath11k_dp_rx_mon_status_bufs_replenish()
2921 skb = ath11k_dp_rx_alloc_mon_status_buf(ab, rx_ring, in ath11k_dp_rx_mon_status_bufs_replenish()
2927 desc = ath11k_hal_srng_src_get_next_entry(ab, srng); in ath11k_dp_rx_mon_status_bufs_replenish()
2939 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_rx_mon_status_bufs_replenish()
2949 dma_unmap_single(ab->dev, paddr, skb->len + skb_tailroom(skb), in ath11k_dp_rx_mon_status_bufs_replenish()
2952 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_rx_mon_status_bufs_replenish()
2995 static int ath11k_dp_rx_reap_mon_status_ring(struct ath11k_base *ab, int mac_id, in ath11k_dp_rx_reap_mon_status_ring() argument
3014 ar = ab->pdevs[ath11k_hw_mac_id_to_pdev_id(&ab->hw_params, mac_id)].ar; in ath11k_dp_rx_reap_mon_status_ring()
3017 srng_id = ath11k_hw_mac_id_to_srng_id(&ab->hw_params, mac_id); in ath11k_dp_rx_reap_mon_status_ring()
3020 srng = &ab->hal.srng_list[rx_ring->refill_buf_ring.ring_id]; in ath11k_dp_rx_reap_mon_status_ring()
3024 ath11k_hal_srng_access_begin(ab, srng); in ath11k_dp_rx_reap_mon_status_ring()
3028 ath11k_hal_srng_src_peek(ab, srng); in ath11k_dp_rx_reap_mon_status_ring()
3044 ath11k_warn(ab, "rx monitor status with invalid buf_id %d\n", in ath11k_dp_rx_reap_mon_status_ring()
3052 dma_sync_single_for_cpu(ab->dev, rxcb->paddr, in ath11k_dp_rx_reap_mon_status_ring()
3059 ath11k_warn(ab, "mon status DONE not set %lx, buf_id %d\n", in ath11k_dp_rx_reap_mon_status_ring()
3076 if (ab->hw_params.full_monitor_mode) { in ath11k_dp_rx_reap_mon_status_ring()
3082 dma_unmap_single(ab->dev, rxcb->paddr, in ath11k_dp_rx_reap_mon_status_ring()
3091 skb = ath11k_dp_rx_alloc_mon_status_buf(ab, rx_ring, in ath11k_dp_rx_reap_mon_status_ring()
3095 hal_params = ab->hw_params.hal_params; in ath11k_dp_rx_reap_mon_status_ring()
3108 ab->hw_params.hal_params->rx_buf_rbm); in ath11k_dp_rx_reap_mon_status_ring()
3109 ath11k_hal_srng_src_get_next_entry(ab, srng); in ath11k_dp_rx_reap_mon_status_ring()
3112 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_rx_reap_mon_status_ring()
3122 spin_lock_bh(&rx_tid->ab->base_lock); in ath11k_dp_rx_frag_timer()
3125 spin_unlock_bh(&rx_tid->ab->base_lock); in ath11k_dp_rx_frag_timer()
3129 spin_unlock_bh(&rx_tid->ab->base_lock); in ath11k_dp_rx_frag_timer()
3134 struct ath11k_base *ab = ar->ab; in ath11k_peer_rx_frag_setup() local
3142 ath11k_warn(ab, "failed to allocate michael_mic shash: %ld\n", in ath11k_peer_rx_frag_setup()
3147 spin_lock_bh(&ab->base_lock); in ath11k_peer_rx_frag_setup()
3149 peer = ath11k_peer_find(ab, vdev_id, peer_mac); in ath11k_peer_rx_frag_setup()
3151 ath11k_warn(ab, "failed to find the peer to set up fragment info\n"); in ath11k_peer_rx_frag_setup()
3152 spin_unlock_bh(&ab->base_lock); in ath11k_peer_rx_frag_setup()
3159 rx_tid->ab = ab; in ath11k_peer_rx_frag_setup()
3166 spin_unlock_bh(&ab->base_lock); in ath11k_peer_rx_frag_setup()
3222 u32 hdr_len, hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_h_verify_tkip_mic()
3226 if (ath11k_dp_rx_h_mpdu_start_enctype(ar->ab, rx_desc) != in ath11k_dp_rx_h_verify_tkip_mic()
3273 u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_h_undecap_frag()
3311 u32 flags, hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_h_defrag()
3321 enctype = ath11k_dp_rx_h_mpdu_start_enctype(ar->ab, rx_desc); in ath11k_dp_rx_h_defrag()
3323 rx_attention = ath11k_dp_rx_get_attention(ar->ab, rx_desc); in ath11k_dp_rx_h_defrag()
3371 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_h_defrag_reo_reinject() local
3386 hal_rx_desc_sz = ab->hw_params.hal_desc_sz; in ath11k_dp_rx_h_defrag_reo_reinject()
3387 link_desc_banks = ab->dp.link_desc_banks; in ath11k_dp_rx_h_defrag_reo_reinject()
3390 ath11k_hal_rx_reo_ent_paddr_get(ab, reo_dest_ring, &paddr, &desc_bank); in ath11k_dp_rx_h_defrag_reo_reinject()
3408 ath11k_dp_rxdesc_set_msdu_len(ab, rx_desc, defrag_skb->len - hal_rx_desc_sz); in ath11k_dp_rx_h_defrag_reo_reinject()
3410 paddr = dma_map_single(ab->dev, defrag_skb->data, in ath11k_dp_rx_h_defrag_reo_reinject()
3413 if (dma_mapping_error(ab->dev, paddr)) in ath11k_dp_rx_h_defrag_reo_reinject()
3430 ab->hw_params.hal_params->rx_buf_rbm); in ath11k_dp_rx_h_defrag_reo_reinject()
3433 srng = &ab->hal.srng_list[ab->dp.reo_reinject_ring.ring_id]; in ath11k_dp_rx_h_defrag_reo_reinject()
3436 ath11k_hal_srng_access_begin(ab, srng); in ath11k_dp_rx_h_defrag_reo_reinject()
3439 ath11k_hal_srng_src_get_next_entry(ab, srng); in ath11k_dp_rx_h_defrag_reo_reinject()
3441 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_rx_h_defrag_reo_reinject()
3448 ath11k_hal_rx_reo_ent_paddr_get(ab, reo_dest_ring, &paddr, &desc_bank); in ath11k_dp_rx_h_defrag_reo_reinject()
3467 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_rx_h_defrag_reo_reinject()
3477 dma_unmap_single(ab->dev, paddr, defrag_skb->len + skb_tailroom(defrag_skb), in ath11k_dp_rx_h_defrag_reo_reinject()
3487 frag1 = ath11k_dp_rx_h_mpdu_start_frag_no(ar->ab, a); in ath11k_dp_rx_h_cmp_frags()
3488 frag2 = ath11k_dp_rx_h_mpdu_start_frag_no(ar->ab, b); in ath11k_dp_rx_h_cmp_frags()
3515 u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_h_get_pn()
3542 encrypt_type = ath11k_dp_rx_h_mpdu_start_enctype(ar->ab, desc); in ath11k_dp_rx_h_defrag_validate_incr_pn()
3566 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_frag_h_mpdu() local
3579 peer_id = ath11k_dp_rx_h_mpdu_start_peer_id(ar->ab, rx_desc); in ath11k_dp_rx_frag_h_mpdu()
3580 tid = ath11k_dp_rx_h_mpdu_start_tid(ar->ab, rx_desc); in ath11k_dp_rx_frag_h_mpdu()
3581 seqno = ath11k_dp_rx_h_mpdu_start_seq_no(ar->ab, rx_desc); in ath11k_dp_rx_frag_h_mpdu()
3582 frag_no = ath11k_dp_rx_h_mpdu_start_frag_no(ar->ab, msdu); in ath11k_dp_rx_frag_h_mpdu()
3583 more_frags = ath11k_dp_rx_h_mpdu_start_more_frags(ar->ab, msdu); in ath11k_dp_rx_frag_h_mpdu()
3584 is_mcbc = ath11k_dp_rx_h_attn_is_mcbc(ar->ab, rx_desc); in ath11k_dp_rx_frag_h_mpdu()
3590 if (!ath11k_dp_rx_h_mpdu_start_seq_ctrl_valid(ar->ab, rx_desc) || in ath11k_dp_rx_frag_h_mpdu()
3591 !ath11k_dp_rx_h_mpdu_start_fc_valid(ar->ab, rx_desc) || in ath11k_dp_rx_frag_h_mpdu()
3603 spin_lock_bh(&ab->base_lock); in ath11k_dp_rx_frag_h_mpdu()
3604 peer = ath11k_peer_find_by_id(ab, peer_id); in ath11k_dp_rx_frag_h_mpdu()
3606 ath11k_warn(ab, "failed to find the peer to de-fragment received fragment peer_id %d\n", in ath11k_dp_rx_frag_h_mpdu()
3612 ath11k_warn(ab, "The peer %pM [%d] has uninitialized datapath\n", in ath11k_dp_rx_frag_h_mpdu()
3651 ath11k_dp_rx_link_desc_return(ab, ring_desc, in ath11k_dp_rx_frag_h_mpdu()
3662 spin_unlock_bh(&ab->base_lock); in ath11k_dp_rx_frag_h_mpdu()
3664 spin_lock_bh(&ab->base_lock); in ath11k_dp_rx_frag_h_mpdu()
3666 peer = ath11k_peer_find_by_id(ab, peer_id); in ath11k_dp_rx_frag_h_mpdu()
3689 spin_unlock_bh(&ab->base_lock); in ath11k_dp_rx_frag_h_mpdu()
3703 u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_process_rx_err_buf()
3708 ath11k_warn(ar->ab, "rx err buf with invalid buf_id %d\n", in ath11k_dp_process_rx_err_buf()
3718 dma_unmap_single(ar->ab->dev, rxcb->paddr, in ath11k_dp_process_rx_err_buf()
3728 if (!rcu_dereference(ar->ab->pdevs_active[ar->pdev_idx])) { in ath11k_dp_process_rx_err_buf()
3739 msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(ar->ab, rx_desc); in ath11k_dp_process_rx_err_buf()
3741 hdr_status = ath11k_dp_rx_h_80211_hdr(ar->ab, rx_desc); in ath11k_dp_process_rx_err_buf()
3742 ath11k_warn(ar->ab, "invalid msdu leng %u", msdu_len); in ath11k_dp_process_rx_err_buf()
3743 ath11k_dbg_dump(ar->ab, ATH11K_DBG_DATA, NULL, "", hdr_status, in ath11k_dp_process_rx_err_buf()
3745 ath11k_dbg_dump(ar->ab, ATH11K_DBG_DATA, NULL, "", rx_desc, in ath11k_dp_process_rx_err_buf()
3755 ath11k_dp_rx_link_desc_return(ar->ab, ring_desc, in ath11k_dp_process_rx_err_buf()
3763 int ath11k_dp_process_rx_err(struct ath11k_base *ab, struct napi_struct *napi, in ath11k_dp_process_rx_err() argument
3787 dp = &ab->dp; in ath11k_dp_process_rx_err()
3791 srng = &ab->hal.srng_list[reo_except->ring_id]; in ath11k_dp_process_rx_err()
3795 ath11k_hal_srng_access_begin(ab, srng); in ath11k_dp_process_rx_err()
3798 (desc = ath11k_hal_srng_dst_get_next_entry(ab, srng))) { in ath11k_dp_process_rx_err()
3801 ab->soc_stats.err_ring_pkts++; in ath11k_dp_process_rx_err()
3802 ret = ath11k_hal_desc_reo_parse_err(ab, desc, &paddr, in ath11k_dp_process_rx_err()
3805 ath11k_warn(ab, "failed to parse error reo desc %d\n", in ath11k_dp_process_rx_err()
3816 ab->soc_stats.invalid_rbm++; in ath11k_dp_process_rx_err()
3817 ath11k_warn(ab, "invalid return buffer manager %d\n", rbm); in ath11k_dp_process_rx_err()
3818 ath11k_dp_rx_link_desc_return(ab, desc, in ath11k_dp_process_rx_err()
3831 ath11k_dp_rx_link_desc_return(ab, desc, in ath11k_dp_process_rx_err()
3842 ar = ab->pdevs[mac_id].ar; in ath11k_dp_process_rx_err()
3859 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_process_rx_err()
3863 for (i = 0; i < ab->num_radios; i++) { in ath11k_dp_process_rx_err()
3867 ar = ab->pdevs[i].ar; in ath11k_dp_process_rx_err()
3870 ath11k_dp_rxbufs_replenish(ab, i, rx_ring, n_bufs_reaped[i], in ath11k_dp_process_rx_err()
3871 ab->hw_params.hal_params->rx_buf_rbm); in ath11k_dp_process_rx_err()
3886 (DP_RX_BUFFER_SIZE - ar->ab->hw_params.hal_desc_sz)); in ath11k_dp_rx_null_q_desc_sg_drop()
3910 u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_h_null_q_desc()
3912 msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(ar->ab, desc); in ath11k_dp_rx_h_null_q_desc()
3921 rx_attention = ath11k_dp_rx_get_attention(ar->ab, desc); in ath11k_dp_rx_h_null_q_desc()
3923 ath11k_warn(ar->ab, in ath11k_dp_rx_h_null_q_desc()
3938 rxcb->is_first_msdu = ath11k_dp_rx_h_msdu_end_first_msdu(ar->ab, desc); in ath11k_dp_rx_h_null_q_desc()
3939 rxcb->is_last_msdu = ath11k_dp_rx_h_msdu_end_last_msdu(ar->ab, desc); in ath11k_dp_rx_h_null_q_desc()
3944 l3pad_bytes = ath11k_dp_rx_h_msdu_end_l3pad(ar->ab, desc); in ath11k_dp_rx_h_null_q_desc()
3956 rxcb->tid = ath11k_dp_rx_h_mpdu_start_tid(ar->ab, desc); in ath11k_dp_rx_h_null_q_desc()
3972 ar->ab->soc_stats.reo_error[rxcb->err_code]++; in ath11k_dp_rx_h_reo_err()
4003 u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_h_tkip_mic_err()
4005 rxcb->is_first_msdu = ath11k_dp_rx_h_msdu_end_first_msdu(ar->ab, desc); in ath11k_dp_rx_h_tkip_mic_err()
4006 rxcb->is_last_msdu = ath11k_dp_rx_h_msdu_end_last_msdu(ar->ab, desc); in ath11k_dp_rx_h_tkip_mic_err()
4008 l3pad_bytes = ath11k_dp_rx_h_msdu_end_l3pad(ar->ab, desc); in ath11k_dp_rx_h_tkip_mic_err()
4009 msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(ar->ab, desc); in ath11k_dp_rx_h_tkip_mic_err()
4028 ar->ab->soc_stats.rxdma_error[rxcb->err_code]++; in ath11k_dp_rx_h_rxdma_err()
4074 int ath11k_dp_rx_process_wbm_err(struct ath11k_base *ab, in ath11k_dp_rx_process_wbm_err() argument
4078 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_rx_process_wbm_err()
4091 for (i = 0; i < ab->num_radios; i++) in ath11k_dp_rx_process_wbm_err()
4094 srng = &ab->hal.srng_list[dp->rx_rel_ring.ring_id]; in ath11k_dp_rx_process_wbm_err()
4098 ath11k_hal_srng_access_begin(ab, srng); in ath11k_dp_rx_process_wbm_err()
4101 rx_desc = ath11k_hal_srng_dst_get_next_entry(ab, srng); in ath11k_dp_rx_process_wbm_err()
4105 ret = ath11k_hal_wbm_desc_parse_err(ab, rx_desc, &err_info); in ath11k_dp_rx_process_wbm_err()
4107 ath11k_warn(ab, in ath11k_dp_rx_process_wbm_err()
4116 ar = ab->pdevs[mac_id].ar; in ath11k_dp_rx_process_wbm_err()
4122 ath11k_warn(ab, "frame rx with invalid buf_id %d pdev %d\n", in ath11k_dp_rx_process_wbm_err()
4132 dma_unmap_single(ab->dev, rxcb->paddr, in ath11k_dp_rx_process_wbm_err()
4152 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_rx_process_wbm_err()
4159 for (i = 0; i < ab->num_radios; i++) { in ath11k_dp_rx_process_wbm_err()
4163 ar = ab->pdevs[i].ar; in ath11k_dp_rx_process_wbm_err()
4166 ath11k_dp_rxbufs_replenish(ab, i, rx_ring, num_buffs_reaped[i], in ath11k_dp_rx_process_wbm_err()
4167 ab->hw_params.hal_params->rx_buf_rbm); in ath11k_dp_rx_process_wbm_err()
4171 for (i = 0; i < ab->num_radios; i++) { in ath11k_dp_rx_process_wbm_err()
4172 if (!rcu_dereference(ab->pdevs_active[i])) { in ath11k_dp_rx_process_wbm_err()
4177 ar = ab->pdevs[i].ar; in ath11k_dp_rx_process_wbm_err()
4192 int ath11k_dp_process_rxdma_err(struct ath11k_base *ab, int mac_id, int budget) in ath11k_dp_process_rxdma_err() argument
4197 struct dp_link_desc_bank *link_desc_banks = ab->dp.link_desc_banks; in ath11k_dp_process_rxdma_err()
4215 ar = ab->pdevs[ath11k_hw_mac_id_to_pdev_id(&ab->hw_params, mac_id)].ar; in ath11k_dp_process_rxdma_err()
4216 err_ring = &ar->dp.rxdma_err_dst_ring[ath11k_hw_mac_id_to_srng_id(&ab->hw_params, in ath11k_dp_process_rxdma_err()
4220 srng = &ab->hal.srng_list[err_ring->ring_id]; in ath11k_dp_process_rxdma_err()
4224 ath11k_hal_srng_access_begin(ab, srng); in ath11k_dp_process_rxdma_err()
4227 (desc = ath11k_hal_srng_dst_get_next_entry(ab, srng))) { in ath11k_dp_process_rxdma_err()
4228 ath11k_hal_rx_reo_ent_paddr_get(ab, desc, &paddr, &desc_bank); in ath11k_dp_process_rxdma_err()
4234 ab->soc_stats.rxdma_error[rxdma_err_code]++; in ath11k_dp_process_rxdma_err()
4248 ath11k_warn(ab, "rxdma error with invalid buf_id %d\n", in ath11k_dp_process_rxdma_err()
4258 dma_unmap_single(ab->dev, rxcb->paddr, in ath11k_dp_process_rxdma_err()
4266 ath11k_dp_rx_link_desc_return(ab, desc, in ath11k_dp_process_rxdma_err()
4270 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_process_rxdma_err()
4275 ath11k_dp_rxbufs_replenish(ab, mac_id, rx_ring, num_buf_freed, in ath11k_dp_process_rxdma_err()
4276 ab->hw_params.hal_params->rx_buf_rbm); in ath11k_dp_process_rxdma_err()
4281 void ath11k_dp_process_reo_status(struct ath11k_base *ab) in ath11k_dp_process_reo_status() argument
4283 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_process_reo_status()
4291 srng = &ab->hal.srng_list[dp->reo_status_ring.ring_id]; in ath11k_dp_process_reo_status()
4297 ath11k_hal_srng_access_begin(ab, srng); in ath11k_dp_process_reo_status()
4299 while ((reo_desc = ath11k_hal_srng_dst_get_next_entry(ab, srng))) { in ath11k_dp_process_reo_status()
4304 ath11k_hal_reo_status_queue_stats(ab, reo_desc, in ath11k_dp_process_reo_status()
4308 ath11k_hal_reo_flush_queue_status(ab, reo_desc, in ath11k_dp_process_reo_status()
4312 ath11k_hal_reo_flush_cache_status(ab, reo_desc, in ath11k_dp_process_reo_status()
4316 ath11k_hal_reo_unblk_cache_status(ab, reo_desc, in ath11k_dp_process_reo_status()
4320 ath11k_hal_reo_flush_timeout_list_status(ab, reo_desc, in ath11k_dp_process_reo_status()
4324 ath11k_hal_reo_desc_thresh_reached_status(ab, reo_desc, in ath11k_dp_process_reo_status()
4328 ath11k_hal_reo_update_rx_reo_queue_status(ab, reo_desc, in ath11k_dp_process_reo_status()
4332 ath11k_warn(ab, "Unknown reo status type %d\n", tag); in ath11k_dp_process_reo_status()
4355 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_process_reo_status()
4360 void ath11k_dp_rx_pdev_free(struct ath11k_base *ab, int mac_id) in ath11k_dp_rx_pdev_free() argument
4362 struct ath11k *ar = ab->pdevs[mac_id].ar; in ath11k_dp_rx_pdev_free()
4368 int ath11k_dp_rx_pdev_alloc(struct ath11k_base *ab, int mac_id) in ath11k_dp_rx_pdev_alloc() argument
4370 struct ath11k *ar = ab->pdevs[mac_id].ar; in ath11k_dp_rx_pdev_alloc()
4378 ath11k_warn(ab, "failed to setup rx srngs\n"); in ath11k_dp_rx_pdev_alloc()
4384 ath11k_warn(ab, "failed to setup rxdma ring\n"); in ath11k_dp_rx_pdev_alloc()
4389 ret = ath11k_dp_tx_htt_srng_setup(ab, ring_id, mac_id, HAL_RXDMA_BUF); in ath11k_dp_rx_pdev_alloc()
4391 ath11k_warn(ab, "failed to configure rx_refill_buf_ring %d\n", in ath11k_dp_rx_pdev_alloc()
4396 if (ab->hw_params.rx_mac_buf_ring) { in ath11k_dp_rx_pdev_alloc()
4397 for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { in ath11k_dp_rx_pdev_alloc()
4399 ret = ath11k_dp_tx_htt_srng_setup(ab, ring_id, in ath11k_dp_rx_pdev_alloc()
4402 ath11k_warn(ab, "failed to configure rx_mac_buf_ring%d %d\n", in ath11k_dp_rx_pdev_alloc()
4409 for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { in ath11k_dp_rx_pdev_alloc()
4411 ret = ath11k_dp_tx_htt_srng_setup(ab, ring_id, in ath11k_dp_rx_pdev_alloc()
4414 ath11k_warn(ab, "failed to configure rxdma_err_dest_ring%d %d\n", in ath11k_dp_rx_pdev_alloc()
4420 if (!ab->hw_params.rxdma1_enable) in ath11k_dp_rx_pdev_alloc()
4424 ret = ath11k_dp_tx_htt_srng_setup(ab, ring_id, in ath11k_dp_rx_pdev_alloc()
4427 ath11k_warn(ab, "failed to configure rxdma_mon_buf_ring %d\n", in ath11k_dp_rx_pdev_alloc()
4431 ret = ath11k_dp_tx_htt_srng_setup(ab, in ath11k_dp_rx_pdev_alloc()
4435 ath11k_warn(ab, "failed to configure rxdma_mon_dst_ring %d\n", in ath11k_dp_rx_pdev_alloc()
4439 ret = ath11k_dp_tx_htt_srng_setup(ab, in ath11k_dp_rx_pdev_alloc()
4443 ath11k_warn(ab, "failed to configure rxdma_mon_dst_ring %d\n", in ath11k_dp_rx_pdev_alloc()
4449 for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { in ath11k_dp_rx_pdev_alloc()
4451 ret = ath11k_dp_tx_htt_srng_setup(ab, ring_id, mac_id + i, in ath11k_dp_rx_pdev_alloc()
4454 ath11k_warn(ab, in ath11k_dp_rx_pdev_alloc()
4486 if (ar->ab->hw_params.rxdma1_enable) { in ath11k_dp_rx_monitor_link_desc_return()
4488 hal_srng = &ar->ab->hal.srng_list[dp_srng->ring_id]; in ath11k_dp_rx_monitor_link_desc_return()
4490 dp_srng = &ar->ab->dp.wbm_desc_rel_ring; in ath11k_dp_rx_monitor_link_desc_return()
4491 hal_srng = &ar->ab->hal.srng_list[dp_srng->ring_id]; in ath11k_dp_rx_monitor_link_desc_return()
4494 ath11k_hal_srng_access_begin(ar->ab, hal_srng); in ath11k_dp_rx_monitor_link_desc_return()
4496 src_srng_desc = ath11k_hal_srng_src_get_next_entry(ar->ab, hal_srng); in ath11k_dp_rx_monitor_link_desc_return()
4504 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_monitor_link_desc_return()
4509 ath11k_hal_srng_access_end(ar->ab, hal_srng); in ath11k_dp_rx_monitor_link_desc_return()
4664 if (!ar->ab->hw_params.rxdma1_enable) in ath11k_dp_rx_mon_mpdu_pop()
4695 if (ar->ab->hw_params.rxdma1_enable) in ath11k_dp_rx_mon_mpdu_pop()
4701 (void *)ar->ab->dp.link_desc_banks[sw_cookie].vaddr + in ath11k_dp_rx_mon_mpdu_pop()
4702 (paddr - ar->ab->dp.link_desc_banks[sw_cookie].paddr); in ath11k_dp_rx_mon_mpdu_pop()
4711 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_mon_mpdu_pop()
4725 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_mon_mpdu_pop()
4731 dma_unmap_single(ar->ab->dev, rxcb->paddr, in ath11k_dp_rx_mon_mpdu_pop()
4738 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_mon_mpdu_pop()
4749 l2_hdr_offset = ath11k_dp_rx_h_msdu_end_l3pad(ar->ab, rx_desc); in ath11k_dp_rx_mon_mpdu_pop()
4752 if (!ath11k_dp_rxdesc_mpdu_valid(ar->ab, rx_desc)) { in ath11k_dp_rx_mon_mpdu_pop()
4761 ath11k_dp_rxdesc_get_ppduid(ar->ab, rx_desc); in ath11k_dp_rx_mon_mpdu_pop()
4804 if (ar->ab->hw_params.rxdma1_enable) { in ath11k_dp_rx_mon_mpdu_pop()
4808 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_mon_mpdu_pop()
4811 ath11k_dp_rx_link_desc_return(ar->ab, rx_link_buf_info, in ath11k_dp_rx_mon_mpdu_pop()
4834 rx_pkt_offset = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_msdus_set_payload()
4835 l2_hdr_offset = ath11k_dp_rx_h_msdu_end_l3pad(ar->ab, in ath11k_dp_rx_msdus_set_payload()
4846 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_mon_merg_msdus() local
4859 rx_attention = ath11k_dp_rx_get_attention(ab, rx_desc); in ath11k_dp_rx_mon_merg_msdus()
4868 decap_format = ath11k_dp_rx_h_msdu_start_decap_type(ab, rx_desc); in ath11k_dp_rx_mon_merg_msdus()
4892 hdr_desc = ath11k_dp_rxdesc_get_80211hdr(ab, rx_desc); in ath11k_dp_rx_mon_merg_msdus()
4917 ath11k_dbg(ab, ATH11K_DBG_DATA, in ath11k_dp_rx_mon_merg_msdus()
4921 ath11k_dbg(ab, ATH11K_DBG_DATA, in ath11k_dp_rx_mon_merg_msdus()
5100 if (ar->ab->hw_params.rxdma1_enable) in ath11k_dp_rx_mon_dest_process()
5105 mon_dst_srng = &ar->ab->hal.srng_list[ring_id]; in ath11k_dp_rx_mon_dest_process()
5108 ath11k_warn(ar->ab, in ath11k_dp_rx_mon_dest_process()
5116 ath11k_hal_srng_access_begin(ar->ab, mon_dst_srng); in ath11k_dp_rx_mon_dest_process()
5122 while ((ring_entry = ath11k_hal_srng_dst_peek(ar->ab, mon_dst_srng))) { in ath11k_dp_rx_mon_dest_process()
5144 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_mon_dest_process()
5156 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_mon_dest_process()
5170 ring_entry = ath11k_hal_srng_dst_get_next_entry(ar->ab, in ath11k_dp_rx_mon_dest_process()
5173 ath11k_hal_srng_access_end(ar->ab, mon_dst_srng); in ath11k_dp_rx_mon_dest_process()
5179 hal_params = ar->ab->hw_params.hal_params; in ath11k_dp_rx_mon_dest_process()
5181 if (ar->ab->hw_params.rxdma1_enable) in ath11k_dp_rx_mon_dest_process()
5182 ath11k_dp_rxbufs_replenish(ar->ab, dp->mac_id, in ath11k_dp_rx_mon_dest_process()
5187 ath11k_dp_rxbufs_replenish(ar->ab, dp->mac_id, in ath11k_dp_rx_mon_dest_process()
5194 int ath11k_dp_rx_process_mon_status(struct ath11k_base *ab, int mac_id, in ath11k_dp_rx_process_mon_status() argument
5197 struct ath11k *ar = ath11k_ab_to_ar(ab, mac_id); in ath11k_dp_rx_process_mon_status()
5212 num_buffs_reaped = ath11k_dp_rx_reap_mon_status_ring(ab, mac_id, &budget, in ath11k_dp_rx_process_mon_status()
5237 hal_status = ath11k_hal_rx_parse_mon_status(ab, ppdu_info, skb); in ath11k_dp_rx_process_mon_status()
5244 if (!ab->hw_params.full_monitor_mode) { in ath11k_dp_rx_process_mon_status()
5258 spin_lock_bh(&ab->base_lock); in ath11k_dp_rx_process_mon_status()
5259 peer = ath11k_peer_find_by_id(ab, ppdu_info->peer_id); in ath11k_dp_rx_process_mon_status()
5262 ath11k_dbg(ab, ATH11K_DBG_DATA, in ath11k_dp_rx_process_mon_status()
5275 spin_unlock_bh(&ab->base_lock); in ath11k_dp_rx_process_mon_status()
5357 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_full_mon_mpdu_pop()
5368 dma_unmap_single(ar->ab->dev, rxcb->paddr, in ath11k_dp_rx_full_mon_mpdu_pop()
5375 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_full_mon_mpdu_pop()
5386 l2_hdr_offset = ath11k_dp_rx_h_msdu_end_l3pad(ar->ab, rx_desc); in ath11k_dp_rx_full_mon_mpdu_pop()
5389 if (!ath11k_dp_rxdesc_mpdu_valid(ar->ab, rx_desc)) { in ath11k_dp_rx_full_mon_mpdu_pop()
5425 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_full_mon_mpdu_pop()
5488 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_full_mon_deliver_ppdu() local
5489 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_rx_full_mon_deliver_ppdu()
5503 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, "full mon: deliver ppdu\n"); in ath11k_dp_rx_full_mon_deliver_ppdu()
5512 ath11k_dp_rx_process_full_mon_status_ring(struct ath11k_base *ab, int mac_id, in ath11k_dp_rx_process_full_mon_status_ring() argument
5515 struct ath11k *ar = ab->pdevs[mac_id].ar; in ath11k_dp_rx_process_full_mon_status_ring()
5524 quota = ath11k_dp_rx_process_mon_status(ab, mac_id, in ath11k_dp_rx_process_full_mon_status_ring()
5529 quota += ath11k_dp_rx_process_mon_status(ab, mac_id, in ath11k_dp_rx_process_full_mon_status_ring()
5549 ath11k_dp_rx_full_mon_drop_ppdu(&ab->dp, pmon->mon_mpdu); in ath11k_dp_rx_process_full_mon_status_ring()
5554 static int ath11k_dp_full_mon_process_rx(struct ath11k_base *ab, int mac_id, in ath11k_dp_full_mon_process_rx() argument
5557 struct ath11k *ar = ab->pdevs[mac_id].ar; in ath11k_dp_full_mon_process_rx()
5563 void *mon_dst_srng = &ar->ab->hal.srng_list[dp->rxdma_mon_dst_ring.ring_id]; in ath11k_dp_full_mon_process_rx()
5579 ath11k_hal_srng_access_begin(ar->ab, mon_dst_srng); in ath11k_dp_full_mon_process_rx()
5580 while ((ring_entry = ath11k_hal_srng_dst_peek(ar->ab, mon_dst_srng))) { in ath11k_dp_full_mon_process_rx()
5592 ret = ath11k_dp_rx_full_mon_prepare_mpdu(&ab->dp, in ath11k_dp_full_mon_process_rx()
5615 ring_entry = ath11k_hal_srng_dst_get_next_entry(ar->ab, in ath11k_dp_full_mon_process_rx()
5621 ath11k_hal_srng_access_end(ar->ab, mon_dst_srng); in ath11k_dp_full_mon_process_rx()
5625 ath11k_dp_rxbufs_replenish(ar->ab, dp->mac_id, in ath11k_dp_full_mon_process_rx()
5632 quota = ath11k_dp_rx_process_full_mon_status_ring(ab, mac_id, in ath11k_dp_full_mon_process_rx()
5638 int ath11k_dp_rx_process_mon_rings(struct ath11k_base *ab, int mac_id, in ath11k_dp_rx_process_mon_rings() argument
5641 struct ath11k *ar = ath11k_ab_to_ar(ab, mac_id); in ath11k_dp_rx_process_mon_rings()
5645 ab->hw_params.full_monitor_mode) in ath11k_dp_rx_process_mon_rings()
5646 ret = ath11k_dp_full_mon_process_rx(ab, mac_id, napi, budget); in ath11k_dp_rx_process_mon_rings()
5648 ret = ath11k_dp_rx_process_mon_status(ab, mac_id, napi, budget); in ath11k_dp_rx_process_mon_rings()
5678 ath11k_warn(ar->ab, "pdev_mon_status_attach() failed"); in ath11k_dp_rx_pdev_mon_attach()
5685 if (!ar->ab->hw_params.rxdma1_enable) in ath11k_dp_rx_pdev_mon_attach()
5690 ath11k_hal_srng_get_entrysize(ar->ab, HAL_RXDMA_MONITOR_DESC); in ath11k_dp_rx_pdev_mon_attach()
5692 &ar->ab->hal.srng_list[dp->rxdma_mon_desc_ring.ring_id]; in ath11k_dp_rx_pdev_mon_attach()
5694 ret = ath11k_dp_link_desc_setup(ar->ab, pmon->link_desc_banks, in ath11k_dp_rx_pdev_mon_attach()
5698 ath11k_warn(ar->ab, "mon_link_desc_pool_setup() failed"); in ath11k_dp_rx_pdev_mon_attach()
5713 ath11k_dp_link_desc_cleanup(ar->ab, pmon->link_desc_banks, in ath11k_dp_mon_link_free()
5725 int ath11k_dp_rx_pktlog_start(struct ath11k_base *ab) in ath11k_dp_rx_pktlog_start() argument
5728 mod_timer(&ab->mon_reap_timer, in ath11k_dp_rx_pktlog_start()
5734 int ath11k_dp_rx_pktlog_stop(struct ath11k_base *ab, bool stop_timer) in ath11k_dp_rx_pktlog_stop() argument
5739 del_timer_sync(&ab->mon_reap_timer); in ath11k_dp_rx_pktlog_stop()
5742 ret = ath11k_dp_purge_mon_ring(ab); in ath11k_dp_rx_pktlog_stop()
5744 ath11k_warn(ab, "failed to purge dp mon ring: %d\n", ret); in ath11k_dp_rx_pktlog_stop()