Lines Matching full:ab
24 u8 *ath11k_dp_rx_h_80211_hdr(struct ath11k_base *ab, struct hal_rx_desc *desc) in ath11k_dp_rx_h_80211_hdr() argument
26 return ab->hw_params.hw_ops->rx_desc_get_hdr_status(desc); in ath11k_dp_rx_h_80211_hdr()
30 enum hal_encrypt_type ath11k_dp_rx_h_mpdu_start_enctype(struct ath11k_base *ab, in ath11k_dp_rx_h_mpdu_start_enctype() argument
33 if (!ab->hw_params.hw_ops->rx_desc_encrypt_valid(desc)) in ath11k_dp_rx_h_mpdu_start_enctype()
36 return ab->hw_params.hw_ops->rx_desc_get_encrypt_type(desc); in ath11k_dp_rx_h_mpdu_start_enctype()
39 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
42 return ab->hw_params.hw_ops->rx_desc_get_decap_type(desc); in ath11k_dp_rx_h_msdu_start_decap_type()
46 bool ath11k_dp_rx_h_msdu_start_ldpc_support(struct ath11k_base *ab, in ath11k_dp_rx_h_msdu_start_ldpc_support() argument
49 return ab->hw_params.hw_ops->rx_desc_get_ldpc_support(desc); in ath11k_dp_rx_h_msdu_start_ldpc_support()
53 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
56 return ab->hw_params.hw_ops->rx_desc_get_mesh_ctl(desc); in ath11k_dp_rx_h_msdu_start_mesh_ctl_present()
60 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
63 return ab->hw_params.hw_ops->rx_desc_get_mpdu_seq_ctl_vld(desc); in ath11k_dp_rx_h_mpdu_start_seq_ctrl_valid()
66 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
69 return ab->hw_params.hw_ops->rx_desc_get_mpdu_fc_valid(desc); in ath11k_dp_rx_h_mpdu_start_fc_valid()
72 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
77 hdr = (struct ieee80211_hdr *)(skb->data + ab->hw_params.hal_desc_sz); in ath11k_dp_rx_h_mpdu_start_more_frags()
81 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
86 hdr = (struct ieee80211_hdr *)(skb->data + ab->hw_params.hal_desc_sz); in ath11k_dp_rx_h_mpdu_start_frag_no()
90 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
93 return ab->hw_params.hw_ops->rx_desc_get_mpdu_start_seq_no(desc); in ath11k_dp_rx_h_mpdu_start_seq_no()
96 static inline void *ath11k_dp_rx_get_attention(struct ath11k_base *ab, in ath11k_dp_rx_get_attention() argument
99 return ab->hw_params.hw_ops->rx_desc_get_attention(desc); in ath11k_dp_rx_get_attention()
156 static bool ath11k_dp_rx_h_attn_msdu_len_err(struct ath11k_base *ab, in ath11k_dp_rx_h_attn_msdu_len_err() argument
162 rx_attention = ath11k_dp_rx_get_attention(ab, desc); in ath11k_dp_rx_h_attn_msdu_len_err()
168 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
171 return ab->hw_params.hw_ops->rx_desc_get_msdu_len(desc); in ath11k_dp_rx_h_msdu_start_msdu_len()
174 static inline u8 ath11k_dp_rx_h_msdu_start_sgi(struct ath11k_base *ab, in ath11k_dp_rx_h_msdu_start_sgi() argument
177 return ab->hw_params.hw_ops->rx_desc_get_msdu_sgi(desc); in ath11k_dp_rx_h_msdu_start_sgi()
180 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
183 return ab->hw_params.hw_ops->rx_desc_get_msdu_rate_mcs(desc); in ath11k_dp_rx_h_msdu_start_rate_mcs()
186 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
189 return ab->hw_params.hw_ops->rx_desc_get_msdu_rx_bw(desc); in ath11k_dp_rx_h_msdu_start_rx_bw()
192 static inline u32 ath11k_dp_rx_h_msdu_start_freq(struct ath11k_base *ab, in ath11k_dp_rx_h_msdu_start_freq() argument
195 return ab->hw_params.hw_ops->rx_desc_get_msdu_freq(desc); in ath11k_dp_rx_h_msdu_start_freq()
198 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
201 return ab->hw_params.hw_ops->rx_desc_get_msdu_pkt_type(desc); in ath11k_dp_rx_h_msdu_start_pkt_type()
204 static inline u8 ath11k_dp_rx_h_msdu_start_nss(struct ath11k_base *ab, in ath11k_dp_rx_h_msdu_start_nss() argument
207 return hweight8(ab->hw_params.hw_ops->rx_desc_get_msdu_nss(desc)); in ath11k_dp_rx_h_msdu_start_nss()
210 static inline u8 ath11k_dp_rx_h_mpdu_start_tid(struct ath11k_base *ab, in ath11k_dp_rx_h_mpdu_start_tid() argument
213 return ab->hw_params.hw_ops->rx_desc_get_mpdu_tid(desc); in ath11k_dp_rx_h_mpdu_start_tid()
216 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
219 return ab->hw_params.hw_ops->rx_desc_get_mpdu_peer_id(desc); in ath11k_dp_rx_h_mpdu_start_peer_id()
222 static inline u8 ath11k_dp_rx_h_msdu_end_l3pad(struct ath11k_base *ab, in ath11k_dp_rx_h_msdu_end_l3pad() argument
225 return ab->hw_params.hw_ops->rx_desc_get_l3_pad_bytes(desc); in ath11k_dp_rx_h_msdu_end_l3pad()
228 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
231 return ab->hw_params.hw_ops->rx_desc_get_first_msdu(desc); in ath11k_dp_rx_h_msdu_end_first_msdu()
234 static bool ath11k_dp_rx_h_msdu_end_last_msdu(struct ath11k_base *ab, in ath11k_dp_rx_h_msdu_end_last_msdu() argument
237 return ab->hw_params.hw_ops->rx_desc_get_last_msdu(desc); in ath11k_dp_rx_h_msdu_end_last_msdu()
240 static void ath11k_dp_rx_desc_end_tlv_copy(struct ath11k_base *ab, in ath11k_dp_rx_desc_end_tlv_copy() argument
244 ab->hw_params.hw_ops->rx_desc_copy_attn_end_tlv(fdesc, ldesc); in ath11k_dp_rx_desc_end_tlv_copy()
253 static inline u8 *ath11k_dp_rxdesc_get_80211hdr(struct ath11k_base *ab, in ath11k_dp_rxdesc_get_80211hdr() argument
258 rx_pkt_hdr = ab->hw_params.hw_ops->rx_desc_get_msdu_payload(rx_desc); in ath11k_dp_rxdesc_get_80211hdr()
263 static inline bool ath11k_dp_rxdesc_mpdu_valid(struct ath11k_base *ab, in ath11k_dp_rxdesc_mpdu_valid() argument
268 tlv_tag = ab->hw_params.hw_ops->rx_desc_get_mpdu_start_tag(rx_desc); in ath11k_dp_rxdesc_mpdu_valid()
273 static inline u32 ath11k_dp_rxdesc_get_ppduid(struct ath11k_base *ab, in ath11k_dp_rxdesc_get_ppduid() argument
276 return ab->hw_params.hw_ops->rx_desc_get_mpdu_ppdu_id(rx_desc); in ath11k_dp_rxdesc_get_ppduid()
279 static inline void ath11k_dp_rxdesc_set_msdu_len(struct ath11k_base *ab, in ath11k_dp_rxdesc_set_msdu_len() argument
283 ab->hw_params.hw_ops->rx_desc_set_msdu_len(desc, len); in ath11k_dp_rxdesc_set_msdu_len()
286 static bool ath11k_dp_rx_h_attn_is_mcbc(struct ath11k_base *ab, in ath11k_dp_rx_h_attn_is_mcbc() argument
289 struct rx_attention *attn = ath11k_dp_rx_get_attention(ab, desc); in ath11k_dp_rx_h_attn_is_mcbc()
291 return ath11k_dp_rx_h_msdu_end_first_msdu(ab, desc) && in ath11k_dp_rx_h_attn_is_mcbc()
296 static bool ath11k_dp_rxdesc_mac_addr2_valid(struct ath11k_base *ab, in ath11k_dp_rxdesc_mac_addr2_valid() argument
299 return ab->hw_params.hw_ops->rx_desc_mac_addr2_valid(desc); in ath11k_dp_rxdesc_mac_addr2_valid()
302 static u8 *ath11k_dp_rxdesc_mpdu_start_addr2(struct ath11k_base *ab, in ath11k_dp_rxdesc_mpdu_start_addr2() argument
305 return ab->hw_params.hw_ops->rx_desc_mpdu_start_addr2(desc); in ath11k_dp_rxdesc_mpdu_start_addr2()
310 struct ath11k_base *ab = from_timer(ab, t, mon_reap_timer); in ath11k_dp_service_mon_ring() local
313 for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) in ath11k_dp_service_mon_ring()
314 ath11k_dp_rx_process_mon_rings(ab, i, NULL, DP_MON_SERVICE_BUDGET); in ath11k_dp_service_mon_ring()
316 mod_timer(&ab->mon_reap_timer, jiffies + in ath11k_dp_service_mon_ring()
320 static int ath11k_dp_purge_mon_ring(struct ath11k_base *ab) in ath11k_dp_purge_mon_ring() argument
326 for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) in ath11k_dp_purge_mon_ring()
327 reaped += ath11k_dp_rx_process_mon_rings(ab, i, in ath11k_dp_purge_mon_ring()
337 ath11k_warn(ab, "dp mon ring purge timeout"); in ath11k_dp_purge_mon_ring()
343 int ath11k_dp_rxbufs_replenish(struct ath11k_base *ab, int mac_id, in ath11k_dp_rxbufs_replenish() argument
359 srng = &ab->hal.srng_list[rx_ring->refill_buf_ring.ring_id]; in ath11k_dp_rxbufs_replenish()
363 ath11k_hal_srng_access_begin(ab, srng); in ath11k_dp_rxbufs_replenish()
365 num_free = ath11k_hal_srng_src_num_free(ab, srng, true); in ath11k_dp_rxbufs_replenish()
385 paddr = dma_map_single(ab->dev, skb->data, in ath11k_dp_rxbufs_replenish()
388 if (dma_mapping_error(ab->dev, paddr)) in ath11k_dp_rxbufs_replenish()
398 desc = ath11k_hal_srng_src_get_next_entry(ab, srng); in ath11k_dp_rxbufs_replenish()
412 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_rxbufs_replenish()
423 dma_unmap_single(ab->dev, paddr, skb->len + skb_tailroom(skb), in ath11k_dp_rxbufs_replenish()
428 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()
459 if (!ar->ab->hw_params.rxdma1_enable) in ath11k_dp_rxdma_buf_ring_free()
470 dma_unmap_single(ar->ab->dev, ATH11K_SKB_RXCB(skb)->paddr, in ath11k_dp_rxdma_buf_ring_free()
484 struct ath11k_base *ab = ar->ab; in ath11k_dp_rxdma_pdev_buf_free() local
493 for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { in ath11k_dp_rxdma_pdev_buf_free()
509 ath11k_hal_srng_get_entrysize(ar->ab, ringtype); in ath11k_dp_rxdma_ring_buf_setup()
512 ath11k_dp_rxbufs_replenish(ar->ab, dp->mac_id, rx_ring, num_entries, in ath11k_dp_rxdma_ring_buf_setup()
513 ar->ab->hw_params.hal_params->rx_buf_rbm); in ath11k_dp_rxdma_ring_buf_setup()
520 struct ath11k_base *ab = ar->ab; in ath11k_dp_rxdma_pdev_buf_setup() local
526 if (ar->ab->hw_params.rxdma1_enable) { in ath11k_dp_rxdma_pdev_buf_setup()
531 for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { in ath11k_dp_rxdma_pdev_buf_setup()
542 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_pdev_srng_free() local
545 ath11k_dp_srng_cleanup(ab, &dp->rx_refill_buf_ring.refill_buf_ring); in ath11k_dp_rx_pdev_srng_free()
547 for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { in ath11k_dp_rx_pdev_srng_free()
548 if (ab->hw_params.rx_mac_buf_ring) in ath11k_dp_rx_pdev_srng_free()
549 ath11k_dp_srng_cleanup(ab, &dp->rx_mac_buf_ring[i]); in ath11k_dp_rx_pdev_srng_free()
551 ath11k_dp_srng_cleanup(ab, &dp->rxdma_err_dst_ring[i]); in ath11k_dp_rx_pdev_srng_free()
552 ath11k_dp_srng_cleanup(ab, in ath11k_dp_rx_pdev_srng_free()
556 ath11k_dp_srng_cleanup(ab, &dp->rxdma_mon_buf_ring.refill_buf_ring); in ath11k_dp_rx_pdev_srng_free()
559 void ath11k_dp_pdev_reo_cleanup(struct ath11k_base *ab) in ath11k_dp_pdev_reo_cleanup() argument
561 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_pdev_reo_cleanup()
565 ath11k_dp_srng_cleanup(ab, &dp->reo_dst_ring[i]); in ath11k_dp_pdev_reo_cleanup()
568 int ath11k_dp_pdev_reo_setup(struct ath11k_base *ab) in ath11k_dp_pdev_reo_setup() argument
570 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_pdev_reo_setup()
575 ret = ath11k_dp_srng_setup(ab, &dp->reo_dst_ring[i], in ath11k_dp_pdev_reo_setup()
579 ath11k_warn(ab, "failed to setup reo_dst_ring\n"); in ath11k_dp_pdev_reo_setup()
587 ath11k_dp_pdev_reo_cleanup(ab); in ath11k_dp_pdev_reo_setup()
595 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_pdev_srng_alloc() local
600 ret = ath11k_dp_srng_setup(ar->ab, in ath11k_dp_rx_pdev_srng_alloc()
605 ath11k_warn(ar->ab, "failed to setup rx_refill_buf_ring\n"); in ath11k_dp_rx_pdev_srng_alloc()
609 if (ar->ab->hw_params.rx_mac_buf_ring) { in ath11k_dp_rx_pdev_srng_alloc()
610 for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { in ath11k_dp_rx_pdev_srng_alloc()
611 ret = ath11k_dp_srng_setup(ar->ab, in ath11k_dp_rx_pdev_srng_alloc()
616 ath11k_warn(ar->ab, "failed to setup rx_mac_buf_ring %d\n", in ath11k_dp_rx_pdev_srng_alloc()
623 for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { in ath11k_dp_rx_pdev_srng_alloc()
624 ret = ath11k_dp_srng_setup(ar->ab, &dp->rxdma_err_dst_ring[i], in ath11k_dp_rx_pdev_srng_alloc()
628 ath11k_warn(ar->ab, "failed to setup rxdma_err_dst_ring %d\n", i); in ath11k_dp_rx_pdev_srng_alloc()
633 for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { in ath11k_dp_rx_pdev_srng_alloc()
635 ret = ath11k_dp_srng_setup(ar->ab, in ath11k_dp_rx_pdev_srng_alloc()
640 ath11k_warn(ar->ab, in ath11k_dp_rx_pdev_srng_alloc()
651 if (!ar->ab->hw_params.rxdma1_enable) { in ath11k_dp_rx_pdev_srng_alloc()
653 timer_setup(&ar->ab->mon_reap_timer, in ath11k_dp_rx_pdev_srng_alloc()
658 ret = ath11k_dp_srng_setup(ar->ab, in ath11k_dp_rx_pdev_srng_alloc()
663 ath11k_warn(ar->ab, in ath11k_dp_rx_pdev_srng_alloc()
668 ret = ath11k_dp_srng_setup(ar->ab, &dp->rxdma_mon_dst_ring, in ath11k_dp_rx_pdev_srng_alloc()
672 ath11k_warn(ar->ab, in ath11k_dp_rx_pdev_srng_alloc()
677 ret = ath11k_dp_srng_setup(ar->ab, &dp->rxdma_mon_desc_ring, in ath11k_dp_rx_pdev_srng_alloc()
681 ath11k_warn(ar->ab, in ath11k_dp_rx_pdev_srng_alloc()
689 void ath11k_dp_reo_cmd_list_cleanup(struct ath11k_base *ab) in ath11k_dp_reo_cmd_list_cleanup() argument
691 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_reo_cmd_list_cleanup()
698 dma_unmap_single(ab->dev, cmd->data.paddr, in ath11k_dp_reo_cmd_list_cleanup()
708 dma_unmap_single(ab->dev, cmd_cache->data.paddr, in ath11k_dp_reo_cmd_list_cleanup()
722 ath11k_warn(dp->ab, "failed to flush rx tid hw desc, tid %d status %d\n", in ath11k_dp_reo_cmd_free()
725 dma_unmap_single(dp->ab->dev, rx_tid->paddr, rx_tid->size, in ath11k_dp_reo_cmd_free()
730 static void ath11k_dp_reo_cache_flush(struct ath11k_base *ab, in ath11k_dp_reo_cache_flush() argument
744 ret = ath11k_dp_tx_send_reo_cmd(ab, rx_tid, in ath11k_dp_reo_cache_flush()
748 ath11k_warn(ab, in ath11k_dp_reo_cache_flush()
757 ret = ath11k_dp_tx_send_reo_cmd(ab, rx_tid, in ath11k_dp_reo_cache_flush()
761 ath11k_err(ab, "failed to send HAL_REO_CMD_FLUSH_CACHE cmd, tid %d (%d)\n", in ath11k_dp_reo_cache_flush()
763 dma_unmap_single(ab->dev, rx_tid->paddr, rx_tid->size, in ath11k_dp_reo_cache_flush()
772 struct ath11k_base *ab = dp->ab; in ath11k_dp_rx_tid_del_func() local
780 ath11k_warn(ab, "failed to delete rx tid %d hw descriptor %d\n", in ath11k_dp_rx_tid_del_func()
806 ath11k_dp_reo_cache_flush(ab, &elem->data); in ath11k_dp_rx_tid_del_func()
815 dma_unmap_single(ab->dev, rx_tid->paddr, rx_tid->size, in ath11k_dp_rx_tid_del_func()
834 ret = ath11k_dp_tx_send_reo_cmd(ar->ab, rx_tid, in ath11k_peer_rx_tid_delete()
839 ath11k_err(ar->ab, "failed to send HAL_REO_CMD_UPDATE_RX_QUEUE cmd, tid %d (%d)\n", in ath11k_peer_rx_tid_delete()
841 dma_unmap_single(ar->ab->dev, rx_tid->paddr, rx_tid->size, in ath11k_peer_rx_tid_delete()
849 static int ath11k_dp_rx_link_desc_return(struct ath11k_base *ab, in ath11k_dp_rx_link_desc_return() argument
853 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_rx_link_desc_return()
858 srng = &ab->hal.srng_list[dp->wbm_desc_rel_ring.ring_id]; in ath11k_dp_rx_link_desc_return()
862 ath11k_hal_srng_access_begin(ab, srng); in ath11k_dp_rx_link_desc_return()
864 desc = ath11k_hal_srng_src_get_next_entry(ab, srng); in ath11k_dp_rx_link_desc_return()
870 ath11k_hal_rx_msdu_link_desc_set(ab, (void *)desc, (void *)link_desc, in ath11k_dp_rx_link_desc_return()
874 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_rx_link_desc_return()
883 struct ath11k_base *ab = rx_tid->ab; in ath11k_dp_rx_frags_cleanup() local
885 lockdep_assert_held(&ab->base_lock); in ath11k_dp_rx_frags_cleanup()
889 ath11k_dp_rx_link_desc_return(ab, (u32 *)rx_tid->dst_ring_desc, in ath11k_dp_rx_frags_cleanup()
906 lockdep_assert_held(&ar->ab->base_lock); in ath11k_peer_frags_flush()
911 spin_unlock_bh(&ar->ab->base_lock); in ath11k_peer_frags_flush()
913 spin_lock_bh(&ar->ab->base_lock); in ath11k_peer_frags_flush()
924 lockdep_assert_held(&ar->ab->base_lock); in ath11k_peer_rx_tid_cleanup()
932 spin_unlock_bh(&ar->ab->base_lock); in ath11k_peer_rx_tid_cleanup()
934 spin_lock_bh(&ar->ab->base_lock); in ath11k_peer_rx_tid_cleanup()
958 ret = ath11k_dp_tx_send_reo_cmd(ar->ab, rx_tid, in ath11k_peer_rx_tid_reo_update()
962 ath11k_warn(ar->ab, "failed to update rx tid queue, tid %d (%d)\n", in ath11k_peer_rx_tid_reo_update()
972 static void ath11k_dp_rx_tid_mem_free(struct ath11k_base *ab, in ath11k_dp_rx_tid_mem_free() argument
978 spin_lock_bh(&ab->base_lock); in ath11k_dp_rx_tid_mem_free()
980 peer = ath11k_peer_find(ab, vdev_id, peer_mac); in ath11k_dp_rx_tid_mem_free()
982 ath11k_warn(ab, "failed to find the peer to free up rx tid mem\n"); in ath11k_dp_rx_tid_mem_free()
990 dma_unmap_single(ab->dev, rx_tid->paddr, rx_tid->size, in ath11k_dp_rx_tid_mem_free()
997 spin_unlock_bh(&ab->base_lock); in ath11k_dp_rx_tid_mem_free()
1004 struct ath11k_base *ab = ar->ab; in ath11k_peer_rx_tid_setup() local
1013 spin_lock_bh(&ab->base_lock); in ath11k_peer_rx_tid_setup()
1015 peer = ath11k_peer_find(ab, vdev_id, peer_mac); in ath11k_peer_rx_tid_setup()
1017 ath11k_warn(ab, "failed to find the peer to set up rx tid\n"); in ath11k_peer_rx_tid_setup()
1018 spin_unlock_bh(&ab->base_lock); in ath11k_peer_rx_tid_setup()
1028 spin_unlock_bh(&ab->base_lock); in ath11k_peer_rx_tid_setup()
1030 ath11k_warn(ab, "failed to update reo for rx tid %d\n", tid); in ath11k_peer_rx_tid_setup()
1038 ath11k_warn(ab, "failed to send wmi command to update rx reorder queue, tid :%d (%d)\n", in ath11k_peer_rx_tid_setup()
1057 spin_unlock_bh(&ab->base_lock); in ath11k_peer_rx_tid_setup()
1066 paddr = dma_map_single(ab->dev, addr_aligned, hw_desc_sz, in ath11k_peer_rx_tid_setup()
1069 ret = dma_mapping_error(ab->dev, paddr); in ath11k_peer_rx_tid_setup()
1071 spin_unlock_bh(&ab->base_lock); 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, 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()
1101 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_ampdu_start() local
1110 ath11k_warn(ab, "failed to setup rx tid %d\n", ret); in ath11k_dp_rx_ampdu_start()
1118 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_ampdu_stop() local
1126 spin_lock_bh(&ab->base_lock); in ath11k_dp_rx_ampdu_stop()
1128 peer = ath11k_peer_find(ab, vdev_id, params->sta->addr); in ath11k_dp_rx_ampdu_stop()
1130 ath11k_warn(ab, "failed to find the peer to stop rx aggregation\n"); in ath11k_dp_rx_ampdu_stop()
1131 spin_unlock_bh(&ab->base_lock); in ath11k_dp_rx_ampdu_stop()
1139 spin_unlock_bh(&ab->base_lock); in ath11k_dp_rx_ampdu_stop()
1144 spin_unlock_bh(&ab->base_lock); in ath11k_dp_rx_ampdu_stop()
1146 ath11k_warn(ab, "failed to update reo for rx tid %d: %d\n", in ath11k_dp_rx_ampdu_stop()
1155 ath11k_warn(ab, "failed to send wmi to delete rx tid %d\n", in ath11k_dp_rx_ampdu_stop()
1167 struct ath11k_base *ab = ar->ab; in ath11k_dp_peer_rx_pn_replay_config() local
1203 spin_lock_bh(&ab->base_lock); in ath11k_dp_peer_rx_pn_replay_config()
1205 peer = ath11k_peer_find(ab, arvif->vdev_id, peer_addr); in ath11k_dp_peer_rx_pn_replay_config()
1207 ath11k_warn(ab, "failed to find the peer to configure pn replay detection\n"); in ath11k_dp_peer_rx_pn_replay_config()
1208 spin_unlock_bh(&ab->base_lock); in ath11k_dp_peer_rx_pn_replay_config()
1218 ret = ath11k_dp_tx_send_reo_cmd(ab, rx_tid, in ath11k_dp_peer_rx_pn_replay_config()
1222 ath11k_warn(ab, "failed to configure rx tid %d queue for pn replay detection %d\n", in ath11k_dp_peer_rx_pn_replay_config()
1228 spin_unlock_bh(&ab->base_lock); in ath11k_dp_peer_rx_pn_replay_config()
1250 static int ath11k_htt_tlv_ppdu_stats_parse(struct ath11k_base *ab, in ath11k_htt_tlv_ppdu_stats_parse() argument
1264 ath11k_warn(ab, "Invalid len %d for the tag 0x%x\n", in ath11k_htt_tlv_ppdu_stats_parse()
1273 ath11k_warn(ab, "Invalid len %d for the tag 0x%x\n", in ath11k_htt_tlv_ppdu_stats_parse()
1292 ath11k_warn(ab, "Invalid len %d for the tag 0x%x\n", in ath11k_htt_tlv_ppdu_stats_parse()
1312 ath11k_warn(ab, "Invalid len %d for the tag 0x%x\n", in ath11k_htt_tlv_ppdu_stats_parse()
1334 int ath11k_dp_htt_tlv_iter(struct ath11k_base *ab, const void *ptr, size_t len, in ath11k_dp_htt_tlv_iter() argument
1346 ath11k_err(ab, "htt tlv parse failure at byte %zd (%zu bytes left, %zu expected)\n", in ath11k_dp_htt_tlv_iter()
1357 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()
1361 ret = iter(ab, tlv_tag, tlv_len, ptr, data); in ath11k_dp_htt_tlv_iter()
1375 struct ath11k_base *ab = ar->ab; in ath11k_update_per_peer_tx_stats() local
1427 ath11k_warn(ab, "Invalid HE mcs %d peer stats", mcs); in ath11k_update_per_peer_tx_stats()
1432 ath11k_warn(ab, "Invalid VHT mcs %d peer stats", mcs); in ath11k_update_per_peer_tx_stats()
1437 ath11k_warn(ab, "Invalid HT mcs %d nss %d peer stats", in ath11k_update_per_peer_tx_stats()
1452 spin_lock_bh(&ab->base_lock); in ath11k_update_per_peer_tx_stats()
1453 peer = ath11k_peer_find_by_id(ab, usr_stats->peer_id); in ath11k_update_per_peer_tx_stats()
1456 spin_unlock_bh(&ab->base_lock); in ath11k_update_per_peer_tx_stats()
1519 spin_unlock_bh(&ab->base_lock); in ath11k_update_per_peer_tx_stats()
1570 static int ath11k_htt_pull_ppdu_stats(struct ath11k_base *ab, in ath11k_htt_pull_ppdu_stats() argument
1586 ar = ath11k_mac_get_ar_by_pdev_id(ab, pdev_id); in ath11k_htt_pull_ppdu_stats()
1602 ret = ath11k_dp_htt_tlv_iter(ab, msg->data, len, in ath11k_htt_pull_ppdu_stats()
1606 ath11k_warn(ab, "Failed to parse tlv %d\n", ret); in ath11k_htt_pull_ppdu_stats()
1616 static void ath11k_htt_pktlog(struct ath11k_base *ab, struct sk_buff *skb) in ath11k_htt_pktlog() argument
1624 ar = ath11k_mac_get_ar_by_pdev_id(ab, pdev_id); in ath11k_htt_pktlog()
1626 ath11k_warn(ab, "invalid pdev id %d on htt pktlog\n", pdev_id); in ath11k_htt_pktlog()
1631 ar->ab->pktlog_defs_checksum); in ath11k_htt_pktlog()
1634 static void ath11k_htt_backpressure_event_handler(struct ath11k_base *ab, in ath11k_htt_backpressure_event_handler() argument
1654 …ath11k_dbg(ab, ATH11K_DBG_DP_HTT, "htt backpressure event, pdev %d, ring type %d,ring id %d, hp %d… in ath11k_htt_backpressure_event_handler()
1661 bp_stats = &ab->soc_stats.bp_stats.umac_ring_bp_stats[ring_id]; in ath11k_htt_backpressure_event_handler()
1668 bp_stats = &ab->soc_stats.bp_stats.lmac_ring_bp_stats[ring_id][pdev_idx]; in ath11k_htt_backpressure_event_handler()
1670 ath11k_warn(ab, "unknown ring type received in htt bp event %d\n", in ath11k_htt_backpressure_event_handler()
1675 spin_lock_bh(&ab->base_lock); in ath11k_htt_backpressure_event_handler()
1680 spin_unlock_bh(&ab->base_lock); in ath11k_htt_backpressure_event_handler()
1683 void ath11k_dp_htt_htc_t2h_msg_handler(struct ath11k_base *ab, in ath11k_dp_htt_htc_t2h_msg_handler() argument
1686 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_htt_htc_t2h_msg_handler()
1696 ath11k_dbg(ab, ATH11K_DBG_DP_HTT, "dp_htt rx msg type :0x%0x\n", type); in ath11k_dp_htt_htc_t2h_msg_handler()
1715 ath11k_peer_map_event(ab, vdev_id, peer_id, mac_addr, 0, 0); in ath11k_dp_htt_htc_t2h_msg_handler()
1730 ath11k_peer_map_event(ab, vdev_id, peer_id, mac_addr, ast_hash, in ath11k_dp_htt_htc_t2h_msg_handler()
1737 ath11k_peer_unmap_event(ab, peer_id); in ath11k_dp_htt_htc_t2h_msg_handler()
1740 ath11k_htt_pull_ppdu_stats(ab, skb); in ath11k_dp_htt_htc_t2h_msg_handler()
1743 ath11k_debugfs_htt_ext_stats_handler(ab, skb); in ath11k_dp_htt_htc_t2h_msg_handler()
1746 ath11k_htt_pktlog(ab, skb); in ath11k_dp_htt_htc_t2h_msg_handler()
1749 ath11k_htt_backpressure_event_handler(ab, skb); in ath11k_dp_htt_htc_t2h_msg_handler()
1752 ath11k_warn(ab, "htt event %d not handled\n", type); in ath11k_dp_htt_htc_t2h_msg_handler()
1764 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_msdu_coalesce() local
1770 u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_msdu_coalesce()
1786 rxcb->is_first_msdu = ath11k_dp_rx_h_msdu_end_first_msdu(ab, ldesc); in ath11k_dp_rx_msdu_coalesce()
1787 rxcb->is_last_msdu = ath11k_dp_rx_h_msdu_end_last_msdu(ab, ldesc); in ath11k_dp_rx_msdu_coalesce()
1799 ath11k_dp_rx_desc_end_tlv_copy(ab, rxcb->rx_desc, ldesc); in ath11k_dp_rx_msdu_coalesce()
1868 rx_attention = ath11k_dp_rx_get_attention(ar->ab, rxcb->rx_desc); in ath11k_dp_rx_h_csum_offload()
1899 ath11k_warn(ar->ab, "unsupported encryption type %d for mic len\n", enctype); in ath11k_dp_rx_crypto_mic_len()
1927 ath11k_warn(ar->ab, "unsupported encryption type %d\n", enctype); in ath11k_dp_rx_crypto_param_len()
1952 ath11k_warn(ar->ab, "unsupported encryption type %d\n", enctype); in ath11k_dp_rx_crypto_icv_len()
2001 if (ath11k_dp_rx_h_msdu_start_mesh_ctl_present(ar->ab, rxcb->rx_desc)) in ath11k_dp_rx_h_undecap_nwifi()
2105 hdr = (struct ieee80211_hdr *)ath11k_dp_rx_h_80211_hdr(ar->ab, rxcb->rx_desc); in ath11k_dp_rx_h_find_rfc1042()
2179 first_hdr = ath11k_dp_rx_h_80211_hdr(ar->ab, rx_desc); in ath11k_dp_rx_h_undecap()
2180 decap = ath11k_dp_rx_h_msdu_start_decap_type(ar->ab, rx_desc); in ath11k_dp_rx_h_undecap()
2216 ath11k_dp_rx_h_find_peer(struct ath11k_base *ab, struct sk_buff *msdu) in ath11k_dp_rx_h_find_peer() argument
2222 lockdep_assert_held(&ab->base_lock); in ath11k_dp_rx_h_find_peer()
2225 peer = ath11k_peer_find_by_id(ab, rxcb->peer_id); in ath11k_dp_rx_h_find_peer()
2230 if (!rx_desc || !(ath11k_dp_rxdesc_mac_addr2_valid(ab, rx_desc))) in ath11k_dp_rx_h_find_peer()
2233 peer = ath11k_peer_find_by_addr(ab, in ath11k_dp_rx_h_find_peer()
2234 ath11k_dp_rxdesc_mpdu_start_addr2(ab, rx_desc)); in ath11k_dp_rx_h_find_peer()
2254 fill_crypto_hdr = ath11k_dp_rx_h_attn_is_mcbc(ar->ab, rx_desc); in ath11k_dp_rx_h_mpdu()
2258 rxcb->peer_id = ath11k_dp_rx_h_mpdu_start_peer_id(ar->ab, rx_desc); in ath11k_dp_rx_h_mpdu()
2259 rxcb->seq_no = ath11k_dp_rx_h_mpdu_start_seq_no(ar->ab, rx_desc); in ath11k_dp_rx_h_mpdu()
2262 spin_lock_bh(&ar->ab->base_lock); in ath11k_dp_rx_h_mpdu()
2263 peer = ath11k_dp_rx_h_find_peer(ar->ab, msdu); in ath11k_dp_rx_h_mpdu()
2270 enctype = ath11k_dp_rx_h_mpdu_start_enctype(ar->ab, rx_desc); in ath11k_dp_rx_h_mpdu()
2272 spin_unlock_bh(&ar->ab->base_lock); in ath11k_dp_rx_h_mpdu()
2274 rx_attention = ath11k_dp_rx_get_attention(ar->ab, rx_desc); in ath11k_dp_rx_h_mpdu()
2309 if (ath11k_dp_rx_h_msdu_start_decap_type(ar->ab, rx_desc) != in ath11k_dp_rx_h_mpdu()
2326 pkt_type = ath11k_dp_rx_h_msdu_start_pkt_type(ar->ab, rx_desc); in ath11k_dp_rx_h_rate()
2327 bw = ath11k_dp_rx_h_msdu_start_rx_bw(ar->ab, rx_desc); in ath11k_dp_rx_h_rate()
2328 rate_mcs = ath11k_dp_rx_h_msdu_start_rate_mcs(ar->ab, rx_desc); in ath11k_dp_rx_h_rate()
2329 nss = ath11k_dp_rx_h_msdu_start_nss(ar->ab, rx_desc); in ath11k_dp_rx_h_rate()
2330 sgi = ath11k_dp_rx_h_msdu_start_sgi(ar->ab, rx_desc); in ath11k_dp_rx_h_rate()
2343 ath11k_warn(ar->ab, in ath11k_dp_rx_h_rate()
2357 ath11k_warn(ar->ab, in ath11k_dp_rx_h_rate()
2366 is_ldpc = ath11k_dp_rx_h_msdu_start_ldpc_support(ar->ab, rx_desc); in ath11k_dp_rx_h_rate()
2373 ath11k_warn(ar->ab, in ath11k_dp_rx_h_rate()
2401 meta_data = ath11k_dp_rx_h_msdu_start_freq(ar->ab, rx_desc); in ath11k_dp_rx_h_ppdu()
2422 ath11k_dbg_dump(ar->ab, ATH11K_DBG_DATA, NULL, "rx_desc: ", in ath11k_dp_rx_h_ppdu()
2460 decap = ath11k_dp_rx_h_msdu_start_decap_type(ar->ab, rxcb->rx_desc); in ath11k_dp_rx_deliver_msdu()
2462 spin_lock_bh(&ar->ab->base_lock); in ath11k_dp_rx_deliver_msdu()
2463 peer = ath11k_dp_rx_h_find_peer(ar->ab, msdu); in ath11k_dp_rx_deliver_msdu()
2466 spin_unlock_bh(&ar->ab->base_lock); in ath11k_dp_rx_deliver_msdu()
2468 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_deliver_msdu()
2492 ath11k_dbg_dump(ar->ab, ATH11K_DBG_DP_RX, NULL, "dp rx msdu: ", in ath11k_dp_rx_deliver_msdu()
2517 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_process_msdu() local
2526 u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_process_msdu()
2530 ath11k_warn(ab, in ath11k_dp_rx_process_msdu()
2537 if (ath11k_dp_rx_h_attn_msdu_len_err(ab, rx_desc)) { in ath11k_dp_rx_process_msdu()
2538 ath11k_warn(ar->ab, "msdu len not valid\n"); in ath11k_dp_rx_process_msdu()
2544 rx_attention = ath11k_dp_rx_get_attention(ab, lrx_desc); in ath11k_dp_rx_process_msdu()
2546 ath11k_warn(ab, "msdu_done bit in attention is not set\n"); in ath11k_dp_rx_process_msdu()
2553 msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(ab, rx_desc); in ath11k_dp_rx_process_msdu()
2554 l3_pad_bytes = ath11k_dp_rx_h_msdu_end_l3pad(ab, lrx_desc); in ath11k_dp_rx_process_msdu()
2560 hdr_status = ath11k_dp_rx_h_80211_hdr(ab, rx_desc); in ath11k_dp_rx_process_msdu()
2562 ath11k_warn(ab, "invalid msdu len %u\n", msdu_len); in ath11k_dp_rx_process_msdu()
2563 ath11k_dbg_dump(ab, ATH11K_DBG_DATA, NULL, "", hdr_status, in ath11k_dp_rx_process_msdu()
2565 ath11k_dbg_dump(ab, ATH11K_DBG_DATA, NULL, "", rx_desc, in ath11k_dp_rx_process_msdu()
2576 ath11k_warn(ab, in ath11k_dp_rx_process_msdu()
2593 static void ath11k_dp_rx_process_received_packets(struct ath11k_base *ab, in ath11k_dp_rx_process_received_packets() argument
2606 if (unlikely(!rcu_access_pointer(ab->pdevs_active[mac_id]))) { in ath11k_dp_rx_process_received_packets()
2611 ar = ab->pdevs[mac_id].ar; in ath11k_dp_rx_process_received_packets()
2620 ath11k_dbg(ab, ATH11K_DBG_DATA, in ath11k_dp_rx_process_received_packets()
2630 int ath11k_dp_process_rx(struct ath11k_base *ab, int ring_id, in ath11k_dp_process_rx() argument
2633 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_process_rx()
2652 srng = &ab->hal.srng_list[dp->reo_dst_ring[ring_id].ring_id]; in ath11k_dp_process_rx()
2657 ath11k_hal_srng_access_begin(ab, srng); in ath11k_dp_process_rx()
2660 (struct hal_reo_dest_ring *)ath11k_hal_srng_dst_get_next_entry(ab, in ath11k_dp_process_rx()
2668 ar = ab->pdevs[mac_id].ar; in ath11k_dp_process_rx()
2673 ath11k_warn(ab, "frame rx with invalid buf_id %d\n", in ath11k_dp_process_rx()
2683 dma_unmap_single(ab->dev, rxcb->paddr, in ath11k_dp_process_rx()
2694 ab->soc_stats.hal_reo_error[dp->reo_dst_ring[ring_id].ring_id]++; in ath11k_dp_process_rx()
2731 if (unlikely(!done && ath11k_hal_srng_dst_num_free(ab, srng, true))) { in ath11k_dp_process_rx()
2732 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_process_rx()
2736 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_process_rx()
2743 for (i = 0; i < ab->num_radios; i++) { in ath11k_dp_process_rx()
2747 ath11k_dp_rx_process_received_packets(ab, napi, &msdu_list[i], i); in ath11k_dp_process_rx()
2749 ar = ab->pdevs[i].ar; in ath11k_dp_process_rx()
2752 ath11k_dp_rxbufs_replenish(ab, i, rx_ring, num_buffs_reaped[i], in ath11k_dp_process_rx()
2753 ab->hw_params.hal_params->rx_buf_rbm); in ath11k_dp_process_rx()
2840 static struct sk_buff *ath11k_dp_rx_alloc_mon_status_buf(struct ath11k_base *ab, in ath11k_dp_rx_alloc_mon_status_buf() argument
2859 paddr = dma_map_single(ab->dev, skb->data, in ath11k_dp_rx_alloc_mon_status_buf()
2862 if (unlikely(dma_mapping_error(ab->dev, paddr))) in ath11k_dp_rx_alloc_mon_status_buf()
2876 dma_unmap_single(ab->dev, paddr, skb->len + skb_tailroom(skb), in ath11k_dp_rx_alloc_mon_status_buf()
2884 int ath11k_dp_rx_mon_status_bufs_replenish(struct ath11k_base *ab, int mac_id, in ath11k_dp_rx_mon_status_bufs_replenish() argument
2900 srng = &ab->hal.srng_list[rx_ring->refill_buf_ring.ring_id]; in ath11k_dp_rx_mon_status_bufs_replenish()
2904 ath11k_hal_srng_access_begin(ab, srng); in ath11k_dp_rx_mon_status_bufs_replenish()
2906 num_free = ath11k_hal_srng_src_num_free(ab, srng, true); in ath11k_dp_rx_mon_status_bufs_replenish()
2912 skb = ath11k_dp_rx_alloc_mon_status_buf(ab, rx_ring, in ath11k_dp_rx_mon_status_bufs_replenish()
2918 desc = ath11k_hal_srng_src_get_next_entry(ab, srng); in ath11k_dp_rx_mon_status_bufs_replenish()
2930 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_rx_mon_status_bufs_replenish()
2940 dma_unmap_single(ab->dev, paddr, skb->len + skb_tailroom(skb), in ath11k_dp_rx_mon_status_bufs_replenish()
2943 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_rx_mon_status_bufs_replenish()
2986 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
3005 ar = ab->pdevs[ath11k_hw_mac_id_to_pdev_id(&ab->hw_params, mac_id)].ar; in ath11k_dp_rx_reap_mon_status_ring()
3008 srng_id = ath11k_hw_mac_id_to_srng_id(&ab->hw_params, mac_id); in ath11k_dp_rx_reap_mon_status_ring()
3011 srng = &ab->hal.srng_list[rx_ring->refill_buf_ring.ring_id]; in ath11k_dp_rx_reap_mon_status_ring()
3015 ath11k_hal_srng_access_begin(ab, srng); in ath11k_dp_rx_reap_mon_status_ring()
3019 ath11k_hal_srng_src_peek(ab, srng); in ath11k_dp_rx_reap_mon_status_ring()
3033 ath11k_warn(ab, "rx monitor status with invalid buf_id %d\n", in ath11k_dp_rx_reap_mon_status_ring()
3045 dma_unmap_single(ab->dev, rxcb->paddr, in ath11k_dp_rx_reap_mon_status_ring()
3052 ath11k_warn(ab, "mon status DONE not set %lx\n", in ath11k_dp_rx_reap_mon_status_ring()
3060 if (ab->hw_params.full_monitor_mode) { in ath11k_dp_rx_reap_mon_status_ring()
3070 skb = ath11k_dp_rx_alloc_mon_status_buf(ab, rx_ring, in ath11k_dp_rx_reap_mon_status_ring()
3074 hal_params = ab->hw_params.hal_params; in ath11k_dp_rx_reap_mon_status_ring()
3087 ab->hw_params.hal_params->rx_buf_rbm); in ath11k_dp_rx_reap_mon_status_ring()
3088 ath11k_hal_srng_src_get_next_entry(ab, srng); in ath11k_dp_rx_reap_mon_status_ring()
3091 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_rx_reap_mon_status_ring()
3101 spin_lock_bh(&rx_tid->ab->base_lock); in ath11k_dp_rx_frag_timer()
3104 spin_unlock_bh(&rx_tid->ab->base_lock); in ath11k_dp_rx_frag_timer()
3108 spin_unlock_bh(&rx_tid->ab->base_lock); in ath11k_dp_rx_frag_timer()
3113 struct ath11k_base *ab = ar->ab; in ath11k_peer_rx_frag_setup() local
3123 spin_lock_bh(&ab->base_lock); in ath11k_peer_rx_frag_setup()
3125 peer = ath11k_peer_find(ab, vdev_id, peer_mac); in ath11k_peer_rx_frag_setup()
3127 ath11k_warn(ab, "failed to find the peer to set up fragment info\n"); in ath11k_peer_rx_frag_setup()
3128 spin_unlock_bh(&ab->base_lock); in ath11k_peer_rx_frag_setup()
3134 rx_tid->ab = ab; in ath11k_peer_rx_frag_setup()
3140 spin_unlock_bh(&ab->base_lock); in ath11k_peer_rx_frag_setup()
3196 u32 hdr_len, hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_h_verify_tkip_mic()
3200 if (ath11k_dp_rx_h_mpdu_start_enctype(ar->ab, rx_desc) != in ath11k_dp_rx_h_verify_tkip_mic()
3247 u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_h_undecap_frag()
3285 u32 flags, hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_h_defrag()
3295 enctype = ath11k_dp_rx_h_mpdu_start_enctype(ar->ab, rx_desc); in ath11k_dp_rx_h_defrag()
3297 rx_attention = ath11k_dp_rx_get_attention(ar->ab, rx_desc); in ath11k_dp_rx_h_defrag()
3345 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_h_defrag_reo_reinject() local
3360 hal_rx_desc_sz = ab->hw_params.hal_desc_sz; in ath11k_dp_rx_h_defrag_reo_reinject()
3361 link_desc_banks = ab->dp.link_desc_banks; in ath11k_dp_rx_h_defrag_reo_reinject()
3364 ath11k_hal_rx_reo_ent_paddr_get(ab, reo_dest_ring, &paddr, &desc_bank); in ath11k_dp_rx_h_defrag_reo_reinject()
3382 ath11k_dp_rxdesc_set_msdu_len(ab, rx_desc, defrag_skb->len - hal_rx_desc_sz); in ath11k_dp_rx_h_defrag_reo_reinject()
3384 paddr = dma_map_single(ab->dev, defrag_skb->data, in ath11k_dp_rx_h_defrag_reo_reinject()
3387 if (dma_mapping_error(ab->dev, paddr)) in ath11k_dp_rx_h_defrag_reo_reinject()
3404 ab->hw_params.hal_params->rx_buf_rbm); in ath11k_dp_rx_h_defrag_reo_reinject()
3407 srng = &ab->hal.srng_list[ab->dp.reo_reinject_ring.ring_id]; in ath11k_dp_rx_h_defrag_reo_reinject()
3410 ath11k_hal_srng_access_begin(ab, srng); in ath11k_dp_rx_h_defrag_reo_reinject()
3413 ath11k_hal_srng_src_get_next_entry(ab, srng); in ath11k_dp_rx_h_defrag_reo_reinject()
3415 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_rx_h_defrag_reo_reinject()
3422 ath11k_hal_rx_reo_ent_paddr_get(ab, reo_dest_ring, &paddr, &desc_bank); in ath11k_dp_rx_h_defrag_reo_reinject()
3441 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_rx_h_defrag_reo_reinject()
3451 dma_unmap_single(ab->dev, paddr, defrag_skb->len + skb_tailroom(defrag_skb), in ath11k_dp_rx_h_defrag_reo_reinject()
3461 frag1 = ath11k_dp_rx_h_mpdu_start_frag_no(ar->ab, a); in ath11k_dp_rx_h_cmp_frags()
3462 frag2 = ath11k_dp_rx_h_mpdu_start_frag_no(ar->ab, b); in ath11k_dp_rx_h_cmp_frags()
3489 u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_h_get_pn()
3516 encrypt_type = ath11k_dp_rx_h_mpdu_start_enctype(ar->ab, desc); in ath11k_dp_rx_h_defrag_validate_incr_pn()
3540 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_frag_h_mpdu() local
3553 peer_id = ath11k_dp_rx_h_mpdu_start_peer_id(ar->ab, rx_desc); in ath11k_dp_rx_frag_h_mpdu()
3554 tid = ath11k_dp_rx_h_mpdu_start_tid(ar->ab, rx_desc); in ath11k_dp_rx_frag_h_mpdu()
3555 seqno = ath11k_dp_rx_h_mpdu_start_seq_no(ar->ab, rx_desc); in ath11k_dp_rx_frag_h_mpdu()
3556 frag_no = ath11k_dp_rx_h_mpdu_start_frag_no(ar->ab, msdu); in ath11k_dp_rx_frag_h_mpdu()
3557 more_frags = ath11k_dp_rx_h_mpdu_start_more_frags(ar->ab, msdu); in ath11k_dp_rx_frag_h_mpdu()
3558 is_mcbc = ath11k_dp_rx_h_attn_is_mcbc(ar->ab, rx_desc); in ath11k_dp_rx_frag_h_mpdu()
3564 if (!ath11k_dp_rx_h_mpdu_start_seq_ctrl_valid(ar->ab, rx_desc) || in ath11k_dp_rx_frag_h_mpdu()
3565 !ath11k_dp_rx_h_mpdu_start_fc_valid(ar->ab, rx_desc) || in ath11k_dp_rx_frag_h_mpdu()
3577 spin_lock_bh(&ab->base_lock); in ath11k_dp_rx_frag_h_mpdu()
3578 peer = ath11k_peer_find_by_id(ab, peer_id); in ath11k_dp_rx_frag_h_mpdu()
3580 ath11k_warn(ab, "failed to find the peer to de-fragment received fragment peer_id %d\n", in ath11k_dp_rx_frag_h_mpdu()
3618 ath11k_dp_rx_link_desc_return(ab, ring_desc, in ath11k_dp_rx_frag_h_mpdu()
3629 spin_unlock_bh(&ab->base_lock); in ath11k_dp_rx_frag_h_mpdu()
3631 spin_lock_bh(&ab->base_lock); in ath11k_dp_rx_frag_h_mpdu()
3633 peer = ath11k_peer_find_by_id(ab, peer_id); in ath11k_dp_rx_frag_h_mpdu()
3656 spin_unlock_bh(&ab->base_lock); in ath11k_dp_rx_frag_h_mpdu()
3670 u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_process_rx_err_buf()
3675 ath11k_warn(ar->ab, "rx err buf with invalid buf_id %d\n", in ath11k_dp_process_rx_err_buf()
3685 dma_unmap_single(ar->ab->dev, rxcb->paddr, in ath11k_dp_process_rx_err_buf()
3695 if (!rcu_dereference(ar->ab->pdevs_active[ar->pdev_idx])) { in ath11k_dp_process_rx_err_buf()
3706 msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(ar->ab, rx_desc); in ath11k_dp_process_rx_err_buf()
3708 hdr_status = ath11k_dp_rx_h_80211_hdr(ar->ab, rx_desc); in ath11k_dp_process_rx_err_buf()
3709 ath11k_warn(ar->ab, "invalid msdu leng %u", msdu_len); in ath11k_dp_process_rx_err_buf()
3710 ath11k_dbg_dump(ar->ab, ATH11K_DBG_DATA, NULL, "", hdr_status, in ath11k_dp_process_rx_err_buf()
3712 ath11k_dbg_dump(ar->ab, ATH11K_DBG_DATA, NULL, "", rx_desc, in ath11k_dp_process_rx_err_buf()
3722 ath11k_dp_rx_link_desc_return(ar->ab, ring_desc, in ath11k_dp_process_rx_err_buf()
3730 int ath11k_dp_process_rx_err(struct ath11k_base *ab, struct napi_struct *napi, in ath11k_dp_process_rx_err() argument
3754 dp = &ab->dp; in ath11k_dp_process_rx_err()
3758 srng = &ab->hal.srng_list[reo_except->ring_id]; in ath11k_dp_process_rx_err()
3762 ath11k_hal_srng_access_begin(ab, srng); in ath11k_dp_process_rx_err()
3765 (desc = ath11k_hal_srng_dst_get_next_entry(ab, srng))) { in ath11k_dp_process_rx_err()
3768 ab->soc_stats.err_ring_pkts++; in ath11k_dp_process_rx_err()
3769 ret = ath11k_hal_desc_reo_parse_err(ab, desc, &paddr, in ath11k_dp_process_rx_err()
3772 ath11k_warn(ab, "failed to parse error reo desc %d\n", in ath11k_dp_process_rx_err()
3782 ab->soc_stats.invalid_rbm++; in ath11k_dp_process_rx_err()
3783 ath11k_warn(ab, "invalid return buffer manager %d\n", rbm); in ath11k_dp_process_rx_err()
3784 ath11k_dp_rx_link_desc_return(ab, desc, in ath11k_dp_process_rx_err()
3797 ath11k_dp_rx_link_desc_return(ab, desc, in ath11k_dp_process_rx_err()
3808 ar = ab->pdevs[mac_id].ar; in ath11k_dp_process_rx_err()
3825 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_process_rx_err()
3829 for (i = 0; i < ab->num_radios; i++) { in ath11k_dp_process_rx_err()
3833 ar = ab->pdevs[i].ar; in ath11k_dp_process_rx_err()
3836 ath11k_dp_rxbufs_replenish(ab, i, rx_ring, n_bufs_reaped[i], in ath11k_dp_process_rx_err()
3837 ab->hw_params.hal_params->rx_buf_rbm); in ath11k_dp_process_rx_err()
3852 (DP_RX_BUFFER_SIZE - ar->ab->hw_params.hal_desc_sz)); in ath11k_dp_rx_null_q_desc_sg_drop()
3876 u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_h_null_q_desc()
3878 msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(ar->ab, desc); in ath11k_dp_rx_h_null_q_desc()
3887 rx_attention = ath11k_dp_rx_get_attention(ar->ab, desc); in ath11k_dp_rx_h_null_q_desc()
3889 ath11k_warn(ar->ab, in ath11k_dp_rx_h_null_q_desc()
3904 rxcb->is_first_msdu = ath11k_dp_rx_h_msdu_end_first_msdu(ar->ab, desc); in ath11k_dp_rx_h_null_q_desc()
3905 rxcb->is_last_msdu = ath11k_dp_rx_h_msdu_end_last_msdu(ar->ab, desc); in ath11k_dp_rx_h_null_q_desc()
3910 l3pad_bytes = ath11k_dp_rx_h_msdu_end_l3pad(ar->ab, desc); in ath11k_dp_rx_h_null_q_desc()
3922 rxcb->tid = ath11k_dp_rx_h_mpdu_start_tid(ar->ab, desc); in ath11k_dp_rx_h_null_q_desc()
3938 ar->ab->soc_stats.reo_error[rxcb->err_code]++; in ath11k_dp_rx_h_reo_err()
3969 u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_h_tkip_mic_err()
3971 rxcb->is_first_msdu = ath11k_dp_rx_h_msdu_end_first_msdu(ar->ab, desc); in ath11k_dp_rx_h_tkip_mic_err()
3972 rxcb->is_last_msdu = ath11k_dp_rx_h_msdu_end_last_msdu(ar->ab, desc); in ath11k_dp_rx_h_tkip_mic_err()
3974 l3pad_bytes = ath11k_dp_rx_h_msdu_end_l3pad(ar->ab, desc); in ath11k_dp_rx_h_tkip_mic_err()
3975 msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(ar->ab, desc); in ath11k_dp_rx_h_tkip_mic_err()
3994 ar->ab->soc_stats.rxdma_error[rxcb->err_code]++; in ath11k_dp_rx_h_rxdma_err()
4040 int ath11k_dp_rx_process_wbm_err(struct ath11k_base *ab, in ath11k_dp_rx_process_wbm_err() argument
4044 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_rx_process_wbm_err()
4057 for (i = 0; i < ab->num_radios; i++) in ath11k_dp_rx_process_wbm_err()
4060 srng = &ab->hal.srng_list[dp->rx_rel_ring.ring_id]; in ath11k_dp_rx_process_wbm_err()
4064 ath11k_hal_srng_access_begin(ab, srng); in ath11k_dp_rx_process_wbm_err()
4067 rx_desc = ath11k_hal_srng_dst_get_next_entry(ab, srng); in ath11k_dp_rx_process_wbm_err()
4071 ret = ath11k_hal_wbm_desc_parse_err(ab, rx_desc, &err_info); in ath11k_dp_rx_process_wbm_err()
4073 ath11k_warn(ab, in ath11k_dp_rx_process_wbm_err()
4082 ar = ab->pdevs[mac_id].ar; in ath11k_dp_rx_process_wbm_err()
4088 ath11k_warn(ab, "frame rx with invalid buf_id %d pdev %d\n", in ath11k_dp_rx_process_wbm_err()
4098 dma_unmap_single(ab->dev, rxcb->paddr, in ath11k_dp_rx_process_wbm_err()
4118 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_rx_process_wbm_err()
4125 for (i = 0; i < ab->num_radios; i++) { in ath11k_dp_rx_process_wbm_err()
4129 ar = ab->pdevs[i].ar; in ath11k_dp_rx_process_wbm_err()
4132 ath11k_dp_rxbufs_replenish(ab, i, rx_ring, num_buffs_reaped[i], in ath11k_dp_rx_process_wbm_err()
4133 ab->hw_params.hal_params->rx_buf_rbm); in ath11k_dp_rx_process_wbm_err()
4137 for (i = 0; i < ab->num_radios; i++) { in ath11k_dp_rx_process_wbm_err()
4138 if (!rcu_dereference(ab->pdevs_active[i])) { in ath11k_dp_rx_process_wbm_err()
4143 ar = ab->pdevs[i].ar; in ath11k_dp_rx_process_wbm_err()
4158 int ath11k_dp_process_rxdma_err(struct ath11k_base *ab, int mac_id, int budget) in ath11k_dp_process_rxdma_err() argument
4163 struct dp_link_desc_bank *link_desc_banks = ab->dp.link_desc_banks; in ath11k_dp_process_rxdma_err()
4181 ar = ab->pdevs[ath11k_hw_mac_id_to_pdev_id(&ab->hw_params, mac_id)].ar; in ath11k_dp_process_rxdma_err()
4182 err_ring = &ar->dp.rxdma_err_dst_ring[ath11k_hw_mac_id_to_srng_id(&ab->hw_params, in ath11k_dp_process_rxdma_err()
4186 srng = &ab->hal.srng_list[err_ring->ring_id]; in ath11k_dp_process_rxdma_err()
4190 ath11k_hal_srng_access_begin(ab, srng); in ath11k_dp_process_rxdma_err()
4193 (desc = ath11k_hal_srng_dst_get_next_entry(ab, srng))) { in ath11k_dp_process_rxdma_err()
4194 ath11k_hal_rx_reo_ent_paddr_get(ab, desc, &paddr, &desc_bank); in ath11k_dp_process_rxdma_err()
4200 ab->soc_stats.rxdma_error[rxdma_err_code]++; in ath11k_dp_process_rxdma_err()
4214 ath11k_warn(ab, "rxdma error with invalid buf_id %d\n", in ath11k_dp_process_rxdma_err()
4224 dma_unmap_single(ab->dev, rxcb->paddr, in ath11k_dp_process_rxdma_err()
4232 ath11k_dp_rx_link_desc_return(ab, desc, in ath11k_dp_process_rxdma_err()
4236 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_process_rxdma_err()
4241 ath11k_dp_rxbufs_replenish(ab, mac_id, rx_ring, num_buf_freed, in ath11k_dp_process_rxdma_err()
4242 ab->hw_params.hal_params->rx_buf_rbm); in ath11k_dp_process_rxdma_err()
4247 void ath11k_dp_process_reo_status(struct ath11k_base *ab) in ath11k_dp_process_reo_status() argument
4249 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_process_reo_status()
4257 srng = &ab->hal.srng_list[dp->reo_status_ring.ring_id]; in ath11k_dp_process_reo_status()
4263 ath11k_hal_srng_access_begin(ab, srng); in ath11k_dp_process_reo_status()
4265 while ((reo_desc = ath11k_hal_srng_dst_get_next_entry(ab, srng))) { in ath11k_dp_process_reo_status()
4270 ath11k_hal_reo_status_queue_stats(ab, reo_desc, in ath11k_dp_process_reo_status()
4274 ath11k_hal_reo_flush_queue_status(ab, reo_desc, in ath11k_dp_process_reo_status()
4278 ath11k_hal_reo_flush_cache_status(ab, reo_desc, in ath11k_dp_process_reo_status()
4282 ath11k_hal_reo_unblk_cache_status(ab, reo_desc, in ath11k_dp_process_reo_status()
4286 ath11k_hal_reo_flush_timeout_list_status(ab, reo_desc, in ath11k_dp_process_reo_status()
4290 ath11k_hal_reo_desc_thresh_reached_status(ab, reo_desc, in ath11k_dp_process_reo_status()
4294 ath11k_hal_reo_update_rx_reo_queue_status(ab, reo_desc, in ath11k_dp_process_reo_status()
4298 ath11k_warn(ab, "Unknown reo status type %d\n", tag); in ath11k_dp_process_reo_status()
4321 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_process_reo_status()
4326 void ath11k_dp_rx_pdev_free(struct ath11k_base *ab, int mac_id) in ath11k_dp_rx_pdev_free() argument
4328 struct ath11k *ar = ab->pdevs[mac_id].ar; in ath11k_dp_rx_pdev_free()
4334 int ath11k_dp_rx_pdev_alloc(struct ath11k_base *ab, int mac_id) in ath11k_dp_rx_pdev_alloc() argument
4336 struct ath11k *ar = ab->pdevs[mac_id].ar; in ath11k_dp_rx_pdev_alloc()
4344 ath11k_warn(ab, "failed to setup rx srngs\n"); in ath11k_dp_rx_pdev_alloc()
4350 ath11k_warn(ab, "failed to setup rxdma ring\n"); in ath11k_dp_rx_pdev_alloc()
4355 ret = ath11k_dp_tx_htt_srng_setup(ab, ring_id, mac_id, HAL_RXDMA_BUF); in ath11k_dp_rx_pdev_alloc()
4357 ath11k_warn(ab, "failed to configure rx_refill_buf_ring %d\n", in ath11k_dp_rx_pdev_alloc()
4362 if (ab->hw_params.rx_mac_buf_ring) { in ath11k_dp_rx_pdev_alloc()
4363 for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { in ath11k_dp_rx_pdev_alloc()
4365 ret = ath11k_dp_tx_htt_srng_setup(ab, ring_id, in ath11k_dp_rx_pdev_alloc()
4368 ath11k_warn(ab, "failed to configure rx_mac_buf_ring%d %d\n", in ath11k_dp_rx_pdev_alloc()
4375 for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { in ath11k_dp_rx_pdev_alloc()
4377 ret = ath11k_dp_tx_htt_srng_setup(ab, ring_id, in ath11k_dp_rx_pdev_alloc()
4380 ath11k_warn(ab, "failed to configure rxdma_err_dest_ring%d %d\n", in ath11k_dp_rx_pdev_alloc()
4386 if (!ab->hw_params.rxdma1_enable) in ath11k_dp_rx_pdev_alloc()
4390 ret = ath11k_dp_tx_htt_srng_setup(ab, ring_id, in ath11k_dp_rx_pdev_alloc()
4393 ath11k_warn(ab, "failed to configure rxdma_mon_buf_ring %d\n", in ath11k_dp_rx_pdev_alloc()
4397 ret = ath11k_dp_tx_htt_srng_setup(ab, in ath11k_dp_rx_pdev_alloc()
4401 ath11k_warn(ab, "failed to configure rxdma_mon_dst_ring %d\n", in ath11k_dp_rx_pdev_alloc()
4405 ret = ath11k_dp_tx_htt_srng_setup(ab, in ath11k_dp_rx_pdev_alloc()
4409 ath11k_warn(ab, "failed to configure rxdma_mon_dst_ring %d\n", in ath11k_dp_rx_pdev_alloc()
4415 for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { in ath11k_dp_rx_pdev_alloc()
4417 ret = ath11k_dp_tx_htt_srng_setup(ab, ring_id, mac_id + i, in ath11k_dp_rx_pdev_alloc()
4420 ath11k_warn(ab, in ath11k_dp_rx_pdev_alloc()
4452 if (ar->ab->hw_params.rxdma1_enable) { in ath11k_dp_rx_monitor_link_desc_return()
4454 hal_srng = &ar->ab->hal.srng_list[dp_srng->ring_id]; in ath11k_dp_rx_monitor_link_desc_return()
4456 dp_srng = &ar->ab->dp.wbm_desc_rel_ring; in ath11k_dp_rx_monitor_link_desc_return()
4457 hal_srng = &ar->ab->hal.srng_list[dp_srng->ring_id]; in ath11k_dp_rx_monitor_link_desc_return()
4460 ath11k_hal_srng_access_begin(ar->ab, hal_srng); in ath11k_dp_rx_monitor_link_desc_return()
4462 src_srng_desc = ath11k_hal_srng_src_get_next_entry(ar->ab, hal_srng); in ath11k_dp_rx_monitor_link_desc_return()
4470 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_monitor_link_desc_return()
4475 ath11k_hal_srng_access_end(ar->ab, hal_srng); in ath11k_dp_rx_monitor_link_desc_return()
4630 if (!ar->ab->hw_params.rxdma1_enable) in ath11k_dp_rx_mon_mpdu_pop()
4661 if (ar->ab->hw_params.rxdma1_enable) in ath11k_dp_rx_mon_mpdu_pop()
4667 (void *)ar->ab->dp.link_desc_banks[sw_cookie].vaddr + in ath11k_dp_rx_mon_mpdu_pop()
4668 (paddr - ar->ab->dp.link_desc_banks[sw_cookie].paddr); in ath11k_dp_rx_mon_mpdu_pop()
4677 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_mon_mpdu_pop()
4691 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_mon_mpdu_pop()
4697 dma_unmap_single(ar->ab->dev, rxcb->paddr, in ath11k_dp_rx_mon_mpdu_pop()
4704 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_mon_mpdu_pop()
4715 l2_hdr_offset = ath11k_dp_rx_h_msdu_end_l3pad(ar->ab, rx_desc); in ath11k_dp_rx_mon_mpdu_pop()
4718 if (!ath11k_dp_rxdesc_mpdu_valid(ar->ab, rx_desc)) { in ath11k_dp_rx_mon_mpdu_pop()
4727 ath11k_dp_rxdesc_get_ppduid(ar->ab, rx_desc); in ath11k_dp_rx_mon_mpdu_pop()
4770 if (ar->ab->hw_params.rxdma1_enable) { in ath11k_dp_rx_mon_mpdu_pop()
4774 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_mon_mpdu_pop()
4777 ath11k_dp_rx_link_desc_return(ar->ab, rx_link_buf_info, in ath11k_dp_rx_mon_mpdu_pop()
4800 rx_pkt_offset = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_msdus_set_payload()
4801 l2_hdr_offset = ath11k_dp_rx_h_msdu_end_l3pad(ar->ab, in ath11k_dp_rx_msdus_set_payload()
4812 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_mon_merg_msdus() local
4825 rx_attention = ath11k_dp_rx_get_attention(ab, rx_desc); in ath11k_dp_rx_mon_merg_msdus()
4834 decap_format = ath11k_dp_rx_h_msdu_start_decap_type(ab, rx_desc); in ath11k_dp_rx_mon_merg_msdus()
4858 hdr_desc = ath11k_dp_rxdesc_get_80211hdr(ab, rx_desc); in ath11k_dp_rx_mon_merg_msdus()
4883 ath11k_dbg(ab, ATH11K_DBG_DATA, in ath11k_dp_rx_mon_merg_msdus()
4887 ath11k_dbg(ab, ATH11K_DBG_DATA, in ath11k_dp_rx_mon_merg_msdus()
5065 if (ar->ab->hw_params.rxdma1_enable) in ath11k_dp_rx_mon_dest_process()
5070 mon_dst_srng = &ar->ab->hal.srng_list[ring_id]; in ath11k_dp_rx_mon_dest_process()
5073 ath11k_warn(ar->ab, in ath11k_dp_rx_mon_dest_process()
5081 ath11k_hal_srng_access_begin(ar->ab, mon_dst_srng); in ath11k_dp_rx_mon_dest_process()
5087 while ((ring_entry = ath11k_hal_srng_dst_peek(ar->ab, mon_dst_srng))) { in ath11k_dp_rx_mon_dest_process()
5109 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_mon_dest_process()
5121 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_mon_dest_process()
5135 ring_entry = ath11k_hal_srng_dst_get_next_entry(ar->ab, in ath11k_dp_rx_mon_dest_process()
5138 ath11k_hal_srng_access_end(ar->ab, mon_dst_srng); in ath11k_dp_rx_mon_dest_process()
5144 hal_params = ar->ab->hw_params.hal_params; in ath11k_dp_rx_mon_dest_process()
5146 if (ar->ab->hw_params.rxdma1_enable) in ath11k_dp_rx_mon_dest_process()
5147 ath11k_dp_rxbufs_replenish(ar->ab, dp->mac_id, in ath11k_dp_rx_mon_dest_process()
5152 ath11k_dp_rxbufs_replenish(ar->ab, dp->mac_id, in ath11k_dp_rx_mon_dest_process()
5159 int ath11k_dp_rx_process_mon_status(struct ath11k_base *ab, int mac_id, in ath11k_dp_rx_process_mon_status() argument
5162 struct ath11k *ar = ath11k_ab_to_ar(ab, mac_id); in ath11k_dp_rx_process_mon_status()
5177 num_buffs_reaped = ath11k_dp_rx_reap_mon_status_ring(ab, mac_id, &budget, in ath11k_dp_rx_process_mon_status()
5202 hal_status = ath11k_hal_rx_parse_mon_status(ab, ppdu_info, skb); in ath11k_dp_rx_process_mon_status()
5220 spin_lock_bh(&ab->base_lock); in ath11k_dp_rx_process_mon_status()
5221 peer = ath11k_peer_find_by_id(ab, ppdu_info->peer_id); in ath11k_dp_rx_process_mon_status()
5224 ath11k_dbg(ab, ATH11K_DBG_DATA, in ath11k_dp_rx_process_mon_status()
5237 spin_unlock_bh(&ab->base_lock); in ath11k_dp_rx_process_mon_status()
5319 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_full_mon_mpdu_pop()
5330 dma_unmap_single(ar->ab->dev, rxcb->paddr, in ath11k_dp_rx_full_mon_mpdu_pop()
5337 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_full_mon_mpdu_pop()
5348 l2_hdr_offset = ath11k_dp_rx_h_msdu_end_l3pad(ar->ab, rx_desc); in ath11k_dp_rx_full_mon_mpdu_pop()
5351 if (!ath11k_dp_rxdesc_mpdu_valid(ar->ab, rx_desc)) { in ath11k_dp_rx_full_mon_mpdu_pop()
5387 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_full_mon_mpdu_pop()
5450 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_full_mon_deliver_ppdu() local
5451 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_rx_full_mon_deliver_ppdu()
5465 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, "full mon: deliver ppdu\n"); in ath11k_dp_rx_full_mon_deliver_ppdu()
5474 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
5477 struct ath11k *ar = ab->pdevs[mac_id].ar; in ath11k_dp_rx_process_full_mon_status_ring()
5486 quota = ath11k_dp_rx_process_mon_status(ab, mac_id, in ath11k_dp_rx_process_full_mon_status_ring()
5491 quota += ath11k_dp_rx_process_mon_status(ab, mac_id, in ath11k_dp_rx_process_full_mon_status_ring()
5511 ath11k_dp_rx_full_mon_drop_ppdu(&ab->dp, pmon->mon_mpdu); in ath11k_dp_rx_process_full_mon_status_ring()
5516 static int ath11k_dp_full_mon_process_rx(struct ath11k_base *ab, int mac_id, in ath11k_dp_full_mon_process_rx() argument
5519 struct ath11k *ar = ab->pdevs[mac_id].ar; in ath11k_dp_full_mon_process_rx()
5525 void *mon_dst_srng = &ar->ab->hal.srng_list[dp->rxdma_mon_dst_ring.ring_id]; in ath11k_dp_full_mon_process_rx()
5541 ath11k_hal_srng_access_begin(ar->ab, mon_dst_srng); in ath11k_dp_full_mon_process_rx()
5542 while ((ring_entry = ath11k_hal_srng_dst_peek(ar->ab, mon_dst_srng))) { in ath11k_dp_full_mon_process_rx()
5554 ret = ath11k_dp_rx_full_mon_prepare_mpdu(&ab->dp, in ath11k_dp_full_mon_process_rx()
5577 ring_entry = ath11k_hal_srng_dst_get_next_entry(ar->ab, in ath11k_dp_full_mon_process_rx()
5583 ath11k_hal_srng_access_end(ar->ab, mon_dst_srng); in ath11k_dp_full_mon_process_rx()
5587 ath11k_dp_rxbufs_replenish(ar->ab, dp->mac_id, in ath11k_dp_full_mon_process_rx()
5594 quota = ath11k_dp_rx_process_full_mon_status_ring(ab, mac_id, in ath11k_dp_full_mon_process_rx()
5600 int ath11k_dp_rx_process_mon_rings(struct ath11k_base *ab, int mac_id, in ath11k_dp_rx_process_mon_rings() argument
5603 struct ath11k *ar = ath11k_ab_to_ar(ab, mac_id); in ath11k_dp_rx_process_mon_rings()
5607 ab->hw_params.full_monitor_mode) in ath11k_dp_rx_process_mon_rings()
5608 ret = ath11k_dp_full_mon_process_rx(ab, mac_id, napi, budget); in ath11k_dp_rx_process_mon_rings()
5610 ret = ath11k_dp_rx_process_mon_status(ab, mac_id, napi, budget); in ath11k_dp_rx_process_mon_rings()
5640 ath11k_warn(ar->ab, "pdev_mon_status_attach() failed"); in ath11k_dp_rx_pdev_mon_attach()
5647 if (!ar->ab->hw_params.rxdma1_enable) in ath11k_dp_rx_pdev_mon_attach()
5652 ath11k_hal_srng_get_entrysize(ar->ab, HAL_RXDMA_MONITOR_DESC); in ath11k_dp_rx_pdev_mon_attach()
5654 &ar->ab->hal.srng_list[dp->rxdma_mon_desc_ring.ring_id]; in ath11k_dp_rx_pdev_mon_attach()
5656 ret = ath11k_dp_link_desc_setup(ar->ab, pmon->link_desc_banks, in ath11k_dp_rx_pdev_mon_attach()
5660 ath11k_warn(ar->ab, "mon_link_desc_pool_setup() failed"); in ath11k_dp_rx_pdev_mon_attach()
5675 ath11k_dp_link_desc_cleanup(ar->ab, pmon->link_desc_banks, in ath11k_dp_mon_link_free()
5687 int ath11k_dp_rx_pktlog_start(struct ath11k_base *ab) in ath11k_dp_rx_pktlog_start() argument
5690 mod_timer(&ab->mon_reap_timer, in ath11k_dp_rx_pktlog_start()
5696 int ath11k_dp_rx_pktlog_stop(struct ath11k_base *ab, bool stop_timer) in ath11k_dp_rx_pktlog_stop() argument
5701 del_timer_sync(&ab->mon_reap_timer); in ath11k_dp_rx_pktlog_stop()
5704 ret = ath11k_dp_purge_mon_ring(ab); in ath11k_dp_rx_pktlog_stop()
5706 ath11k_warn(ab, "failed to purge dp mon ring: %d\n", ret); in ath11k_dp_rx_pktlog_stop()