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()
447 dma_unmap_single(ar->ab->dev, ATH11K_SKB_RXCB(skb)->paddr, in ath11k_dp_rxdma_buf_ring_free()
461 struct ath11k_base *ab = ar->ab; in ath11k_dp_rxdma_pdev_buf_free() local
470 for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { in ath11k_dp_rxdma_pdev_buf_free()
486 ath11k_hal_srng_get_entrysize(ar->ab, ringtype); in ath11k_dp_rxdma_ring_buf_setup()
489 ath11k_dp_rxbufs_replenish(ar->ab, dp->mac_id, rx_ring, num_entries, in ath11k_dp_rxdma_ring_buf_setup()
490 ar->ab->hw_params.hal_params->rx_buf_rbm); in ath11k_dp_rxdma_ring_buf_setup()
497 struct ath11k_base *ab = ar->ab; in ath11k_dp_rxdma_pdev_buf_setup() local
503 if (ar->ab->hw_params.rxdma1_enable) { in ath11k_dp_rxdma_pdev_buf_setup()
508 for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { in ath11k_dp_rxdma_pdev_buf_setup()
519 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_pdev_srng_free() local
522 ath11k_dp_srng_cleanup(ab, &dp->rx_refill_buf_ring.refill_buf_ring); in ath11k_dp_rx_pdev_srng_free()
524 for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { in ath11k_dp_rx_pdev_srng_free()
525 if (ab->hw_params.rx_mac_buf_ring) in ath11k_dp_rx_pdev_srng_free()
526 ath11k_dp_srng_cleanup(ab, &dp->rx_mac_buf_ring[i]); in ath11k_dp_rx_pdev_srng_free()
528 ath11k_dp_srng_cleanup(ab, &dp->rxdma_err_dst_ring[i]); in ath11k_dp_rx_pdev_srng_free()
529 ath11k_dp_srng_cleanup(ab, in ath11k_dp_rx_pdev_srng_free()
533 ath11k_dp_srng_cleanup(ab, &dp->rxdma_mon_buf_ring.refill_buf_ring); in ath11k_dp_rx_pdev_srng_free()
536 void ath11k_dp_pdev_reo_cleanup(struct ath11k_base *ab) in ath11k_dp_pdev_reo_cleanup() argument
538 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_pdev_reo_cleanup()
542 ath11k_dp_srng_cleanup(ab, &dp->reo_dst_ring[i]); in ath11k_dp_pdev_reo_cleanup()
545 int ath11k_dp_pdev_reo_setup(struct ath11k_base *ab) in ath11k_dp_pdev_reo_setup() argument
547 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_pdev_reo_setup()
552 ret = ath11k_dp_srng_setup(ab, &dp->reo_dst_ring[i], in ath11k_dp_pdev_reo_setup()
556 ath11k_warn(ab, "failed to setup reo_dst_ring\n"); in ath11k_dp_pdev_reo_setup()
564 ath11k_dp_pdev_reo_cleanup(ab); in ath11k_dp_pdev_reo_setup()
572 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_pdev_srng_alloc() local
577 ret = ath11k_dp_srng_setup(ar->ab, in ath11k_dp_rx_pdev_srng_alloc()
582 ath11k_warn(ar->ab, "failed to setup rx_refill_buf_ring\n"); in ath11k_dp_rx_pdev_srng_alloc()
586 if (ar->ab->hw_params.rx_mac_buf_ring) { in ath11k_dp_rx_pdev_srng_alloc()
587 for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { in ath11k_dp_rx_pdev_srng_alloc()
588 ret = ath11k_dp_srng_setup(ar->ab, in ath11k_dp_rx_pdev_srng_alloc()
593 ath11k_warn(ar->ab, "failed to setup rx_mac_buf_ring %d\n", in ath11k_dp_rx_pdev_srng_alloc()
600 for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { in ath11k_dp_rx_pdev_srng_alloc()
601 ret = ath11k_dp_srng_setup(ar->ab, &dp->rxdma_err_dst_ring[i], in ath11k_dp_rx_pdev_srng_alloc()
605 ath11k_warn(ar->ab, "failed to setup rxdma_err_dst_ring %d\n", i); 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()
612 ret = ath11k_dp_srng_setup(ar->ab, in ath11k_dp_rx_pdev_srng_alloc()
617 ath11k_warn(ar->ab, in ath11k_dp_rx_pdev_srng_alloc()
628 if (!ar->ab->hw_params.rxdma1_enable) { in ath11k_dp_rx_pdev_srng_alloc()
630 timer_setup(&ar->ab->mon_reap_timer, 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()
645 ret = ath11k_dp_srng_setup(ar->ab, &dp->rxdma_mon_dst_ring, in ath11k_dp_rx_pdev_srng_alloc()
649 ath11k_warn(ar->ab, in ath11k_dp_rx_pdev_srng_alloc()
654 ret = ath11k_dp_srng_setup(ar->ab, &dp->rxdma_mon_desc_ring, in ath11k_dp_rx_pdev_srng_alloc()
658 ath11k_warn(ar->ab, in ath11k_dp_rx_pdev_srng_alloc()
666 void ath11k_dp_reo_cmd_list_cleanup(struct ath11k_base *ab) in ath11k_dp_reo_cmd_list_cleanup() argument
668 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_reo_cmd_list_cleanup()
678 dma_unmap_single(ab->dev, rx_tid->paddr, in ath11k_dp_reo_cmd_list_cleanup()
692 dma_unmap_single(ab->dev, rx_tid->paddr, in ath11k_dp_reo_cmd_list_cleanup()
708 ath11k_warn(dp->ab, "failed to flush rx tid hw desc, tid %d status %d\n", in ath11k_dp_reo_cmd_free()
711 dma_unmap_single(dp->ab->dev, rx_tid->paddr, rx_tid->size, in ath11k_dp_reo_cmd_free()
718 static void ath11k_dp_reo_cache_flush(struct ath11k_base *ab, in ath11k_dp_reo_cache_flush() argument
732 ret = ath11k_dp_tx_send_reo_cmd(ab, rx_tid, in ath11k_dp_reo_cache_flush()
736 ath11k_warn(ab, in ath11k_dp_reo_cache_flush()
745 ret = ath11k_dp_tx_send_reo_cmd(ab, rx_tid, in ath11k_dp_reo_cache_flush()
749 ath11k_err(ab, "failed to send HAL_REO_CMD_FLUSH_CACHE cmd, tid %d (%d)\n", in ath11k_dp_reo_cache_flush()
751 dma_unmap_single(ab->dev, rx_tid->paddr, rx_tid->size, in ath11k_dp_reo_cache_flush()
761 struct ath11k_base *ab = dp->ab; in ath11k_dp_rx_tid_del_func() local
769 ath11k_warn(ab, "failed to delete rx tid %d hw descriptor %d\n", in ath11k_dp_rx_tid_del_func()
795 ath11k_dp_reo_cache_flush(ab, &elem->data); in ath11k_dp_rx_tid_del_func()
804 dma_unmap_single(ab->dev, rx_tid->paddr, rx_tid->size, in ath11k_dp_rx_tid_del_func()
826 ret = ath11k_dp_tx_send_reo_cmd(ar->ab, rx_tid, in ath11k_peer_rx_tid_delete()
831 ath11k_err(ar->ab, "failed to send HAL_REO_CMD_UPDATE_RX_QUEUE cmd, tid %d (%d)\n", in ath11k_peer_rx_tid_delete()
833 dma_unmap_single(ar->ab->dev, rx_tid->paddr, rx_tid->size, in ath11k_peer_rx_tid_delete()
843 static int ath11k_dp_rx_link_desc_return(struct ath11k_base *ab, in ath11k_dp_rx_link_desc_return() argument
847 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_rx_link_desc_return()
852 srng = &ab->hal.srng_list[dp->wbm_desc_rel_ring.ring_id]; in ath11k_dp_rx_link_desc_return()
856 ath11k_hal_srng_access_begin(ab, srng); in ath11k_dp_rx_link_desc_return()
858 desc = ath11k_hal_srng_src_get_next_entry(ab, srng); in ath11k_dp_rx_link_desc_return()
864 ath11k_hal_rx_msdu_link_desc_set(ab, (void *)desc, (void *)link_desc, in ath11k_dp_rx_link_desc_return()
868 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_rx_link_desc_return()
877 struct ath11k_base *ab = rx_tid->ab; in ath11k_dp_rx_frags_cleanup() local
879 lockdep_assert_held(&ab->base_lock); in ath11k_dp_rx_frags_cleanup()
883 ath11k_dp_rx_link_desc_return(ab, (u32 *)rx_tid->dst_ring_desc, in ath11k_dp_rx_frags_cleanup()
900 lockdep_assert_held(&ar->ab->base_lock); in ath11k_peer_frags_flush()
905 spin_unlock_bh(&ar->ab->base_lock); in ath11k_peer_frags_flush()
907 spin_lock_bh(&ar->ab->base_lock); in ath11k_peer_frags_flush()
918 lockdep_assert_held(&ar->ab->base_lock); in ath11k_peer_rx_tid_cleanup()
926 spin_unlock_bh(&ar->ab->base_lock); in ath11k_peer_rx_tid_cleanup()
928 spin_lock_bh(&ar->ab->base_lock); in ath11k_peer_rx_tid_cleanup()
952 ret = ath11k_dp_tx_send_reo_cmd(ar->ab, rx_tid, in ath11k_peer_rx_tid_reo_update()
956 ath11k_warn(ar->ab, "failed to update rx tid queue, tid %d (%d)\n", in ath11k_peer_rx_tid_reo_update()
966 static void ath11k_dp_rx_tid_mem_free(struct ath11k_base *ab, in ath11k_dp_rx_tid_mem_free() argument
972 spin_lock_bh(&ab->base_lock); in ath11k_dp_rx_tid_mem_free()
974 peer = ath11k_peer_find(ab, vdev_id, peer_mac); in ath11k_dp_rx_tid_mem_free()
976 ath11k_warn(ab, "failed to find the peer to free up rx tid mem\n"); in ath11k_dp_rx_tid_mem_free()
984 dma_unmap_single(ab->dev, rx_tid->paddr, rx_tid->size, in ath11k_dp_rx_tid_mem_free()
992 spin_unlock_bh(&ab->base_lock); in ath11k_dp_rx_tid_mem_free()
999 struct ath11k_base *ab = ar->ab; in ath11k_peer_rx_tid_setup() local
1008 spin_lock_bh(&ab->base_lock); in ath11k_peer_rx_tid_setup()
1010 peer = ath11k_peer_find(ab, vdev_id, peer_mac); in ath11k_peer_rx_tid_setup()
1012 ath11k_warn(ab, "failed to find the peer %pM to set up rx tid\n", in ath11k_peer_rx_tid_setup()
1014 spin_unlock_bh(&ab->base_lock); in ath11k_peer_rx_tid_setup()
1024 spin_unlock_bh(&ab->base_lock); in ath11k_peer_rx_tid_setup()
1026 ath11k_warn(ab, "failed to update reo for peer %pM rx tid %d\n: %d", in ath11k_peer_rx_tid_setup()
1035 ath11k_warn(ab, "failed to send wmi rx reorder queue for peer %pM tid %d: %d\n", in ath11k_peer_rx_tid_setup()
1054 spin_unlock_bh(&ab->base_lock); in ath11k_peer_rx_tid_setup()
1063 paddr = dma_map_single(ab->dev, addr_aligned, hw_desc_sz, in ath11k_peer_rx_tid_setup()
1066 ret = dma_mapping_error(ab->dev, paddr); in ath11k_peer_rx_tid_setup()
1068 spin_unlock_bh(&ab->base_lock); in ath11k_peer_rx_tid_setup()
1069 ath11k_warn(ab, "failed to setup dma map for peer %pM rx tid %d: %d\n", in ath11k_peer_rx_tid_setup()
1079 spin_unlock_bh(&ab->base_lock); in ath11k_peer_rx_tid_setup()
1084 ath11k_warn(ar->ab, "failed to setup rx reorder queue for peer %pM tid %d: %d\n", in ath11k_peer_rx_tid_setup()
1086 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()
1296 ath11k_warn(ab, "Invalid len %d for the tag 0x%x\n", in ath11k_htt_tlv_ppdu_stats_parse()
1320 ath11k_warn(ab, "Invalid len %d for the tag 0x%x\n", in ath11k_htt_tlv_ppdu_stats_parse()
1347 int ath11k_dp_htt_tlv_iter(struct ath11k_base *ab, const void *ptr, size_t len, in ath11k_dp_htt_tlv_iter() argument
1349 int ath11k_dp_htt_tlv_iter(struct ath11k_base *ab, const u8 *ptr, size_t len, in ath11k_dp_htt_tlv_iter()
1366 ath11k_err(ab, "htt tlv parse failure at byte %zd (%zu bytes left, %zu expected)\n", in ath11k_dp_htt_tlv_iter()
1381 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()
1385 ret = iter(ab, tlv_tag, tlv_len, ptr, data); in ath11k_dp_htt_tlv_iter()
1399 struct ath11k_base *ab = ar->ab; in ath11k_update_per_peer_tx_stats() local
1451 ath11k_warn(ab, "Invalid HE mcs %d peer stats", mcs); in ath11k_update_per_peer_tx_stats()
1456 ath11k_warn(ab, "Invalid VHT mcs %d peer stats", mcs); in ath11k_update_per_peer_tx_stats()
1461 ath11k_warn(ab, "Invalid HT mcs %d nss %d peer stats", in ath11k_update_per_peer_tx_stats()
1476 spin_lock_bh(&ab->base_lock); in ath11k_update_per_peer_tx_stats()
1477 peer = ath11k_peer_find_by_id(ab, usr_stats->peer_id); in ath11k_update_per_peer_tx_stats()
1480 spin_unlock_bh(&ab->base_lock); in ath11k_update_per_peer_tx_stats()
1543 spin_unlock_bh(&ab->base_lock); in ath11k_update_per_peer_tx_stats()
1590 static int ath11k_htt_pull_ppdu_stats(struct ath11k_base *ab, in ath11k_htt_pull_ppdu_stats() argument
1606 ar = ath11k_mac_get_ar_by_pdev_id(ab, pdev_id); in ath11k_htt_pull_ppdu_stats()
1623 ret = ath11k_dp_htt_tlv_iter(ab, msg->data, len, in ath11k_htt_pull_ppdu_stats()
1627 ath11k_warn(ab, "Failed to parse tlv %d\n", ret); in ath11k_htt_pull_ppdu_stats()
1640 static void ath11k_htt_pktlog(struct ath11k_base *ab, struct sk_buff *skb) in ath11k_htt_pktlog() argument
1648 ar = ath11k_mac_get_ar_by_pdev_id(ab, pdev_id); in ath11k_htt_pktlog()
1650 ath11k_warn(ab, "invalid pdev id %d on htt pktlog\n", pdev_id); in ath11k_htt_pktlog()
1655 ar->ab->pktlog_defs_checksum); in ath11k_htt_pktlog()
1658 static void ath11k_htt_backpressure_event_handler(struct ath11k_base *ab, in ath11k_htt_backpressure_event_handler() argument
1678 …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()
1685 bp_stats = &ab->soc_stats.bp_stats.umac_ring_bp_stats[ring_id]; in ath11k_htt_backpressure_event_handler()
1692 bp_stats = &ab->soc_stats.bp_stats.lmac_ring_bp_stats[ring_id][pdev_idx]; in ath11k_htt_backpressure_event_handler()
1694 ath11k_warn(ab, "unknown ring type received in htt bp event %d\n", in ath11k_htt_backpressure_event_handler()
1699 spin_lock_bh(&ab->base_lock); in ath11k_htt_backpressure_event_handler()
1704 spin_unlock_bh(&ab->base_lock); in ath11k_htt_backpressure_event_handler()
1707 void ath11k_dp_htt_htc_t2h_msg_handler(struct ath11k_base *ab, in ath11k_dp_htt_htc_t2h_msg_handler() argument
1710 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_htt_htc_t2h_msg_handler()
1720 ath11k_dbg(ab, ATH11K_DBG_DP_HTT, "dp_htt rx msg type :0x%0x\n", type); in ath11k_dp_htt_htc_t2h_msg_handler()
1739 ath11k_peer_map_event(ab, vdev_id, peer_id, mac_addr, 0, 0); in ath11k_dp_htt_htc_t2h_msg_handler()
1754 ath11k_peer_map_event(ab, vdev_id, peer_id, mac_addr, ast_hash, in ath11k_dp_htt_htc_t2h_msg_handler()
1761 ath11k_peer_unmap_event(ab, peer_id); in ath11k_dp_htt_htc_t2h_msg_handler()
1764 ath11k_htt_pull_ppdu_stats(ab, skb); in ath11k_dp_htt_htc_t2h_msg_handler()
1767 ath11k_debugfs_htt_ext_stats_handler(ab, skb); in ath11k_dp_htt_htc_t2h_msg_handler()
1770 ath11k_htt_pktlog(ab, skb); in ath11k_dp_htt_htc_t2h_msg_handler()
1773 ath11k_htt_backpressure_event_handler(ab, skb); in ath11k_dp_htt_htc_t2h_msg_handler()
1776 ath11k_warn(ab, "htt event %d not handled\n", type); in ath11k_dp_htt_htc_t2h_msg_handler()
1788 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_msdu_coalesce() local
1794 u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_msdu_coalesce()
1810 rxcb->is_first_msdu = ath11k_dp_rx_h_msdu_end_first_msdu(ab, ldesc); in ath11k_dp_rx_msdu_coalesce()
1811 rxcb->is_last_msdu = ath11k_dp_rx_h_msdu_end_last_msdu(ab, ldesc); in ath11k_dp_rx_msdu_coalesce()
1823 ath11k_dp_rx_desc_end_tlv_copy(ab, rxcb->rx_desc, ldesc); in ath11k_dp_rx_msdu_coalesce()
1892 rx_attention = ath11k_dp_rx_get_attention(ar->ab, rxcb->rx_desc); in ath11k_dp_rx_h_csum_offload()
1923 ath11k_warn(ar->ab, "unsupported encryption type %d for mic len\n", enctype); in ath11k_dp_rx_crypto_mic_len()
1951 ath11k_warn(ar->ab, "unsupported encryption type %d\n", enctype); in ath11k_dp_rx_crypto_param_len()
1976 ath11k_warn(ar->ab, "unsupported encryption type %d\n", enctype); in ath11k_dp_rx_crypto_icv_len()
2025 if (ath11k_dp_rx_h_msdu_start_mesh_ctl_present(ar->ab, rxcb->rx_desc)) in ath11k_dp_rx_h_undecap_nwifi()
2142 hdr = (struct ieee80211_hdr *)ath11k_dp_rx_h_80211_hdr(ar->ab, rxcb->rx_desc); in ath11k_dp_rx_h_find_rfc1042()
2224 first_hdr = ath11k_dp_rx_h_80211_hdr(ar->ab, rx_desc); in ath11k_dp_rx_h_undecap()
2225 decap = ath11k_dp_rx_h_msdu_start_decap_type(ar->ab, rx_desc); in ath11k_dp_rx_h_undecap()
2261 ath11k_dp_rx_h_find_peer(struct ath11k_base *ab, struct sk_buff *msdu) in ath11k_dp_rx_h_find_peer() argument
2267 lockdep_assert_held(&ab->base_lock); in ath11k_dp_rx_h_find_peer()
2270 peer = ath11k_peer_find_by_id(ab, rxcb->peer_id); in ath11k_dp_rx_h_find_peer()
2275 if (!rx_desc || !(ath11k_dp_rxdesc_mac_addr2_valid(ab, rx_desc))) in ath11k_dp_rx_h_find_peer()
2278 peer = ath11k_peer_find_by_addr(ab, in ath11k_dp_rx_h_find_peer()
2279 ath11k_dp_rxdesc_mpdu_start_addr2(ab, rx_desc)); in ath11k_dp_rx_h_find_peer()
2299 fill_crypto_hdr = ath11k_dp_rx_h_attn_is_mcbc(ar->ab, rx_desc); in ath11k_dp_rx_h_mpdu()
2303 rxcb->peer_id = ath11k_dp_rx_h_mpdu_start_peer_id(ar->ab, rx_desc); in ath11k_dp_rx_h_mpdu()
2304 rxcb->seq_no = ath11k_dp_rx_h_mpdu_start_seq_no(ar->ab, rx_desc); in ath11k_dp_rx_h_mpdu()
2307 spin_lock_bh(&ar->ab->base_lock); in ath11k_dp_rx_h_mpdu()
2308 peer = ath11k_dp_rx_h_find_peer(ar->ab, msdu); in ath11k_dp_rx_h_mpdu()
2315 enctype = ath11k_dp_rx_h_mpdu_start_enctype(ar->ab, rx_desc); in ath11k_dp_rx_h_mpdu()
2317 spin_unlock_bh(&ar->ab->base_lock); in ath11k_dp_rx_h_mpdu()
2319 rx_attention = ath11k_dp_rx_get_attention(ar->ab, rx_desc); in ath11k_dp_rx_h_mpdu()
2354 if (ath11k_dp_rx_h_msdu_start_decap_type(ar->ab, rx_desc) != in ath11k_dp_rx_h_mpdu()
2371 pkt_type = ath11k_dp_rx_h_msdu_start_pkt_type(ar->ab, rx_desc); in ath11k_dp_rx_h_rate()
2372 bw = ath11k_dp_rx_h_msdu_start_rx_bw(ar->ab, rx_desc); in ath11k_dp_rx_h_rate()
2373 rate_mcs = ath11k_dp_rx_h_msdu_start_rate_mcs(ar->ab, rx_desc); in ath11k_dp_rx_h_rate()
2374 nss = ath11k_dp_rx_h_msdu_start_nss(ar->ab, rx_desc); in ath11k_dp_rx_h_rate()
2375 sgi = ath11k_dp_rx_h_msdu_start_sgi(ar->ab, rx_desc); in ath11k_dp_rx_h_rate()
2388 ath11k_warn(ar->ab, in ath11k_dp_rx_h_rate()
2402 ath11k_warn(ar->ab, in ath11k_dp_rx_h_rate()
2411 is_ldpc = ath11k_dp_rx_h_msdu_start_ldpc_support(ar->ab, rx_desc); in ath11k_dp_rx_h_rate()
2418 ath11k_warn(ar->ab, in ath11k_dp_rx_h_rate()
2446 meta_data = ath11k_dp_rx_h_msdu_start_freq(ar->ab, rx_desc); in ath11k_dp_rx_h_ppdu()
2467 ath11k_dbg_dump(ar->ab, ATH11K_DBG_DATA, NULL, "rx_desc: ", in ath11k_dp_rx_h_ppdu()
2505 decap = ath11k_dp_rx_h_msdu_start_decap_type(ar->ab, rxcb->rx_desc); in ath11k_dp_rx_deliver_msdu()
2507 spin_lock_bh(&ar->ab->base_lock); in ath11k_dp_rx_deliver_msdu()
2508 peer = ath11k_dp_rx_h_find_peer(ar->ab, msdu); in ath11k_dp_rx_deliver_msdu()
2511 spin_unlock_bh(&ar->ab->base_lock); in ath11k_dp_rx_deliver_msdu()
2513 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_deliver_msdu()
2537 ath11k_dbg_dump(ar->ab, ATH11K_DBG_DP_RX, NULL, "dp rx msdu: ", in ath11k_dp_rx_deliver_msdu()
2562 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_process_msdu() local
2571 u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_process_msdu()
2575 ath11k_warn(ab, in ath11k_dp_rx_process_msdu()
2582 if (ath11k_dp_rx_h_attn_msdu_len_err(ab, rx_desc)) { in ath11k_dp_rx_process_msdu()
2583 ath11k_warn(ar->ab, "msdu len not valid\n"); in ath11k_dp_rx_process_msdu()
2589 rx_attention = ath11k_dp_rx_get_attention(ab, lrx_desc); in ath11k_dp_rx_process_msdu()
2591 ath11k_warn(ab, "msdu_done bit in attention is not set\n"); in ath11k_dp_rx_process_msdu()
2598 msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(ab, rx_desc); in ath11k_dp_rx_process_msdu()
2599 l3_pad_bytes = ath11k_dp_rx_h_msdu_end_l3pad(ab, lrx_desc); in ath11k_dp_rx_process_msdu()
2605 hdr_status = ath11k_dp_rx_h_80211_hdr(ab, rx_desc); in ath11k_dp_rx_process_msdu()
2607 ath11k_warn(ab, "invalid msdu len %u\n", msdu_len); in ath11k_dp_rx_process_msdu()
2608 ath11k_dbg_dump(ab, ATH11K_DBG_DATA, NULL, "", hdr_status, in ath11k_dp_rx_process_msdu()
2610 ath11k_dbg_dump(ab, ATH11K_DBG_DATA, NULL, "", rx_desc, in ath11k_dp_rx_process_msdu()
2621 ath11k_warn(ab, in ath11k_dp_rx_process_msdu()
2638 static void ath11k_dp_rx_process_received_packets(struct ath11k_base *ab, in ath11k_dp_rx_process_received_packets() argument
2651 if (unlikely(!rcu_access_pointer(ab->pdevs_active[mac_id]))) { in ath11k_dp_rx_process_received_packets()
2656 ar = ab->pdevs[mac_id].ar; in ath11k_dp_rx_process_received_packets()
2665 ath11k_dbg(ab, ATH11K_DBG_DATA, in ath11k_dp_rx_process_received_packets()
2675 int ath11k_dp_process_rx(struct ath11k_base *ab, int ring_id, in ath11k_dp_process_rx() argument
2678 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_process_rx()
2697 srng = &ab->hal.srng_list[dp->reo_dst_ring[ring_id].ring_id]; in ath11k_dp_process_rx()
2702 ath11k_hal_srng_access_begin(ab, srng); in ath11k_dp_process_rx()
2705 (struct hal_reo_dest_ring *)ath11k_hal_srng_dst_get_next_entry(ab, in ath11k_dp_process_rx()
2716 ar = ab->pdevs[mac_id].ar; in ath11k_dp_process_rx()
2721 ath11k_warn(ab, "frame rx with invalid buf_id %d\n", in ath11k_dp_process_rx()
2731 dma_unmap_single(ab->dev, rxcb->paddr, in ath11k_dp_process_rx()
2742 ab->soc_stats.hal_reo_error[dp->reo_dst_ring[ring_id].ring_id]++; in ath11k_dp_process_rx()
2779 if (unlikely(!done && ath11k_hal_srng_dst_num_free(ab, srng, true))) { in ath11k_dp_process_rx()
2780 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_process_rx()
2784 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_process_rx()
2791 for (i = 0; i < ab->num_radios; i++) { in ath11k_dp_process_rx()
2795 ath11k_dp_rx_process_received_packets(ab, napi, &msdu_list[i], i); in ath11k_dp_process_rx()
2797 ar = ab->pdevs[i].ar; in ath11k_dp_process_rx()
2800 ath11k_dp_rxbufs_replenish(ab, i, rx_ring, num_buffs_reaped[i], in ath11k_dp_process_rx()
2801 ab->hw_params.hal_params->rx_buf_rbm); in ath11k_dp_process_rx()
2888 static struct sk_buff *ath11k_dp_rx_alloc_mon_status_buf(struct ath11k_base *ab, in ath11k_dp_rx_alloc_mon_status_buf() argument
2907 paddr = dma_map_single(ab->dev, skb->data, in ath11k_dp_rx_alloc_mon_status_buf()
2910 if (unlikely(dma_mapping_error(ab->dev, paddr))) in ath11k_dp_rx_alloc_mon_status_buf()
2924 dma_unmap_single(ab->dev, paddr, skb->len + skb_tailroom(skb), in ath11k_dp_rx_alloc_mon_status_buf()
2932 int ath11k_dp_rx_mon_status_bufs_replenish(struct ath11k_base *ab, int mac_id, in ath11k_dp_rx_mon_status_bufs_replenish() argument
2948 srng = &ab->hal.srng_list[rx_ring->refill_buf_ring.ring_id]; in ath11k_dp_rx_mon_status_bufs_replenish()
2952 ath11k_hal_srng_access_begin(ab, srng); in ath11k_dp_rx_mon_status_bufs_replenish()
2954 num_free = ath11k_hal_srng_src_num_free(ab, srng, true); in ath11k_dp_rx_mon_status_bufs_replenish()
2960 skb = ath11k_dp_rx_alloc_mon_status_buf(ab, rx_ring, in ath11k_dp_rx_mon_status_bufs_replenish()
2966 desc = ath11k_hal_srng_src_get_next_entry(ab, srng); in ath11k_dp_rx_mon_status_bufs_replenish()
2978 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_rx_mon_status_bufs_replenish()
2988 dma_unmap_single(ab->dev, paddr, skb->len + skb_tailroom(skb), in ath11k_dp_rx_mon_status_bufs_replenish()
2991 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_rx_mon_status_bufs_replenish()
3034 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
3053 ar = ab->pdevs[ath11k_hw_mac_id_to_pdev_id(&ab->hw_params, mac_id)].ar; in ath11k_dp_rx_reap_mon_status_ring()
3056 srng_id = ath11k_hw_mac_id_to_srng_id(&ab->hw_params, mac_id); in ath11k_dp_rx_reap_mon_status_ring()
3059 srng = &ab->hal.srng_list[rx_ring->refill_buf_ring.ring_id]; in ath11k_dp_rx_reap_mon_status_ring()
3063 ath11k_hal_srng_access_begin(ab, srng); in ath11k_dp_rx_reap_mon_status_ring()
3067 ath11k_hal_srng_src_peek(ab, srng); in ath11k_dp_rx_reap_mon_status_ring()
3083 ath11k_warn(ab, "rx monitor status with invalid buf_id %d\n", in ath11k_dp_rx_reap_mon_status_ring()
3091 dma_sync_single_for_cpu(ab->dev, rxcb->paddr, in ath11k_dp_rx_reap_mon_status_ring()
3098 ath11k_warn(ab, "mon status DONE not set %lx, buf_id %d\n", in ath11k_dp_rx_reap_mon_status_ring()
3115 if (ab->hw_params.full_monitor_mode) { in ath11k_dp_rx_reap_mon_status_ring()
3121 dma_unmap_single(ab->dev, rxcb->paddr, in ath11k_dp_rx_reap_mon_status_ring()
3130 skb = ath11k_dp_rx_alloc_mon_status_buf(ab, rx_ring, in ath11k_dp_rx_reap_mon_status_ring()
3134 hal_params = ab->hw_params.hal_params; in ath11k_dp_rx_reap_mon_status_ring()
3147 ab->hw_params.hal_params->rx_buf_rbm); in ath11k_dp_rx_reap_mon_status_ring()
3148 ath11k_hal_srng_src_get_next_entry(ab, srng); in ath11k_dp_rx_reap_mon_status_ring()
3151 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_rx_reap_mon_status_ring()
3161 spin_lock_bh(&rx_tid->ab->base_lock); in ath11k_dp_rx_frag_timer()
3164 spin_unlock_bh(&rx_tid->ab->base_lock); in ath11k_dp_rx_frag_timer()
3168 spin_unlock_bh(&rx_tid->ab->base_lock); in ath11k_dp_rx_frag_timer()
3173 struct ath11k_base *ab = ar->ab; in ath11k_peer_rx_frag_setup() local
3181 ath11k_warn(ab, "failed to allocate michael_mic shash: %ld\n", in ath11k_peer_rx_frag_setup()
3186 spin_lock_bh(&ab->base_lock); in ath11k_peer_rx_frag_setup()
3188 peer = ath11k_peer_find(ab, vdev_id, peer_mac); in ath11k_peer_rx_frag_setup()
3190 ath11k_warn(ab, "failed to find the peer to set up fragment info\n"); in ath11k_peer_rx_frag_setup()
3191 spin_unlock_bh(&ab->base_lock); in ath11k_peer_rx_frag_setup()
3198 rx_tid->ab = ab; in ath11k_peer_rx_frag_setup()
3205 spin_unlock_bh(&ab->base_lock); in ath11k_peer_rx_frag_setup()
3261 u32 hdr_len, hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_h_verify_tkip_mic()
3265 if (ath11k_dp_rx_h_mpdu_start_enctype(ar->ab, rx_desc) != in ath11k_dp_rx_h_verify_tkip_mic()
3312 u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_h_undecap_frag()
3355 u32 flags, hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_h_defrag()
3365 enctype = ath11k_dp_rx_h_mpdu_start_enctype(ar->ab, rx_desc); in ath11k_dp_rx_h_defrag()
3367 rx_attention = ath11k_dp_rx_get_attention(ar->ab, rx_desc); in ath11k_dp_rx_h_defrag()
3415 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_h_defrag_reo_reinject() local
3430 hal_rx_desc_sz = ab->hw_params.hal_desc_sz; in ath11k_dp_rx_h_defrag_reo_reinject()
3431 link_desc_banks = ab->dp.link_desc_banks; in ath11k_dp_rx_h_defrag_reo_reinject()
3434 ath11k_hal_rx_reo_ent_paddr_get(ab, reo_dest_ring, &paddr, &desc_bank); in ath11k_dp_rx_h_defrag_reo_reinject()
3456 ath11k_dp_rxdesc_set_msdu_len(ab, rx_desc, defrag_skb->len - hal_rx_desc_sz); in ath11k_dp_rx_h_defrag_reo_reinject()
3458 paddr = dma_map_single(ab->dev, defrag_skb->data, in ath11k_dp_rx_h_defrag_reo_reinject()
3461 if (dma_mapping_error(ab->dev, paddr)) in ath11k_dp_rx_h_defrag_reo_reinject()
3478 ab->hw_params.hal_params->rx_buf_rbm); in ath11k_dp_rx_h_defrag_reo_reinject()
3481 srng = &ab->hal.srng_list[ab->dp.reo_reinject_ring.ring_id]; in ath11k_dp_rx_h_defrag_reo_reinject()
3484 ath11k_hal_srng_access_begin(ab, srng); in ath11k_dp_rx_h_defrag_reo_reinject()
3487 ath11k_hal_srng_src_get_next_entry(ab, srng); in ath11k_dp_rx_h_defrag_reo_reinject()
3489 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_rx_h_defrag_reo_reinject()
3496 ath11k_hal_rx_reo_ent_paddr_get(ab, reo_dest_ring, &paddr, &desc_bank); in ath11k_dp_rx_h_defrag_reo_reinject()
3515 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_rx_h_defrag_reo_reinject()
3525 dma_unmap_single(ab->dev, paddr, defrag_skb->len + skb_tailroom(defrag_skb), in ath11k_dp_rx_h_defrag_reo_reinject()
3535 frag1 = ath11k_dp_rx_h_mpdu_start_frag_no(ar->ab, a); in ath11k_dp_rx_h_cmp_frags()
3536 frag2 = ath11k_dp_rx_h_mpdu_start_frag_no(ar->ab, b); in ath11k_dp_rx_h_cmp_frags()
3563 u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_h_get_pn()
3590 encrypt_type = ath11k_dp_rx_h_mpdu_start_enctype(ar->ab, desc); in ath11k_dp_rx_h_defrag_validate_incr_pn()
3614 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_frag_h_mpdu() local
3627 peer_id = ath11k_dp_rx_h_mpdu_start_peer_id(ar->ab, rx_desc); in ath11k_dp_rx_frag_h_mpdu()
3628 tid = ath11k_dp_rx_h_mpdu_start_tid(ar->ab, rx_desc); in ath11k_dp_rx_frag_h_mpdu()
3629 seqno = ath11k_dp_rx_h_mpdu_start_seq_no(ar->ab, rx_desc); in ath11k_dp_rx_frag_h_mpdu()
3630 frag_no = ath11k_dp_rx_h_mpdu_start_frag_no(ar->ab, msdu); in ath11k_dp_rx_frag_h_mpdu()
3631 more_frags = ath11k_dp_rx_h_mpdu_start_more_frags(ar->ab, msdu); in ath11k_dp_rx_frag_h_mpdu()
3632 is_mcbc = ath11k_dp_rx_h_attn_is_mcbc(ar->ab, rx_desc); in ath11k_dp_rx_frag_h_mpdu()
3638 if (!ath11k_dp_rx_h_mpdu_start_seq_ctrl_valid(ar->ab, rx_desc) || in ath11k_dp_rx_frag_h_mpdu()
3639 !ath11k_dp_rx_h_mpdu_start_fc_valid(ar->ab, rx_desc) || in ath11k_dp_rx_frag_h_mpdu()
3651 spin_lock_bh(&ab->base_lock); in ath11k_dp_rx_frag_h_mpdu()
3652 peer = ath11k_peer_find_by_id(ab, peer_id); in ath11k_dp_rx_frag_h_mpdu()
3654 ath11k_warn(ab, "failed to find the peer to de-fragment received fragment peer_id %d\n", in ath11k_dp_rx_frag_h_mpdu()
3660 ath11k_warn(ab, "The peer %pM [%d] has uninitialized datapath\n", in ath11k_dp_rx_frag_h_mpdu()
3699 ath11k_dp_rx_link_desc_return(ab, ring_desc, in ath11k_dp_rx_frag_h_mpdu()
3710 spin_unlock_bh(&ab->base_lock); in ath11k_dp_rx_frag_h_mpdu()
3712 spin_lock_bh(&ab->base_lock); in ath11k_dp_rx_frag_h_mpdu()
3714 peer = ath11k_peer_find_by_id(ab, peer_id); in ath11k_dp_rx_frag_h_mpdu()
3737 spin_unlock_bh(&ab->base_lock); in ath11k_dp_rx_frag_h_mpdu()
3751 u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_process_rx_err_buf()
3756 ath11k_warn(ar->ab, "rx err buf with invalid buf_id %d\n", in ath11k_dp_process_rx_err_buf()
3766 dma_unmap_single(ar->ab->dev, rxcb->paddr, in ath11k_dp_process_rx_err_buf()
3776 if (!rcu_dereference(ar->ab->pdevs_active[ar->pdev_idx])) { in ath11k_dp_process_rx_err_buf()
3787 msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(ar->ab, rx_desc); in ath11k_dp_process_rx_err_buf()
3789 hdr_status = ath11k_dp_rx_h_80211_hdr(ar->ab, rx_desc); in ath11k_dp_process_rx_err_buf()
3790 ath11k_warn(ar->ab, "invalid msdu leng %u", msdu_len); in ath11k_dp_process_rx_err_buf()
3791 ath11k_dbg_dump(ar->ab, ATH11K_DBG_DATA, NULL, "", hdr_status, in ath11k_dp_process_rx_err_buf()
3793 ath11k_dbg_dump(ar->ab, ATH11K_DBG_DATA, NULL, "", rx_desc, in ath11k_dp_process_rx_err_buf()
3803 ath11k_dp_rx_link_desc_return(ar->ab, ring_desc, in ath11k_dp_process_rx_err_buf()
3811 int ath11k_dp_process_rx_err(struct ath11k_base *ab, struct napi_struct *napi, in ath11k_dp_process_rx_err() argument
3835 dp = &ab->dp; in ath11k_dp_process_rx_err()
3839 srng = &ab->hal.srng_list[reo_except->ring_id]; in ath11k_dp_process_rx_err()
3843 ath11k_hal_srng_access_begin(ab, srng); in ath11k_dp_process_rx_err()
3846 (desc = ath11k_hal_srng_dst_get_next_entry(ab, srng))) { in ath11k_dp_process_rx_err()
3849 ab->soc_stats.err_ring_pkts++; in ath11k_dp_process_rx_err()
3850 ret = ath11k_hal_desc_reo_parse_err(ab, desc, &paddr, in ath11k_dp_process_rx_err()
3853 ath11k_warn(ab, "failed to parse error reo desc %d\n", in ath11k_dp_process_rx_err()
3867 ab->soc_stats.invalid_rbm++; in ath11k_dp_process_rx_err()
3868 ath11k_warn(ab, "invalid return buffer manager %d\n", rbm); in ath11k_dp_process_rx_err()
3869 ath11k_dp_rx_link_desc_return(ab, desc, in ath11k_dp_process_rx_err()
3882 ath11k_dp_rx_link_desc_return(ab, desc, in ath11k_dp_process_rx_err()
3893 ar = ab->pdevs[mac_id].ar; in ath11k_dp_process_rx_err()
3910 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_process_rx_err()
3914 for (i = 0; i < ab->num_radios; i++) { in ath11k_dp_process_rx_err()
3918 ar = ab->pdevs[i].ar; in ath11k_dp_process_rx_err()
3921 ath11k_dp_rxbufs_replenish(ab, i, rx_ring, n_bufs_reaped[i], in ath11k_dp_process_rx_err()
3922 ab->hw_params.hal_params->rx_buf_rbm); in ath11k_dp_process_rx_err()
3937 (DP_RX_BUFFER_SIZE - ar->ab->hw_params.hal_desc_sz)); in ath11k_dp_rx_null_q_desc_sg_drop()
3961 u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_h_null_q_desc()
3963 msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(ar->ab, desc); in ath11k_dp_rx_h_null_q_desc()
3972 rx_attention = ath11k_dp_rx_get_attention(ar->ab, desc); in ath11k_dp_rx_h_null_q_desc()
3974 ath11k_warn(ar->ab, in ath11k_dp_rx_h_null_q_desc()
3989 rxcb->is_first_msdu = ath11k_dp_rx_h_msdu_end_first_msdu(ar->ab, desc); in ath11k_dp_rx_h_null_q_desc()
3990 rxcb->is_last_msdu = ath11k_dp_rx_h_msdu_end_last_msdu(ar->ab, desc); in ath11k_dp_rx_h_null_q_desc()
3995 l3pad_bytes = ath11k_dp_rx_h_msdu_end_l3pad(ar->ab, desc); in ath11k_dp_rx_h_null_q_desc()
4007 rxcb->tid = ath11k_dp_rx_h_mpdu_start_tid(ar->ab, desc); in ath11k_dp_rx_h_null_q_desc()
4023 ar->ab->soc_stats.reo_error[rxcb->err_code]++; in ath11k_dp_rx_h_reo_err()
4054 u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_h_tkip_mic_err()
4056 rxcb->is_first_msdu = ath11k_dp_rx_h_msdu_end_first_msdu(ar->ab, desc); in ath11k_dp_rx_h_tkip_mic_err()
4057 rxcb->is_last_msdu = ath11k_dp_rx_h_msdu_end_last_msdu(ar->ab, desc); in ath11k_dp_rx_h_tkip_mic_err()
4059 l3pad_bytes = ath11k_dp_rx_h_msdu_end_l3pad(ar->ab, desc); in ath11k_dp_rx_h_tkip_mic_err()
4060 msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(ar->ab, desc); in ath11k_dp_rx_h_tkip_mic_err()
4079 ar->ab->soc_stats.rxdma_error[rxcb->err_code]++; in ath11k_dp_rx_h_rxdma_err()
4125 int ath11k_dp_rx_process_wbm_err(struct ath11k_base *ab, in ath11k_dp_rx_process_wbm_err() argument
4129 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_rx_process_wbm_err()
4142 for (i = 0; i < ab->num_radios; i++) in ath11k_dp_rx_process_wbm_err()
4145 srng = &ab->hal.srng_list[dp->rx_rel_ring.ring_id]; in ath11k_dp_rx_process_wbm_err()
4149 ath11k_hal_srng_access_begin(ab, srng); in ath11k_dp_rx_process_wbm_err()
4152 rx_desc = ath11k_hal_srng_dst_get_next_entry(ab, srng); in ath11k_dp_rx_process_wbm_err()
4156 ret = ath11k_hal_wbm_desc_parse_err(ab, rx_desc, &err_info); in ath11k_dp_rx_process_wbm_err()
4158 ath11k_warn(ab, in ath11k_dp_rx_process_wbm_err()
4167 ar = ab->pdevs[mac_id].ar; in ath11k_dp_rx_process_wbm_err()
4173 ath11k_warn(ab, "frame rx with invalid buf_id %d pdev %d\n", in ath11k_dp_rx_process_wbm_err()
4183 dma_unmap_single(ab->dev, rxcb->paddr, in ath11k_dp_rx_process_wbm_err()
4203 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_rx_process_wbm_err()
4210 for (i = 0; i < ab->num_radios; i++) { in ath11k_dp_rx_process_wbm_err()
4214 ar = ab->pdevs[i].ar; in ath11k_dp_rx_process_wbm_err()
4217 ath11k_dp_rxbufs_replenish(ab, i, rx_ring, num_buffs_reaped[i], in ath11k_dp_rx_process_wbm_err()
4218 ab->hw_params.hal_params->rx_buf_rbm); in ath11k_dp_rx_process_wbm_err()
4222 for (i = 0; i < ab->num_radios; i++) { in ath11k_dp_rx_process_wbm_err()
4223 if (!rcu_dereference(ab->pdevs_active[i])) { in ath11k_dp_rx_process_wbm_err()
4228 ar = ab->pdevs[i].ar; in ath11k_dp_rx_process_wbm_err()
4243 int ath11k_dp_process_rxdma_err(struct ath11k_base *ab, int mac_id, int budget) in ath11k_dp_process_rxdma_err() argument
4248 struct dp_link_desc_bank *link_desc_banks = ab->dp.link_desc_banks; in ath11k_dp_process_rxdma_err()
4266 ar = ab->pdevs[ath11k_hw_mac_id_to_pdev_id(&ab->hw_params, mac_id)].ar; in ath11k_dp_process_rxdma_err()
4267 err_ring = &ar->dp.rxdma_err_dst_ring[ath11k_hw_mac_id_to_srng_id(&ab->hw_params, in ath11k_dp_process_rxdma_err()
4271 srng = &ab->hal.srng_list[err_ring->ring_id]; in ath11k_dp_process_rxdma_err()
4275 ath11k_hal_srng_access_begin(ab, srng); in ath11k_dp_process_rxdma_err()
4278 (desc = ath11k_hal_srng_dst_get_next_entry(ab, srng))) { in ath11k_dp_process_rxdma_err()
4279 ath11k_hal_rx_reo_ent_paddr_get(ab, desc, &paddr, &desc_bank); in ath11k_dp_process_rxdma_err()
4285 ab->soc_stats.rxdma_error[rxdma_err_code]++; in ath11k_dp_process_rxdma_err()
4303 ath11k_warn(ab, "rxdma error with invalid buf_id %d\n", in ath11k_dp_process_rxdma_err()
4313 dma_unmap_single(ab->dev, rxcb->paddr, in ath11k_dp_process_rxdma_err()
4321 ath11k_dp_rx_link_desc_return(ab, desc, in ath11k_dp_process_rxdma_err()
4325 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_process_rxdma_err()
4330 ath11k_dp_rxbufs_replenish(ab, mac_id, rx_ring, num_buf_freed, in ath11k_dp_process_rxdma_err()
4331 ab->hw_params.hal_params->rx_buf_rbm); in ath11k_dp_process_rxdma_err()
4336 void ath11k_dp_process_reo_status(struct ath11k_base *ab) in ath11k_dp_process_reo_status() argument
4338 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_process_reo_status()
4346 srng = &ab->hal.srng_list[dp->reo_status_ring.ring_id]; in ath11k_dp_process_reo_status()
4352 ath11k_hal_srng_access_begin(ab, srng); in ath11k_dp_process_reo_status()
4354 while ((reo_desc = ath11k_hal_srng_dst_get_next_entry(ab, srng))) { in ath11k_dp_process_reo_status()
4359 ath11k_hal_reo_status_queue_stats(ab, reo_desc, in ath11k_dp_process_reo_status()
4363 ath11k_hal_reo_flush_queue_status(ab, reo_desc, in ath11k_dp_process_reo_status()
4367 ath11k_hal_reo_flush_cache_status(ab, reo_desc, in ath11k_dp_process_reo_status()
4371 ath11k_hal_reo_unblk_cache_status(ab, reo_desc, in ath11k_dp_process_reo_status()
4375 ath11k_hal_reo_flush_timeout_list_status(ab, reo_desc, in ath11k_dp_process_reo_status()
4379 ath11k_hal_reo_desc_thresh_reached_status(ab, reo_desc, in ath11k_dp_process_reo_status()
4383 ath11k_hal_reo_update_rx_reo_queue_status(ab, reo_desc, in ath11k_dp_process_reo_status()
4387 ath11k_warn(ab, "Unknown reo status type %d\n", tag); in ath11k_dp_process_reo_status()
4410 ath11k_hal_srng_access_end(ab, srng); in ath11k_dp_process_reo_status()
4415 void ath11k_dp_rx_pdev_free(struct ath11k_base *ab, int mac_id) in ath11k_dp_rx_pdev_free() argument
4417 struct ath11k *ar = ab->pdevs[mac_id].ar; in ath11k_dp_rx_pdev_free()
4423 int ath11k_dp_rx_pdev_alloc(struct ath11k_base *ab, int mac_id) in ath11k_dp_rx_pdev_alloc() argument
4425 struct ath11k *ar = ab->pdevs[mac_id].ar; in ath11k_dp_rx_pdev_alloc()
4433 ath11k_warn(ab, "failed to setup rx srngs\n"); in ath11k_dp_rx_pdev_alloc()
4439 ath11k_warn(ab, "failed to setup rxdma ring\n"); in ath11k_dp_rx_pdev_alloc()
4444 ret = ath11k_dp_tx_htt_srng_setup(ab, ring_id, mac_id, HAL_RXDMA_BUF); in ath11k_dp_rx_pdev_alloc()
4446 ath11k_warn(ab, "failed to configure rx_refill_buf_ring %d\n", in ath11k_dp_rx_pdev_alloc()
4451 if (ab->hw_params.rx_mac_buf_ring) { in ath11k_dp_rx_pdev_alloc()
4452 for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { in ath11k_dp_rx_pdev_alloc()
4454 ret = ath11k_dp_tx_htt_srng_setup(ab, ring_id, in ath11k_dp_rx_pdev_alloc()
4457 ath11k_warn(ab, "failed to configure rx_mac_buf_ring%d %d\n", in ath11k_dp_rx_pdev_alloc()
4464 for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { in ath11k_dp_rx_pdev_alloc()
4466 ret = ath11k_dp_tx_htt_srng_setup(ab, ring_id, in ath11k_dp_rx_pdev_alloc()
4469 ath11k_warn(ab, "failed to configure rxdma_err_dest_ring%d %d\n", in ath11k_dp_rx_pdev_alloc()
4475 if (!ab->hw_params.rxdma1_enable) in ath11k_dp_rx_pdev_alloc()
4479 ret = ath11k_dp_tx_htt_srng_setup(ab, ring_id, in ath11k_dp_rx_pdev_alloc()
4482 ath11k_warn(ab, "failed to configure rxdma_mon_buf_ring %d\n", in ath11k_dp_rx_pdev_alloc()
4486 ret = ath11k_dp_tx_htt_srng_setup(ab, in ath11k_dp_rx_pdev_alloc()
4490 ath11k_warn(ab, "failed to configure rxdma_mon_dst_ring %d\n", in ath11k_dp_rx_pdev_alloc()
4494 ret = ath11k_dp_tx_htt_srng_setup(ab, in ath11k_dp_rx_pdev_alloc()
4498 ath11k_warn(ab, "failed to configure rxdma_mon_dst_ring %d\n", in ath11k_dp_rx_pdev_alloc()
4504 for (i = 0; i < ab->hw_params.num_rxmda_per_pdev; i++) { in ath11k_dp_rx_pdev_alloc()
4506 ret = ath11k_dp_tx_htt_srng_setup(ab, ring_id, mac_id + i, in ath11k_dp_rx_pdev_alloc()
4509 ath11k_warn(ab, in ath11k_dp_rx_pdev_alloc()
4541 if (ar->ab->hw_params.rxdma1_enable) { in ath11k_dp_rx_monitor_link_desc_return()
4543 hal_srng = &ar->ab->hal.srng_list[dp_srng->ring_id]; in ath11k_dp_rx_monitor_link_desc_return()
4545 dp_srng = &ar->ab->dp.wbm_desc_rel_ring; in ath11k_dp_rx_monitor_link_desc_return()
4546 hal_srng = &ar->ab->hal.srng_list[dp_srng->ring_id]; in ath11k_dp_rx_monitor_link_desc_return()
4549 ath11k_hal_srng_access_begin(ar->ab, hal_srng); in ath11k_dp_rx_monitor_link_desc_return()
4551 src_srng_desc = ath11k_hal_srng_src_get_next_entry(ar->ab, hal_srng); in ath11k_dp_rx_monitor_link_desc_return()
4559 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_monitor_link_desc_return()
4564 ath11k_hal_srng_access_end(ar->ab, hal_srng); in ath11k_dp_rx_monitor_link_desc_return()
4719 if (!ar->ab->hw_params.rxdma1_enable) in ath11k_dp_rx_mon_mpdu_pop()
4750 if (ar->ab->hw_params.rxdma1_enable) in ath11k_dp_rx_mon_mpdu_pop()
4761 (void *)ar->ab->dp.link_desc_banks[sw_cookie].vaddr + in ath11k_dp_rx_mon_mpdu_pop()
4763 (u8 *)ar->ab->dp.link_desc_banks[sw_cookie].vaddr + in ath11k_dp_rx_mon_mpdu_pop()
4765 (paddr - ar->ab->dp.link_desc_banks[sw_cookie].paddr); in ath11k_dp_rx_mon_mpdu_pop()
4774 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_mon_mpdu_pop()
4788 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_mon_mpdu_pop()
4794 dma_unmap_single(ar->ab->dev, rxcb->paddr, in ath11k_dp_rx_mon_mpdu_pop()
4801 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_mon_mpdu_pop()
4812 l2_hdr_offset = ath11k_dp_rx_h_msdu_end_l3pad(ar->ab, rx_desc); in ath11k_dp_rx_mon_mpdu_pop()
4815 if (!ath11k_dp_rxdesc_mpdu_valid(ar->ab, rx_desc)) { in ath11k_dp_rx_mon_mpdu_pop()
4824 ath11k_dp_rxdesc_get_ppduid(ar->ab, rx_desc); in ath11k_dp_rx_mon_mpdu_pop()
4867 if (ar->ab->hw_params.rxdma1_enable) { in ath11k_dp_rx_mon_mpdu_pop()
4871 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_mon_mpdu_pop()
4874 ath11k_dp_rx_link_desc_return(ar->ab, rx_link_buf_info, in ath11k_dp_rx_mon_mpdu_pop()
4897 rx_pkt_offset = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_msdus_set_payload()
4898 l2_hdr_offset = ath11k_dp_rx_h_msdu_end_l3pad(ar->ab, in ath11k_dp_rx_msdus_set_payload()
4909 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_mon_merg_msdus() local
4922 rx_attention = ath11k_dp_rx_get_attention(ab, rx_desc); in ath11k_dp_rx_mon_merg_msdus()
4931 decap_format = ath11k_dp_rx_h_msdu_start_decap_type(ab, rx_desc); in ath11k_dp_rx_mon_merg_msdus()
4955 hdr_desc = ath11k_dp_rxdesc_get_80211hdr(ab, rx_desc); in ath11k_dp_rx_mon_merg_msdus()
4980 ath11k_dbg(ab, ATH11K_DBG_DATA, in ath11k_dp_rx_mon_merg_msdus()
4984 ath11k_dbg(ab, ATH11K_DBG_DATA, in ath11k_dp_rx_mon_merg_msdus()
5163 if (ar->ab->hw_params.rxdma1_enable) in ath11k_dp_rx_mon_dest_process()
5168 mon_dst_srng = &ar->ab->hal.srng_list[ring_id]; in ath11k_dp_rx_mon_dest_process()
5171 ath11k_warn(ar->ab, in ath11k_dp_rx_mon_dest_process()
5179 ath11k_hal_srng_access_begin(ar->ab, mon_dst_srng); in ath11k_dp_rx_mon_dest_process()
5185 while ((ring_entry = ath11k_hal_srng_dst_peek(ar->ab, mon_dst_srng))) { in ath11k_dp_rx_mon_dest_process()
5207 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_mon_dest_process()
5219 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_mon_dest_process()
5233 ring_entry = ath11k_hal_srng_dst_get_next_entry(ar->ab, in ath11k_dp_rx_mon_dest_process()
5236 ath11k_hal_srng_access_end(ar->ab, mon_dst_srng); in ath11k_dp_rx_mon_dest_process()
5242 hal_params = ar->ab->hw_params.hal_params; in ath11k_dp_rx_mon_dest_process()
5244 if (ar->ab->hw_params.rxdma1_enable) in ath11k_dp_rx_mon_dest_process()
5245 ath11k_dp_rxbufs_replenish(ar->ab, dp->mac_id, in ath11k_dp_rx_mon_dest_process()
5250 ath11k_dp_rxbufs_replenish(ar->ab, dp->mac_id, in ath11k_dp_rx_mon_dest_process()
5257 int ath11k_dp_rx_process_mon_status(struct ath11k_base *ab, int mac_id, in ath11k_dp_rx_process_mon_status() argument
5260 struct ath11k *ar = ath11k_ab_to_ar(ab, mac_id); in ath11k_dp_rx_process_mon_status()
5275 num_buffs_reaped = ath11k_dp_rx_reap_mon_status_ring(ab, mac_id, &budget, in ath11k_dp_rx_process_mon_status()
5300 hal_status = ath11k_hal_rx_parse_mon_status(ab, ppdu_info, skb); in ath11k_dp_rx_process_mon_status()
5318 spin_lock_bh(&ab->base_lock); in ath11k_dp_rx_process_mon_status()
5319 peer = ath11k_peer_find_by_id(ab, ppdu_info->peer_id); in ath11k_dp_rx_process_mon_status()
5322 ath11k_dbg(ab, ATH11K_DBG_DATA, in ath11k_dp_rx_process_mon_status()
5335 spin_unlock_bh(&ab->base_lock); in ath11k_dp_rx_process_mon_status()
5417 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_full_mon_mpdu_pop()
5428 dma_unmap_single(ar->ab->dev, rxcb->paddr, in ath11k_dp_rx_full_mon_mpdu_pop()
5435 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_full_mon_mpdu_pop()
5446 l2_hdr_offset = ath11k_dp_rx_h_msdu_end_l3pad(ar->ab, rx_desc); in ath11k_dp_rx_full_mon_mpdu_pop()
5449 if (!ath11k_dp_rxdesc_mpdu_valid(ar->ab, rx_desc)) { in ath11k_dp_rx_full_mon_mpdu_pop()
5485 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_full_mon_mpdu_pop()
5548 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_full_mon_deliver_ppdu() local
5549 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_rx_full_mon_deliver_ppdu()
5563 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, "full mon: deliver ppdu\n"); in ath11k_dp_rx_full_mon_deliver_ppdu()
5572 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
5575 struct ath11k *ar = ab->pdevs[mac_id].ar; in ath11k_dp_rx_process_full_mon_status_ring()
5584 quota = ath11k_dp_rx_process_mon_status(ab, mac_id, in ath11k_dp_rx_process_full_mon_status_ring()
5589 quota += ath11k_dp_rx_process_mon_status(ab, mac_id, in ath11k_dp_rx_process_full_mon_status_ring()
5609 ath11k_dp_rx_full_mon_drop_ppdu(&ab->dp, pmon->mon_mpdu); in ath11k_dp_rx_process_full_mon_status_ring()
5614 static int ath11k_dp_full_mon_process_rx(struct ath11k_base *ab, int mac_id, in ath11k_dp_full_mon_process_rx() argument
5617 struct ath11k *ar = ab->pdevs[mac_id].ar; in ath11k_dp_full_mon_process_rx()
5623 void *mon_dst_srng = &ar->ab->hal.srng_list[dp->rxdma_mon_dst_ring.ring_id]; in ath11k_dp_full_mon_process_rx()
5639 ath11k_hal_srng_access_begin(ar->ab, mon_dst_srng); in ath11k_dp_full_mon_process_rx()
5640 while ((ring_entry = ath11k_hal_srng_dst_peek(ar->ab, mon_dst_srng))) { in ath11k_dp_full_mon_process_rx()
5652 ret = ath11k_dp_rx_full_mon_prepare_mpdu(&ab->dp, in ath11k_dp_full_mon_process_rx()
5675 ring_entry = ath11k_hal_srng_dst_get_next_entry(ar->ab, in ath11k_dp_full_mon_process_rx()
5681 ath11k_hal_srng_access_end(ar->ab, mon_dst_srng); in ath11k_dp_full_mon_process_rx()
5685 ath11k_dp_rxbufs_replenish(ar->ab, dp->mac_id, in ath11k_dp_full_mon_process_rx()
5692 quota = ath11k_dp_rx_process_full_mon_status_ring(ab, mac_id, in ath11k_dp_full_mon_process_rx()
5698 int ath11k_dp_rx_process_mon_rings(struct ath11k_base *ab, int mac_id, in ath11k_dp_rx_process_mon_rings() argument
5701 struct ath11k *ar = ath11k_ab_to_ar(ab, mac_id); in ath11k_dp_rx_process_mon_rings()
5705 ab->hw_params.full_monitor_mode) in ath11k_dp_rx_process_mon_rings()
5706 ret = ath11k_dp_full_mon_process_rx(ab, mac_id, napi, budget); in ath11k_dp_rx_process_mon_rings()
5708 ret = ath11k_dp_rx_process_mon_status(ab, mac_id, napi, budget); in ath11k_dp_rx_process_mon_rings()
5738 ath11k_warn(ar->ab, "pdev_mon_status_attach() failed"); in ath11k_dp_rx_pdev_mon_attach()
5745 if (!ar->ab->hw_params.rxdma1_enable) in ath11k_dp_rx_pdev_mon_attach()
5750 ath11k_hal_srng_get_entrysize(ar->ab, HAL_RXDMA_MONITOR_DESC); in ath11k_dp_rx_pdev_mon_attach()
5752 &ar->ab->hal.srng_list[dp->rxdma_mon_desc_ring.ring_id]; in ath11k_dp_rx_pdev_mon_attach()
5754 ret = ath11k_dp_link_desc_setup(ar->ab, pmon->link_desc_banks, in ath11k_dp_rx_pdev_mon_attach()
5758 ath11k_warn(ar->ab, "mon_link_desc_pool_setup() failed"); in ath11k_dp_rx_pdev_mon_attach()
5773 ath11k_dp_link_desc_cleanup(ar->ab, pmon->link_desc_banks, in ath11k_dp_mon_link_free()
5785 int ath11k_dp_rx_pktlog_start(struct ath11k_base *ab) in ath11k_dp_rx_pktlog_start() argument
5788 mod_timer(&ab->mon_reap_timer, in ath11k_dp_rx_pktlog_start()
5794 int ath11k_dp_rx_pktlog_stop(struct ath11k_base *ab, bool stop_timer) in ath11k_dp_rx_pktlog_stop() argument
5799 del_timer_sync(&ab->mon_reap_timer); in ath11k_dp_rx_pktlog_stop()
5802 ret = ath11k_dp_purge_mon_ring(ab); in ath11k_dp_rx_pktlog_stop()
5804 ath11k_warn(ab, "failed to purge dp mon ring: %d\n", ret); in ath11k_dp_rx_pktlog_stop()