Lines Matching +full:tx +full:- +full:atten
1 // SPDX-License-Identifier: BSD-3-Clause-Clear
3 * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
4 * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
27 return ab->hw_params.hw_ops->rx_desc_get_hdr_status(desc); in ath11k_dp_rx_h_80211_hdr()
34 if (!ab->hw_params.hw_ops->rx_desc_encrypt_valid(desc)) in ath11k_dp_rx_h_mpdu_start_enctype()
37 return ab->hw_params.hw_ops->rx_desc_get_encrypt_type(desc); in ath11k_dp_rx_h_mpdu_start_enctype()
43 return ab->hw_params.hw_ops->rx_desc_get_decap_type(desc); in ath11k_dp_rx_h_msdu_start_decap_type()
50 return ab->hw_params.hw_ops->rx_desc_get_ldpc_support(desc); in ath11k_dp_rx_h_msdu_start_ldpc_support()
57 return ab->hw_params.hw_ops->rx_desc_get_mesh_ctl(desc); in ath11k_dp_rx_h_msdu_start_mesh_ctl_present()
64 return ab->hw_params.hw_ops->rx_desc_get_mpdu_seq_ctl_vld(desc); in ath11k_dp_rx_h_mpdu_start_seq_ctrl_valid()
70 return ab->hw_params.hw_ops->rx_desc_get_mpdu_fc_valid(desc); in ath11k_dp_rx_h_mpdu_start_fc_valid()
78 hdr = (struct ieee80211_hdr *)(skb->data + ab->hw_params.hal_desc_sz); in ath11k_dp_rx_h_mpdu_start_more_frags()
79 return ieee80211_has_morefrags(hdr->frame_control); in ath11k_dp_rx_h_mpdu_start_more_frags()
87 hdr = (struct ieee80211_hdr *)(skb->data + ab->hw_params.hal_desc_sz); in ath11k_dp_rx_h_mpdu_start_frag_no()
88 return le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG; in ath11k_dp_rx_h_mpdu_start_frag_no()
94 return ab->hw_params.hw_ops->rx_desc_get_mpdu_start_seq_no(desc); in ath11k_dp_rx_h_mpdu_start_seq_no()
100 return ab->hw_params.hw_ops->rx_desc_get_attention(desc); in ath11k_dp_rx_get_attention()
106 __le32_to_cpu(attn->info2)); in ath11k_dp_rx_h_attn_msdu_done()
112 __le32_to_cpu(attn->info1)); in ath11k_dp_rx_h_attn_l4_cksum_fail()
118 __le32_to_cpu(attn->info1)); in ath11k_dp_rx_h_attn_ip_cksum_fail()
124 __le32_to_cpu(attn->info2)) == in ath11k_dp_rx_h_attn_is_decrypted()
130 u32 info = __le32_to_cpu(attn->info1); in ath11k_dp_rx_h_attn_mpdu_err()
172 return ab->hw_params.hw_ops->rx_desc_get_msdu_len(desc); in ath11k_dp_rx_h_msdu_start_msdu_len()
178 return ab->hw_params.hw_ops->rx_desc_get_msdu_sgi(desc); in ath11k_dp_rx_h_msdu_start_sgi()
184 return ab->hw_params.hw_ops->rx_desc_get_msdu_rate_mcs(desc); in ath11k_dp_rx_h_msdu_start_rate_mcs()
190 return ab->hw_params.hw_ops->rx_desc_get_msdu_rx_bw(desc); in ath11k_dp_rx_h_msdu_start_rx_bw()
196 return ab->hw_params.hw_ops->rx_desc_get_msdu_freq(desc); in ath11k_dp_rx_h_msdu_start_freq()
202 return ab->hw_params.hw_ops->rx_desc_get_msdu_pkt_type(desc); in ath11k_dp_rx_h_msdu_start_pkt_type()
208 return hweight8(ab->hw_params.hw_ops->rx_desc_get_msdu_nss(desc)); in ath11k_dp_rx_h_msdu_start_nss()
214 return ab->hw_params.hw_ops->rx_desc_get_mpdu_tid(desc); in ath11k_dp_rx_h_mpdu_start_tid()
220 return ab->hw_params.hw_ops->rx_desc_get_mpdu_peer_id(desc); in ath11k_dp_rx_h_mpdu_start_peer_id()
226 return ab->hw_params.hw_ops->rx_desc_get_l3_pad_bytes(desc); in ath11k_dp_rx_h_msdu_end_l3pad()
232 return ab->hw_params.hw_ops->rx_desc_get_first_msdu(desc); in ath11k_dp_rx_h_msdu_end_first_msdu()
238 return ab->hw_params.hw_ops->rx_desc_get_last_msdu(desc); in ath11k_dp_rx_h_msdu_end_last_msdu()
245 ab->hw_params.hw_ops->rx_desc_copy_attn_end_tlv(fdesc, ldesc); in ath11k_dp_rx_desc_end_tlv_copy()
251 __le32_to_cpu(attn->info1)); in ath11k_dp_rxdesc_get_mpdulen_err()
259 rx_pkt_hdr = ab->hw_params.hw_ops->rx_desc_get_msdu_payload(rx_desc); in ath11k_dp_rxdesc_get_80211hdr()
269 tlv_tag = ab->hw_params.hw_ops->rx_desc_get_mpdu_start_tag(rx_desc); in ath11k_dp_rxdesc_mpdu_valid()
277 return ab->hw_params.hw_ops->rx_desc_get_mpdu_ppdu_id(rx_desc); in ath11k_dp_rxdesc_get_ppduid()
284 ab->hw_params.hw_ops->rx_desc_set_msdu_len(desc, len); in ath11k_dp_rxdesc_set_msdu_len()
294 __le32_to_cpu(attn->info1))); in ath11k_dp_rx_h_attn_is_mcbc()
300 return ab->hw_params.hw_ops->rx_desc_mac_addr2_valid(desc); in ath11k_dp_rxdesc_mac_addr2_valid()
306 return ab->hw_params.hw_ops->rx_desc_mpdu_start_addr2(desc); in ath11k_dp_rxdesc_mpdu_start_addr2()
314 for (i = 0; i < ab->hw_params.num_rxdma_per_pdev; i++) in ath11k_dp_service_mon_ring()
317 mod_timer(&ab->mon_reap_timer, jiffies + in ath11k_dp_service_mon_ring()
327 for (i = 0; i < ab->hw_params.num_rxdma_per_pdev; i++) in ath11k_dp_purge_mon_ring()
340 return -ETIMEDOUT; in ath11k_dp_purge_mon_ring()
358 req_entries = min(req_entries, rx_ring->bufs_max); in ath11k_dp_rxbufs_replenish()
360 srng = &ab->hal.srng_list[rx_ring->refill_buf_ring.ring_id]; in ath11k_dp_rxbufs_replenish()
362 spin_lock_bh(&srng->lock); in ath11k_dp_rxbufs_replenish()
367 if (!req_entries && (num_free > (rx_ring->bufs_max * 3) / 4)) in ath11k_dp_rxbufs_replenish()
379 if (!IS_ALIGNED((unsigned long)skb->data, in ath11k_dp_rxbufs_replenish()
382 PTR_ALIGN(skb->data, DP_RX_BUFFER_ALIGN_SIZE) - in ath11k_dp_rxbufs_replenish()
383 skb->data); in ath11k_dp_rxbufs_replenish()
386 paddr = dma_map_single(ab->dev, skb->data, in ath11k_dp_rxbufs_replenish()
387 skb->len + skb_tailroom(skb), in ath11k_dp_rxbufs_replenish()
389 if (dma_mapping_error(ab->dev, paddr)) in ath11k_dp_rxbufs_replenish()
392 spin_lock_bh(&rx_ring->idr_lock); in ath11k_dp_rxbufs_replenish()
393 buf_id = idr_alloc(&rx_ring->bufs_idr, skb, 1, in ath11k_dp_rxbufs_replenish()
394 (rx_ring->bufs_max * 3) + 1, GFP_ATOMIC); in ath11k_dp_rxbufs_replenish()
395 spin_unlock_bh(&rx_ring->idr_lock); in ath11k_dp_rxbufs_replenish()
403 ATH11K_SKB_RXCB(skb)->paddr = paddr; in ath11k_dp_rxbufs_replenish()
408 num_remain--; in ath11k_dp_rxbufs_replenish()
415 spin_unlock_bh(&srng->lock); in ath11k_dp_rxbufs_replenish()
417 return req_entries - num_remain; in ath11k_dp_rxbufs_replenish()
420 spin_lock_bh(&rx_ring->idr_lock); in ath11k_dp_rxbufs_replenish()
421 idr_remove(&rx_ring->bufs_idr, buf_id); in ath11k_dp_rxbufs_replenish()
422 spin_unlock_bh(&rx_ring->idr_lock); in ath11k_dp_rxbufs_replenish()
424 dma_unmap_single(ab->dev, paddr, skb->len + skb_tailroom(skb), in ath11k_dp_rxbufs_replenish()
431 spin_unlock_bh(&srng->lock); in ath11k_dp_rxbufs_replenish()
433 return req_entries - num_remain; in ath11k_dp_rxbufs_replenish()
442 spin_lock_bh(&rx_ring->idr_lock); in ath11k_dp_rxdma_buf_ring_free()
443 idr_for_each_entry(&rx_ring->bufs_idr, skb, buf_id) { in ath11k_dp_rxdma_buf_ring_free()
444 idr_remove(&rx_ring->bufs_idr, buf_id); in ath11k_dp_rxdma_buf_ring_free()
448 dma_unmap_single(ar->ab->dev, ATH11K_SKB_RXCB(skb)->paddr, in ath11k_dp_rxdma_buf_ring_free()
449 skb->len + skb_tailroom(skb), DMA_FROM_DEVICE); in ath11k_dp_rxdma_buf_ring_free()
453 idr_destroy(&rx_ring->bufs_idr); in ath11k_dp_rxdma_buf_ring_free()
454 spin_unlock_bh(&rx_ring->idr_lock); in ath11k_dp_rxdma_buf_ring_free()
461 struct ath11k_pdev_dp *dp = &ar->dp; in ath11k_dp_rxdma_pdev_buf_free()
462 struct ath11k_base *ab = ar->ab; in ath11k_dp_rxdma_pdev_buf_free()
463 struct dp_rxdma_ring *rx_ring = &dp->rx_refill_buf_ring; in ath11k_dp_rxdma_pdev_buf_free()
468 rx_ring = &dp->rxdma_mon_buf_ring; in ath11k_dp_rxdma_pdev_buf_free()
471 for (i = 0; i < ab->hw_params.num_rxdma_per_pdev; i++) { in ath11k_dp_rxdma_pdev_buf_free()
472 rx_ring = &dp->rx_mon_status_refill_ring[i]; in ath11k_dp_rxdma_pdev_buf_free()
483 struct ath11k_pdev_dp *dp = &ar->dp; in ath11k_dp_rxdma_ring_buf_setup()
486 num_entries = rx_ring->refill_buf_ring.size / in ath11k_dp_rxdma_ring_buf_setup()
487 ath11k_hal_srng_get_entrysize(ar->ab, ringtype); in ath11k_dp_rxdma_ring_buf_setup()
489 rx_ring->bufs_max = num_entries; in ath11k_dp_rxdma_ring_buf_setup()
490 ath11k_dp_rxbufs_replenish(ar->ab, dp->mac_id, rx_ring, num_entries, in ath11k_dp_rxdma_ring_buf_setup()
491 ar->ab->hw_params.hal_params->rx_buf_rbm); in ath11k_dp_rxdma_ring_buf_setup()
497 struct ath11k_pdev_dp *dp = &ar->dp; in ath11k_dp_rxdma_pdev_buf_setup()
498 struct ath11k_base *ab = ar->ab; in ath11k_dp_rxdma_pdev_buf_setup()
499 struct dp_rxdma_ring *rx_ring = &dp->rx_refill_buf_ring; in ath11k_dp_rxdma_pdev_buf_setup()
504 if (ar->ab->hw_params.rxdma1_enable) { in ath11k_dp_rxdma_pdev_buf_setup()
505 rx_ring = &dp->rxdma_mon_buf_ring; in ath11k_dp_rxdma_pdev_buf_setup()
509 for (i = 0; i < ab->hw_params.num_rxdma_per_pdev; i++) { in ath11k_dp_rxdma_pdev_buf_setup()
510 rx_ring = &dp->rx_mon_status_refill_ring[i]; in ath11k_dp_rxdma_pdev_buf_setup()
519 struct ath11k_pdev_dp *dp = &ar->dp; in ath11k_dp_rx_pdev_srng_free()
520 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_pdev_srng_free()
523 ath11k_dp_srng_cleanup(ab, &dp->rx_refill_buf_ring.refill_buf_ring); in ath11k_dp_rx_pdev_srng_free()
525 for (i = 0; i < ab->hw_params.num_rxdma_per_pdev; i++) { in ath11k_dp_rx_pdev_srng_free()
526 if (ab->hw_params.rx_mac_buf_ring) in ath11k_dp_rx_pdev_srng_free()
527 ath11k_dp_srng_cleanup(ab, &dp->rx_mac_buf_ring[i]); in ath11k_dp_rx_pdev_srng_free()
529 ath11k_dp_srng_cleanup(ab, &dp->rxdma_err_dst_ring[i]); in ath11k_dp_rx_pdev_srng_free()
531 &dp->rx_mon_status_refill_ring[i].refill_buf_ring); in ath11k_dp_rx_pdev_srng_free()
534 ath11k_dp_srng_cleanup(ab, &dp->rxdma_mon_buf_ring.refill_buf_ring); in ath11k_dp_rx_pdev_srng_free()
539 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_pdev_reo_cleanup()
543 ath11k_dp_srng_cleanup(ab, &dp->reo_dst_ring[i]); in ath11k_dp_pdev_reo_cleanup()
548 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_pdev_reo_setup()
553 ret = ath11k_dp_srng_setup(ab, &dp->reo_dst_ring[i], in ath11k_dp_pdev_reo_setup()
572 struct ath11k_pdev_dp *dp = &ar->dp; in ath11k_dp_rx_pdev_srng_alloc()
573 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_pdev_srng_alloc()
578 ret = ath11k_dp_srng_setup(ar->ab, in ath11k_dp_rx_pdev_srng_alloc()
579 &dp->rx_refill_buf_ring.refill_buf_ring, in ath11k_dp_rx_pdev_srng_alloc()
581 dp->mac_id, DP_RXDMA_BUF_RING_SIZE); in ath11k_dp_rx_pdev_srng_alloc()
583 ath11k_warn(ar->ab, "failed to setup rx_refill_buf_ring\n"); in ath11k_dp_rx_pdev_srng_alloc()
587 if (ar->ab->hw_params.rx_mac_buf_ring) { in ath11k_dp_rx_pdev_srng_alloc()
588 for (i = 0; i < ab->hw_params.num_rxdma_per_pdev; i++) { in ath11k_dp_rx_pdev_srng_alloc()
589 ret = ath11k_dp_srng_setup(ar->ab, in ath11k_dp_rx_pdev_srng_alloc()
590 &dp->rx_mac_buf_ring[i], in ath11k_dp_rx_pdev_srng_alloc()
592 dp->mac_id + i, 1024); in ath11k_dp_rx_pdev_srng_alloc()
594 ath11k_warn(ar->ab, "failed to setup rx_mac_buf_ring %d\n", in ath11k_dp_rx_pdev_srng_alloc()
601 for (i = 0; i < ab->hw_params.num_rxdma_per_pdev; i++) { in ath11k_dp_rx_pdev_srng_alloc()
602 ret = ath11k_dp_srng_setup(ar->ab, &dp->rxdma_err_dst_ring[i], in ath11k_dp_rx_pdev_srng_alloc()
603 HAL_RXDMA_DST, 0, dp->mac_id + i, in ath11k_dp_rx_pdev_srng_alloc()
606 ath11k_warn(ar->ab, "failed to setup rxdma_err_dst_ring %d\n", i); in ath11k_dp_rx_pdev_srng_alloc()
611 for (i = 0; i < ab->hw_params.num_rxdma_per_pdev; i++) { in ath11k_dp_rx_pdev_srng_alloc()
612 srng = &dp->rx_mon_status_refill_ring[i].refill_buf_ring; in ath11k_dp_rx_pdev_srng_alloc()
613 ret = ath11k_dp_srng_setup(ar->ab, in ath11k_dp_rx_pdev_srng_alloc()
615 HAL_RXDMA_MONITOR_STATUS, 0, dp->mac_id + i, in ath11k_dp_rx_pdev_srng_alloc()
618 ath11k_warn(ar->ab, in ath11k_dp_rx_pdev_srng_alloc()
629 if (!ar->ab->hw_params.rxdma1_enable) { in ath11k_dp_rx_pdev_srng_alloc()
631 timer_setup(&ar->ab->mon_reap_timer, in ath11k_dp_rx_pdev_srng_alloc()
636 ret = ath11k_dp_srng_setup(ar->ab, in ath11k_dp_rx_pdev_srng_alloc()
637 &dp->rxdma_mon_buf_ring.refill_buf_ring, in ath11k_dp_rx_pdev_srng_alloc()
638 HAL_RXDMA_MONITOR_BUF, 0, dp->mac_id, in ath11k_dp_rx_pdev_srng_alloc()
641 ath11k_warn(ar->ab, in ath11k_dp_rx_pdev_srng_alloc()
646 ret = ath11k_dp_srng_setup(ar->ab, &dp->rxdma_mon_dst_ring, in ath11k_dp_rx_pdev_srng_alloc()
647 HAL_RXDMA_MONITOR_DST, 0, dp->mac_id, in ath11k_dp_rx_pdev_srng_alloc()
650 ath11k_warn(ar->ab, in ath11k_dp_rx_pdev_srng_alloc()
655 ret = ath11k_dp_srng_setup(ar->ab, &dp->rxdma_mon_desc_ring, in ath11k_dp_rx_pdev_srng_alloc()
656 HAL_RXDMA_MONITOR_DESC, 0, dp->mac_id, in ath11k_dp_rx_pdev_srng_alloc()
659 ath11k_warn(ar->ab, in ath11k_dp_rx_pdev_srng_alloc()
669 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_reo_cmd_list_cleanup()
674 spin_lock_bh(&dp->reo_cmd_lock); in ath11k_dp_reo_cmd_list_cleanup()
675 list_for_each_entry_safe(cmd, tmp, &dp->reo_cmd_list, list) { in ath11k_dp_reo_cmd_list_cleanup()
676 list_del(&cmd->list); in ath11k_dp_reo_cmd_list_cleanup()
677 rx_tid = &cmd->data; in ath11k_dp_reo_cmd_list_cleanup()
678 if (rx_tid->vaddr) { in ath11k_dp_reo_cmd_list_cleanup()
679 dma_unmap_single(ab->dev, rx_tid->paddr, in ath11k_dp_reo_cmd_list_cleanup()
680 rx_tid->size, DMA_BIDIRECTIONAL); in ath11k_dp_reo_cmd_list_cleanup()
681 kfree(rx_tid->vaddr); in ath11k_dp_reo_cmd_list_cleanup()
682 rx_tid->vaddr = NULL; in ath11k_dp_reo_cmd_list_cleanup()
688 &dp->reo_cmd_cache_flush_list, list) { in ath11k_dp_reo_cmd_list_cleanup()
689 list_del(&cmd_cache->list); in ath11k_dp_reo_cmd_list_cleanup()
690 dp->reo_cmd_cache_flush_count--; in ath11k_dp_reo_cmd_list_cleanup()
691 rx_tid = &cmd_cache->data; in ath11k_dp_reo_cmd_list_cleanup()
692 if (rx_tid->vaddr) { in ath11k_dp_reo_cmd_list_cleanup()
693 dma_unmap_single(ab->dev, rx_tid->paddr, in ath11k_dp_reo_cmd_list_cleanup()
694 rx_tid->size, DMA_BIDIRECTIONAL); in ath11k_dp_reo_cmd_list_cleanup()
695 kfree(rx_tid->vaddr); in ath11k_dp_reo_cmd_list_cleanup()
696 rx_tid->vaddr = NULL; in ath11k_dp_reo_cmd_list_cleanup()
700 spin_unlock_bh(&dp->reo_cmd_lock); in ath11k_dp_reo_cmd_list_cleanup()
709 ath11k_warn(dp->ab, "failed to flush rx tid hw desc, tid %d status %d\n", in ath11k_dp_reo_cmd_free()
710 rx_tid->tid, status); in ath11k_dp_reo_cmd_free()
711 if (rx_tid->vaddr) { in ath11k_dp_reo_cmd_free()
712 dma_unmap_single(dp->ab->dev, rx_tid->paddr, rx_tid->size, in ath11k_dp_reo_cmd_free()
714 kfree(rx_tid->vaddr); in ath11k_dp_reo_cmd_free()
715 rx_tid->vaddr = NULL; in ath11k_dp_reo_cmd_free()
726 tot_desc_sz = rx_tid->size; in ath11k_dp_reo_cache_flush()
730 tot_desc_sz -= desc_sz; in ath11k_dp_reo_cache_flush()
731 cmd.addr_lo = lower_32_bits(rx_tid->paddr + tot_desc_sz); in ath11k_dp_reo_cache_flush()
732 cmd.addr_hi = upper_32_bits(rx_tid->paddr); in ath11k_dp_reo_cache_flush()
739 rx_tid->tid, ret); in ath11k_dp_reo_cache_flush()
743 cmd.addr_lo = lower_32_bits(rx_tid->paddr); in ath11k_dp_reo_cache_flush()
744 cmd.addr_hi = upper_32_bits(rx_tid->paddr); in ath11k_dp_reo_cache_flush()
751 rx_tid->tid, ret); in ath11k_dp_reo_cache_flush()
752 dma_unmap_single(ab->dev, rx_tid->paddr, rx_tid->size, in ath11k_dp_reo_cache_flush()
754 kfree(rx_tid->vaddr); in ath11k_dp_reo_cache_flush()
755 rx_tid->vaddr = NULL; in ath11k_dp_reo_cache_flush()
762 struct ath11k_base *ab = dp->ab; in ath11k_dp_rx_tid_del_func()
771 rx_tid->tid, status); in ath11k_dp_rx_tid_del_func()
779 elem->ts = jiffies; in ath11k_dp_rx_tid_del_func()
780 memcpy(&elem->data, rx_tid, sizeof(*rx_tid)); in ath11k_dp_rx_tid_del_func()
782 spin_lock_bh(&dp->reo_cmd_lock); in ath11k_dp_rx_tid_del_func()
783 list_add_tail(&elem->list, &dp->reo_cmd_cache_flush_list); in ath11k_dp_rx_tid_del_func()
784 dp->reo_cmd_cache_flush_count++; in ath11k_dp_rx_tid_del_func()
787 list_for_each_entry_safe(elem, tmp, &dp->reo_cmd_cache_flush_list, in ath11k_dp_rx_tid_del_func()
789 if (dp->reo_cmd_cache_flush_count > DP_REO_DESC_FREE_THRESHOLD || in ath11k_dp_rx_tid_del_func()
790 time_after(jiffies, elem->ts + in ath11k_dp_rx_tid_del_func()
792 list_del(&elem->list); in ath11k_dp_rx_tid_del_func()
793 dp->reo_cmd_cache_flush_count--; in ath11k_dp_rx_tid_del_func()
794 spin_unlock_bh(&dp->reo_cmd_lock); in ath11k_dp_rx_tid_del_func()
796 ath11k_dp_reo_cache_flush(ab, &elem->data); in ath11k_dp_rx_tid_del_func()
798 spin_lock_bh(&dp->reo_cmd_lock); in ath11k_dp_rx_tid_del_func()
801 spin_unlock_bh(&dp->reo_cmd_lock); in ath11k_dp_rx_tid_del_func()
805 dma_unmap_single(ab->dev, rx_tid->paddr, rx_tid->size, in ath11k_dp_rx_tid_del_func()
807 kfree(rx_tid->vaddr); in ath11k_dp_rx_tid_del_func()
808 rx_tid->vaddr = NULL; in ath11k_dp_rx_tid_del_func()
815 struct dp_rx_tid *rx_tid = &peer->rx_tid[tid]; in ath11k_peer_rx_tid_delete()
818 if (!rx_tid->active) in ath11k_peer_rx_tid_delete()
821 rx_tid->active = false; in ath11k_peer_rx_tid_delete()
824 cmd.addr_lo = lower_32_bits(rx_tid->paddr); in ath11k_peer_rx_tid_delete()
825 cmd.addr_hi = upper_32_bits(rx_tid->paddr); in ath11k_peer_rx_tid_delete()
827 ret = ath11k_dp_tx_send_reo_cmd(ar->ab, rx_tid, in ath11k_peer_rx_tid_delete()
831 if (ret != -ESHUTDOWN) in ath11k_peer_rx_tid_delete()
832 ath11k_err(ar->ab, "failed to send HAL_REO_CMD_UPDATE_RX_QUEUE cmd, tid %d (%d)\n", in ath11k_peer_rx_tid_delete()
834 dma_unmap_single(ar->ab->dev, rx_tid->paddr, rx_tid->size, in ath11k_peer_rx_tid_delete()
836 kfree(rx_tid->vaddr); in ath11k_peer_rx_tid_delete()
837 rx_tid->vaddr = NULL; in ath11k_peer_rx_tid_delete()
840 rx_tid->paddr = 0; in ath11k_peer_rx_tid_delete()
841 rx_tid->size = 0; in ath11k_peer_rx_tid_delete()
848 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_rx_link_desc_return()
853 srng = &ab->hal.srng_list[dp->wbm_desc_rel_ring.ring_id]; in ath11k_dp_rx_link_desc_return()
855 spin_lock_bh(&srng->lock); in ath11k_dp_rx_link_desc_return()
861 ret = -ENOBUFS; in ath11k_dp_rx_link_desc_return()
871 spin_unlock_bh(&srng->lock); in ath11k_dp_rx_link_desc_return()
878 struct ath11k_base *ab = rx_tid->ab; in ath11k_dp_rx_frags_cleanup()
880 lockdep_assert_held(&ab->base_lock); in ath11k_dp_rx_frags_cleanup()
882 if (rx_tid->dst_ring_desc) { in ath11k_dp_rx_frags_cleanup()
884 ath11k_dp_rx_link_desc_return(ab, (u32 *)rx_tid->dst_ring_desc, in ath11k_dp_rx_frags_cleanup()
886 kfree(rx_tid->dst_ring_desc); in ath11k_dp_rx_frags_cleanup()
887 rx_tid->dst_ring_desc = NULL; in ath11k_dp_rx_frags_cleanup()
890 rx_tid->cur_sn = 0; in ath11k_dp_rx_frags_cleanup()
891 rx_tid->last_frag_no = 0; in ath11k_dp_rx_frags_cleanup()
892 rx_tid->rx_frag_bitmap = 0; in ath11k_dp_rx_frags_cleanup()
893 __skb_queue_purge(&rx_tid->rx_frags); in ath11k_dp_rx_frags_cleanup()
901 lockdep_assert_held(&ar->ab->base_lock); in ath11k_peer_frags_flush()
904 rx_tid = &peer->rx_tid[i]; in ath11k_peer_frags_flush()
906 spin_unlock_bh(&ar->ab->base_lock); in ath11k_peer_frags_flush()
907 del_timer_sync(&rx_tid->frag_timer); in ath11k_peer_frags_flush()
908 spin_lock_bh(&ar->ab->base_lock); in ath11k_peer_frags_flush()
919 lockdep_assert_held(&ar->ab->base_lock); in ath11k_peer_rx_tid_cleanup()
922 rx_tid = &peer->rx_tid[i]; in ath11k_peer_rx_tid_cleanup()
927 spin_unlock_bh(&ar->ab->base_lock); in ath11k_peer_rx_tid_cleanup()
928 del_timer_sync(&rx_tid->frag_timer); in ath11k_peer_rx_tid_cleanup()
929 spin_lock_bh(&ar->ab->base_lock); in ath11k_peer_rx_tid_cleanup()
942 cmd.addr_lo = lower_32_bits(rx_tid->paddr); in ath11k_peer_rx_tid_reo_update()
943 cmd.addr_hi = upper_32_bits(rx_tid->paddr); in ath11k_peer_rx_tid_reo_update()
953 ret = ath11k_dp_tx_send_reo_cmd(ar->ab, rx_tid, in ath11k_peer_rx_tid_reo_update()
957 ath11k_warn(ar->ab, "failed to update rx tid queue, tid %d (%d)\n", in ath11k_peer_rx_tid_reo_update()
958 rx_tid->tid, ret); in ath11k_peer_rx_tid_reo_update()
962 rx_tid->ba_win_sz = ba_win_sz; in ath11k_peer_rx_tid_reo_update()
973 spin_lock_bh(&ab->base_lock); in ath11k_dp_rx_tid_mem_free()
981 rx_tid = &peer->rx_tid[tid]; in ath11k_dp_rx_tid_mem_free()
982 if (!rx_tid->active) in ath11k_dp_rx_tid_mem_free()
985 dma_unmap_single(ab->dev, rx_tid->paddr, rx_tid->size, in ath11k_dp_rx_tid_mem_free()
987 kfree(rx_tid->vaddr); in ath11k_dp_rx_tid_mem_free()
988 rx_tid->vaddr = NULL; in ath11k_dp_rx_tid_mem_free()
990 rx_tid->active = false; in ath11k_dp_rx_tid_mem_free()
993 spin_unlock_bh(&ab->base_lock); in ath11k_dp_rx_tid_mem_free()
1000 struct ath11k_base *ab = ar->ab; in ath11k_peer_rx_tid_setup()
1009 spin_lock_bh(&ab->base_lock); in ath11k_peer_rx_tid_setup()
1015 spin_unlock_bh(&ab->base_lock); in ath11k_peer_rx_tid_setup()
1016 return -ENOENT; in ath11k_peer_rx_tid_setup()
1019 rx_tid = &peer->rx_tid[tid]; in ath11k_peer_rx_tid_setup()
1021 if (rx_tid->active) { in ath11k_peer_rx_tid_setup()
1022 paddr = rx_tid->paddr; in ath11k_peer_rx_tid_setup()
1025 spin_unlock_bh(&ab->base_lock); in ath11k_peer_rx_tid_setup()
1041 rx_tid->tid = tid; in ath11k_peer_rx_tid_setup()
1043 rx_tid->ba_win_sz = ba_win_sz; in ath11k_peer_rx_tid_setup()
1053 vaddr = kzalloc(hw_desc_sz + HAL_LINK_DESC_ALIGN - 1, GFP_ATOMIC); in ath11k_peer_rx_tid_setup()
1055 spin_unlock_bh(&ab->base_lock); in ath11k_peer_rx_tid_setup()
1056 return -ENOMEM; in ath11k_peer_rx_tid_setup()
1064 paddr = dma_map_single(ab->dev, addr_aligned, hw_desc_sz, in ath11k_peer_rx_tid_setup()
1067 ret = dma_mapping_error(ab->dev, paddr); in ath11k_peer_rx_tid_setup()
1069 spin_unlock_bh(&ab->base_lock); in ath11k_peer_rx_tid_setup()
1075 rx_tid->vaddr = vaddr; in ath11k_peer_rx_tid_setup()
1076 rx_tid->paddr = paddr; in ath11k_peer_rx_tid_setup()
1077 rx_tid->size = hw_desc_sz; in ath11k_peer_rx_tid_setup()
1078 rx_tid->active = true; in ath11k_peer_rx_tid_setup()
1080 spin_unlock_bh(&ab->base_lock); in ath11k_peer_rx_tid_setup()
1085 ath11k_warn(ar->ab, "failed to setup rx reorder queue for peer %pM tid %d: %d\n", in ath11k_peer_rx_tid_setup()
1093 kfree(rx_tid->vaddr); in ath11k_peer_rx_tid_setup()
1094 rx_tid->vaddr = NULL; in ath11k_peer_rx_tid_setup()
1102 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_ampdu_start()
1103 struct ath11k_sta *arsta = ath11k_sta_to_arsta(params->sta); in ath11k_dp_rx_ampdu_start()
1104 int vdev_id = arsta->arvif->vdev_id; in ath11k_dp_rx_ampdu_start()
1107 ret = ath11k_peer_rx_tid_setup(ar, params->sta->addr, vdev_id, in ath11k_dp_rx_ampdu_start()
1108 params->tid, params->buf_size, in ath11k_dp_rx_ampdu_start()
1109 params->ssn, arsta->pn_type); in ath11k_dp_rx_ampdu_start()
1119 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_ampdu_stop()
1121 struct ath11k_sta *arsta = ath11k_sta_to_arsta(params->sta); in ath11k_dp_rx_ampdu_stop()
1122 int vdev_id = arsta->arvif->vdev_id; in ath11k_dp_rx_ampdu_stop()
1127 spin_lock_bh(&ab->base_lock); in ath11k_dp_rx_ampdu_stop()
1129 peer = ath11k_peer_find(ab, vdev_id, params->sta->addr); in ath11k_dp_rx_ampdu_stop()
1132 spin_unlock_bh(&ab->base_lock); in ath11k_dp_rx_ampdu_stop()
1133 return -ENOENT; in ath11k_dp_rx_ampdu_stop()
1136 paddr = peer->rx_tid[params->tid].paddr; in ath11k_dp_rx_ampdu_stop()
1137 active = peer->rx_tid[params->tid].active; in ath11k_dp_rx_ampdu_stop()
1140 spin_unlock_bh(&ab->base_lock); in ath11k_dp_rx_ampdu_stop()
1144 ret = ath11k_peer_rx_tid_reo_update(ar, peer, peer->rx_tid, 1, 0, false); in ath11k_dp_rx_ampdu_stop()
1145 spin_unlock_bh(&ab->base_lock); in ath11k_dp_rx_ampdu_stop()
1148 params->tid, ret); in ath11k_dp_rx_ampdu_stop()
1153 params->sta->addr, paddr, in ath11k_dp_rx_ampdu_stop()
1154 params->tid, 1, 1); in ath11k_dp_rx_ampdu_stop()
1167 struct ath11k *ar = arvif->ar; in ath11k_dp_peer_rx_pn_replay_config()
1168 struct ath11k_base *ab = ar->ab; in ath11k_dp_peer_rx_pn_replay_config()
1179 if (!(key->flags & IEEE80211_KEY_FLAG_PAIRWISE)) in ath11k_dp_peer_rx_pn_replay_config()
1189 switch (key->cipher) { in ath11k_dp_peer_rx_pn_replay_config()
1204 spin_lock_bh(&ab->base_lock); in ath11k_dp_peer_rx_pn_replay_config()
1206 peer = ath11k_peer_find(ab, arvif->vdev_id, peer_addr); in ath11k_dp_peer_rx_pn_replay_config()
1209 spin_unlock_bh(&ab->base_lock); in ath11k_dp_peer_rx_pn_replay_config()
1210 return -ENOENT; in ath11k_dp_peer_rx_pn_replay_config()
1214 rx_tid = &peer->rx_tid[tid]; in ath11k_dp_peer_rx_pn_replay_config()
1215 if (!rx_tid->active) in ath11k_dp_peer_rx_pn_replay_config()
1217 cmd.addr_lo = lower_32_bits(rx_tid->paddr); in ath11k_dp_peer_rx_pn_replay_config()
1218 cmd.addr_hi = upper_32_bits(rx_tid->paddr); in ath11k_dp_peer_rx_pn_replay_config()
1229 spin_unlock_bh(&ab->base_lock); in ath11k_dp_peer_rx_pn_replay_config()
1239 for (i = 0; i < HTT_PPDU_STATS_MAX_USERS - 1; i++) { in ath11k_get_ppdu_user_index()
1240 if (ppdu_stats->user_stats[i].is_valid_peer_id) { in ath11k_get_ppdu_user_index()
1241 if (peer_id == ppdu_stats->user_stats[i].peer_id) in ath11k_get_ppdu_user_index()
1248 return -EINVAL; in ath11k_get_ppdu_user_index()
1267 return -EINVAL; in ath11k_htt_tlv_ppdu_stats_parse()
1269 memcpy((void *)&ppdu_info->ppdu_stats.common, ptr, in ath11k_htt_tlv_ppdu_stats_parse()
1276 return -EINVAL; in ath11k_htt_tlv_ppdu_stats_parse()
1279 peer_id = ((struct htt_ppdu_stats_user_rate *)ptr)->sw_peer_id; in ath11k_htt_tlv_ppdu_stats_parse()
1280 cur_user = ath11k_get_ppdu_user_index(&ppdu_info->ppdu_stats, in ath11k_htt_tlv_ppdu_stats_parse()
1283 return -EINVAL; in ath11k_htt_tlv_ppdu_stats_parse()
1284 user_stats = &ppdu_info->ppdu_stats.user_stats[cur_user]; in ath11k_htt_tlv_ppdu_stats_parse()
1285 user_stats->peer_id = peer_id; in ath11k_htt_tlv_ppdu_stats_parse()
1286 user_stats->is_valid_peer_id = true; in ath11k_htt_tlv_ppdu_stats_parse()
1287 memcpy((void *)&user_stats->rate, ptr, in ath11k_htt_tlv_ppdu_stats_parse()
1289 user_stats->tlv_flags |= BIT(tag); in ath11k_htt_tlv_ppdu_stats_parse()
1295 return -EINVAL; in ath11k_htt_tlv_ppdu_stats_parse()
1298 peer_id = ((struct htt_ppdu_stats_usr_cmpltn_cmn *)ptr)->sw_peer_id; in ath11k_htt_tlv_ppdu_stats_parse()
1299 cur_user = ath11k_get_ppdu_user_index(&ppdu_info->ppdu_stats, in ath11k_htt_tlv_ppdu_stats_parse()
1302 return -EINVAL; in ath11k_htt_tlv_ppdu_stats_parse()
1303 user_stats = &ppdu_info->ppdu_stats.user_stats[cur_user]; in ath11k_htt_tlv_ppdu_stats_parse()
1304 user_stats->peer_id = peer_id; in ath11k_htt_tlv_ppdu_stats_parse()
1305 user_stats->is_valid_peer_id = true; in ath11k_htt_tlv_ppdu_stats_parse()
1306 memcpy((void *)&user_stats->cmpltn_cmn, ptr, in ath11k_htt_tlv_ppdu_stats_parse()
1308 user_stats->tlv_flags |= BIT(tag); in ath11k_htt_tlv_ppdu_stats_parse()
1315 return -EINVAL; in ath11k_htt_tlv_ppdu_stats_parse()
1319 ((struct htt_ppdu_stats_usr_cmpltn_ack_ba_status *)ptr)->sw_peer_id; in ath11k_htt_tlv_ppdu_stats_parse()
1320 cur_user = ath11k_get_ppdu_user_index(&ppdu_info->ppdu_stats, in ath11k_htt_tlv_ppdu_stats_parse()
1323 return -EINVAL; in ath11k_htt_tlv_ppdu_stats_parse()
1324 user_stats = &ppdu_info->ppdu_stats.user_stats[cur_user]; in ath11k_htt_tlv_ppdu_stats_parse()
1325 user_stats->peer_id = peer_id; in ath11k_htt_tlv_ppdu_stats_parse()
1326 user_stats->is_valid_peer_id = true; in ath11k_htt_tlv_ppdu_stats_parse()
1327 memcpy((void *)&user_stats->ack_ba, ptr, in ath11k_htt_tlv_ppdu_stats_parse()
1329 user_stats->tlv_flags |= BIT(tag); in ath11k_htt_tlv_ppdu_stats_parse()
1343 int ret = -EINVAL; in ath11k_dp_htt_tlv_iter()
1348 ptr - begin, len, sizeof(*tlv)); in ath11k_dp_htt_tlv_iter()
1349 return -EINVAL; in ath11k_dp_htt_tlv_iter()
1352 tlv_tag = FIELD_GET(HTT_TLV_TAG, tlv->header); in ath11k_dp_htt_tlv_iter()
1353 tlv_len = FIELD_GET(HTT_TLV_LEN, tlv->header); in ath11k_dp_htt_tlv_iter()
1355 len -= sizeof(*tlv); in ath11k_dp_htt_tlv_iter()
1359 tlv_tag, ptr - begin, len, tlv_len); in ath11k_dp_htt_tlv_iter()
1360 return -EINVAL; in ath11k_dp_htt_tlv_iter()
1363 if (ret == -ENOMEM) in ath11k_dp_htt_tlv_iter()
1367 len -= tlv_len; in ath11k_dp_htt_tlv_iter()
1376 struct ath11k_base *ab = ar->ab; in ath11k_update_per_peer_tx_stats()
1381 struct ath11k_per_peer_tx_stats *peer_stats = &ar->peer_tx_stats; in ath11k_update_per_peer_tx_stats()
1382 struct htt_ppdu_user_stats *usr_stats = &ppdu_stats->user_stats[user]; in ath11k_update_per_peer_tx_stats()
1383 struct htt_ppdu_stats_common *common = &ppdu_stats->common; in ath11k_update_per_peer_tx_stats()
1392 if (!(usr_stats->tlv_flags & BIT(HTT_PPDU_STATS_TAG_USR_RATE))) in ath11k_update_per_peer_tx_stats()
1395 if (usr_stats->tlv_flags & BIT(HTT_PPDU_STATS_TAG_USR_COMPLTN_COMMON)) in ath11k_update_per_peer_tx_stats()
1397 HTT_USR_CMPLTN_IS_AMPDU(usr_stats->cmpltn_cmn.flags); in ath11k_update_per_peer_tx_stats()
1399 if (usr_stats->tlv_flags & in ath11k_update_per_peer_tx_stats()
1401 succ_bytes = usr_stats->ack_ba.success_bytes; in ath11k_update_per_peer_tx_stats()
1403 usr_stats->ack_ba.info); in ath11k_update_per_peer_tx_stats()
1405 usr_stats->ack_ba.info); in ath11k_update_per_peer_tx_stats()
1408 if (common->fes_duration_us) in ath11k_update_per_peer_tx_stats()
1409 tx_duration = common->fes_duration_us; in ath11k_update_per_peer_tx_stats()
1411 user_rate = &usr_stats->rate; in ath11k_update_per_peer_tx_stats()
1412 flags = HTT_USR_RATE_PREAMBLE(user_rate->rate_flags); in ath11k_update_per_peer_tx_stats()
1413 bw = HTT_USR_RATE_BW(user_rate->rate_flags) - 2; in ath11k_update_per_peer_tx_stats()
1414 nss = HTT_USR_RATE_NSS(user_rate->rate_flags) + 1; in ath11k_update_per_peer_tx_stats()
1415 mcs = HTT_USR_RATE_MCS(user_rate->rate_flags); in ath11k_update_per_peer_tx_stats()
1416 sgi = HTT_USR_RATE_GI(user_rate->rate_flags); in ath11k_update_per_peer_tx_stats()
1417 dcm = HTT_USR_RATE_DCM(user_rate->rate_flags); in ath11k_update_per_peer_tx_stats()
1450 spin_lock_bh(&ab->base_lock); in ath11k_update_per_peer_tx_stats()
1451 peer = ath11k_peer_find_by_id(ab, usr_stats->peer_id); in ath11k_update_per_peer_tx_stats()
1453 if (!peer || !peer->sta) { in ath11k_update_per_peer_tx_stats()
1454 spin_unlock_bh(&ab->base_lock); in ath11k_update_per_peer_tx_stats()
1459 sta = peer->sta; in ath11k_update_per_peer_tx_stats()
1462 memset(&arsta->txrate, 0, sizeof(arsta->txrate)); in ath11k_update_per_peer_tx_stats()
1466 arsta->txrate.legacy = rate; in ath11k_update_per_peer_tx_stats()
1469 arsta->txrate.legacy = rate; in ath11k_update_per_peer_tx_stats()
1472 arsta->txrate.mcs = mcs + 8 * (nss - 1); in ath11k_update_per_peer_tx_stats()
1473 arsta->txrate.flags = RATE_INFO_FLAGS_MCS; in ath11k_update_per_peer_tx_stats()
1475 arsta->txrate.flags |= RATE_INFO_FLAGS_SHORT_GI; in ath11k_update_per_peer_tx_stats()
1478 arsta->txrate.mcs = mcs; in ath11k_update_per_peer_tx_stats()
1479 arsta->txrate.flags = RATE_INFO_FLAGS_VHT_MCS; in ath11k_update_per_peer_tx_stats()
1481 arsta->txrate.flags |= RATE_INFO_FLAGS_SHORT_GI; in ath11k_update_per_peer_tx_stats()
1484 arsta->txrate.mcs = mcs; in ath11k_update_per_peer_tx_stats()
1485 arsta->txrate.flags = RATE_INFO_FLAGS_HE_MCS; in ath11k_update_per_peer_tx_stats()
1486 arsta->txrate.he_dcm = dcm; in ath11k_update_per_peer_tx_stats()
1487 arsta->txrate.he_gi = ath11k_mac_he_gi_to_nl80211_he_gi(sgi); in ath11k_update_per_peer_tx_stats()
1488 arsta->txrate.he_ru_alloc = ath11k_mac_phy_he_ru_to_nl80211_he_ru_alloc in ath11k_update_per_peer_tx_stats()
1489 ((user_rate->ru_end - in ath11k_update_per_peer_tx_stats()
1490 user_rate->ru_start) + 1); in ath11k_update_per_peer_tx_stats()
1494 arsta->txrate.nss = nss; in ath11k_update_per_peer_tx_stats()
1496 arsta->txrate.bw = ath11k_mac_bw_to_mac80211_bw(bw); in ath11k_update_per_peer_tx_stats()
1497 arsta->tx_duration += tx_duration; in ath11k_update_per_peer_tx_stats()
1498 memcpy(&arsta->last_txrate, &arsta->txrate, sizeof(struct rate_info)); in ath11k_update_per_peer_tx_stats()
1500 /* PPDU stats reported for mgmt packet doesn't have valid tx bytes. in ath11k_update_per_peer_tx_stats()
1505 peer_stats->succ_pkts = succ_pkts; in ath11k_update_per_peer_tx_stats()
1506 peer_stats->succ_bytes = succ_bytes; in ath11k_update_per_peer_tx_stats()
1507 peer_stats->is_ampdu = is_ampdu; in ath11k_update_per_peer_tx_stats()
1508 peer_stats->duration = tx_duration; in ath11k_update_per_peer_tx_stats()
1509 peer_stats->ba_fails = in ath11k_update_per_peer_tx_stats()
1510 HTT_USR_CMPLTN_LONG_RETRY(usr_stats->cmpltn_cmn.flags) + in ath11k_update_per_peer_tx_stats()
1511 HTT_USR_CMPLTN_SHORT_RETRY(usr_stats->cmpltn_cmn.flags); in ath11k_update_per_peer_tx_stats()
1517 spin_unlock_bh(&ab->base_lock); in ath11k_update_per_peer_tx_stats()
1526 for (user = 0; user < HTT_PPDU_STATS_MAX_USERS - 1; user++) in ath11k_htt_update_ppdu_stats()
1536 lockdep_assert_held(&ar->data_lock); in ath11k_dp_htt_get_ppdu_desc()
1538 if (!list_empty(&ar->ppdu_stats_info)) { in ath11k_dp_htt_get_ppdu_desc()
1539 list_for_each_entry(ppdu_info, &ar->ppdu_stats_info, list) { in ath11k_dp_htt_get_ppdu_desc()
1540 if (ppdu_info->ppdu_id == ppdu_id) in ath11k_dp_htt_get_ppdu_desc()
1544 if (ar->ppdu_stat_list_depth > HTT_PPDU_DESC_MAX_DEPTH) { in ath11k_dp_htt_get_ppdu_desc()
1545 ppdu_info = list_first_entry(&ar->ppdu_stats_info, in ath11k_dp_htt_get_ppdu_desc()
1547 list_del(&ppdu_info->list); in ath11k_dp_htt_get_ppdu_desc()
1548 ar->ppdu_stat_list_depth--; in ath11k_dp_htt_get_ppdu_desc()
1549 ath11k_htt_update_ppdu_stats(ar, &ppdu_info->ppdu_stats); in ath11k_dp_htt_get_ppdu_desc()
1558 list_add_tail(&ppdu_info->list, &ar->ppdu_stats_info); in ath11k_dp_htt_get_ppdu_desc()
1559 ar->ppdu_stat_list_depth++; in ath11k_dp_htt_get_ppdu_desc()
1574 msg = (struct ath11k_htt_ppdu_stats_msg *)skb->data; in ath11k_htt_pull_ppdu_stats()
1575 len = FIELD_GET(HTT_T2H_PPDU_STATS_INFO_PAYLOAD_SIZE, msg->info); in ath11k_htt_pull_ppdu_stats()
1576 pdev_id = FIELD_GET(HTT_T2H_PPDU_STATS_INFO_PDEV_ID, msg->info); in ath11k_htt_pull_ppdu_stats()
1577 ppdu_id = msg->ppdu_id; in ath11k_htt_pull_ppdu_stats()
1582 ret = -EINVAL; in ath11k_htt_pull_ppdu_stats()
1587 trace_ath11k_htt_ppdu_stats(ar, skb->data, len); in ath11k_htt_pull_ppdu_stats()
1589 spin_lock_bh(&ar->data_lock); in ath11k_htt_pull_ppdu_stats()
1592 ret = -EINVAL; in ath11k_htt_pull_ppdu_stats()
1596 ppdu_info->ppdu_id = ppdu_id; in ath11k_htt_pull_ppdu_stats()
1597 ret = ath11k_dp_htt_tlv_iter(ab, msg->data, len, in ath11k_htt_pull_ppdu_stats()
1606 spin_unlock_bh(&ar->data_lock); in ath11k_htt_pull_ppdu_stats()
1616 struct htt_pktlog_msg *data = (struct htt_pktlog_msg *)skb->data; in ath11k_htt_pktlog()
1621 pdev_id = FIELD_GET(HTT_T2H_PPDU_STATS_INFO_PDEV_ID, data->hdr); in ath11k_htt_pktlog()
1631 trace_ath11k_htt_pktlog(ar, data->payload, hdr->size, in ath11k_htt_pktlog()
1632 ar->ab->pktlog_defs_checksum); in ath11k_htt_pktlog()
1641 u32 *data = (u32 *)skb->data; in ath11k_htt_backpressure_event_handler()
1665 bp_stats = &ab->soc_stats.bp_stats.umac_ring_bp_stats[ring_id]; in ath11k_htt_backpressure_event_handler()
1672 bp_stats = &ab->soc_stats.bp_stats.lmac_ring_bp_stats[ring_id][pdev_idx]; in ath11k_htt_backpressure_event_handler()
1679 spin_lock_bh(&ab->base_lock); in ath11k_htt_backpressure_event_handler()
1680 bp_stats->hp = hp; in ath11k_htt_backpressure_event_handler()
1681 bp_stats->tp = tp; in ath11k_htt_backpressure_event_handler()
1682 bp_stats->count++; in ath11k_htt_backpressure_event_handler()
1683 bp_stats->jiffies = jiffies; in ath11k_htt_backpressure_event_handler()
1684 spin_unlock_bh(&ab->base_lock); in ath11k_htt_backpressure_event_handler()
1690 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_htt_htc_t2h_msg_handler()
1691 struct htt_resp_msg *resp = (struct htt_resp_msg *)skb->data; in ath11k_dp_htt_htc_t2h_msg_handler()
1704 dp->htt_tgt_ver_major = FIELD_GET(HTT_T2H_VERSION_CONF_MAJOR, in ath11k_dp_htt_htc_t2h_msg_handler()
1705 resp->version_msg.version); in ath11k_dp_htt_htc_t2h_msg_handler()
1706 dp->htt_tgt_ver_minor = FIELD_GET(HTT_T2H_VERSION_CONF_MINOR, in ath11k_dp_htt_htc_t2h_msg_handler()
1707 resp->version_msg.version); in ath11k_dp_htt_htc_t2h_msg_handler()
1708 complete(&dp->htt_tgt_version_received); in ath11k_dp_htt_htc_t2h_msg_handler()
1712 resp->peer_map_ev.info); in ath11k_dp_htt_htc_t2h_msg_handler()
1714 resp->peer_map_ev.info); in ath11k_dp_htt_htc_t2h_msg_handler()
1716 resp->peer_map_ev.info1); in ath11k_dp_htt_htc_t2h_msg_handler()
1717 ath11k_dp_get_mac_addr(resp->peer_map_ev.mac_addr_l32, in ath11k_dp_htt_htc_t2h_msg_handler()
1723 resp->peer_map_ev.info); in ath11k_dp_htt_htc_t2h_msg_handler()
1725 resp->peer_map_ev.info); in ath11k_dp_htt_htc_t2h_msg_handler()
1727 resp->peer_map_ev.info1); in ath11k_dp_htt_htc_t2h_msg_handler()
1728 ath11k_dp_get_mac_addr(resp->peer_map_ev.mac_addr_l32, in ath11k_dp_htt_htc_t2h_msg_handler()
1731 resp->peer_map_ev.info2); in ath11k_dp_htt_htc_t2h_msg_handler()
1733 resp->peer_map_ev.info1); in ath11k_dp_htt_htc_t2h_msg_handler()
1740 resp->peer_unmap_ev.info); in ath11k_dp_htt_htc_t2h_msg_handler()
1768 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_msdu_coalesce()
1774 u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_msdu_coalesce()
1781 buf_first_len = DP_RX_BUFFER_SIZE - buf_first_hdr_len; in ath11k_dp_rx_msdu_coalesce()
1789 ldesc = (struct hal_rx_desc *)last->data; in ath11k_dp_rx_msdu_coalesce()
1790 rxcb->is_first_msdu = ath11k_dp_rx_h_msdu_end_first_msdu(ab, ldesc); in ath11k_dp_rx_msdu_coalesce()
1791 rxcb->is_last_msdu = ath11k_dp_rx_h_msdu_end_last_msdu(ab, ldesc); in ath11k_dp_rx_msdu_coalesce()
1794 * exceeds DP_RX_BUFFER_SIZE - HAL_RX_DESC_SIZE. So assume the data in ath11k_dp_rx_msdu_coalesce()
1795 * in the first buf is of length DP_RX_BUFFER_SIZE - HAL_RX_DESC_SIZE. in ath11k_dp_rx_msdu_coalesce()
1803 ath11k_dp_rx_desc_end_tlv_copy(ab, rxcb->rx_desc, ldesc); in ath11k_dp_rx_msdu_coalesce()
1805 space_extra = msdu_len - (buf_first_len + skb_tailroom(first)); in ath11k_dp_rx_msdu_coalesce()
1811 if (!rxcb->is_continuation) { in ath11k_dp_rx_msdu_coalesce()
1817 return -ENOMEM; in ath11k_dp_rx_msdu_coalesce()
1820 rem_len = msdu_len - buf_first_len; in ath11k_dp_rx_msdu_coalesce()
1823 if (rxcb->is_continuation) in ath11k_dp_rx_msdu_coalesce()
1824 buf_len = DP_RX_BUFFER_SIZE - hal_rx_desc_sz; in ath11k_dp_rx_msdu_coalesce()
1828 if (buf_len > (DP_RX_BUFFER_SIZE - hal_rx_desc_sz)) { in ath11k_dp_rx_msdu_coalesce()
1831 return -EINVAL; in ath11k_dp_rx_msdu_coalesce()
1840 rem_len -= buf_len; in ath11k_dp_rx_msdu_coalesce()
1841 if (!rxcb->is_continuation) in ath11k_dp_rx_msdu_coalesce()
1854 if (!rxcb->is_continuation) in ath11k_dp_rx_get_msdu_last_buf()
1859 if (!rxcb->is_continuation) in ath11k_dp_rx_get_msdu_last_buf()
1872 rx_attention = ath11k_dp_rx_get_attention(ar->ab, rxcb->rx_desc); in ath11k_dp_rx_h_csum_offload()
1876 msdu->ip_summed = (ip_csum_fail || l4_csum_fail) ? in ath11k_dp_rx_h_csum_offload()
1902 ath11k_warn(ar->ab, "unsupported encryption type %d for mic len\n", enctype); in ath11k_dp_rx_crypto_mic_len()
1930 ath11k_warn(ar->ab, "unsupported encryption type %d\n", enctype); in ath11k_dp_rx_crypto_param_len()
1955 ath11k_warn(ar->ab, "unsupported encryption type %d\n", enctype); in ath11k_dp_rx_crypto_icv_len()
1975 hdr = (struct ieee80211_hdr *)msdu->data; in ath11k_dp_rx_h_undecap_nwifi()
1976 hdr_len = ieee80211_hdrlen(hdr->frame_control); in ath11k_dp_rx_h_undecap_nwifi()
1979 skb_pull(msdu, ieee80211_hdrlen(hdr->frame_control)); in ath11k_dp_rx_h_undecap_nwifi()
1981 if (rxcb->is_first_msdu) { in ath11k_dp_rx_h_undecap_nwifi()
1986 hdr_len = ieee80211_hdrlen(hdr->frame_control); in ath11k_dp_rx_h_undecap_nwifi()
1988 /* Each A-MSDU subframe will be reported as a separate MSDU, in ath11k_dp_rx_h_undecap_nwifi()
1989 * so strip the A-MSDU bit from QoS Ctl. in ath11k_dp_rx_h_undecap_nwifi()
1991 if (ieee80211_is_data_qos(hdr->frame_control)) { in ath11k_dp_rx_h_undecap_nwifi()
1997 hdr->frame_control |= __cpu_to_le16(IEEE80211_STYPE_QOS_DATA); in ath11k_dp_rx_h_undecap_nwifi()
2000 hdr->frame_control &= ~(__cpu_to_le16(IEEE80211_FCTL_ORDER)); in ath11k_dp_rx_h_undecap_nwifi()
2002 qos_ctl = rxcb->tid; in ath11k_dp_rx_h_undecap_nwifi()
2004 if (ath11k_dp_rx_h_msdu_start_mesh_ctl_present(ar->ab, rxcb->rx_desc)) in ath11k_dp_rx_h_undecap_nwifi()
2013 if (!(status->flag & RX_FLAG_IV_STRIPPED)) { in ath11k_dp_rx_h_undecap_nwifi()
2020 if (!rxcb->is_first_msdu) { in ath11k_dp_rx_h_undecap_nwifi()
2033 hdr = (struct ieee80211_hdr *)msdu->data; in ath11k_dp_rx_h_undecap_nwifi()
2048 if (!rxcb->is_first_msdu || in ath11k_dp_rx_h_undecap_raw()
2049 !(rxcb->is_first_msdu && rxcb->is_last_msdu)) { in ath11k_dp_rx_h_undecap_raw()
2054 skb_trim(msdu, msdu->len - FCS_LEN); in ath11k_dp_rx_h_undecap_raw()
2059 hdr = (void *)msdu->data; in ath11k_dp_rx_h_undecap_raw()
2062 if (status->flag & RX_FLAG_IV_STRIPPED) { in ath11k_dp_rx_h_undecap_raw()
2063 skb_trim(msdu, msdu->len - in ath11k_dp_rx_h_undecap_raw()
2066 skb_trim(msdu, msdu->len - in ath11k_dp_rx_h_undecap_raw()
2070 if (status->flag & RX_FLAG_MIC_STRIPPED) in ath11k_dp_rx_h_undecap_raw()
2071 skb_trim(msdu, msdu->len - in ath11k_dp_rx_h_undecap_raw()
2075 if (status->flag & RX_FLAG_ICV_STRIPPED) in ath11k_dp_rx_h_undecap_raw()
2076 skb_trim(msdu, msdu->len - in ath11k_dp_rx_h_undecap_raw()
2081 if ((status->flag & RX_FLAG_MMIC_STRIPPED) && in ath11k_dp_rx_h_undecap_raw()
2082 !ieee80211_has_morefrags(hdr->frame_control) && in ath11k_dp_rx_h_undecap_raw()
2084 skb_trim(msdu, msdu->len - IEEE80211_CCMP_MIC_LEN); in ath11k_dp_rx_h_undecap_raw()
2087 if (status->flag & RX_FLAG_IV_STRIPPED) { in ath11k_dp_rx_h_undecap_raw()
2088 hdr_len = ieee80211_hdrlen(hdr->frame_control); in ath11k_dp_rx_h_undecap_raw()
2091 memmove((void *)msdu->data + crypto_len, in ath11k_dp_rx_h_undecap_raw()
2092 (void *)msdu->data, hdr_len); in ath11k_dp_rx_h_undecap_raw()
2107 is_amsdu = !(rxcb->is_first_msdu && rxcb->is_last_msdu); in ath11k_dp_rx_h_find_rfc1042()
2108 hdr = (struct ieee80211_hdr *)ath11k_dp_rx_h_80211_hdr(ar->ab, rxcb->rx_desc); in ath11k_dp_rx_h_find_rfc1042()
2111 if (rxcb->is_first_msdu) { in ath11k_dp_rx_h_find_rfc1042()
2112 hdr_len = ieee80211_hdrlen(hdr->frame_control); in ath11k_dp_rx_h_find_rfc1042()
2142 eth = (struct ethhdr *)msdu->data; in ath11k_dp_rx_h_undecap_eth()
2143 ether_addr_copy(da, eth->h_dest); in ath11k_dp_rx_h_undecap_eth()
2144 ether_addr_copy(sa, eth->h_source); in ath11k_dp_rx_h_undecap_eth()
2153 hdr_len = ieee80211_hdrlen(hdr->frame_control); in ath11k_dp_rx_h_undecap_eth()
2155 if (!(status->flag & RX_FLAG_IV_STRIPPED)) { in ath11k_dp_rx_h_undecap_eth()
2167 hdr = (struct ieee80211_hdr *)msdu->data; in ath11k_dp_rx_h_undecap_eth()
2182 first_hdr = ath11k_dp_rx_h_80211_hdr(ar->ab, rx_desc); in ath11k_dp_rx_h_undecap()
2183 decap = ath11k_dp_rx_h_msdu_start_decap_type(ar->ab, rx_desc); in ath11k_dp_rx_h_undecap()
2195 ehdr = (struct ethhdr *)msdu->data; in ath11k_dp_rx_h_undecap()
2198 if (ehdr->h_proto == cpu_to_be16(ETH_P_PAE)) { in ath11k_dp_rx_h_undecap()
2199 ATH11K_SKB_RXCB(msdu)->is_eapol = true; in ath11k_dp_rx_h_undecap()
2208 if (ATH11K_SKB_RXCB(msdu)->is_mcbc && decrypted) in ath11k_dp_rx_h_undecap()
2222 struct hal_rx_desc *rx_desc = rxcb->rx_desc; in ath11k_dp_rx_h_find_peer()
2225 lockdep_assert_held(&ab->base_lock); in ath11k_dp_rx_h_find_peer()
2227 if (rxcb->peer_id) in ath11k_dp_rx_h_find_peer()
2228 peer = ath11k_peer_find_by_id(ab, rxcb->peer_id); in ath11k_dp_rx_h_find_peer()
2257 fill_crypto_hdr = ath11k_dp_rx_h_attn_is_mcbc(ar->ab, rx_desc); in ath11k_dp_rx_h_mpdu()
2258 rxcb->is_mcbc = fill_crypto_hdr; in ath11k_dp_rx_h_mpdu()
2260 if (rxcb->is_mcbc) { in ath11k_dp_rx_h_mpdu()
2261 rxcb->peer_id = ath11k_dp_rx_h_mpdu_start_peer_id(ar->ab, rx_desc); in ath11k_dp_rx_h_mpdu()
2262 rxcb->seq_no = ath11k_dp_rx_h_mpdu_start_seq_no(ar->ab, rx_desc); in ath11k_dp_rx_h_mpdu()
2265 spin_lock_bh(&ar->ab->base_lock); in ath11k_dp_rx_h_mpdu()
2266 peer = ath11k_dp_rx_h_find_peer(ar->ab, msdu); in ath11k_dp_rx_h_mpdu()
2268 if (rxcb->is_mcbc) in ath11k_dp_rx_h_mpdu()
2269 enctype = peer->sec_type_grp; in ath11k_dp_rx_h_mpdu()
2271 enctype = peer->sec_type; in ath11k_dp_rx_h_mpdu()
2273 enctype = ath11k_dp_rx_h_mpdu_start_enctype(ar->ab, rx_desc); in ath11k_dp_rx_h_mpdu()
2275 spin_unlock_bh(&ar->ab->base_lock); in ath11k_dp_rx_h_mpdu()
2277 rx_attention = ath11k_dp_rx_get_attention(ar->ab, rx_desc); in ath11k_dp_rx_h_mpdu()
2282 /* Clear per-MPDU flags while leaving per-PPDU flags intact */ in ath11k_dp_rx_h_mpdu()
2283 rx_status->flag &= ~(RX_FLAG_FAILED_FCS_CRC | in ath11k_dp_rx_h_mpdu()
2290 rx_status->flag |= RX_FLAG_FAILED_FCS_CRC; in ath11k_dp_rx_h_mpdu()
2292 rx_status->flag |= RX_FLAG_MMIC_ERROR; in ath11k_dp_rx_h_mpdu()
2295 rx_status->flag |= RX_FLAG_DECRYPTED | RX_FLAG_MMIC_STRIPPED; in ath11k_dp_rx_h_mpdu()
2298 rx_status->flag |= RX_FLAG_MIC_STRIPPED | in ath11k_dp_rx_h_mpdu()
2301 rx_status->flag |= RX_FLAG_IV_STRIPPED | in ath11k_dp_rx_h_mpdu()
2312 if (ath11k_dp_rx_h_msdu_start_decap_type(ar->ab, rx_desc) != in ath11k_dp_rx_h_mpdu()
2314 hdr = (void *)msdu->data; in ath11k_dp_rx_h_mpdu()
2315 hdr->frame_control &= ~__cpu_to_le16(IEEE80211_FCTL_PROTECTED); in ath11k_dp_rx_h_mpdu()
2329 pkt_type = ath11k_dp_rx_h_msdu_start_pkt_type(ar->ab, rx_desc); in ath11k_dp_rx_h_rate()
2330 bw = ath11k_dp_rx_h_msdu_start_rx_bw(ar->ab, rx_desc); in ath11k_dp_rx_h_rate()
2331 rate_mcs = ath11k_dp_rx_h_msdu_start_rate_mcs(ar->ab, rx_desc); in ath11k_dp_rx_h_rate()
2332 nss = ath11k_dp_rx_h_msdu_start_nss(ar->ab, rx_desc); in ath11k_dp_rx_h_rate()
2333 sgi = ath11k_dp_rx_h_msdu_start_sgi(ar->ab, rx_desc); in ath11k_dp_rx_h_rate()
2339 sband = &ar->mac.sbands[rx_status->band]; in ath11k_dp_rx_h_rate()
2340 rx_status->rate_idx = ath11k_mac_hw_rate_to_idx(sband, rate_mcs, in ath11k_dp_rx_h_rate()
2344 rx_status->encoding = RX_ENC_HT; in ath11k_dp_rx_h_rate()
2346 ath11k_warn(ar->ab, in ath11k_dp_rx_h_rate()
2351 rx_status->rate_idx = rate_mcs + (8 * (nss - 1)); in ath11k_dp_rx_h_rate()
2353 rx_status->enc_flags |= RX_ENC_FLAG_SHORT_GI; in ath11k_dp_rx_h_rate()
2354 rx_status->bw = ath11k_mac_bw_to_mac80211_bw(bw); in ath11k_dp_rx_h_rate()
2357 rx_status->encoding = RX_ENC_VHT; in ath11k_dp_rx_h_rate()
2358 rx_status->rate_idx = rate_mcs; in ath11k_dp_rx_h_rate()
2360 ath11k_warn(ar->ab, in ath11k_dp_rx_h_rate()
2365 rx_status->nss = nss; in ath11k_dp_rx_h_rate()
2367 rx_status->enc_flags |= RX_ENC_FLAG_SHORT_GI; in ath11k_dp_rx_h_rate()
2368 rx_status->bw = ath11k_mac_bw_to_mac80211_bw(bw); in ath11k_dp_rx_h_rate()
2369 is_ldpc = ath11k_dp_rx_h_msdu_start_ldpc_support(ar->ab, rx_desc); in ath11k_dp_rx_h_rate()
2371 rx_status->enc_flags |= RX_ENC_FLAG_LDPC; in ath11k_dp_rx_h_rate()
2374 rx_status->rate_idx = rate_mcs; in ath11k_dp_rx_h_rate()
2376 ath11k_warn(ar->ab, in ath11k_dp_rx_h_rate()
2381 rx_status->encoding = RX_ENC_HE; in ath11k_dp_rx_h_rate()
2382 rx_status->nss = nss; in ath11k_dp_rx_h_rate()
2383 rx_status->he_gi = ath11k_mac_he_gi_to_nl80211_he_gi(sgi); in ath11k_dp_rx_h_rate()
2384 rx_status->bw = ath11k_mac_bw_to_mac80211_bw(bw); in ath11k_dp_rx_h_rate()
2396 rx_status->freq = 0; in ath11k_dp_rx_h_ppdu()
2397 rx_status->rate_idx = 0; in ath11k_dp_rx_h_ppdu()
2398 rx_status->nss = 0; in ath11k_dp_rx_h_ppdu()
2399 rx_status->encoding = RX_ENC_LEGACY; in ath11k_dp_rx_h_ppdu()
2400 rx_status->bw = RATE_INFO_BW_20; in ath11k_dp_rx_h_ppdu()
2402 rx_status->flag |= RX_FLAG_NO_SIGNAL_VAL; in ath11k_dp_rx_h_ppdu()
2404 meta_data = ath11k_dp_rx_h_msdu_start_freq(ar->ab, rx_desc); in ath11k_dp_rx_h_ppdu()
2410 rx_status->band = NL80211_BAND_6GHZ; in ath11k_dp_rx_h_ppdu()
2411 rx_status->freq = center_freq; in ath11k_dp_rx_h_ppdu()
2413 rx_status->band = NL80211_BAND_2GHZ; in ath11k_dp_rx_h_ppdu()
2415 rx_status->band = NL80211_BAND_5GHZ; in ath11k_dp_rx_h_ppdu()
2417 spin_lock_bh(&ar->data_lock); in ath11k_dp_rx_h_ppdu()
2418 channel = ar->rx_channel; in ath11k_dp_rx_h_ppdu()
2420 rx_status->band = channel->band; in ath11k_dp_rx_h_ppdu()
2422 ieee80211_frequency_to_channel(channel->center_freq); in ath11k_dp_rx_h_ppdu()
2424 spin_unlock_bh(&ar->data_lock); in ath11k_dp_rx_h_ppdu()
2425 ath11k_dbg_dump(ar->ab, ATH11K_DBG_DATA, NULL, "rx_desc: ", in ath11k_dp_rx_h_ppdu()
2429 if (rx_status->band != NL80211_BAND_6GHZ) in ath11k_dp_rx_h_ppdu()
2430 rx_status->freq = ieee80211_channel_to_frequency(channel_num, in ath11k_dp_rx_h_ppdu()
2431 rx_status->band); in ath11k_dp_rx_h_ppdu()
2451 bool is_mcbc = rxcb->is_mcbc; in ath11k_dp_rx_deliver_msdu()
2452 bool is_eapol = rxcb->is_eapol; in ath11k_dp_rx_deliver_msdu()
2454 if (status->encoding == RX_ENC_HE && in ath11k_dp_rx_deliver_msdu()
2455 !(status->flag & RX_FLAG_RADIOTAP_HE) && in ath11k_dp_rx_deliver_msdu()
2456 !(status->flag & RX_FLAG_SKIP_MONITOR)) { in ath11k_dp_rx_deliver_msdu()
2459 status->flag |= RX_FLAG_RADIOTAP_HE; in ath11k_dp_rx_deliver_msdu()
2462 if (!(status->flag & RX_FLAG_ONLY_MONITOR)) in ath11k_dp_rx_deliver_msdu()
2463 decap = ath11k_dp_rx_h_msdu_start_decap_type(ar->ab, rxcb->rx_desc); in ath11k_dp_rx_deliver_msdu()
2465 spin_lock_bh(&ar->ab->base_lock); in ath11k_dp_rx_deliver_msdu()
2466 peer = ath11k_dp_rx_h_find_peer(ar->ab, msdu); in ath11k_dp_rx_deliver_msdu()
2467 if (peer && peer->sta) in ath11k_dp_rx_deliver_msdu()
2468 pubsta = peer->sta; in ath11k_dp_rx_deliver_msdu()
2469 spin_unlock_bh(&ar->ab->base_lock); in ath11k_dp_rx_deliver_msdu()
2471 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_deliver_msdu()
2472 …s%s%s%s%s %srate_idx %u vht_nss %u freq %u band %u flag 0x%x fcs-err %i mic-err %i amsdu-more %i\n… in ath11k_dp_rx_deliver_msdu()
2474 msdu->len, in ath11k_dp_rx_deliver_msdu()
2475 peer ? peer->addr : NULL, in ath11k_dp_rx_deliver_msdu()
2476 rxcb->tid, in ath11k_dp_rx_deliver_msdu()
2478 rxcb->seq_no, in ath11k_dp_rx_deliver_msdu()
2479 (status->encoding == RX_ENC_LEGACY) ? "legacy" : "", in ath11k_dp_rx_deliver_msdu()
2480 (status->encoding == RX_ENC_HT) ? "ht" : "", in ath11k_dp_rx_deliver_msdu()
2481 (status->encoding == RX_ENC_VHT) ? "vht" : "", in ath11k_dp_rx_deliver_msdu()
2482 (status->encoding == RX_ENC_HE) ? "he" : "", in ath11k_dp_rx_deliver_msdu()
2483 (status->bw == RATE_INFO_BW_40) ? "40" : "", in ath11k_dp_rx_deliver_msdu()
2484 (status->bw == RATE_INFO_BW_80) ? "80" : "", in ath11k_dp_rx_deliver_msdu()
2485 (status->bw == RATE_INFO_BW_160) ? "160" : "", in ath11k_dp_rx_deliver_msdu()
2486 status->enc_flags & RX_ENC_FLAG_SHORT_GI ? "sgi " : "", in ath11k_dp_rx_deliver_msdu()
2487 status->rate_idx, in ath11k_dp_rx_deliver_msdu()
2488 status->nss, in ath11k_dp_rx_deliver_msdu()
2489 status->freq, in ath11k_dp_rx_deliver_msdu()
2490 status->band, status->flag, in ath11k_dp_rx_deliver_msdu()
2491 !!(status->flag & RX_FLAG_FAILED_FCS_CRC), in ath11k_dp_rx_deliver_msdu()
2492 !!(status->flag & RX_FLAG_MMIC_ERROR), in ath11k_dp_rx_deliver_msdu()
2493 !!(status->flag & RX_FLAG_AMSDU_MORE)); in ath11k_dp_rx_deliver_msdu()
2495 ath11k_dbg_dump(ar->ab, ATH11K_DBG_DP_RX, NULL, "dp rx msdu: ", in ath11k_dp_rx_deliver_msdu()
2496 msdu->data, msdu->len); in ath11k_dp_rx_deliver_msdu()
2509 !(is_mcbc && rx_status->flag & RX_FLAG_DECRYPTED)) in ath11k_dp_rx_deliver_msdu()
2510 rx_status->flag |= RX_FLAG_8023; in ath11k_dp_rx_deliver_msdu()
2512 ieee80211_rx_napi(ar->hw, pubsta, msdu, napi); in ath11k_dp_rx_deliver_msdu()
2520 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_process_msdu()
2529 u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_process_msdu()
2534 "No valid Rx buffer to access Atten/MSDU_END/MPDU_END tlvs\n"); in ath11k_dp_rx_process_msdu()
2535 ret = -EIO; in ath11k_dp_rx_process_msdu()
2539 rx_desc = (struct hal_rx_desc *)msdu->data; in ath11k_dp_rx_process_msdu()
2541 ath11k_warn(ar->ab, "msdu len not valid\n"); in ath11k_dp_rx_process_msdu()
2542 ret = -EIO; in ath11k_dp_rx_process_msdu()
2546 lrx_desc = (struct hal_rx_desc *)last_buf->data; in ath11k_dp_rx_process_msdu()
2550 ret = -EIO; in ath11k_dp_rx_process_msdu()
2555 rxcb->rx_desc = rx_desc; in ath11k_dp_rx_process_msdu()
2559 if (rxcb->is_frag) { in ath11k_dp_rx_process_msdu()
2561 } else if (!rxcb->is_continuation) { in ath11k_dp_rx_process_msdu()
2564 ret = -EINVAL; in ath11k_dp_rx_process_msdu()
2588 rx_status->flag |= RX_FLAG_SKIP_MONITOR | RX_FLAG_DUP_VALIDATED; in ath11k_dp_rx_process_msdu()
2609 if (unlikely(!rcu_access_pointer(ab->pdevs_active[mac_id]))) { in ath11k_dp_rx_process_received_packets()
2614 ar = ab->pdevs[mac_id].ar; in ath11k_dp_rx_process_received_packets()
2615 if (unlikely(test_bit(ATH11K_CAC_RUNNING, &ar->dev_flags))) { in ath11k_dp_rx_process_received_packets()
2636 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_process_rx()
2655 srng = &ab->hal.srng_list[dp->reo_dst_ring[ring_id].ring_id]; in ath11k_dp_process_rx()
2657 spin_lock_bh(&srng->lock); in ath11k_dp_process_rx()
2666 desc->buf_addr_info.info1); in ath11k_dp_process_rx()
2674 ar = ab->pdevs[mac_id].ar; in ath11k_dp_process_rx()
2675 rx_ring = &ar->dp.rx_refill_buf_ring; in ath11k_dp_process_rx()
2676 spin_lock_bh(&rx_ring->idr_lock); in ath11k_dp_process_rx()
2677 msdu = idr_find(&rx_ring->bufs_idr, buf_id); in ath11k_dp_process_rx()
2681 spin_unlock_bh(&rx_ring->idr_lock); in ath11k_dp_process_rx()
2685 idr_remove(&rx_ring->bufs_idr, buf_id); in ath11k_dp_process_rx()
2686 spin_unlock_bh(&rx_ring->idr_lock); in ath11k_dp_process_rx()
2689 dma_unmap_single(ab->dev, rxcb->paddr, in ath11k_dp_process_rx()
2690 msdu->len + skb_tailroom(msdu), in ath11k_dp_process_rx()
2696 desc->info0); in ath11k_dp_process_rx()
2700 ab->soc_stats.hal_reo_error[ring_id]++; in ath11k_dp_process_rx()
2704 rxcb->is_first_msdu = !!(desc->rx_msdu_info.info0 & in ath11k_dp_process_rx()
2706 rxcb->is_last_msdu = !!(desc->rx_msdu_info.info0 & in ath11k_dp_process_rx()
2708 rxcb->is_continuation = !!(desc->rx_msdu_info.info0 & in ath11k_dp_process_rx()
2710 rxcb->peer_id = FIELD_GET(RX_MPDU_DESC_META_DATA_PEER_ID, in ath11k_dp_process_rx()
2711 desc->rx_mpdu_info.meta_data); in ath11k_dp_process_rx()
2712 rxcb->seq_no = FIELD_GET(RX_MPDU_DESC_INFO0_SEQ_NUM, in ath11k_dp_process_rx()
2713 desc->rx_mpdu_info.info0); in ath11k_dp_process_rx()
2714 rxcb->tid = FIELD_GET(HAL_REO_DEST_RING_INFO0_RX_QUEUE_NUM, in ath11k_dp_process_rx()
2715 desc->info0); in ath11k_dp_process_rx()
2717 rxcb->mac_id = mac_id; in ath11k_dp_process_rx()
2720 if (rxcb->is_continuation) { in ath11k_dp_process_rx()
2744 spin_unlock_bh(&srng->lock); in ath11k_dp_process_rx()
2749 for (i = 0; i < ab->num_radios; i++) { in ath11k_dp_process_rx()
2755 ar = ab->pdevs[i].ar; in ath11k_dp_process_rx()
2756 rx_ring = &ar->dp.rx_refill_buf_ring; in ath11k_dp_process_rx()
2759 ab->hw_params.hal_params->rx_buf_rbm); in ath11k_dp_process_rx()
2768 struct ath11k_rx_peer_stats *rx_stats = arsta->rx_stats; in ath11k_dp_rx_update_peer_stats()
2775 arsta->rssi_comb = ppdu_info->rssi_comb; in ath11k_dp_rx_update_peer_stats()
2776 ewma_avg_rssi_add(&arsta->avg_rssi, ppdu_info->rssi_comb); in ath11k_dp_rx_update_peer_stats()
2778 num_msdu = ppdu_info->tcp_msdu_count + ppdu_info->tcp_ack_msdu_count + in ath11k_dp_rx_update_peer_stats()
2779 ppdu_info->udp_msdu_count + ppdu_info->other_msdu_count; in ath11k_dp_rx_update_peer_stats()
2781 rx_stats->num_msdu += num_msdu; in ath11k_dp_rx_update_peer_stats()
2782 rx_stats->tcp_msdu_count += ppdu_info->tcp_msdu_count + in ath11k_dp_rx_update_peer_stats()
2783 ppdu_info->tcp_ack_msdu_count; in ath11k_dp_rx_update_peer_stats()
2784 rx_stats->udp_msdu_count += ppdu_info->udp_msdu_count; in ath11k_dp_rx_update_peer_stats()
2785 rx_stats->other_msdu_count += ppdu_info->other_msdu_count; in ath11k_dp_rx_update_peer_stats()
2787 if (ppdu_info->preamble_type == HAL_RX_PREAMBLE_11A || in ath11k_dp_rx_update_peer_stats()
2788 ppdu_info->preamble_type == HAL_RX_PREAMBLE_11B) { in ath11k_dp_rx_update_peer_stats()
2789 ppdu_info->nss = 1; in ath11k_dp_rx_update_peer_stats()
2790 ppdu_info->mcs = HAL_RX_MAX_MCS; in ath11k_dp_rx_update_peer_stats()
2791 ppdu_info->tid = IEEE80211_NUM_TIDS; in ath11k_dp_rx_update_peer_stats()
2794 if (ppdu_info->nss > 0 && ppdu_info->nss <= HAL_RX_MAX_NSS) in ath11k_dp_rx_update_peer_stats()
2795 rx_stats->nss_count[ppdu_info->nss - 1] += num_msdu; in ath11k_dp_rx_update_peer_stats()
2797 if (ppdu_info->mcs <= HAL_RX_MAX_MCS) in ath11k_dp_rx_update_peer_stats()
2798 rx_stats->mcs_count[ppdu_info->mcs] += num_msdu; in ath11k_dp_rx_update_peer_stats()
2800 if (ppdu_info->gi < HAL_RX_GI_MAX) in ath11k_dp_rx_update_peer_stats()
2801 rx_stats->gi_count[ppdu_info->gi] += num_msdu; in ath11k_dp_rx_update_peer_stats()
2803 if (ppdu_info->bw < HAL_RX_BW_MAX) in ath11k_dp_rx_update_peer_stats()
2804 rx_stats->bw_count[ppdu_info->bw] += num_msdu; in ath11k_dp_rx_update_peer_stats()
2806 if (ppdu_info->ldpc < HAL_RX_SU_MU_CODING_MAX) in ath11k_dp_rx_update_peer_stats()
2807 rx_stats->coding_count[ppdu_info->ldpc] += num_msdu; in ath11k_dp_rx_update_peer_stats()
2809 if (ppdu_info->tid <= IEEE80211_NUM_TIDS) in ath11k_dp_rx_update_peer_stats()
2810 rx_stats->tid_count[ppdu_info->tid] += num_msdu; in ath11k_dp_rx_update_peer_stats()
2812 if (ppdu_info->preamble_type < HAL_RX_PREAMBLE_MAX) in ath11k_dp_rx_update_peer_stats()
2813 rx_stats->pream_cnt[ppdu_info->preamble_type] += num_msdu; in ath11k_dp_rx_update_peer_stats()
2815 if (ppdu_info->reception_type < HAL_RX_RECEPTION_TYPE_MAX) in ath11k_dp_rx_update_peer_stats()
2816 rx_stats->reception_type[ppdu_info->reception_type] += num_msdu; in ath11k_dp_rx_update_peer_stats()
2818 if (ppdu_info->is_stbc) in ath11k_dp_rx_update_peer_stats()
2819 rx_stats->stbc_count += num_msdu; in ath11k_dp_rx_update_peer_stats()
2821 if (ppdu_info->beamformed) in ath11k_dp_rx_update_peer_stats()
2822 rx_stats->beamformed_count += num_msdu; in ath11k_dp_rx_update_peer_stats()
2824 if (ppdu_info->num_mpdu_fcs_ok > 1) in ath11k_dp_rx_update_peer_stats()
2825 rx_stats->ampdu_msdu_count += num_msdu; in ath11k_dp_rx_update_peer_stats()
2827 rx_stats->non_ampdu_msdu_count += num_msdu; in ath11k_dp_rx_update_peer_stats()
2829 rx_stats->num_mpdu_fcs_ok += ppdu_info->num_mpdu_fcs_ok; in ath11k_dp_rx_update_peer_stats()
2830 rx_stats->num_mpdu_fcs_err += ppdu_info->num_mpdu_fcs_err; in ath11k_dp_rx_update_peer_stats()
2831 rx_stats->dcm_count += ppdu_info->dcm; in ath11k_dp_rx_update_peer_stats()
2832 rx_stats->ru_alloc_cnt[ppdu_info->ru_alloc] += num_msdu; in ath11k_dp_rx_update_peer_stats()
2834 arsta->rssi_comb = ppdu_info->rssi_comb; in ath11k_dp_rx_update_peer_stats()
2836 BUILD_BUG_ON(ARRAY_SIZE(arsta->chain_signal) > in ath11k_dp_rx_update_peer_stats()
2837 ARRAY_SIZE(ppdu_info->rssi_chain_pri20)); in ath11k_dp_rx_update_peer_stats()
2839 for (i = 0; i < ARRAY_SIZE(arsta->chain_signal); i++) in ath11k_dp_rx_update_peer_stats()
2840 arsta->chain_signal[i] = ppdu_info->rssi_chain_pri20[i]; in ath11k_dp_rx_update_peer_stats()
2842 rx_stats->rx_duration += ppdu_info->rx_duration; in ath11k_dp_rx_update_peer_stats()
2843 arsta->rx_duration = rx_stats->rx_duration; in ath11k_dp_rx_update_peer_stats()
2859 if (!IS_ALIGNED((unsigned long)skb->data, in ath11k_dp_rx_alloc_mon_status_buf()
2861 skb_pull(skb, PTR_ALIGN(skb->data, DP_RX_BUFFER_ALIGN_SIZE) - in ath11k_dp_rx_alloc_mon_status_buf()
2862 skb->data); in ath11k_dp_rx_alloc_mon_status_buf()
2865 paddr = dma_map_single(ab->dev, skb->data, in ath11k_dp_rx_alloc_mon_status_buf()
2866 skb->len + skb_tailroom(skb), in ath11k_dp_rx_alloc_mon_status_buf()
2868 if (unlikely(dma_mapping_error(ab->dev, paddr))) in ath11k_dp_rx_alloc_mon_status_buf()
2871 spin_lock_bh(&rx_ring->idr_lock); in ath11k_dp_rx_alloc_mon_status_buf()
2872 *buf_id = idr_alloc(&rx_ring->bufs_idr, skb, 0, in ath11k_dp_rx_alloc_mon_status_buf()
2873 rx_ring->bufs_max, GFP_ATOMIC); in ath11k_dp_rx_alloc_mon_status_buf()
2874 spin_unlock_bh(&rx_ring->idr_lock); in ath11k_dp_rx_alloc_mon_status_buf()
2878 ATH11K_SKB_RXCB(skb)->paddr = paddr; in ath11k_dp_rx_alloc_mon_status_buf()
2882 dma_unmap_single(ab->dev, paddr, skb->len + skb_tailroom(skb), in ath11k_dp_rx_alloc_mon_status_buf()
2904 req_entries = min(req_entries, rx_ring->bufs_max); in ath11k_dp_rx_mon_status_bufs_replenish()
2906 srng = &ab->hal.srng_list[rx_ring->refill_buf_ring.ring_id]; in ath11k_dp_rx_mon_status_bufs_replenish()
2908 spin_lock_bh(&srng->lock); in ath11k_dp_rx_mon_status_bufs_replenish()
2922 paddr = ATH11K_SKB_RXCB(skb)->paddr; in ath11k_dp_rx_mon_status_bufs_replenish()
2931 num_remain--; in ath11k_dp_rx_mon_status_bufs_replenish()
2938 spin_unlock_bh(&srng->lock); in ath11k_dp_rx_mon_status_bufs_replenish()
2940 return req_entries - num_remain; in ath11k_dp_rx_mon_status_bufs_replenish()
2943 spin_lock_bh(&rx_ring->idr_lock); in ath11k_dp_rx_mon_status_bufs_replenish()
2944 idr_remove(&rx_ring->bufs_idr, buf_id); in ath11k_dp_rx_mon_status_bufs_replenish()
2945 spin_unlock_bh(&rx_ring->idr_lock); in ath11k_dp_rx_mon_status_bufs_replenish()
2946 dma_unmap_single(ab->dev, paddr, skb->len + skb_tailroom(skb), in ath11k_dp_rx_mon_status_bufs_replenish()
2950 spin_unlock_bh(&srng->lock); in ath11k_dp_rx_mon_status_bufs_replenish()
2952 return req_entries - num_remain; in ath11k_dp_rx_mon_status_bufs_replenish()
2966 tlv_len = FIELD_GET(HAL_TLV_HDR_LEN, tlv->tl); in ath11k_dp_rx_mon_update_status_buf_state()
2971 if (FIELD_GET(HAL_TLV_HDR_TAG, tlv->tl) != HAL_RX_PPDU_START) in ath11k_dp_rx_mon_update_status_buf_state()
2977 __le32_to_cpu(ppdu_start->info0)); in ath11k_dp_rx_mon_update_status_buf_state()
2979 if (pmon->sw_mon_entries.ppdu_id < ppdu_id) { in ath11k_dp_rx_mon_update_status_buf_state()
2980 pmon->buf_state = DP_MON_STATUS_LEAD; in ath11k_dp_rx_mon_update_status_buf_state()
2981 ppdu_id_diff = ppdu_id - pmon->sw_mon_entries.ppdu_id; in ath11k_dp_rx_mon_update_status_buf_state()
2983 pmon->buf_state = DP_MON_STATUS_LAG; in ath11k_dp_rx_mon_update_status_buf_state()
2984 } else if (pmon->sw_mon_entries.ppdu_id > ppdu_id) { in ath11k_dp_rx_mon_update_status_buf_state()
2985 pmon->buf_state = DP_MON_STATUS_LAG; in ath11k_dp_rx_mon_update_status_buf_state()
2986 ppdu_id_diff = pmon->sw_mon_entries.ppdu_id - ppdu_id; in ath11k_dp_rx_mon_update_status_buf_state()
2988 pmon->buf_state = DP_MON_STATUS_LEAD; in ath11k_dp_rx_mon_update_status_buf_state()
3013 spin_lock_bh(&rx_ring->idr_lock); in ath11k_dp_rx_mon_buf_done()
3014 skb = idr_find(&rx_ring->bufs_idr, buf_id); in ath11k_dp_rx_mon_buf_done()
3015 spin_unlock_bh(&rx_ring->idr_lock); in ath11k_dp_rx_mon_buf_done()
3021 dma_sync_single_for_cpu(ab->dev, rxcb->paddr, in ath11k_dp_rx_mon_buf_done()
3022 skb->len + skb_tailroom(skb), in ath11k_dp_rx_mon_buf_done()
3025 tlv = (struct hal_tlv_hdr *)skb->data; in ath11k_dp_rx_mon_buf_done()
3026 if (FIELD_GET(HAL_TLV_HDR_TAG, tlv->tl) != HAL_RX_STATUS_BUFFER_DONE) in ath11k_dp_rx_mon_buf_done()
3052 ar = ab->pdevs[ath11k_hw_mac_id_to_pdev_id(&ab->hw_params, mac_id)].ar; in ath11k_dp_rx_reap_mon_status_ring()
3053 dp = &ar->dp; in ath11k_dp_rx_reap_mon_status_ring()
3054 pmon = &dp->mon_data; in ath11k_dp_rx_reap_mon_status_ring()
3055 srng_id = ath11k_hw_mac_id_to_srng_id(&ab->hw_params, mac_id); in ath11k_dp_rx_reap_mon_status_ring()
3056 rx_ring = &dp->rx_mon_status_refill_ring[srng_id]; in ath11k_dp_rx_reap_mon_status_ring()
3058 srng = &ab->hal.srng_list[rx_ring->refill_buf_ring.ring_id]; in ath11k_dp_rx_reap_mon_status_ring()
3060 spin_lock_bh(&srng->lock); in ath11k_dp_rx_reap_mon_status_ring()
3064 *budget -= 1; in ath11k_dp_rx_reap_mon_status_ring()
3068 pmon->buf_state = DP_MON_STATUS_REPLINISH; in ath11k_dp_rx_reap_mon_status_ring()
3077 spin_lock_bh(&rx_ring->idr_lock); in ath11k_dp_rx_reap_mon_status_ring()
3078 skb = idr_find(&rx_ring->bufs_idr, buf_id); in ath11k_dp_rx_reap_mon_status_ring()
3079 spin_unlock_bh(&rx_ring->idr_lock); in ath11k_dp_rx_reap_mon_status_ring()
3084 pmon->buf_state = DP_MON_STATUS_REPLINISH; in ath11k_dp_rx_reap_mon_status_ring()
3090 dma_sync_single_for_cpu(ab->dev, rxcb->paddr, in ath11k_dp_rx_reap_mon_status_ring()
3091 skb->len + skb_tailroom(skb), in ath11k_dp_rx_reap_mon_status_ring()
3094 tlv = (struct hal_tlv_hdr *)skb->data; in ath11k_dp_rx_reap_mon_status_ring()
3095 if (FIELD_GET(HAL_TLV_HDR_TAG, tlv->tl) != in ath11k_dp_rx_reap_mon_status_ring()
3099 tlv->tl), buf_id); in ath11k_dp_rx_reap_mon_status_ring()
3121 spin_lock_bh(&rx_ring->idr_lock); in ath11k_dp_rx_reap_mon_status_ring()
3122 idr_remove(&rx_ring->bufs_idr, buf_id); in ath11k_dp_rx_reap_mon_status_ring()
3123 spin_unlock_bh(&rx_ring->idr_lock); in ath11k_dp_rx_reap_mon_status_ring()
3125 dma_unmap_single(ab->dev, rxcb->paddr, in ath11k_dp_rx_reap_mon_status_ring()
3126 skb->len + skb_tailroom(skb), in ath11k_dp_rx_reap_mon_status_ring()
3130 pmon->buf_state = DP_MON_STATUS_REPLINISH; in ath11k_dp_rx_reap_mon_status_ring()
3134 spin_lock_bh(&rx_ring->idr_lock); in ath11k_dp_rx_reap_mon_status_ring()
3135 idr_remove(&rx_ring->bufs_idr, buf_id); in ath11k_dp_rx_reap_mon_status_ring()
3136 spin_unlock_bh(&rx_ring->idr_lock); in ath11k_dp_rx_reap_mon_status_ring()
3137 if (ab->hw_params.full_monitor_mode) { in ath11k_dp_rx_reap_mon_status_ring()
3139 if (paddr == pmon->mon_status_paddr) in ath11k_dp_rx_reap_mon_status_ring()
3140 pmon->buf_state = DP_MON_STATUS_MATCH; in ath11k_dp_rx_reap_mon_status_ring()
3143 dma_unmap_single(ab->dev, rxcb->paddr, in ath11k_dp_rx_reap_mon_status_ring()
3144 skb->len + skb_tailroom(skb), in ath11k_dp_rx_reap_mon_status_ring()
3149 pmon->buf_state = DP_MON_STATUS_REPLINISH; in ath11k_dp_rx_reap_mon_status_ring()
3156 hal_params = ab->hw_params.hal_params; in ath11k_dp_rx_reap_mon_status_ring()
3158 hal_params->rx_buf_rbm); in ath11k_dp_rx_reap_mon_status_ring()
3167 ath11k_hal_rx_buf_addr_info_set(rx_mon_status_desc, rxcb->paddr, in ath11k_dp_rx_reap_mon_status_ring()
3169 ab->hw_params.hal_params->rx_buf_rbm); in ath11k_dp_rx_reap_mon_status_ring()
3174 spin_unlock_bh(&srng->lock); in ath11k_dp_rx_reap_mon_status_ring()
3183 spin_lock_bh(&rx_tid->ab->base_lock); in ath11k_dp_rx_frag_timer()
3184 if (rx_tid->last_frag_no && in ath11k_dp_rx_frag_timer()
3185 rx_tid->rx_frag_bitmap == GENMASK(rx_tid->last_frag_no, 0)) { in ath11k_dp_rx_frag_timer()
3186 spin_unlock_bh(&rx_tid->ab->base_lock); in ath11k_dp_rx_frag_timer()
3190 spin_unlock_bh(&rx_tid->ab->base_lock); in ath11k_dp_rx_frag_timer()
3195 struct ath11k_base *ab = ar->ab; in ath11k_peer_rx_frag_setup()
3208 spin_lock_bh(&ab->base_lock); in ath11k_peer_rx_frag_setup()
3213 spin_unlock_bh(&ab->base_lock); in ath11k_peer_rx_frag_setup()
3215 return -ENOENT; in ath11k_peer_rx_frag_setup()
3219 rx_tid = &peer->rx_tid[i]; in ath11k_peer_rx_frag_setup()
3220 rx_tid->ab = ab; in ath11k_peer_rx_frag_setup()
3221 timer_setup(&rx_tid->frag_timer, ath11k_dp_rx_frag_timer, 0); in ath11k_peer_rx_frag_setup()
3222 skb_queue_head_init(&rx_tid->rx_frags); in ath11k_peer_rx_frag_setup()
3225 peer->tfm_mmic = tfm; in ath11k_peer_rx_frag_setup()
3226 peer->dp_setup_done = true; in ath11k_peer_rx_frag_setup()
3227 spin_unlock_bh(&ab->base_lock); in ath11k_peer_rx_frag_setup()
3242 return -EINVAL; in ath11k_dp_rx_h_michael_mic()
3244 desc->tfm = tfm; in ath11k_dp_rx_h_michael_mic()
3257 if (ieee80211_is_data_qos(hdr->frame_control)) in ath11k_dp_rx_h_michael_mic()
3276 struct hal_rx_desc *rx_desc = (struct hal_rx_desc *)msdu->data; in ath11k_dp_rx_h_verify_tkip_mic()
3283 u32 hdr_len, hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_h_verify_tkip_mic()
3287 if (ath11k_dp_rx_h_mpdu_start_enctype(ar->ab, rx_desc) != in ath11k_dp_rx_h_verify_tkip_mic()
3291 hdr = (struct ieee80211_hdr *)(msdu->data + hal_rx_desc_sz); in ath11k_dp_rx_h_verify_tkip_mic()
3292 hdr_len = ieee80211_hdrlen(hdr->frame_control); in ath11k_dp_rx_h_verify_tkip_mic()
3296 if (!is_multicast_ether_addr(hdr->addr1)) in ath11k_dp_rx_h_verify_tkip_mic()
3297 key_idx = peer->ucast_keyidx; in ath11k_dp_rx_h_verify_tkip_mic()
3299 key_idx = peer->mcast_keyidx; in ath11k_dp_rx_h_verify_tkip_mic()
3301 key_conf = peer->keys[key_idx]; in ath11k_dp_rx_h_verify_tkip_mic()
3303 data = msdu->data + head_len; in ath11k_dp_rx_h_verify_tkip_mic()
3304 data_len = msdu->len - head_len - tail_len; in ath11k_dp_rx_h_verify_tkip_mic()
3305 key = &key_conf->key[NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY]; in ath11k_dp_rx_h_verify_tkip_mic()
3307 ret = ath11k_dp_rx_h_michael_mic(peer->tfm_mmic, key, hdr, data, data_len, mic); in ath11k_dp_rx_h_verify_tkip_mic()
3314 (ATH11K_SKB_RXCB(msdu))->is_first_msdu = true; in ath11k_dp_rx_h_verify_tkip_mic()
3315 (ATH11K_SKB_RXCB(msdu))->is_last_msdu = true; in ath11k_dp_rx_h_verify_tkip_mic()
3317 rxs->flag |= RX_FLAG_MMIC_ERROR | RX_FLAG_MMIC_STRIPPED | in ath11k_dp_rx_h_verify_tkip_mic()
3324 ieee80211_rx(ar->hw, msdu); in ath11k_dp_rx_h_verify_tkip_mic()
3325 return -EINVAL; in ath11k_dp_rx_h_verify_tkip_mic()
3334 u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_h_undecap_frag()
3339 hdr = (struct ieee80211_hdr *)(msdu->data + hal_rx_desc_sz); in ath11k_dp_rx_h_undecap_frag()
3342 skb_trim(msdu, msdu->len - in ath11k_dp_rx_h_undecap_frag()
3346 skb_trim(msdu, msdu->len - in ath11k_dp_rx_h_undecap_frag()
3350 hdr_len = ieee80211_hdrlen(hdr->frame_control); in ath11k_dp_rx_h_undecap_frag()
3353 memmove((void *)msdu->data + hal_rx_desc_sz + crypto_len, in ath11k_dp_rx_h_undecap_frag()
3354 (void *)msdu->data + hal_rx_desc_sz, hdr_len); in ath11k_dp_rx_h_undecap_frag()
3372 u32 flags, hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_h_defrag()
3374 first_frag = skb_peek(&rx_tid->rx_frags); in ath11k_dp_rx_h_defrag()
3375 last_frag = skb_peek_tail(&rx_tid->rx_frags); in ath11k_dp_rx_h_defrag()
3377 skb_queue_walk(&rx_tid->rx_frags, skb) { in ath11k_dp_rx_h_defrag()
3379 rx_desc = (struct hal_rx_desc *)skb->data; in ath11k_dp_rx_h_defrag()
3380 hdr = (struct ieee80211_hdr *)(skb->data + hal_rx_desc_sz); in ath11k_dp_rx_h_defrag()
3382 enctype = ath11k_dp_rx_h_mpdu_start_enctype(ar->ab, rx_desc); in ath11k_dp_rx_h_defrag()
3384 rx_attention = ath11k_dp_rx_get_attention(ar->ab, rx_desc); in ath11k_dp_rx_h_defrag()
3398 skb_trim(skb, skb->len - FCS_LEN); in ath11k_dp_rx_h_defrag()
3403 ieee80211_hdrlen(hdr->frame_control)); in ath11k_dp_rx_h_defrag()
3404 msdu_len += skb->len; in ath11k_dp_rx_h_defrag()
3407 extra_space = msdu_len - (DP_RX_BUFFER_SIZE + skb_tailroom(first_frag)); in ath11k_dp_rx_h_defrag()
3410 return -ENOMEM; in ath11k_dp_rx_h_defrag()
3412 __skb_unlink(first_frag, &rx_tid->rx_frags); in ath11k_dp_rx_h_defrag()
3413 while ((skb = __skb_dequeue(&rx_tid->rx_frags))) { in ath11k_dp_rx_h_defrag()
3414 skb_put_data(first_frag, skb->data, skb->len); in ath11k_dp_rx_h_defrag()
3418 hdr = (struct ieee80211_hdr *)(first_frag->data + hal_rx_desc_sz); in ath11k_dp_rx_h_defrag()
3419 hdr->frame_control &= ~__cpu_to_le16(IEEE80211_FCTL_MOREFRAGS); in ath11k_dp_rx_h_defrag()
3420 ATH11K_SKB_RXCB(first_frag)->is_frag = 1; in ath11k_dp_rx_h_defrag()
3432 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_h_defrag_reo_reinject()
3433 struct ath11k_pdev_dp *dp = &ar->dp; in ath11k_dp_rx_h_defrag_reo_reinject()
3434 struct dp_rxdma_ring *rx_refill_ring = &dp->rx_refill_buf_ring; in ath11k_dp_rx_h_defrag_reo_reinject()
3435 struct hal_rx_desc *rx_desc = (struct hal_rx_desc *)defrag_skb->data; in ath11k_dp_rx_h_defrag_reo_reinject()
3447 hal_rx_desc_sz = ab->hw_params.hal_desc_sz; in ath11k_dp_rx_h_defrag_reo_reinject()
3448 link_desc_banks = ab->dp.link_desc_banks; in ath11k_dp_rx_h_defrag_reo_reinject()
3449 reo_dest_ring = rx_tid->dst_ring_desc; in ath11k_dp_rx_h_defrag_reo_reinject()
3453 (paddr - link_desc_banks[desc_bank].paddr)); in ath11k_dp_rx_h_defrag_reo_reinject()
3454 msdu0 = &msdu_link->msdu_link[0]; in ath11k_dp_rx_h_defrag_reo_reinject()
3455 dst_idx = FIELD_GET(RX_MSDU_DESC_INFO0_REO_DEST_IND, msdu0->rx_msdu_info.info0); in ath11k_dp_rx_h_defrag_reo_reinject()
3462 defrag_skb->len - hal_rx_desc_sz) | in ath11k_dp_rx_h_defrag_reo_reinject()
3466 msdu0->rx_msdu_info.info0 = msdu_info; in ath11k_dp_rx_h_defrag_reo_reinject()
3469 ath11k_dp_rxdesc_set_msdu_len(ab, rx_desc, defrag_skb->len - hal_rx_desc_sz); in ath11k_dp_rx_h_defrag_reo_reinject()
3471 paddr = dma_map_single(ab->dev, defrag_skb->data, in ath11k_dp_rx_h_defrag_reo_reinject()
3472 defrag_skb->len + skb_tailroom(defrag_skb), in ath11k_dp_rx_h_defrag_reo_reinject()
3474 if (dma_mapping_error(ab->dev, paddr)) in ath11k_dp_rx_h_defrag_reo_reinject()
3475 return -ENOMEM; in ath11k_dp_rx_h_defrag_reo_reinject()
3477 spin_lock_bh(&rx_refill_ring->idr_lock); in ath11k_dp_rx_h_defrag_reo_reinject()
3478 buf_id = idr_alloc(&rx_refill_ring->bufs_idr, defrag_skb, 0, in ath11k_dp_rx_h_defrag_reo_reinject()
3479 rx_refill_ring->bufs_max * 3, GFP_ATOMIC); in ath11k_dp_rx_h_defrag_reo_reinject()
3480 spin_unlock_bh(&rx_refill_ring->idr_lock); in ath11k_dp_rx_h_defrag_reo_reinject()
3482 ret = -ENOMEM; in ath11k_dp_rx_h_defrag_reo_reinject()
3486 ATH11K_SKB_RXCB(defrag_skb)->paddr = paddr; in ath11k_dp_rx_h_defrag_reo_reinject()
3487 cookie = FIELD_PREP(DP_RXDMA_BUF_COOKIE_PDEV_ID, dp->mac_id) | in ath11k_dp_rx_h_defrag_reo_reinject()
3491 ab->hw_params.hal_params->rx_buf_rbm); in ath11k_dp_rx_h_defrag_reo_reinject()
3494 srng = &ab->hal.srng_list[ab->dp.reo_reinject_ring.ring_id]; in ath11k_dp_rx_h_defrag_reo_reinject()
3496 spin_lock_bh(&srng->lock); in ath11k_dp_rx_h_defrag_reo_reinject()
3503 spin_unlock_bh(&srng->lock); in ath11k_dp_rx_h_defrag_reo_reinject()
3504 ret = -ENOSPC; in ath11k_dp_rx_h_defrag_reo_reinject()
3514 FIELD_PREP(RX_MPDU_DESC_INFO0_SEQ_NUM, rx_tid->cur_sn) | in ath11k_dp_rx_h_defrag_reo_reinject()
3521 reo_ent_ring->rx_mpdu_info.info0 = mpdu_info; in ath11k_dp_rx_h_defrag_reo_reinject()
3522 reo_ent_ring->rx_mpdu_info.meta_data = reo_dest_ring->rx_mpdu_info.meta_data; in ath11k_dp_rx_h_defrag_reo_reinject()
3523 reo_ent_ring->queue_addr_lo = reo_dest_ring->queue_addr_lo; in ath11k_dp_rx_h_defrag_reo_reinject()
3524 reo_ent_ring->info0 = FIELD_PREP(HAL_REO_ENTR_RING_INFO0_QUEUE_ADDR_HI, in ath11k_dp_rx_h_defrag_reo_reinject()
3526 reo_dest_ring->info0)) | in ath11k_dp_rx_h_defrag_reo_reinject()
3529 spin_unlock_bh(&srng->lock); in ath11k_dp_rx_h_defrag_reo_reinject()
3534 spin_lock_bh(&rx_refill_ring->idr_lock); in ath11k_dp_rx_h_defrag_reo_reinject()
3535 idr_remove(&rx_refill_ring->bufs_idr, buf_id); in ath11k_dp_rx_h_defrag_reo_reinject()
3536 spin_unlock_bh(&rx_refill_ring->idr_lock); in ath11k_dp_rx_h_defrag_reo_reinject()
3538 dma_unmap_single(ab->dev, paddr, defrag_skb->len + skb_tailroom(defrag_skb), in ath11k_dp_rx_h_defrag_reo_reinject()
3548 frag1 = ath11k_dp_rx_h_mpdu_start_frag_no(ar->ab, a); in ath11k_dp_rx_h_cmp_frags()
3549 frag2 = ath11k_dp_rx_h_mpdu_start_frag_no(ar->ab, b); in ath11k_dp_rx_h_cmp_frags()
3551 return frag1 - frag2; in ath11k_dp_rx_h_cmp_frags()
3576 u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_h_get_pn()
3578 hdr = (struct ieee80211_hdr *)(skb->data + hal_rx_desc_sz); in ath11k_dp_rx_h_get_pn()
3579 ehdr = skb->data + hal_rx_desc_sz + ieee80211_hdrlen(hdr->frame_control); in ath11k_dp_rx_h_get_pn()
3600 first_frag = skb_peek(&rx_tid->rx_frags); in ath11k_dp_rx_h_defrag_validate_incr_pn()
3601 desc = (struct hal_rx_desc *)first_frag->data; in ath11k_dp_rx_h_defrag_validate_incr_pn()
3603 encrypt_type = ath11k_dp_rx_h_mpdu_start_enctype(ar->ab, desc); in ath11k_dp_rx_h_defrag_validate_incr_pn()
3611 skb_queue_walk(&rx_tid->rx_frags, skb) { in ath11k_dp_rx_h_defrag_validate_incr_pn()
3627 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_frag_h_mpdu()
3639 rx_desc = (struct hal_rx_desc *)msdu->data; in ath11k_dp_rx_frag_h_mpdu()
3640 peer_id = ath11k_dp_rx_h_mpdu_start_peer_id(ar->ab, rx_desc); in ath11k_dp_rx_frag_h_mpdu()
3641 tid = ath11k_dp_rx_h_mpdu_start_tid(ar->ab, rx_desc); in ath11k_dp_rx_frag_h_mpdu()
3642 seqno = ath11k_dp_rx_h_mpdu_start_seq_no(ar->ab, rx_desc); in ath11k_dp_rx_frag_h_mpdu()
3643 frag_no = ath11k_dp_rx_h_mpdu_start_frag_no(ar->ab, msdu); in ath11k_dp_rx_frag_h_mpdu()
3644 more_frags = ath11k_dp_rx_h_mpdu_start_more_frags(ar->ab, msdu); in ath11k_dp_rx_frag_h_mpdu()
3645 is_mcbc = ath11k_dp_rx_h_attn_is_mcbc(ar->ab, rx_desc); in ath11k_dp_rx_frag_h_mpdu()
3649 return -EINVAL; in ath11k_dp_rx_frag_h_mpdu()
3651 if (!ath11k_dp_rx_h_mpdu_start_seq_ctrl_valid(ar->ab, rx_desc) || in ath11k_dp_rx_frag_h_mpdu()
3652 !ath11k_dp_rx_h_mpdu_start_fc_valid(ar->ab, rx_desc) || in ath11k_dp_rx_frag_h_mpdu()
3654 return -EINVAL; in ath11k_dp_rx_frag_h_mpdu()
3662 return -EINVAL; in ath11k_dp_rx_frag_h_mpdu()
3664 spin_lock_bh(&ab->base_lock); in ath11k_dp_rx_frag_h_mpdu()
3667 ath11k_warn(ab, "failed to find the peer to de-fragment received fragment peer_id %d\n", in ath11k_dp_rx_frag_h_mpdu()
3669 ret = -ENOENT; in ath11k_dp_rx_frag_h_mpdu()
3672 if (!peer->dp_setup_done) { in ath11k_dp_rx_frag_h_mpdu()
3674 peer->addr, peer_id); in ath11k_dp_rx_frag_h_mpdu()
3675 ret = -ENOENT; in ath11k_dp_rx_frag_h_mpdu()
3679 rx_tid = &peer->rx_tid[tid]; in ath11k_dp_rx_frag_h_mpdu()
3681 if ((!skb_queue_empty(&rx_tid->rx_frags) && seqno != rx_tid->cur_sn) || in ath11k_dp_rx_frag_h_mpdu()
3682 skb_queue_empty(&rx_tid->rx_frags)) { in ath11k_dp_rx_frag_h_mpdu()
3685 rx_tid->cur_sn = seqno; in ath11k_dp_rx_frag_h_mpdu()
3688 if (rx_tid->rx_frag_bitmap & BIT(frag_no)) { in ath11k_dp_rx_frag_h_mpdu()
3690 ret = -EINVAL; in ath11k_dp_rx_frag_h_mpdu()
3694 if (!rx_tid->rx_frag_bitmap || (frag_no > __fls(rx_tid->rx_frag_bitmap))) in ath11k_dp_rx_frag_h_mpdu()
3695 __skb_queue_tail(&rx_tid->rx_frags, msdu); in ath11k_dp_rx_frag_h_mpdu()
3697 ath11k_dp_rx_h_sort_frags(ar, &rx_tid->rx_frags, msdu); in ath11k_dp_rx_frag_h_mpdu()
3699 rx_tid->rx_frag_bitmap |= BIT(frag_no); in ath11k_dp_rx_frag_h_mpdu()
3701 rx_tid->last_frag_no = frag_no; in ath11k_dp_rx_frag_h_mpdu()
3704 rx_tid->dst_ring_desc = kmemdup(ring_desc, in ath11k_dp_rx_frag_h_mpdu()
3705 sizeof(*rx_tid->dst_ring_desc), in ath11k_dp_rx_frag_h_mpdu()
3707 if (!rx_tid->dst_ring_desc) { in ath11k_dp_rx_frag_h_mpdu()
3708 ret = -ENOMEM; in ath11k_dp_rx_frag_h_mpdu()
3716 if (!rx_tid->last_frag_no || in ath11k_dp_rx_frag_h_mpdu()
3717 rx_tid->rx_frag_bitmap != GENMASK(rx_tid->last_frag_no, 0)) { in ath11k_dp_rx_frag_h_mpdu()
3718 mod_timer(&rx_tid->frag_timer, jiffies + in ath11k_dp_rx_frag_h_mpdu()
3723 spin_unlock_bh(&ab->base_lock); in ath11k_dp_rx_frag_h_mpdu()
3724 del_timer_sync(&rx_tid->frag_timer); in ath11k_dp_rx_frag_h_mpdu()
3725 spin_lock_bh(&ab->base_lock); in ath11k_dp_rx_frag_h_mpdu()
3750 spin_unlock_bh(&ab->base_lock); in ath11k_dp_rx_frag_h_mpdu()
3757 struct ath11k_pdev_dp *dp = &ar->dp; in ath11k_dp_process_rx_err_buf()
3758 struct dp_rxdma_ring *rx_ring = &dp->rx_refill_buf_ring; in ath11k_dp_process_rx_err_buf()
3764 u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_process_rx_err_buf()
3766 spin_lock_bh(&rx_ring->idr_lock); in ath11k_dp_process_rx_err_buf()
3767 msdu = idr_find(&rx_ring->bufs_idr, buf_id); in ath11k_dp_process_rx_err_buf()
3769 ath11k_warn(ar->ab, "rx err buf with invalid buf_id %d\n", in ath11k_dp_process_rx_err_buf()
3771 spin_unlock_bh(&rx_ring->idr_lock); in ath11k_dp_process_rx_err_buf()
3772 return -EINVAL; in ath11k_dp_process_rx_err_buf()
3775 idr_remove(&rx_ring->bufs_idr, buf_id); in ath11k_dp_process_rx_err_buf()
3776 spin_unlock_bh(&rx_ring->idr_lock); in ath11k_dp_process_rx_err_buf()
3779 dma_unmap_single(ar->ab->dev, rxcb->paddr, in ath11k_dp_process_rx_err_buf()
3780 msdu->len + skb_tailroom(msdu), in ath11k_dp_process_rx_err_buf()
3789 if (!rcu_dereference(ar->ab->pdevs_active[ar->pdev_idx])) { in ath11k_dp_process_rx_err_buf()
3794 if (test_bit(ATH11K_CAC_RUNNING, &ar->dev_flags)) { in ath11k_dp_process_rx_err_buf()
3799 rx_desc = (struct hal_rx_desc *)msdu->data; in ath11k_dp_process_rx_err_buf()
3800 msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(ar->ab, rx_desc); in ath11k_dp_process_rx_err_buf()
3802 hdr_status = ath11k_dp_rx_h_80211_hdr(ar->ab, rx_desc); in ath11k_dp_process_rx_err_buf()
3803 ath11k_warn(ar->ab, "invalid msdu leng %u", msdu_len); in ath11k_dp_process_rx_err_buf()
3804 ath11k_dbg_dump(ar->ab, ATH11K_DBG_DATA, NULL, "", hdr_status, in ath11k_dp_process_rx_err_buf()
3806 ath11k_dbg_dump(ar->ab, ATH11K_DBG_DATA, NULL, "", rx_desc, in ath11k_dp_process_rx_err_buf()
3816 ath11k_dp_rx_link_desc_return(ar->ab, ring_desc, in ath11k_dp_process_rx_err_buf()
3848 dp = &ab->dp; in ath11k_dp_process_rx_err()
3849 reo_except = &dp->reo_except_ring; in ath11k_dp_process_rx_err()
3850 link_desc_banks = dp->link_desc_banks; in ath11k_dp_process_rx_err()
3852 srng = &ab->hal.srng_list[reo_except->ring_id]; in ath11k_dp_process_rx_err()
3854 spin_lock_bh(&srng->lock); in ath11k_dp_process_rx_err()
3862 ab->soc_stats.err_ring_pkts++; in ath11k_dp_process_rx_err()
3871 (paddr - link_desc_banks[desc_bank].paddr); in ath11k_dp_process_rx_err()
3876 ab->soc_stats.invalid_rbm++; in ath11k_dp_process_rx_err()
3883 is_frag = !!(reo_desc->rx_mpdu_info.info0 & RX_MPDU_DESC_INFO0_FRAG_FLAG); in ath11k_dp_process_rx_err()
3902 ar = ab->pdevs[mac_id].ar; in ath11k_dp_process_rx_err()
3915 budget = quota - tot_n_bufs_reaped; in ath11k_dp_process_rx_err()
3921 spin_unlock_bh(&srng->lock); in ath11k_dp_process_rx_err()
3923 for (i = 0; i < ab->num_radios; i++) { in ath11k_dp_process_rx_err()
3927 ar = ab->pdevs[i].ar; in ath11k_dp_process_rx_err()
3928 rx_ring = &ar->dp.rx_refill_buf_ring; in ath11k_dp_process_rx_err()
3931 ab->hw_params.hal_params->rx_buf_rbm); in ath11k_dp_process_rx_err()
3946 (DP_RX_BUFFER_SIZE - ar->ab->hw_params.hal_desc_sz)); in ath11k_dp_rx_null_q_desc_sg_drop()
3950 if (rxcb->err_rel_src == HAL_WBM_REL_SRC_MODULE_REO && in ath11k_dp_rx_null_q_desc_sg_drop()
3951 rxcb->err_code == HAL_REO_DEST_RING_ERROR_CODE_DESC_ADDR_ZERO) { in ath11k_dp_rx_null_q_desc_sg_drop()
3956 n_buffs--; in ath11k_dp_rx_null_q_desc_sg_drop()
3966 struct hal_rx_desc *desc = (struct hal_rx_desc *)msdu->data; in ath11k_dp_rx_h_null_q_desc()
3970 u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_h_null_q_desc()
3972 msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(ar->ab, desc); in ath11k_dp_rx_h_null_q_desc()
3974 if (!rxcb->is_frag && ((msdu_len + hal_rx_desc_sz) > DP_RX_BUFFER_SIZE)) { in ath11k_dp_rx_h_null_q_desc()
3976 msdu_len = msdu_len - (DP_RX_BUFFER_SIZE - hal_rx_desc_sz); in ath11k_dp_rx_h_null_q_desc()
3978 return -EINVAL; in ath11k_dp_rx_h_null_q_desc()
3981 rx_attention = ath11k_dp_rx_get_attention(ar->ab, desc); in ath11k_dp_rx_h_null_q_desc()
3983 ath11k_warn(ar->ab, in ath11k_dp_rx_h_null_q_desc()
3986 return -EIO; in ath11k_dp_rx_h_null_q_desc()
3994 * non-QOS TID queue, in the absence of any other default TID queue. in ath11k_dp_rx_h_null_q_desc()
3998 rxcb->is_first_msdu = ath11k_dp_rx_h_msdu_end_first_msdu(ar->ab, desc); in ath11k_dp_rx_h_null_q_desc()
3999 rxcb->is_last_msdu = ath11k_dp_rx_h_msdu_end_last_msdu(ar->ab, desc); in ath11k_dp_rx_h_null_q_desc()
4001 if (rxcb->is_frag) { in ath11k_dp_rx_h_null_q_desc()
4004 l3pad_bytes = ath11k_dp_rx_h_msdu_end_l3pad(ar->ab, desc); in ath11k_dp_rx_h_null_q_desc()
4007 return -EINVAL; in ath11k_dp_rx_h_null_q_desc()
4016 rxcb->tid = ath11k_dp_rx_h_mpdu_start_tid(ar->ab, desc); in ath11k_dp_rx_h_null_q_desc()
4032 ar->ab->soc_stats.reo_error[rxcb->err_code]++; in ath11k_dp_rx_h_reo_err()
4034 switch (rxcb->err_code) { in ath11k_dp_rx_h_reo_err()
4060 struct hal_rx_desc *desc = (struct hal_rx_desc *)msdu->data; in ath11k_dp_rx_h_tkip_mic_err()
4063 u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_h_tkip_mic_err()
4065 rxcb->is_first_msdu = ath11k_dp_rx_h_msdu_end_first_msdu(ar->ab, desc); in ath11k_dp_rx_h_tkip_mic_err()
4066 rxcb->is_last_msdu = ath11k_dp_rx_h_msdu_end_last_msdu(ar->ab, desc); in ath11k_dp_rx_h_tkip_mic_err()
4068 l3pad_bytes = ath11k_dp_rx_h_msdu_end_l3pad(ar->ab, desc); in ath11k_dp_rx_h_tkip_mic_err()
4069 msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(ar->ab, desc); in ath11k_dp_rx_h_tkip_mic_err()
4075 status->flag |= (RX_FLAG_MMIC_STRIPPED | RX_FLAG_MMIC_ERROR | in ath11k_dp_rx_h_tkip_mic_err()
4088 ar->ab->soc_stats.rxdma_error[rxcb->err_code]++; in ath11k_dp_rx_h_rxdma_err()
4090 switch (rxcb->err_code) { in ath11k_dp_rx_h_rxdma_err()
4114 switch (rxcb->err_rel_src) { in ath11k_dp_rx_wbm_err()
4138 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_rx_process_wbm_err()
4151 for (i = 0; i < ab->num_radios; i++) in ath11k_dp_rx_process_wbm_err()
4154 srng = &ab->hal.srng_list[dp->rx_rel_ring.ring_id]; in ath11k_dp_rx_process_wbm_err()
4156 spin_lock_bh(&srng->lock); in ath11k_dp_rx_process_wbm_err()
4176 ar = ab->pdevs[mac_id].ar; in ath11k_dp_rx_process_wbm_err()
4177 rx_ring = &ar->dp.rx_refill_buf_ring; in ath11k_dp_rx_process_wbm_err()
4179 spin_lock_bh(&rx_ring->idr_lock); in ath11k_dp_rx_process_wbm_err()
4180 msdu = idr_find(&rx_ring->bufs_idr, buf_id); in ath11k_dp_rx_process_wbm_err()
4184 spin_unlock_bh(&rx_ring->idr_lock); in ath11k_dp_rx_process_wbm_err()
4188 idr_remove(&rx_ring->bufs_idr, buf_id); in ath11k_dp_rx_process_wbm_err()
4189 spin_unlock_bh(&rx_ring->idr_lock); in ath11k_dp_rx_process_wbm_err()
4192 dma_unmap_single(ab->dev, rxcb->paddr, in ath11k_dp_rx_process_wbm_err()
4193 msdu->len + skb_tailroom(msdu), in ath11k_dp_rx_process_wbm_err()
4198 budget--; in ath11k_dp_rx_process_wbm_err()
4206 rxcb->err_rel_src = err_info.err_rel_src; in ath11k_dp_rx_process_wbm_err()
4207 rxcb->err_code = err_info.err_code; in ath11k_dp_rx_process_wbm_err()
4208 rxcb->rx_desc = (struct hal_rx_desc *)msdu->data; in ath11k_dp_rx_process_wbm_err()
4214 spin_unlock_bh(&srng->lock); in ath11k_dp_rx_process_wbm_err()
4219 for (i = 0; i < ab->num_radios; i++) { in ath11k_dp_rx_process_wbm_err()
4223 ar = ab->pdevs[i].ar; in ath11k_dp_rx_process_wbm_err()
4224 rx_ring = &ar->dp.rx_refill_buf_ring; in ath11k_dp_rx_process_wbm_err()
4227 ab->hw_params.hal_params->rx_buf_rbm); in ath11k_dp_rx_process_wbm_err()
4231 for (i = 0; i < ab->num_radios; i++) { in ath11k_dp_rx_process_wbm_err()
4232 if (!rcu_dereference(ab->pdevs_active[i])) { in ath11k_dp_rx_process_wbm_err()
4237 ar = ab->pdevs[i].ar; in ath11k_dp_rx_process_wbm_err()
4239 if (test_bit(ATH11K_CAC_RUNNING, &ar->dev_flags)) { in ath11k_dp_rx_process_wbm_err()
4257 struct dp_link_desc_bank *link_desc_banks = ab->dp.link_desc_banks; in ath11k_dp_process_rxdma_err()
4275 ar = ab->pdevs[ath11k_hw_mac_id_to_pdev_id(&ab->hw_params, mac_id)].ar; in ath11k_dp_process_rxdma_err()
4276 err_ring = &ar->dp.rxdma_err_dst_ring[ath11k_hw_mac_id_to_srng_id(&ab->hw_params, in ath11k_dp_process_rxdma_err()
4278 rx_ring = &ar->dp.rx_refill_buf_ring; in ath11k_dp_process_rxdma_err()
4280 srng = &ab->hal.srng_list[err_ring->ring_id]; in ath11k_dp_process_rxdma_err()
4282 spin_lock_bh(&srng->lock); in ath11k_dp_process_rxdma_err()
4286 while (quota-- && in ath11k_dp_process_rxdma_err()
4293 entr_ring->info1); in ath11k_dp_process_rxdma_err()
4294 ab->soc_stats.rxdma_error[rxdma_err_code]++; in ath11k_dp_process_rxdma_err()
4297 (paddr - link_desc_banks[desc_bank].paddr); in ath11k_dp_process_rxdma_err()
4305 spin_lock_bh(&rx_ring->idr_lock); in ath11k_dp_process_rxdma_err()
4306 skb = idr_find(&rx_ring->bufs_idr, buf_id); in ath11k_dp_process_rxdma_err()
4310 spin_unlock_bh(&rx_ring->idr_lock); in ath11k_dp_process_rxdma_err()
4314 idr_remove(&rx_ring->bufs_idr, buf_id); in ath11k_dp_process_rxdma_err()
4315 spin_unlock_bh(&rx_ring->idr_lock); in ath11k_dp_process_rxdma_err()
4318 dma_unmap_single(ab->dev, rxcb->paddr, in ath11k_dp_process_rxdma_err()
4319 skb->len + skb_tailroom(skb), in ath11k_dp_process_rxdma_err()
4332 spin_unlock_bh(&srng->lock); in ath11k_dp_process_rxdma_err()
4336 ab->hw_params.hal_params->rx_buf_rbm); in ath11k_dp_process_rxdma_err()
4338 return budget - quota; in ath11k_dp_process_rxdma_err()
4343 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_process_reo_status()
4351 srng = &ab->hal.srng_list[dp->reo_status_ring.ring_id]; in ath11k_dp_process_reo_status()
4355 spin_lock_bh(&srng->lock); in ath11k_dp_process_reo_status()
4396 spin_lock_bh(&dp->reo_cmd_lock); in ath11k_dp_process_reo_status()
4397 list_for_each_entry_safe(cmd, tmp, &dp->reo_cmd_list, list) { in ath11k_dp_process_reo_status()
4398 if (reo_status.uniform_hdr.cmd_num == cmd->cmd_num) { in ath11k_dp_process_reo_status()
4400 list_del(&cmd->list); in ath11k_dp_process_reo_status()
4404 spin_unlock_bh(&dp->reo_cmd_lock); in ath11k_dp_process_reo_status()
4407 cmd->handler(dp, (void *)&cmd->data, in ath11k_dp_process_reo_status()
4417 spin_unlock_bh(&srng->lock); in ath11k_dp_process_reo_status()
4422 struct ath11k *ar = ab->pdevs[mac_id].ar; in ath11k_dp_rx_pdev_free()
4430 struct ath11k *ar = ab->pdevs[mac_id].ar; in ath11k_dp_rx_pdev_alloc()
4431 struct ath11k_pdev_dp *dp = &ar->dp; in ath11k_dp_rx_pdev_alloc()
4448 ring_id = dp->rx_refill_buf_ring.refill_buf_ring.ring_id; in ath11k_dp_rx_pdev_alloc()
4456 if (ab->hw_params.rx_mac_buf_ring) { in ath11k_dp_rx_pdev_alloc()
4457 for (i = 0; i < ab->hw_params.num_rxdma_per_pdev; i++) { in ath11k_dp_rx_pdev_alloc()
4458 ring_id = dp->rx_mac_buf_ring[i].ring_id; in ath11k_dp_rx_pdev_alloc()
4469 for (i = 0; i < ab->hw_params.num_rxdma_per_pdev; i++) { in ath11k_dp_rx_pdev_alloc()
4470 ring_id = dp->rxdma_err_dst_ring[i].ring_id; in ath11k_dp_rx_pdev_alloc()
4480 if (!ab->hw_params.rxdma1_enable) in ath11k_dp_rx_pdev_alloc()
4483 ring_id = dp->rxdma_mon_buf_ring.refill_buf_ring.ring_id; in ath11k_dp_rx_pdev_alloc()
4492 dp->rxdma_mon_dst_ring.ring_id, in ath11k_dp_rx_pdev_alloc()
4500 dp->rxdma_mon_desc_ring.ring_id, in ath11k_dp_rx_pdev_alloc()
4509 for (i = 0; i < ab->hw_params.num_rxdma_per_pdev; i++) { in ath11k_dp_rx_pdev_alloc()
4510 ring_id = dp->rx_mon_status_refill_ring[i].refill_buf_ring.ring_id; in ath11k_dp_rx_pdev_alloc()
4526 if (*total_len >= (DP_RX_BUFFER_SIZE - sizeof(struct hal_rx_desc))) { in ath11k_dp_mon_set_frag_len()
4527 *frag_len = DP_RX_BUFFER_SIZE - sizeof(struct hal_rx_desc); in ath11k_dp_mon_set_frag_len()
4528 *total_len -= *frag_len; in ath11k_dp_mon_set_frag_len()
4540 struct ath11k_pdev_dp *dp = &ar->dp; in ath11k_dp_rx_monitor_link_desc_return()
4546 if (ar->ab->hw_params.rxdma1_enable) { in ath11k_dp_rx_monitor_link_desc_return()
4547 dp_srng = &dp->rxdma_mon_desc_ring; in ath11k_dp_rx_monitor_link_desc_return()
4548 hal_srng = &ar->ab->hal.srng_list[dp_srng->ring_id]; in ath11k_dp_rx_monitor_link_desc_return()
4550 dp_srng = &ar->ab->dp.wbm_desc_rel_ring; in ath11k_dp_rx_monitor_link_desc_return()
4551 hal_srng = &ar->ab->hal.srng_list[dp_srng->ring_id]; in ath11k_dp_rx_monitor_link_desc_return()
4554 ath11k_hal_srng_access_begin(ar->ab, hal_srng); in ath11k_dp_rx_monitor_link_desc_return()
4556 src_srng_desc = ath11k_hal_srng_src_get_next_entry(ar->ab, hal_srng); in ath11k_dp_rx_monitor_link_desc_return()
4563 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_monitor_link_desc_return()
4565 ret = -ENOMEM; in ath11k_dp_rx_monitor_link_desc_return()
4568 ath11k_hal_srng_access_end(ar->ab, hal_srng); in ath11k_dp_rx_monitor_link_desc_return()
4581 buf_addr_info = (struct ath11k_buffer_addr *)&msdu_link->buf_addr_info; in ath11k_dp_rx_mon_next_link_desc_get()
4590 if (skb->len > len) { in ath11k_dp_pkt_set_pktlen()
4593 if (skb_tailroom(skb) < len - skb->len) { in ath11k_dp_pkt_set_pktlen()
4595 len - skb->len - skb_tailroom(skb), in ath11k_dp_pkt_set_pktlen()
4598 return -ENOMEM; in ath11k_dp_pkt_set_pktlen()
4601 skb_put(skb, (len - skb->len)); in ath11k_dp_pkt_set_pktlen()
4620 msdu_details = &msdu_link->msdu_link[0]; in ath11k_hal_rx_msdu_list_get()
4625 msdu_desc_info = &msdu_details[i - 1].rx_msdu_info; in ath11k_hal_rx_msdu_list_get()
4626 msdu_desc_info->info0 |= last; in ath11k_hal_rx_msdu_list_get()
4633 msdu_desc_info->info0 |= first; in ath11k_hal_rx_msdu_list_get()
4634 else if (i == (HAL_RX_NUM_MSDU_DESC - 1)) in ath11k_hal_rx_msdu_list_get()
4635 msdu_desc_info->info0 |= last; in ath11k_hal_rx_msdu_list_get()
4636 msdu_list->msdu_info[i].msdu_flags = msdu_desc_info->info0; in ath11k_hal_rx_msdu_list_get()
4637 msdu_list->msdu_info[i].msdu_len = in ath11k_hal_rx_msdu_list_get()
4638 HAL_RX_MSDU_PKT_LENGTH_GET(msdu_desc_info->info0); in ath11k_hal_rx_msdu_list_get()
4639 msdu_list->sw_cookie[i] = in ath11k_hal_rx_msdu_list_get()
4644 msdu_list->rbm[i] = tmp; in ath11k_hal_rx_msdu_list_get()
4655 ((msdu_ppdu_id - *ppdu_id) < DP_NOT_PPDU_ID_WRAP_AROUND)) { in ath11k_dp_rx_mon_comp_ppduid()
4659 ((*ppdu_id - msdu_ppdu_id) > DP_NOT_PPDU_ID_WRAP_AROUND)) { in ath11k_dp_rx_mon_comp_ppduid()
4674 if (info->msdu_flags & RX_MSDU_DESC_INFO0_MSDU_CONTINUATION) { in ath11k_dp_mon_get_buf_len()
4676 *total_len = info->msdu_len; in ath11k_dp_mon_get_buf_len()
4686 *frag_len = info->msdu_len; in ath11k_dp_mon_get_buf_len()
4689 *msdu_cnt -= 1; in ath11k_dp_mon_get_buf_len()
4699 struct ath11k_pdev_dp *dp = &ar->dp; in ath11k_dp_rx_mon_mpdu_pop()
4700 struct ath11k_mon_data *pmon = (struct ath11k_mon_data *)&dp->mon_data; in ath11k_dp_rx_mon_mpdu_pop()
4701 struct dp_rxdma_ring *rx_ring = &dp->rxdma_mon_buf_ring; in ath11k_dp_rx_mon_mpdu_pop()
4721 if (!ar->ab->hw_params.rxdma1_enable) in ath11k_dp_rx_mon_mpdu_pop()
4722 rx_ring = &dp->rx_refill_buf_ring; in ath11k_dp_rx_mon_mpdu_pop()
4730 ent_desc->info1) == in ath11k_dp_rx_mon_mpdu_pop()
4734 ent_desc->info1); in ath11k_dp_rx_mon_mpdu_pop()
4739 pmon->rx_mon_stats.dest_mpdu_drop++; in ath11k_dp_rx_mon_mpdu_pop()
4747 if (pmon->mon_last_linkdesc_paddr == paddr) { in ath11k_dp_rx_mon_mpdu_pop()
4748 pmon->rx_mon_stats.dup_mon_linkdesc_cnt++; in ath11k_dp_rx_mon_mpdu_pop()
4752 if (ar->ab->hw_params.rxdma1_enable) in ath11k_dp_rx_mon_mpdu_pop()
4754 (void *)pmon->link_desc_banks[sw_cookie].vaddr + in ath11k_dp_rx_mon_mpdu_pop()
4755 (paddr - pmon->link_desc_banks[sw_cookie].paddr); in ath11k_dp_rx_mon_mpdu_pop()
4758 (void *)ar->ab->dp.link_desc_banks[sw_cookie].vaddr + in ath11k_dp_rx_mon_mpdu_pop()
4759 (paddr - ar->ab->dp.link_desc_banks[sw_cookie].paddr); in ath11k_dp_rx_mon_mpdu_pop()
4767 if (pmon->mon_last_buf_cookie == msdu_list.sw_cookie[i]) { in ath11k_dp_rx_mon_mpdu_pop()
4768 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_mon_mpdu_pop()
4770 i, pmon->mon_last_buf_cookie); in ath11k_dp_rx_mon_mpdu_pop()
4772 pmon->rx_mon_stats.dup_mon_buf_cnt++; in ath11k_dp_rx_mon_mpdu_pop()
4778 spin_lock_bh(&rx_ring->idr_lock); in ath11k_dp_rx_mon_mpdu_pop()
4779 msdu = idr_find(&rx_ring->bufs_idr, buf_id); in ath11k_dp_rx_mon_mpdu_pop()
4780 spin_unlock_bh(&rx_ring->idr_lock); in ath11k_dp_rx_mon_mpdu_pop()
4782 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_mon_mpdu_pop()
4787 if (!rxcb->unmapped) { in ath11k_dp_rx_mon_mpdu_pop()
4788 dma_unmap_single(ar->ab->dev, rxcb->paddr, in ath11k_dp_rx_mon_mpdu_pop()
4789 msdu->len + in ath11k_dp_rx_mon_mpdu_pop()
4792 rxcb->unmapped = 1; in ath11k_dp_rx_mon_mpdu_pop()
4795 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_mon_mpdu_pop()
4803 rx_desc = (struct hal_rx_desc *)msdu->data; in ath11k_dp_rx_mon_mpdu_pop()
4806 l2_hdr_offset = ath11k_dp_rx_h_msdu_end_l3pad(ar->ab, rx_desc); in ath11k_dp_rx_mon_mpdu_pop()
4809 if (!ath11k_dp_rxdesc_mpdu_valid(ar->ab, rx_desc)) { in ath11k_dp_rx_mon_mpdu_pop()
4813 pmon->mon_last_linkdesc_paddr = paddr; in ath11k_dp_rx_mon_mpdu_pop()
4818 ath11k_dp_rxdesc_get_ppduid(ar->ab, rx_desc); in ath11k_dp_rx_mon_mpdu_pop()
4831 pmon->mon_last_linkdesc_paddr = paddr; in ath11k_dp_rx_mon_mpdu_pop()
4844 last->next = msdu; in ath11k_dp_rx_mon_mpdu_pop()
4848 pmon->mon_last_buf_cookie = msdu_list.sw_cookie[i]; in ath11k_dp_rx_mon_mpdu_pop()
4850 spin_lock_bh(&rx_ring->idr_lock); in ath11k_dp_rx_mon_mpdu_pop()
4851 idr_remove(&rx_ring->bufs_idr, buf_id); in ath11k_dp_rx_mon_mpdu_pop()
4852 spin_unlock_bh(&rx_ring->idr_lock); in ath11k_dp_rx_mon_mpdu_pop()
4861 if (ar->ab->hw_params.rxdma1_enable) { in ath11k_dp_rx_mon_mpdu_pop()
4864 dp->mac_id)) in ath11k_dp_rx_mon_mpdu_pop()
4865 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_mon_mpdu_pop()
4868 ath11k_dp_rx_link_desc_return(ar->ab, rx_link_buf_info, in ath11k_dp_rx_mon_mpdu_pop()
4877 last->next = NULL; in ath11k_dp_rx_mon_mpdu_pop()
4891 rx_pkt_offset = ar->ab->hw_params.hal_desc_sz; in ath11k_dp_rx_msdus_set_payload()
4892 l2_hdr_offset = ath11k_dp_rx_h_msdu_end_l3pad(ar->ab, in ath11k_dp_rx_msdus_set_payload()
4893 (struct hal_rx_desc *)msdu->data); in ath11k_dp_rx_msdus_set_payload()
4903 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_mon_merg_msdus()
4915 rx_desc = (struct hal_rx_desc *)head_msdu->data; in ath11k_dp_rx_mon_merg_msdus()
4933 msdu = head_msdu->next; in ath11k_dp_rx_mon_merg_msdus()
4939 msdu = msdu->next; in ath11k_dp_rx_mon_merg_msdus()
4942 prev_buf->next = NULL; in ath11k_dp_rx_mon_merg_msdus()
4944 skb_trim(prev_buf, prev_buf->len - HAL_RX_FCS_LEN); in ath11k_dp_rx_mon_merg_msdus()
4948 rx_desc = (struct hal_rx_desc *)head_msdu->data; in ath11k_dp_rx_mon_merg_msdus()
4954 if (ieee80211_is_data_qos(wh->frame_control)) in ath11k_dp_rx_mon_merg_msdus()
4968 msdu = msdu->next; in ath11k_dp_rx_mon_merg_msdus()
4975 "mpdu_buf %p mpdu_buf->len %u", in ath11k_dp_rx_mon_merg_msdus()
4976 prev_buf, prev_buf->len); in ath11k_dp_rx_mon_merg_msdus()
4996 put_unaligned_le16(rx_status->he_data1, &rtap_buf[rtap_len]); in ath11k_dp_rx_update_radiotap_he()
4999 put_unaligned_le16(rx_status->he_data2, &rtap_buf[rtap_len]); in ath11k_dp_rx_update_radiotap_he()
5002 put_unaligned_le16(rx_status->he_data3, &rtap_buf[rtap_len]); in ath11k_dp_rx_update_radiotap_he()
5005 put_unaligned_le16(rx_status->he_data4, &rtap_buf[rtap_len]); in ath11k_dp_rx_update_radiotap_he()
5008 put_unaligned_le16(rx_status->he_data5, &rtap_buf[rtap_len]); in ath11k_dp_rx_update_radiotap_he()
5011 put_unaligned_le16(rx_status->he_data6, &rtap_buf[rtap_len]); in ath11k_dp_rx_update_radiotap_he()
5020 put_unaligned_le16(rx_status->he_flags1, &rtap_buf[rtap_len]); in ath11k_dp_rx_update_radiotap_he_mu()
5023 put_unaligned_le16(rx_status->he_flags2, &rtap_buf[rtap_len]); in ath11k_dp_rx_update_radiotap_he_mu()
5026 rtap_buf[rtap_len] = rx_status->he_RU[0]; in ath11k_dp_rx_update_radiotap_he_mu()
5029 rtap_buf[rtap_len] = rx_status->he_RU[1]; in ath11k_dp_rx_update_radiotap_he_mu()
5032 rtap_buf[rtap_len] = rx_status->he_RU[2]; in ath11k_dp_rx_update_radiotap_he_mu()
5035 rtap_buf[rtap_len] = rx_status->he_RU[3]; in ath11k_dp_rx_update_radiotap_he_mu()
5046 rxs->flag |= RX_FLAG_MACTIME_START; in ath11k_update_radiotap()
5047 rxs->signal = ppduinfo->rssi_comb + ATH11K_DEFAULT_NOISE_FLOOR; in ath11k_update_radiotap()
5049 if (ppduinfo->nss) in ath11k_update_radiotap()
5050 rxs->nss = ppduinfo->nss; in ath11k_update_radiotap()
5052 if (ppduinfo->he_mu_flags) { in ath11k_update_radiotap()
5053 rxs->flag |= RX_FLAG_RADIOTAP_HE_MU; in ath11k_update_radiotap()
5054 rxs->encoding = RX_ENC_HE; in ath11k_update_radiotap()
5057 } else if (ppduinfo->he_flags) { in ath11k_update_radiotap()
5058 rxs->flag |= RX_FLAG_RADIOTAP_HE; in ath11k_update_radiotap()
5059 rxs->encoding = RX_ENC_HE; in ath11k_update_radiotap()
5062 rxs->rate_idx = ppduinfo->rate; in ath11k_update_radiotap()
5063 } else if (ppduinfo->vht_flags) { in ath11k_update_radiotap()
5064 rxs->encoding = RX_ENC_VHT; in ath11k_update_radiotap()
5065 rxs->rate_idx = ppduinfo->rate; in ath11k_update_radiotap()
5066 } else if (ppduinfo->ht_flags) { in ath11k_update_radiotap()
5067 rxs->encoding = RX_ENC_HT; in ath11k_update_radiotap()
5068 rxs->rate_idx = ppduinfo->rate; in ath11k_update_radiotap()
5070 rxs->encoding = RX_ENC_LEGACY; in ath11k_update_radiotap()
5071 sband = &ar->mac.sbands[rxs->band]; in ath11k_update_radiotap()
5072 rxs->rate_idx = ath11k_mac_hw_rate_to_idx(sband, ppduinfo->rate, in ath11k_update_radiotap()
5073 ppduinfo->cck_flag); in ath11k_update_radiotap()
5076 rxs->mactime = ppduinfo->tsft; in ath11k_update_radiotap()
5085 struct ath11k_pdev_dp *dp = &ar->dp; in ath11k_dp_rx_mon_deliver()
5087 struct ieee80211_rx_status *rxs = &dp->rx_status; in ath11k_dp_rx_mon_deliver()
5098 rxs->flag = 0; in ath11k_dp_rx_mon_deliver()
5101 rxs->flag = RX_FLAG_FAILED_FCS_CRC; in ath11k_dp_rx_mon_deliver()
5104 skb_next = mon_skb->next; in ath11k_dp_rx_mon_deliver()
5106 rxs->flag &= ~RX_FLAG_AMSDU_MORE; in ath11k_dp_rx_mon_deliver()
5108 rxs->flag |= RX_FLAG_AMSDU_MORE; in ath11k_dp_rx_mon_deliver()
5112 rxs->flag &= ~RX_FLAG_ALLOW_SAME_PN; in ath11k_dp_rx_mon_deliver()
5114 rxs->flag |= RX_FLAG_ALLOW_SAME_PN; in ath11k_dp_rx_mon_deliver()
5116 rxs->flag |= RX_FLAG_ONLY_MONITOR; in ath11k_dp_rx_mon_deliver()
5122 rxs->flag = 0; in ath11k_dp_rx_mon_deliver()
5129 skb_next = mon_skb->next; in ath11k_dp_rx_mon_deliver()
5133 return -EINVAL; in ath11k_dp_rx_mon_deliver()
5145 struct ath11k_pdev_dp *dp = &ar->dp; in ath11k_dp_rx_mon_dest_process()
5146 struct ath11k_mon_data *pmon = (struct ath11k_mon_data *)&dp->mon_data; in ath11k_dp_rx_mon_dest_process()
5157 if (ar->ab->hw_params.rxdma1_enable) in ath11k_dp_rx_mon_dest_process()
5158 ring_id = dp->rxdma_mon_dst_ring.ring_id; in ath11k_dp_rx_mon_dest_process()
5160 ring_id = dp->rxdma_err_dst_ring[mac_id].ring_id; in ath11k_dp_rx_mon_dest_process()
5162 mon_dst_srng = &ar->ab->hal.srng_list[ring_id]; in ath11k_dp_rx_mon_dest_process()
5164 spin_lock_bh(&pmon->mon_lock); in ath11k_dp_rx_mon_dest_process()
5166 ath11k_hal_srng_access_begin(ar->ab, mon_dst_srng); in ath11k_dp_rx_mon_dest_process()
5168 ppdu_id = pmon->mon_ppdu_info.ppdu_id; in ath11k_dp_rx_mon_dest_process()
5170 rx_mon_stats = &pmon->rx_mon_stats; in ath11k_dp_rx_mon_dest_process()
5172 while ((ring_entry = ath11k_hal_srng_dst_peek(ar->ab, mon_dst_srng))) { in ath11k_dp_rx_mon_dest_process()
5186 dp->mon_dest_ring_stuck_cnt = 0; in ath11k_dp_rx_mon_dest_process()
5188 dp->mon_dest_ring_stuck_cnt++; in ath11k_dp_rx_mon_dest_process()
5189 rx_mon_stats->dest_mon_not_reaped++; in ath11k_dp_rx_mon_dest_process()
5192 if (dp->mon_dest_ring_stuck_cnt > MON_DEST_RING_STUCK_MAX_CNT) { in ath11k_dp_rx_mon_dest_process()
5193 rx_mon_stats->dest_mon_stuck++; in ath11k_dp_rx_mon_dest_process()
5194 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_mon_dest_process()
5196 pmon->mon_ppdu_info.ppdu_id, ppdu_id, in ath11k_dp_rx_mon_dest_process()
5197 dp->mon_dest_ring_stuck_cnt, in ath11k_dp_rx_mon_dest_process()
5198 rx_mon_stats->dest_mon_not_reaped, in ath11k_dp_rx_mon_dest_process()
5199 rx_mon_stats->dest_mon_stuck); in ath11k_dp_rx_mon_dest_process()
5200 pmon->mon_ppdu_info.ppdu_id = ppdu_id; in ath11k_dp_rx_mon_dest_process()
5204 if (ppdu_id != pmon->mon_ppdu_info.ppdu_id) { in ath11k_dp_rx_mon_dest_process()
5205 pmon->mon_ppdu_status = DP_PPDU_STATUS_START; in ath11k_dp_rx_mon_dest_process()
5206 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_mon_dest_process()
5208 ppdu_id, pmon->mon_ppdu_info.ppdu_id, in ath11k_dp_rx_mon_dest_process()
5209 rx_mon_stats->dest_mon_not_reaped, in ath11k_dp_rx_mon_dest_process()
5210 rx_mon_stats->dest_mon_stuck); in ath11k_dp_rx_mon_dest_process()
5214 ath11k_dp_rx_mon_deliver(ar, dp->mac_id, head_msdu, in ath11k_dp_rx_mon_dest_process()
5215 &pmon->mon_ppdu_info, in ath11k_dp_rx_mon_dest_process()
5217 rx_mon_stats->dest_mpdu_done++; in ath11k_dp_rx_mon_dest_process()
5220 ring_entry = ath11k_hal_srng_dst_get_next_entry(ar->ab, in ath11k_dp_rx_mon_dest_process()
5223 ath11k_hal_srng_access_end(ar->ab, mon_dst_srng); in ath11k_dp_rx_mon_dest_process()
5225 spin_unlock_bh(&pmon->mon_lock); in ath11k_dp_rx_mon_dest_process()
5228 rx_mon_stats->dest_ppdu_done++; in ath11k_dp_rx_mon_dest_process()
5229 hal_params = ar->ab->hw_params.hal_params; in ath11k_dp_rx_mon_dest_process()
5231 if (ar->ab->hw_params.rxdma1_enable) in ath11k_dp_rx_mon_dest_process()
5232 ath11k_dp_rxbufs_replenish(ar->ab, dp->mac_id, in ath11k_dp_rx_mon_dest_process()
5233 &dp->rxdma_mon_buf_ring, in ath11k_dp_rx_mon_dest_process()
5235 hal_params->rx_buf_rbm); in ath11k_dp_rx_mon_dest_process()
5237 ath11k_dp_rxbufs_replenish(ar->ab, dp->mac_id, in ath11k_dp_rx_mon_dest_process()
5238 &dp->rx_refill_buf_ring, in ath11k_dp_rx_mon_dest_process()
5240 hal_params->rx_buf_rbm); in ath11k_dp_rx_mon_dest_process()
5256 struct ath11k_mon_data *pmon = (struct ath11k_mon_data *)&ar->dp.mon_data; in ath11k_dp_rx_process_mon_status()
5257 struct ath11k_pdev_mon_stats *rx_mon_stats = &pmon->rx_mon_stats; in ath11k_dp_rx_process_mon_status()
5258 struct hal_rx_mon_ppdu_info *ppdu_info = &pmon->mon_ppdu_info; in ath11k_dp_rx_process_mon_status()
5268 ppdu_info->peer_id = HAL_INVALID_PEERID; in ath11k_dp_rx_process_mon_status()
5283 trace_ath11k_htt_rxdesc(ar, skb->data, log_type, rx_buf_sz); in ath11k_dp_rx_process_mon_status()
5286 ppdu_info->peer_id = HAL_INVALID_PEERID; in ath11k_dp_rx_process_mon_status()
5289 if (test_bit(ATH11K_FLAG_MONITOR_STARTED, &ar->monitor_flags) && in ath11k_dp_rx_process_mon_status()
5290 pmon->mon_ppdu_status == DP_PPDU_STATUS_START && in ath11k_dp_rx_process_mon_status()
5292 rx_mon_stats->status_ppdu_done++; in ath11k_dp_rx_process_mon_status()
5293 pmon->mon_ppdu_status = DP_PPDU_STATUS_DONE; in ath11k_dp_rx_process_mon_status()
5294 if (!ab->hw_params.full_monitor_mode) { in ath11k_dp_rx_process_mon_status()
5297 pmon->mon_ppdu_status = DP_PPDU_STATUS_START; in ath11k_dp_rx_process_mon_status()
5301 if (ppdu_info->peer_id == HAL_INVALID_PEERID || in ath11k_dp_rx_process_mon_status()
5308 spin_lock_bh(&ab->base_lock); in ath11k_dp_rx_process_mon_status()
5309 peer = ath11k_peer_find_by_id(ab, ppdu_info->peer_id); in ath11k_dp_rx_process_mon_status()
5311 if (!peer || !peer->sta) { in ath11k_dp_rx_process_mon_status()
5314 ppdu_info->peer_id); in ath11k_dp_rx_process_mon_status()
5318 arsta = ath11k_sta_to_arsta(peer->sta); in ath11k_dp_rx_process_mon_status()
5321 if (ath11k_debugfs_is_pktlog_peer_valid(ar, peer->addr)) in ath11k_dp_rx_process_mon_status()
5322 trace_ath11k_htt_rxdesc(ar, skb->data, log_type, rx_buf_sz); in ath11k_dp_rx_process_mon_status()
5325 spin_unlock_bh(&ab->base_lock); in ath11k_dp_rx_process_mon_status()
5330 ppdu_info->peer_id = HAL_INVALID_PEERID; in ath11k_dp_rx_process_mon_status()
5342 struct ath11k_pdev_dp *dp = &ar->dp; in ath11k_dp_rx_full_mon_mpdu_pop()
5343 struct ath11k_mon_data *pmon = &dp->mon_data; in ath11k_dp_rx_full_mon_mpdu_pop()
5344 struct dp_rxdma_ring *rx_ring = &dp->rxdma_mon_buf_ring; in ath11k_dp_rx_full_mon_mpdu_pop()
5363 sw_cookie = sw_mon_entries->mon_dst_sw_cookie; in ath11k_dp_rx_full_mon_mpdu_pop()
5364 sw_mon_entries->end_of_ppdu = false; in ath11k_dp_rx_full_mon_mpdu_pop()
5365 sw_mon_entries->drop_ppdu = false; in ath11k_dp_rx_full_mon_mpdu_pop()
5366 p_last_buf_addr_info = sw_mon_entries->dst_buf_addr_info; in ath11k_dp_rx_full_mon_mpdu_pop()
5367 msdu_cnt = sw_mon_entries->msdu_cnt; in ath11k_dp_rx_full_mon_mpdu_pop()
5369 sw_mon_entries->end_of_ppdu = in ath11k_dp_rx_full_mon_mpdu_pop()
5370 FIELD_GET(HAL_SW_MON_RING_INFO0_END_OF_PPDU, sw_desc->info0); in ath11k_dp_rx_full_mon_mpdu_pop()
5371 if (sw_mon_entries->end_of_ppdu) in ath11k_dp_rx_full_mon_mpdu_pop()
5375 sw_desc->info0) == in ath11k_dp_rx_full_mon_mpdu_pop()
5379 sw_desc->info0); in ath11k_dp_rx_full_mon_mpdu_pop()
5383 pmon->rx_mon_stats.dest_mpdu_drop++; in ath11k_dp_rx_full_mon_mpdu_pop()
5393 (u8 *)pmon->link_desc_banks[sw_cookie].vaddr + in ath11k_dp_rx_full_mon_mpdu_pop()
5394 (sw_mon_entries->mon_dst_paddr - in ath11k_dp_rx_full_mon_mpdu_pop()
5395 pmon->link_desc_banks[sw_cookie].paddr); in ath11k_dp_rx_full_mon_mpdu_pop()
5404 spin_lock_bh(&rx_ring->idr_lock); in ath11k_dp_rx_full_mon_mpdu_pop()
5405 msdu = idr_find(&rx_ring->bufs_idr, buf_id); in ath11k_dp_rx_full_mon_mpdu_pop()
5407 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_full_mon_mpdu_pop()
5410 spin_unlock_bh(&rx_ring->idr_lock); in ath11k_dp_rx_full_mon_mpdu_pop()
5413 idr_remove(&rx_ring->bufs_idr, buf_id); in ath11k_dp_rx_full_mon_mpdu_pop()
5414 spin_unlock_bh(&rx_ring->idr_lock); in ath11k_dp_rx_full_mon_mpdu_pop()
5417 if (!rxcb->unmapped) { in ath11k_dp_rx_full_mon_mpdu_pop()
5418 dma_unmap_single(ar->ab->dev, rxcb->paddr, in ath11k_dp_rx_full_mon_mpdu_pop()
5419 msdu->len + in ath11k_dp_rx_full_mon_mpdu_pop()
5422 rxcb->unmapped = 1; in ath11k_dp_rx_full_mon_mpdu_pop()
5425 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_full_mon_mpdu_pop()
5427 i, msdu, sw_mon_entries->ppdu_id); in ath11k_dp_rx_full_mon_mpdu_pop()
5429 msdu_cnt--; in ath11k_dp_rx_full_mon_mpdu_pop()
5433 rx_desc = (struct hal_rx_desc *)msdu->data; in ath11k_dp_rx_full_mon_mpdu_pop()
5436 l2_hdr_offset = ath11k_dp_rx_h_msdu_end_l3pad(ar->ab, rx_desc); in ath11k_dp_rx_full_mon_mpdu_pop()
5439 if (!ath11k_dp_rxdesc_mpdu_valid(ar->ab, rx_desc)) { in ath11k_dp_rx_full_mon_mpdu_pop()
5459 last->next = msdu; in ath11k_dp_rx_full_mon_mpdu_pop()
5467 &sw_mon_entries->mon_dst_paddr, in ath11k_dp_rx_full_mon_mpdu_pop()
5468 &sw_mon_entries->mon_dst_sw_cookie, in ath11k_dp_rx_full_mon_mpdu_pop()
5474 dp->mac_id)) in ath11k_dp_rx_full_mon_mpdu_pop()
5475 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, in ath11k_dp_rx_full_mon_mpdu_pop()
5480 } while (sw_mon_entries->mon_dst_paddr && msdu_cnt); in ath11k_dp_rx_full_mon_mpdu_pop()
5483 last->next = NULL; in ath11k_dp_rx_full_mon_mpdu_pop()
5497 return -ENOMEM; in ath11k_dp_rx_full_mon_prepare_mpdu()
5499 list_add_tail(&mon_mpdu->list, &dp->dp_full_mon_mpdu_list); in ath11k_dp_rx_full_mon_prepare_mpdu()
5500 mon_mpdu->head = head; in ath11k_dp_rx_full_mon_prepare_mpdu()
5501 mon_mpdu->tail = tail; in ath11k_dp_rx_full_mon_prepare_mpdu()
5512 if (list_empty(&dp->dp_full_mon_mpdu_list)) in ath11k_dp_rx_full_mon_drop_ppdu()
5515 list_for_each_entry_safe(mon_mpdu, tmp, &dp->dp_full_mon_mpdu_list, list) { in ath11k_dp_rx_full_mon_drop_ppdu()
5516 list_del(&mon_mpdu->list); in ath11k_dp_rx_full_mon_drop_ppdu()
5518 tmp_msdu = mon_mpdu->head; in ath11k_dp_rx_full_mon_drop_ppdu()
5520 skb_next = tmp_msdu->next; in ath11k_dp_rx_full_mon_drop_ppdu()
5536 struct dp_full_mon_mpdu *mon_mpdu = pmon->mon_mpdu; in ath11k_dp_rx_full_mon_deliver_ppdu()
5538 struct ath11k_base *ab = ar->ab; in ath11k_dp_rx_full_mon_deliver_ppdu()
5539 struct ath11k_dp *dp = &ab->dp; in ath11k_dp_rx_full_mon_deliver_ppdu()
5542 rx_mon_stats = &pmon->rx_mon_stats; in ath11k_dp_rx_full_mon_deliver_ppdu()
5544 list_for_each_entry_safe(mon_mpdu, tmp, &dp->dp_full_mon_mpdu_list, list) { in ath11k_dp_rx_full_mon_deliver_ppdu()
5545 list_del(&mon_mpdu->list); in ath11k_dp_rx_full_mon_deliver_ppdu()
5546 head_msdu = mon_mpdu->head; in ath11k_dp_rx_full_mon_deliver_ppdu()
5547 tail_msdu = mon_mpdu->tail; in ath11k_dp_rx_full_mon_deliver_ppdu()
5550 &pmon->mon_ppdu_info, in ath11k_dp_rx_full_mon_deliver_ppdu()
5552 rx_mon_stats->dest_mpdu_done++; in ath11k_dp_rx_full_mon_deliver_ppdu()
5553 ath11k_dbg(ar->ab, ATH11K_DBG_DATA, "full mon: deliver ppdu\n"); in ath11k_dp_rx_full_mon_deliver_ppdu()
5565 struct ath11k *ar = ab->pdevs[mac_id].ar; in ath11k_dp_rx_process_full_mon_status_ring()
5566 struct ath11k_pdev_dp *dp = &ar->dp; in ath11k_dp_rx_process_full_mon_status_ring()
5567 struct ath11k_mon_data *pmon = &dp->mon_data; in ath11k_dp_rx_process_full_mon_status_ring()
5571 sw_mon_entries = &pmon->sw_mon_entries; in ath11k_dp_rx_process_full_mon_status_ring()
5573 while (pmon->hold_mon_dst_ring) { in ath11k_dp_rx_process_full_mon_status_ring()
5576 if (pmon->buf_state == DP_MON_STATUS_MATCH) { in ath11k_dp_rx_process_full_mon_status_ring()
5577 count = sw_mon_entries->status_buf_count; in ath11k_dp_rx_process_full_mon_status_ring()
5583 ath11k_dp_rx_full_mon_deliver_ppdu(ar, dp->mac_id, in ath11k_dp_rx_process_full_mon_status_ring()
5585 pmon->hold_mon_dst_ring = false; in ath11k_dp_rx_process_full_mon_status_ring()
5586 } else if (!pmon->mon_status_paddr || in ath11k_dp_rx_process_full_mon_status_ring()
5587 pmon->buf_state == DP_MON_STATUS_LEAD) { in ath11k_dp_rx_process_full_mon_status_ring()
5588 sw_mon_entries->drop_ppdu = true; in ath11k_dp_rx_process_full_mon_status_ring()
5589 pmon->hold_mon_dst_ring = false; in ath11k_dp_rx_process_full_mon_status_ring()
5598 if (sw_mon_entries->drop_ppdu) in ath11k_dp_rx_process_full_mon_status_ring()
5599 ath11k_dp_rx_full_mon_drop_ppdu(&ab->dp, pmon->mon_mpdu); in ath11k_dp_rx_process_full_mon_status_ring()
5607 struct ath11k *ar = ab->pdevs[mac_id].ar; in ath11k_dp_full_mon_process_rx()
5608 struct ath11k_pdev_dp *dp = &ar->dp; in ath11k_dp_full_mon_process_rx()
5609 struct ath11k_mon_data *pmon = &dp->mon_data; in ath11k_dp_full_mon_process_rx()
5613 void *mon_dst_srng = &ar->ab->hal.srng_list[dp->rxdma_mon_dst_ring.ring_id]; in ath11k_dp_full_mon_process_rx()
5619 spin_lock_bh(&pmon->mon_lock); in ath11k_dp_full_mon_process_rx()
5621 sw_mon_entries = &pmon->sw_mon_entries; in ath11k_dp_full_mon_process_rx()
5622 rx_mon_stats = &pmon->rx_mon_stats; in ath11k_dp_full_mon_process_rx()
5624 if (pmon->hold_mon_dst_ring) { in ath11k_dp_full_mon_process_rx()
5625 spin_unlock_bh(&pmon->mon_lock); in ath11k_dp_full_mon_process_rx()
5629 ath11k_hal_srng_access_begin(ar->ab, mon_dst_srng); in ath11k_dp_full_mon_process_rx()
5630 while ((ring_entry = ath11k_hal_srng_dst_peek(ar->ab, mon_dst_srng))) { in ath11k_dp_full_mon_process_rx()
5640 if (!sw_mon_entries->end_of_ppdu) { in ath11k_dp_full_mon_process_rx()
5642 ret = ath11k_dp_rx_full_mon_prepare_mpdu(&ab->dp, in ath11k_dp_full_mon_process_rx()
5643 pmon->mon_mpdu, in ath11k_dp_full_mon_process_rx()
5652 if (!sw_mon_entries->ppdu_id && in ath11k_dp_full_mon_process_rx()
5653 !sw_mon_entries->mon_status_paddr) { in ath11k_dp_full_mon_process_rx()
5659 rx_mon_stats->dest_ppdu_done++; in ath11k_dp_full_mon_process_rx()
5660 pmon->mon_ppdu_status = DP_PPDU_STATUS_START; in ath11k_dp_full_mon_process_rx()
5661 pmon->buf_state = DP_MON_STATUS_LAG; in ath11k_dp_full_mon_process_rx()
5662 pmon->mon_status_paddr = sw_mon_entries->mon_status_paddr; in ath11k_dp_full_mon_process_rx()
5663 pmon->hold_mon_dst_ring = true; in ath11k_dp_full_mon_process_rx()
5665 ring_entry = ath11k_hal_srng_dst_get_next_entry(ar->ab, in ath11k_dp_full_mon_process_rx()
5671 ath11k_hal_srng_access_end(ar->ab, mon_dst_srng); in ath11k_dp_full_mon_process_rx()
5672 spin_unlock_bh(&pmon->mon_lock); in ath11k_dp_full_mon_process_rx()
5675 ath11k_dp_rxbufs_replenish(ar->ab, dp->mac_id, in ath11k_dp_full_mon_process_rx()
5676 &dp->rxdma_mon_buf_ring, in ath11k_dp_full_mon_process_rx()
5694 if (test_bit(ATH11K_FLAG_MONITOR_STARTED, &ar->monitor_flags) && in ath11k_dp_rx_process_mon_rings()
5695 ab->hw_params.full_monitor_mode) in ath11k_dp_rx_process_mon_rings()
5705 struct ath11k_pdev_dp *dp = &ar->dp; in ath11k_dp_rx_pdev_mon_status_attach()
5706 struct ath11k_mon_data *pmon = (struct ath11k_mon_data *)&dp->mon_data; in ath11k_dp_rx_pdev_mon_status_attach()
5708 skb_queue_head_init(&pmon->rx_status_q); in ath11k_dp_rx_pdev_mon_status_attach()
5710 pmon->mon_ppdu_status = DP_PPDU_STATUS_START; in ath11k_dp_rx_pdev_mon_status_attach()
5712 memset(&pmon->rx_mon_stats, 0, in ath11k_dp_rx_pdev_mon_status_attach()
5713 sizeof(pmon->rx_mon_stats)); in ath11k_dp_rx_pdev_mon_status_attach()
5719 struct ath11k_pdev_dp *dp = &ar->dp; in ath11k_dp_rx_pdev_mon_attach()
5720 struct ath11k_mon_data *pmon = &dp->mon_data; in ath11k_dp_rx_pdev_mon_attach()
5728 ath11k_warn(ar->ab, "pdev_mon_status_attach() failed"); in ath11k_dp_rx_pdev_mon_attach()
5735 if (!ar->ab->hw_params.rxdma1_enable) in ath11k_dp_rx_pdev_mon_attach()
5738 dp_srng = &dp->rxdma_mon_desc_ring; in ath11k_dp_rx_pdev_mon_attach()
5739 n_link_desc = dp_srng->size / in ath11k_dp_rx_pdev_mon_attach()
5740 ath11k_hal_srng_get_entrysize(ar->ab, HAL_RXDMA_MONITOR_DESC); in ath11k_dp_rx_pdev_mon_attach()
5742 &ar->ab->hal.srng_list[dp->rxdma_mon_desc_ring.ring_id]; in ath11k_dp_rx_pdev_mon_attach()
5744 ret = ath11k_dp_link_desc_setup(ar->ab, pmon->link_desc_banks, in ath11k_dp_rx_pdev_mon_attach()
5748 ath11k_warn(ar->ab, "mon_link_desc_pool_setup() failed"); in ath11k_dp_rx_pdev_mon_attach()
5751 pmon->mon_last_linkdesc_paddr = 0; in ath11k_dp_rx_pdev_mon_attach()
5752 pmon->mon_last_buf_cookie = DP_RX_DESC_COOKIE_MAX + 1; in ath11k_dp_rx_pdev_mon_attach()
5753 spin_lock_init(&pmon->mon_lock); in ath11k_dp_rx_pdev_mon_attach()
5760 struct ath11k_pdev_dp *dp = &ar->dp; in ath11k_dp_mon_link_free()
5761 struct ath11k_mon_data *pmon = &dp->mon_data; in ath11k_dp_mon_link_free()
5763 ath11k_dp_link_desc_cleanup(ar->ab, pmon->link_desc_banks, in ath11k_dp_mon_link_free()
5765 &dp->rxdma_mon_desc_ring); in ath11k_dp_mon_link_free()
5778 mod_timer(&ab->mon_reap_timer, in ath11k_dp_rx_pktlog_start()
5789 del_timer_sync(&ab->mon_reap_timer); in ath11k_dp_rx_pktlog_stop()