Lines Matching refs:ab

23 static enum hal_encrypt_type ath12k_dp_rx_h_enctype(struct ath12k_base *ab,  in ath12k_dp_rx_h_enctype()  argument
26 if (!ab->hw_params->hal_ops->rx_desc_encrypt_valid(desc)) in ath12k_dp_rx_h_enctype()
29 return ab->hw_params->hal_ops->rx_desc_get_encrypt_type(desc); in ath12k_dp_rx_h_enctype()
32 u8 ath12k_dp_rx_h_decap_type(struct ath12k_base *ab, in ath12k_dp_rx_h_decap_type() argument
35 return ab->hw_params->hal_ops->rx_desc_get_decap_type(desc); in ath12k_dp_rx_h_decap_type()
38 static u8 ath12k_dp_rx_h_mesh_ctl_present(struct ath12k_base *ab, in ath12k_dp_rx_h_mesh_ctl_present() argument
41 return ab->hw_params->hal_ops->rx_desc_get_mesh_ctl(desc); in ath12k_dp_rx_h_mesh_ctl_present()
44 static bool ath12k_dp_rx_h_seq_ctrl_valid(struct ath12k_base *ab, in ath12k_dp_rx_h_seq_ctrl_valid() argument
47 return ab->hw_params->hal_ops->rx_desc_get_mpdu_seq_ctl_vld(desc); in ath12k_dp_rx_h_seq_ctrl_valid()
50 static bool ath12k_dp_rx_h_fc_valid(struct ath12k_base *ab, in ath12k_dp_rx_h_fc_valid() argument
53 return ab->hw_params->hal_ops->rx_desc_get_mpdu_fc_valid(desc); in ath12k_dp_rx_h_fc_valid()
56 static bool ath12k_dp_rx_h_more_frags(struct ath12k_base *ab, in ath12k_dp_rx_h_more_frags() argument
61 hdr = (struct ieee80211_hdr *)(skb->data + ab->hw_params->hal_desc_sz); in ath12k_dp_rx_h_more_frags()
65 static u16 ath12k_dp_rx_h_frag_no(struct ath12k_base *ab, in ath12k_dp_rx_h_frag_no() argument
70 hdr = (struct ieee80211_hdr *)(skb->data + ab->hw_params->hal_desc_sz); in ath12k_dp_rx_h_frag_no()
74 static u16 ath12k_dp_rx_h_seq_no(struct ath12k_base *ab, in ath12k_dp_rx_h_seq_no() argument
77 return ab->hw_params->hal_ops->rx_desc_get_mpdu_start_seq_no(desc); in ath12k_dp_rx_h_seq_no()
80 static bool ath12k_dp_rx_h_msdu_done(struct ath12k_base *ab, in ath12k_dp_rx_h_msdu_done() argument
83 return ab->hw_params->hal_ops->dp_rx_h_msdu_done(desc); in ath12k_dp_rx_h_msdu_done()
86 static bool ath12k_dp_rx_h_l4_cksum_fail(struct ath12k_base *ab, in ath12k_dp_rx_h_l4_cksum_fail() argument
89 return ab->hw_params->hal_ops->dp_rx_h_l4_cksum_fail(desc); in ath12k_dp_rx_h_l4_cksum_fail()
92 static bool ath12k_dp_rx_h_ip_cksum_fail(struct ath12k_base *ab, in ath12k_dp_rx_h_ip_cksum_fail() argument
95 return ab->hw_params->hal_ops->dp_rx_h_ip_cksum_fail(desc); in ath12k_dp_rx_h_ip_cksum_fail()
98 static bool ath12k_dp_rx_h_is_decrypted(struct ath12k_base *ab, in ath12k_dp_rx_h_is_decrypted() argument
101 return ab->hw_params->hal_ops->dp_rx_h_is_decrypted(desc); in ath12k_dp_rx_h_is_decrypted()
104 u32 ath12k_dp_rx_h_mpdu_err(struct ath12k_base *ab, in ath12k_dp_rx_h_mpdu_err() argument
107 return ab->hw_params->hal_ops->dp_rx_h_mpdu_err(desc); in ath12k_dp_rx_h_mpdu_err()
110 static u16 ath12k_dp_rx_h_msdu_len(struct ath12k_base *ab, in ath12k_dp_rx_h_msdu_len() argument
113 return ab->hw_params->hal_ops->rx_desc_get_msdu_len(desc); in ath12k_dp_rx_h_msdu_len()
116 static u8 ath12k_dp_rx_h_sgi(struct ath12k_base *ab, in ath12k_dp_rx_h_sgi() argument
119 return ab->hw_params->hal_ops->rx_desc_get_msdu_sgi(desc); in ath12k_dp_rx_h_sgi()
122 static u8 ath12k_dp_rx_h_rate_mcs(struct ath12k_base *ab, in ath12k_dp_rx_h_rate_mcs() argument
125 return ab->hw_params->hal_ops->rx_desc_get_msdu_rate_mcs(desc); in ath12k_dp_rx_h_rate_mcs()
128 static u8 ath12k_dp_rx_h_rx_bw(struct ath12k_base *ab, in ath12k_dp_rx_h_rx_bw() argument
131 return ab->hw_params->hal_ops->rx_desc_get_msdu_rx_bw(desc); in ath12k_dp_rx_h_rx_bw()
134 static u32 ath12k_dp_rx_h_freq(struct ath12k_base *ab, in ath12k_dp_rx_h_freq() argument
137 return ab->hw_params->hal_ops->rx_desc_get_msdu_freq(desc); in ath12k_dp_rx_h_freq()
140 static u8 ath12k_dp_rx_h_pkt_type(struct ath12k_base *ab, in ath12k_dp_rx_h_pkt_type() argument
143 return ab->hw_params->hal_ops->rx_desc_get_msdu_pkt_type(desc); in ath12k_dp_rx_h_pkt_type()
146 static u8 ath12k_dp_rx_h_nss(struct ath12k_base *ab, in ath12k_dp_rx_h_nss() argument
149 return hweight8(ab->hw_params->hal_ops->rx_desc_get_msdu_nss(desc)); in ath12k_dp_rx_h_nss()
152 static u8 ath12k_dp_rx_h_tid(struct ath12k_base *ab, in ath12k_dp_rx_h_tid() argument
155 return ab->hw_params->hal_ops->rx_desc_get_mpdu_tid(desc); in ath12k_dp_rx_h_tid()
158 static u16 ath12k_dp_rx_h_peer_id(struct ath12k_base *ab, in ath12k_dp_rx_h_peer_id() argument
161 return ab->hw_params->hal_ops->rx_desc_get_mpdu_peer_id(desc); in ath12k_dp_rx_h_peer_id()
164 u8 ath12k_dp_rx_h_l3pad(struct ath12k_base *ab, in ath12k_dp_rx_h_l3pad() argument
167 return ab->hw_params->hal_ops->rx_desc_get_l3_pad_bytes(desc); in ath12k_dp_rx_h_l3pad()
170 static bool ath12k_dp_rx_h_first_msdu(struct ath12k_base *ab, in ath12k_dp_rx_h_first_msdu() argument
173 return ab->hw_params->hal_ops->rx_desc_get_first_msdu(desc); in ath12k_dp_rx_h_first_msdu()
176 static bool ath12k_dp_rx_h_last_msdu(struct ath12k_base *ab, in ath12k_dp_rx_h_last_msdu() argument
179 return ab->hw_params->hal_ops->rx_desc_get_last_msdu(desc); in ath12k_dp_rx_h_last_msdu()
182 static void ath12k_dp_rx_desc_end_tlv_copy(struct ath12k_base *ab, in ath12k_dp_rx_desc_end_tlv_copy() argument
186 ab->hw_params->hal_ops->rx_desc_copy_end_tlv(fdesc, ldesc); in ath12k_dp_rx_desc_end_tlv_copy()
189 static void ath12k_dp_rxdesc_set_msdu_len(struct ath12k_base *ab, in ath12k_dp_rxdesc_set_msdu_len() argument
193 ab->hw_params->hal_ops->rx_desc_set_msdu_len(desc, len); in ath12k_dp_rxdesc_set_msdu_len()
196 static bool ath12k_dp_rx_h_is_mcbc(struct ath12k_base *ab, in ath12k_dp_rx_h_is_mcbc() argument
199 return ab->hw_params->hal_ops->rx_desc_is_mcbc(desc); in ath12k_dp_rx_h_is_mcbc()
202 static bool ath12k_dp_rxdesc_mac_addr2_valid(struct ath12k_base *ab, in ath12k_dp_rxdesc_mac_addr2_valid() argument
205 return ab->hw_params->hal_ops->rx_desc_mac_addr2_valid(desc); in ath12k_dp_rxdesc_mac_addr2_valid()
208 static u8 *ath12k_dp_rxdesc_get_mpdu_start_addr2(struct ath12k_base *ab, in ath12k_dp_rxdesc_get_mpdu_start_addr2() argument
211 return ab->hw_params->hal_ops->rx_desc_mpdu_start_addr2(desc); in ath12k_dp_rxdesc_get_mpdu_start_addr2()
214 static void ath12k_dp_rx_desc_get_dot11_hdr(struct ath12k_base *ab, in ath12k_dp_rx_desc_get_dot11_hdr() argument
218 ab->hw_params->hal_ops->rx_desc_get_dot11_hdr(desc, hdr); in ath12k_dp_rx_desc_get_dot11_hdr()
221 static void ath12k_dp_rx_desc_get_crypto_header(struct ath12k_base *ab, in ath12k_dp_rx_desc_get_crypto_header() argument
226 ab->hw_params->hal_ops->rx_desc_get_crypto_header(desc, crypto_hdr, enctype); in ath12k_dp_rx_desc_get_crypto_header()
229 static u16 ath12k_dp_rxdesc_get_mpdu_frame_ctrl(struct ath12k_base *ab, in ath12k_dp_rxdesc_get_mpdu_frame_ctrl() argument
232 return ab->hw_params->hal_ops->rx_desc_get_mpdu_frame_ctl(desc); in ath12k_dp_rxdesc_get_mpdu_frame_ctrl()
235 static int ath12k_dp_purge_mon_ring(struct ath12k_base *ab) in ath12k_dp_purge_mon_ring() argument
241 for (i = 0; i < ab->hw_params->num_rxmda_per_pdev; i++) in ath12k_dp_purge_mon_ring()
242 reaped += ath12k_dp_mon_process_ring(ab, i, NULL, in ath12k_dp_purge_mon_ring()
252 ath12k_warn(ab, "dp mon ring purge timeout"); in ath12k_dp_purge_mon_ring()
258 int ath12k_dp_rx_bufs_replenish(struct ath12k_base *ab, int mac_id, in ath12k_dp_rx_bufs_replenish() argument
272 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_bufs_replenish()
277 srng = &ab->hal.srng_list[rx_ring->refill_buf_ring.ring_id]; in ath12k_dp_rx_bufs_replenish()
281 ath12k_hal_srng_access_begin(ab, srng); in ath12k_dp_rx_bufs_replenish()
283 num_free = ath12k_hal_srng_src_num_free(ab, srng, true); in ath12k_dp_rx_bufs_replenish()
303 paddr = dma_map_single(ab->dev, skb->data, in ath12k_dp_rx_bufs_replenish()
306 if (dma_mapping_error(ab->dev, paddr)) in ath12k_dp_rx_bufs_replenish()
345 desc = ath12k_hal_srng_src_get_next_entry(ab, srng); in ath12k_dp_rx_bufs_replenish()
356 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_bufs_replenish()
375 dma_unmap_single(ab->dev, paddr, skb->len + skb_tailroom(skb), in ath12k_dp_rx_bufs_replenish()
380 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_bufs_replenish()
387 static int ath12k_dp_rxdma_buf_ring_free(struct ath12k_base *ab, in ath12k_dp_rxdma_buf_ring_free() argument
399 dma_unmap_single(ab->dev, ATH12K_SKB_RXCB(skb)->paddr, in ath12k_dp_rxdma_buf_ring_free()
410 static int ath12k_dp_rxdma_buf_free(struct ath12k_base *ab) in ath12k_dp_rxdma_buf_free() argument
412 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rxdma_buf_free()
415 ath12k_dp_rxdma_buf_ring_free(ab, rx_ring); in ath12k_dp_rxdma_buf_free()
418 ath12k_dp_rxdma_buf_ring_free(ab, rx_ring); in ath12k_dp_rxdma_buf_free()
421 ath12k_dp_rxdma_buf_ring_free(ab, rx_ring); in ath12k_dp_rxdma_buf_free()
426 static int ath12k_dp_rxdma_ring_buf_setup(struct ath12k_base *ab, in ath12k_dp_rxdma_ring_buf_setup() argument
433 ath12k_hal_srng_get_entrysize(ab, ringtype); in ath12k_dp_rxdma_ring_buf_setup()
437 ath12k_dp_mon_buf_replenish(ab, rx_ring, num_entries); in ath12k_dp_rxdma_ring_buf_setup()
439 ath12k_dp_rx_bufs_replenish(ab, 0, rx_ring, num_entries, in ath12k_dp_rxdma_ring_buf_setup()
440 ab->hw_params->hal_params->rx_buf_rbm, in ath12k_dp_rxdma_ring_buf_setup()
445 static int ath12k_dp_rxdma_buf_setup(struct ath12k_base *ab) in ath12k_dp_rxdma_buf_setup() argument
447 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rxdma_buf_setup()
451 ret = ath12k_dp_rxdma_ring_buf_setup(ab, rx_ring, in ath12k_dp_rxdma_buf_setup()
454 ath12k_warn(ab, in ath12k_dp_rxdma_buf_setup()
459 if (ab->hw_params->rxdma1_enable) { in ath12k_dp_rxdma_buf_setup()
461 ret = ath12k_dp_rxdma_ring_buf_setup(ab, rx_ring, in ath12k_dp_rxdma_buf_setup()
464 ath12k_warn(ab, in ath12k_dp_rxdma_buf_setup()
470 ret = ath12k_dp_rxdma_ring_buf_setup(ab, rx_ring, in ath12k_dp_rxdma_buf_setup()
473 ath12k_warn(ab, in ath12k_dp_rxdma_buf_setup()
485 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_pdev_srng_free() local
488 for (i = 0; i < ab->hw_params->num_rxmda_per_pdev; i++) { in ath12k_dp_rx_pdev_srng_free()
489 ath12k_dp_srng_cleanup(ab, &dp->rxdma_mon_dst_ring[i]); in ath12k_dp_rx_pdev_srng_free()
490 ath12k_dp_srng_cleanup(ab, &dp->tx_mon_dst_ring[i]); in ath12k_dp_rx_pdev_srng_free()
494 void ath12k_dp_rx_pdev_reo_cleanup(struct ath12k_base *ab) in ath12k_dp_rx_pdev_reo_cleanup() argument
496 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_pdev_reo_cleanup()
500 ath12k_dp_srng_cleanup(ab, &dp->reo_dst_ring[i]); in ath12k_dp_rx_pdev_reo_cleanup()
503 int ath12k_dp_rx_pdev_reo_setup(struct ath12k_base *ab) in ath12k_dp_rx_pdev_reo_setup() argument
505 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_pdev_reo_setup()
510 ret = ath12k_dp_srng_setup(ab, &dp->reo_dst_ring[i], in ath12k_dp_rx_pdev_reo_setup()
514 ath12k_warn(ab, "failed to setup reo_dst_ring\n"); in ath12k_dp_rx_pdev_reo_setup()
522 ath12k_dp_rx_pdev_reo_cleanup(ab); in ath12k_dp_rx_pdev_reo_setup()
530 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_pdev_srng_alloc() local
535 for (i = 0; i < ab->hw_params->num_rxmda_per_pdev; i++) { in ath12k_dp_rx_pdev_srng_alloc()
536 ret = ath12k_dp_srng_setup(ar->ab, in ath12k_dp_rx_pdev_srng_alloc()
542 ath12k_warn(ar->ab, in ath12k_dp_rx_pdev_srng_alloc()
547 ret = ath12k_dp_srng_setup(ar->ab, in ath12k_dp_rx_pdev_srng_alloc()
553 ath12k_warn(ar->ab, in ath12k_dp_rx_pdev_srng_alloc()
562 void ath12k_dp_rx_reo_cmd_list_cleanup(struct ath12k_base *ab) in ath12k_dp_rx_reo_cmd_list_cleanup() argument
564 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_reo_cmd_list_cleanup()
571 dma_unmap_single(ab->dev, cmd->data.paddr, in ath12k_dp_rx_reo_cmd_list_cleanup()
581 dma_unmap_single(ab->dev, cmd_cache->data.paddr, in ath12k_dp_rx_reo_cmd_list_cleanup()
595 ath12k_warn(dp->ab, "failed to flush rx tid hw desc, tid %d status %d\n", in ath12k_dp_reo_cmd_free()
598 dma_unmap_single(dp->ab->dev, rx_tid->paddr, rx_tid->size, in ath12k_dp_reo_cmd_free()
604 static int ath12k_dp_reo_cmd_send(struct ath12k_base *ab, struct ath12k_dp_rx_tid *rx_tid, in ath12k_dp_reo_cmd_send() argument
610 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_reo_cmd_send()
615 cmd_ring = &ab->hal.srng_list[dp->reo_cmd_ring.ring_id]; in ath12k_dp_reo_cmd_send()
616 cmd_num = ath12k_hal_reo_cmd_send(ab, cmd_ring, type, cmd); in ath12k_dp_reo_cmd_send()
649 static void ath12k_dp_reo_cache_flush(struct ath12k_base *ab, in ath12k_dp_reo_cache_flush() argument
663 ret = ath12k_dp_reo_cmd_send(ab, rx_tid, in ath12k_dp_reo_cache_flush()
667 ath12k_warn(ab, in ath12k_dp_reo_cache_flush()
676 ret = ath12k_dp_reo_cmd_send(ab, rx_tid, in ath12k_dp_reo_cache_flush()
680 ath12k_err(ab, "failed to send HAL_REO_CMD_FLUSH_CACHE cmd, tid %d (%d)\n", in ath12k_dp_reo_cache_flush()
682 dma_unmap_single(ab->dev, rx_tid->paddr, rx_tid->size, in ath12k_dp_reo_cache_flush()
692 struct ath12k_base *ab = dp->ab; in ath12k_dp_rx_tid_del_func() local
700 ath12k_warn(ab, "failed to delete rx tid %d hw descriptor %d\n", in ath12k_dp_rx_tid_del_func()
735 ath12k_dp_reo_cache_flush(ab, &elem->data); in ath12k_dp_rx_tid_del_func()
744 dma_unmap_single(ab->dev, rx_tid->paddr, rx_tid->size, in ath12k_dp_rx_tid_del_func()
750 static void ath12k_peer_rx_tid_qref_setup(struct ath12k_base *ab, u16 peer_id, u16 tid, in ath12k_peer_rx_tid_qref_setup() argument
754 struct ath12k_dp *dp = &ab->dp; in ath12k_peer_rx_tid_qref_setup()
756 if (!ab->hw_params->reoq_lut_support) in ath12k_peer_rx_tid_qref_setup()
772 static void ath12k_peer_rx_tid_qref_reset(struct ath12k_base *ab, u16 peer_id, u16 tid) in ath12k_peer_rx_tid_qref_reset() argument
775 struct ath12k_dp *dp = &ab->dp; in ath12k_peer_rx_tid_qref_reset()
777 if (!ab->hw_params->reoq_lut_support) in ath12k_peer_rx_tid_qref_reset()
805 ret = ath12k_dp_reo_cmd_send(ar->ab, rx_tid, in ath12k_dp_rx_peer_tid_delete()
809 ath12k_err(ar->ab, "failed to send HAL_REO_CMD_UPDATE_RX_QUEUE cmd, tid %d (%d)\n", in ath12k_dp_rx_peer_tid_delete()
811 dma_unmap_single(ar->ab->dev, rx_tid->paddr, rx_tid->size, in ath12k_dp_rx_peer_tid_delete()
817 ath12k_peer_rx_tid_qref_reset(ar->ab, peer->peer_id, tid); in ath12k_dp_rx_peer_tid_delete()
826 static int ath12k_dp_rx_link_desc_return(struct ath12k_base *ab, in ath12k_dp_rx_link_desc_return() argument
832 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_link_desc_return()
836 srng = &ab->hal.srng_list[dp->wbm_desc_rel_ring.ring_id]; in ath12k_dp_rx_link_desc_return()
840 ath12k_hal_srng_access_begin(ab, srng); in ath12k_dp_rx_link_desc_return()
842 desc = ath12k_hal_srng_src_get_next_entry(ab, srng); in ath12k_dp_rx_link_desc_return()
848 ath12k_hal_rx_msdu_link_desc_set(ab, desc, link_desc, action); in ath12k_dp_rx_link_desc_return()
851 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_link_desc_return()
861 struct ath12k_base *ab = rx_tid->ab; in ath12k_dp_rx_frags_cleanup() local
863 lockdep_assert_held(&ab->base_lock); in ath12k_dp_rx_frags_cleanup()
867 ath12k_dp_rx_link_desc_return(ab, rx_tid->dst_ring_desc, in ath12k_dp_rx_frags_cleanup()
884 lockdep_assert_held(&ar->ab->base_lock); in ath12k_dp_rx_peer_tid_cleanup()
892 spin_unlock_bh(&ar->ab->base_lock); in ath12k_dp_rx_peer_tid_cleanup()
894 spin_lock_bh(&ar->ab->base_lock); in ath12k_dp_rx_peer_tid_cleanup()
918 ret = ath12k_dp_reo_cmd_send(ar->ab, rx_tid, in ath12k_peer_rx_tid_reo_update()
922 ath12k_warn(ar->ab, "failed to update rx tid queue, tid %d (%d)\n", in ath12k_peer_rx_tid_reo_update()
936 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_peer_tid_setup() local
937 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_peer_tid_setup()
946 spin_lock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
948 peer = ath12k_peer_find(ab, vdev_id, peer_mac); in ath12k_dp_rx_peer_tid_setup()
950 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
951 ath12k_warn(ab, "failed to find the peer to set up rx tid\n"); in ath12k_dp_rx_peer_tid_setup()
955 if (ab->hw_params->reoq_lut_support && !dp->reoq_lut.vaddr) { in ath12k_dp_rx_peer_tid_setup()
956 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
957 ath12k_warn(ab, "reo qref table is not setup\n"); in ath12k_dp_rx_peer_tid_setup()
962 ath12k_warn(ab, "peer id of peer %d or tid %d doesn't allow reoq setup\n", in ath12k_dp_rx_peer_tid_setup()
964 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
974 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
976 ath12k_warn(ab, "failed to update reo for rx tid %d\n", tid); in ath12k_dp_rx_peer_tid_setup()
997 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
1006 paddr = dma_map_single(ab->dev, addr_aligned, hw_desc_sz, in ath12k_dp_rx_peer_tid_setup()
1009 ret = dma_mapping_error(ab->dev, paddr); in ath12k_dp_rx_peer_tid_setup()
1011 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
1020 if (ab->hw_params->reoq_lut_support) { in ath12k_dp_rx_peer_tid_setup()
1024 ath12k_peer_rx_tid_qref_setup(ab, peer->peer_id, tid, paddr); in ath12k_dp_rx_peer_tid_setup()
1025 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
1027 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
1043 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_ampdu_start() local
1052 ath12k_warn(ab, "failed to setup rx tid %d\n", ret); in ath12k_dp_rx_ampdu_start()
1060 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_ampdu_stop() local
1067 spin_lock_bh(&ab->base_lock); in ath12k_dp_rx_ampdu_stop()
1069 peer = ath12k_peer_find(ab, vdev_id, params->sta->addr); in ath12k_dp_rx_ampdu_stop()
1071 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_ampdu_stop()
1072 ath12k_warn(ab, "failed to find the peer to stop rx aggregation\n"); in ath12k_dp_rx_ampdu_stop()
1079 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_ampdu_stop()
1084 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_ampdu_stop()
1086 ath12k_warn(ab, "failed to update reo for rx tid %d: %d\n", in ath12k_dp_rx_ampdu_stop()
1100 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_peer_pn_replay_config() local
1136 spin_lock_bh(&ab->base_lock); in ath12k_dp_rx_peer_pn_replay_config()
1138 peer = ath12k_peer_find(ab, arvif->vdev_id, peer_addr); in ath12k_dp_rx_peer_pn_replay_config()
1140 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_pn_replay_config()
1141 ath12k_warn(ab, "failed to find the peer %pM to configure pn replay detection\n", in ath12k_dp_rx_peer_pn_replay_config()
1152 ret = ath12k_dp_reo_cmd_send(ab, rx_tid, in ath12k_dp_rx_peer_pn_replay_config()
1156 ath12k_warn(ab, "failed to configure rx tid %d queue of peer %pM for pn replay detection %d\n", in ath12k_dp_rx_peer_pn_replay_config()
1162 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_pn_replay_config()
1184 static int ath12k_htt_tlv_ppdu_stats_parse(struct ath12k_base *ab, in ath12k_htt_tlv_ppdu_stats_parse() argument
1201 ath12k_warn(ab, "Invalid len %d for the tag 0x%x\n", in ath12k_htt_tlv_ppdu_stats_parse()
1210 ath12k_warn(ab, "Invalid len %d for the tag 0x%x\n", in ath12k_htt_tlv_ppdu_stats_parse()
1229 ath12k_warn(ab, "Invalid len %d for the tag 0x%x\n", in ath12k_htt_tlv_ppdu_stats_parse()
1250 ath12k_warn(ab, "Invalid len %d for the tag 0x%x\n", in ath12k_htt_tlv_ppdu_stats_parse()
1272 static int ath12k_dp_htt_tlv_iter(struct ath12k_base *ab, const void *ptr, size_t len, in ath12k_dp_htt_tlv_iter() argument
1284 ath12k_err(ab, "htt tlv parse failure at byte %zd (%zu bytes left, %zu expected)\n", in ath12k_dp_htt_tlv_iter()
1295 ath12k_err(ab, "htt tlv parse failure of tag %u at byte %zd (%zu bytes left, %u expected)\n", in ath12k_dp_htt_tlv_iter()
1299 ret = iter(ab, tlv_tag, tlv_len, ptr, data); in ath12k_dp_htt_tlv_iter()
1313 struct ath12k_base *ab = ar->ab; in ath12k_update_per_peer_tx_stats() local
1365 ath12k_warn(ab, "Invalid HE mcs %d peer stats", mcs); in ath12k_update_per_peer_tx_stats()
1370 ath12k_warn(ab, "Invalid HE mcs %d peer stats", mcs); in ath12k_update_per_peer_tx_stats()
1375 ath12k_warn(ab, "Invalid VHT mcs %d peer stats", mcs); in ath12k_update_per_peer_tx_stats()
1380 ath12k_warn(ab, "Invalid HT mcs %d nss %d peer stats", in ath12k_update_per_peer_tx_stats()
1395 spin_lock_bh(&ab->base_lock); in ath12k_update_per_peer_tx_stats()
1396 peer = ath12k_peer_find_by_id(ab, usr_stats->peer_id); in ath12k_update_per_peer_tx_stats()
1399 spin_unlock_bh(&ab->base_lock); in ath12k_update_per_peer_tx_stats()
1459 spin_unlock_bh(&ab->base_lock); in ath12k_update_per_peer_tx_stats()
1535 static int ath12k_htt_pull_ppdu_stats(struct ath12k_base *ab, in ath12k_htt_pull_ppdu_stats() argument
1554 ar = ath12k_mac_get_ar_by_pdev_id(ab, pdev_id); in ath12k_htt_pull_ppdu_stats()
1569 ret = ath12k_dp_htt_tlv_iter(ab, msg->data, len, in ath12k_htt_pull_ppdu_stats()
1574 ath12k_warn(ab, "Failed to parse tlv %d\n", ret); in ath12k_htt_pull_ppdu_stats()
1584 spin_lock_bh(&ab->base_lock); in ath12k_htt_pull_ppdu_stats()
1585 peer = ath12k_peer_find_by_id(ab, peer_id); in ath12k_htt_pull_ppdu_stats()
1587 spin_unlock_bh(&ab->base_lock); in ath12k_htt_pull_ppdu_stats()
1594 spin_unlock_bh(&ab->base_lock); in ath12k_htt_pull_ppdu_stats()
1603 spin_lock_bh(&ab->base_lock); in ath12k_htt_pull_ppdu_stats()
1604 peer = ath12k_peer_find_by_id(ab, peer_id); in ath12k_htt_pull_ppdu_stats()
1606 spin_unlock_bh(&ab->base_lock); in ath12k_htt_pull_ppdu_stats()
1613 spin_unlock_bh(&ab->base_lock); in ath12k_htt_pull_ppdu_stats()
1625 static void ath12k_htt_mlo_offset_event_handler(struct ath12k_base *ab, in ath12k_htt_mlo_offset_event_handler() argument
1636 ar = ath12k_mac_get_ar_by_pdev_id(ab, pdev_id); in ath12k_htt_mlo_offset_event_handler()
1639 ath12k_warn(ab, "invalid pdev id %d on htt mlo offset\n", pdev_id); in ath12k_htt_mlo_offset_event_handler()
1658 void ath12k_dp_htt_htc_t2h_msg_handler(struct ath12k_base *ab, in ath12k_dp_htt_htc_t2h_msg_handler() argument
1661 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_htt_htc_t2h_msg_handler()
1673 ath12k_dbg(ab, ATH12K_DBG_DP_HTT, "dp_htt rx msg type :0x%0x\n", type); in ath12k_dp_htt_htc_t2h_msg_handler()
1693 ath12k_peer_map_event(ab, vdev_id, peer_id, mac_addr, 0, 0); in ath12k_dp_htt_htc_t2h_msg_handler()
1708 ath12k_peer_map_event(ab, vdev_id, peer_id, mac_addr, ast_hash, in ath12k_dp_htt_htc_t2h_msg_handler()
1720 ath12k_peer_map_event(ab, vdev_id, peer_id, mac_addr, ast_hash, in ath12k_dp_htt_htc_t2h_msg_handler()
1727 ath12k_peer_unmap_event(ab, peer_id); in ath12k_dp_htt_htc_t2h_msg_handler()
1730 ath12k_htt_pull_ppdu_stats(ab, skb); in ath12k_dp_htt_htc_t2h_msg_handler()
1735 ath12k_htt_mlo_offset_event_handler(ab, skb); in ath12k_dp_htt_htc_t2h_msg_handler()
1738 ath12k_dbg(ab, ATH12K_DBG_DP_HTT, "dp_htt event %d not handled\n", in ath12k_dp_htt_htc_t2h_msg_handler()
1751 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_msdu_coalesce() local
1757 u32 hal_rx_desc_sz = ar->ab->hw_params->hal_desc_sz; in ath12k_dp_rx_msdu_coalesce()
1773 rxcb->is_first_msdu = ath12k_dp_rx_h_first_msdu(ab, ldesc); in ath12k_dp_rx_msdu_coalesce()
1774 rxcb->is_last_msdu = ath12k_dp_rx_h_last_msdu(ab, ldesc); in ath12k_dp_rx_msdu_coalesce()
1786 ath12k_dp_rx_desc_end_tlv_copy(ab, rxcb->rx_desc, ldesc); in ath12k_dp_rx_msdu_coalesce()
1852 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_csum_offload() local
1855 ip_csum_fail = ath12k_dp_rx_h_ip_cksum_fail(ab, rxcb->rx_desc); in ath12k_dp_rx_h_csum_offload()
1856 l4_csum_fail = ath12k_dp_rx_h_l4_cksum_fail(ab, rxcb->rx_desc); in ath12k_dp_rx_h_csum_offload()
1885 ath12k_warn(ar->ab, "unsupported encryption type %d for mic len\n", enctype); in ath12k_dp_rx_crypto_mic_len()
1913 ath12k_warn(ar->ab, "unsupported encryption type %d\n", enctype); in ath12k_dp_rx_crypto_param_len()
1938 ath12k_warn(ar->ab, "unsupported encryption type %d\n", enctype); in ath12k_dp_rx_crypto_icv_len()
1947 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_undecap_nwifi() local
1968 if (ath12k_dp_rx_h_mesh_ctl_present(ab, rxcb->rx_desc)) in ath12k_dp_rx_h_undecap_nwifi()
1979 ath12k_dp_rx_desc_get_crypto_header(ar->ab, in ath12k_dp_rx_h_undecap_nwifi()
2055 struct ath12k_base *ab = ar->ab; in ath12k_get_dot11_hdr_from_rx_desc() local
2065 ath12k_dp_rx_desc_get_crypto_header(ab, rx_desc, crypto_hdr, enctype); in ath12k_get_dot11_hdr_from_rx_desc()
2068 fc = cpu_to_le16(ath12k_dp_rxdesc_get_mpdu_frame_ctrl(ab, rx_desc)); in ath12k_get_dot11_hdr_from_rx_desc()
2075 ath12k_dp_rx_desc_get_dot11_hdr(ab, rx_desc, hdr); in ath12k_get_dot11_hdr_from_rx_desc()
2083 if (ath12k_dp_rx_h_mesh_ctl_present(ab, rx_desc)) in ath12k_get_dot11_hdr_from_rx_desc()
2127 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_undecap() local
2131 decap = ath12k_dp_rx_h_decap_type(ab, rx_desc); in ath12k_dp_rx_h_undecap()
2164 ath12k_dp_rx_h_find_peer(struct ath12k_base *ab, struct sk_buff *msdu) in ath12k_dp_rx_h_find_peer() argument
2170 lockdep_assert_held(&ab->base_lock); in ath12k_dp_rx_h_find_peer()
2173 peer = ath12k_peer_find_by_id(ab, rxcb->peer_id); in ath12k_dp_rx_h_find_peer()
2178 if (!rx_desc || !(ath12k_dp_rxdesc_mac_addr2_valid(ab, rx_desc))) in ath12k_dp_rx_h_find_peer()
2181 peer = ath12k_peer_find_by_addr(ab, in ath12k_dp_rx_h_find_peer()
2182 ath12k_dp_rxdesc_get_mpdu_start_addr2(ab, in ath12k_dp_rx_h_find_peer()
2193 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_mpdu() local
2203 fill_crypto_hdr = ath12k_dp_rx_h_is_mcbc(ar->ab, rx_desc); in ath12k_dp_rx_h_mpdu()
2207 rxcb->peer_id = ath12k_dp_rx_h_peer_id(ar->ab, rx_desc); in ath12k_dp_rx_h_mpdu()
2209 spin_lock_bh(&ar->ab->base_lock); in ath12k_dp_rx_h_mpdu()
2210 peer = ath12k_dp_rx_h_find_peer(ar->ab, msdu); in ath12k_dp_rx_h_mpdu()
2219 spin_unlock_bh(&ar->ab->base_lock); in ath12k_dp_rx_h_mpdu()
2221 err_bitmap = ath12k_dp_rx_h_mpdu_err(ab, rx_desc); in ath12k_dp_rx_h_mpdu()
2223 is_decrypted = ath12k_dp_rx_h_is_decrypted(ab, rx_desc); in ath12k_dp_rx_h_mpdu()
2255 if (ath12k_dp_rx_h_decap_type(ar->ab, rx_desc) != in ath12k_dp_rx_h_mpdu()
2265 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_rate() local
2273 pkt_type = ath12k_dp_rx_h_pkt_type(ab, rx_desc); in ath12k_dp_rx_h_rate()
2274 bw = ath12k_dp_rx_h_rx_bw(ab, rx_desc); in ath12k_dp_rx_h_rate()
2275 rate_mcs = ath12k_dp_rx_h_rate_mcs(ab, rx_desc); in ath12k_dp_rx_h_rate()
2276 nss = ath12k_dp_rx_h_nss(ab, rx_desc); in ath12k_dp_rx_h_rate()
2277 sgi = ath12k_dp_rx_h_sgi(ab, rx_desc); in ath12k_dp_rx_h_rate()
2290 ath12k_warn(ar->ab, in ath12k_dp_rx_h_rate()
2304 ath12k_warn(ar->ab, in ath12k_dp_rx_h_rate()
2317 ath12k_warn(ar->ab, in ath12k_dp_rx_h_rate()
2333 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_ppdu() local
2347 meta_data = ath12k_dp_rx_h_freq(ab, rx_desc); in ath12k_dp_rx_h_ppdu()
2366 ath12k_dbg_dump(ar->ab, ATH12K_DBG_DATA, NULL, "rx_desc: ", in ath12k_dp_rx_h_ppdu()
2380 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_deliver_msdu() local
2403 decap = ath12k_dp_rx_h_decap_type(ab, rxcb->rx_desc); in ath12k_dp_rx_deliver_msdu()
2405 spin_lock_bh(&ab->base_lock); in ath12k_dp_rx_deliver_msdu()
2406 peer = ath12k_dp_rx_h_find_peer(ab, msdu); in ath12k_dp_rx_deliver_msdu()
2410 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_deliver_msdu()
2412 ath12k_dbg(ab, ATH12K_DBG_DATA, in ath12k_dp_rx_deliver_msdu()
2419 ath12k_dp_rx_h_seq_no(ab, rxcb->rx_desc), in ath12k_dp_rx_deliver_msdu()
2436 ath12k_dbg_dump(ab, ATH12K_DBG_DP_RX, NULL, "dp rx msdu: ", in ath12k_dp_rx_deliver_msdu()
2461 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_process_msdu() local
2468 u32 hal_rx_desc_sz = ar->ab->hw_params->hal_desc_sz; in ath12k_dp_rx_process_msdu()
2472 ath12k_warn(ab, in ath12k_dp_rx_process_msdu()
2480 if (!ath12k_dp_rx_h_msdu_done(ab, lrx_desc)) { in ath12k_dp_rx_process_msdu()
2481 ath12k_warn(ab, "msdu_done bit in msdu_end is not set\n"); in ath12k_dp_rx_process_msdu()
2488 msdu_len = ath12k_dp_rx_h_msdu_len(ab, lrx_desc); in ath12k_dp_rx_process_msdu()
2489 l3_pad_bytes = ath12k_dp_rx_h_l3pad(ab, lrx_desc); in ath12k_dp_rx_process_msdu()
2496 ath12k_warn(ab, "invalid msdu len %u\n", msdu_len); in ath12k_dp_rx_process_msdu()
2497 ath12k_dbg_dump(ab, ATH12K_DBG_DATA, NULL, "", rx_desc, in ath12k_dp_rx_process_msdu()
2508 ath12k_warn(ab, in ath12k_dp_rx_process_msdu()
2525 static void ath12k_dp_rx_process_received_packets(struct ath12k_base *ab, in ath12k_dp_rx_process_received_packets() argument
2545 ar = ab->pdevs[mac_id].ar; in ath12k_dp_rx_process_received_packets()
2546 if (!rcu_dereference(ab->pdevs_active[mac_id])) { in ath12k_dp_rx_process_received_packets()
2558 ath12k_dbg(ab, ATH12K_DBG_DATA, in ath12k_dp_rx_process_received_packets()
2570 int ath12k_dp_rx_process(struct ath12k_base *ab, int ring_id, in ath12k_dp_rx_process() argument
2574 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_process()
2589 srng = &ab->hal.srng_list[dp->reo_dst_ring[ring_id].ring_id]; in ath12k_dp_rx_process()
2594 ath12k_hal_srng_access_begin(ab, srng); in ath12k_dp_rx_process()
2596 while ((desc = ath12k_hal_srng_dst_get_next_entry(ab, srng))) { in ath12k_dp_rx_process()
2612 desc_info = ath12k_dp_get_rx_desc(ab, cookie); in ath12k_dp_rx_process()
2614 ath12k_warn(ab, "Invalid cookie in manual desc retrival"); in ath12k_dp_rx_process()
2620 ath12k_warn(ab, "Check HW CC implementation"); in ath12k_dp_rx_process()
2630 dma_unmap_single(ab->dev, rxcb->paddr, in ath12k_dp_rx_process()
2641 ab->soc_stats.hal_reo_error[dp->reo_dst_ring[ring_id].ring_id]++; in ath12k_dp_rx_process()
2676 if (!done && ath12k_hal_srng_dst_num_free(ab, srng, true)) { in ath12k_dp_rx_process()
2677 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_process()
2681 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_process()
2689 ath12k_dp_rx_bufs_replenish(ab, 0, rx_ring, num_buffs_reaped, in ath12k_dp_rx_process()
2690 ab->hw_params->hal_params->rx_buf_rbm, true); in ath12k_dp_rx_process()
2692 ath12k_dp_rx_process_received_packets(ab, napi, &msdu_list, in ath12k_dp_rx_process()
2703 spin_lock_bh(&rx_tid->ab->base_lock); in ath12k_dp_rx_frag_timer()
2706 spin_unlock_bh(&rx_tid->ab->base_lock); in ath12k_dp_rx_frag_timer()
2710 spin_unlock_bh(&rx_tid->ab->base_lock); in ath12k_dp_rx_frag_timer()
2715 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_peer_frag_setup() local
2725 spin_lock_bh(&ab->base_lock); in ath12k_dp_rx_peer_frag_setup()
2727 peer = ath12k_peer_find(ab, vdev_id, peer_mac); in ath12k_dp_rx_peer_frag_setup()
2729 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_frag_setup()
2730 ath12k_warn(ab, "failed to find the peer to set up fragment info\n"); in ath12k_dp_rx_peer_frag_setup()
2736 rx_tid->ab = ab; in ath12k_dp_rx_peer_frag_setup()
2742 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_frag_setup()
2791 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_verify_tkip_mic() local
2799 u32 hdr_len, hal_rx_desc_sz = ar->ab->hw_params->hal_desc_sz; in ath12k_dp_rx_h_verify_tkip_mic()
2803 if (ath12k_dp_rx_h_enctype(ab, rx_desc) != HAL_ENCRYPT_TYPE_TKIP_MIC) in ath12k_dp_rx_h_verify_tkip_mic()
2849 u32 hal_rx_desc_sz = ar->ab->hw_params->hal_desc_sz; in ath12k_dp_rx_h_undecap_frag()
2879 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_defrag() local
2887 u32 flags, hal_rx_desc_sz = ar->ab->hw_params->hal_desc_sz; in ath12k_dp_rx_h_defrag()
2897 enctype = ath12k_dp_rx_h_enctype(ab, rx_desc); in ath12k_dp_rx_h_defrag()
2899 is_decrypted = ath12k_dp_rx_h_is_decrypted(ab, in ath12k_dp_rx_h_defrag()
2947 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_defrag_reo_reinject() local
2948 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_h_defrag_reo_reinject()
2963 hal_rx_desc_sz = ab->hw_params->hal_desc_sz; in ath12k_dp_rx_h_defrag_reo_reinject()
2967 ath12k_hal_rx_reo_ent_paddr_get(ab, &reo_dest_ring->buf_addr_info, in ath12k_dp_rx_h_defrag_reo_reinject()
2990 ath12k_dp_rxdesc_set_msdu_len(ab, rx_desc, defrag_skb->len - hal_rx_desc_sz); in ath12k_dp_rx_h_defrag_reo_reinject()
2992 buf_paddr = dma_map_single(ab->dev, defrag_skb->data, in ath12k_dp_rx_h_defrag_reo_reinject()
2995 if (dma_mapping_error(ab->dev, buf_paddr)) in ath12k_dp_rx_h_defrag_reo_reinject()
3004 ath12k_warn(ab, "failed to find rx desc for reinject\n"); in ath12k_dp_rx_h_defrag_reo_reinject()
3022 srng = &ab->hal.srng_list[dp->reo_reinject_ring.ring_id]; in ath12k_dp_rx_h_defrag_reo_reinject()
3025 ath12k_hal_srng_access_begin(ab, srng); in ath12k_dp_rx_h_defrag_reo_reinject()
3027 reo_ent_ring = ath12k_hal_srng_src_get_next_entry(ab, srng); in ath12k_dp_rx_h_defrag_reo_reinject()
3029 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_h_defrag_reo_reinject()
3063 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_h_defrag_reo_reinject()
3075 dma_unmap_single(ab->dev, buf_paddr, defrag_skb->len + skb_tailroom(defrag_skb), in ath12k_dp_rx_h_defrag_reo_reinject()
3080 static int ath12k_dp_rx_h_cmp_frags(struct ath12k_base *ab, in ath12k_dp_rx_h_cmp_frags() argument
3085 frag1 = ath12k_dp_rx_h_frag_no(ab, a); in ath12k_dp_rx_h_cmp_frags()
3086 frag2 = ath12k_dp_rx_h_frag_no(ab, b); in ath12k_dp_rx_h_cmp_frags()
3091 static void ath12k_dp_rx_h_sort_frags(struct ath12k_base *ab, in ath12k_dp_rx_h_sort_frags() argument
3099 cmp = ath12k_dp_rx_h_cmp_frags(ab, skb, cur_frag); in ath12k_dp_rx_h_sort_frags()
3113 u32 hal_rx_desc_sz = ar->ab->hw_params->hal_desc_sz; in ath12k_dp_rx_h_get_pn()
3131 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_defrag_validate_incr_pn() local
3141 encrypt_type = ath12k_dp_rx_h_enctype(ab, desc); in ath12k_dp_rx_h_defrag_validate_incr_pn()
3165 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_frag_h_mpdu() local
3177 peer_id = ath12k_dp_rx_h_peer_id(ab, rx_desc); in ath12k_dp_rx_frag_h_mpdu()
3178 tid = ath12k_dp_rx_h_tid(ab, rx_desc); in ath12k_dp_rx_frag_h_mpdu()
3179 seqno = ath12k_dp_rx_h_seq_no(ab, rx_desc); in ath12k_dp_rx_frag_h_mpdu()
3180 frag_no = ath12k_dp_rx_h_frag_no(ab, msdu); in ath12k_dp_rx_frag_h_mpdu()
3181 more_frags = ath12k_dp_rx_h_more_frags(ab, msdu); in ath12k_dp_rx_frag_h_mpdu()
3183 if (!ath12k_dp_rx_h_seq_ctrl_valid(ab, rx_desc) || in ath12k_dp_rx_frag_h_mpdu()
3184 !ath12k_dp_rx_h_fc_valid(ab, rx_desc) || in ath12k_dp_rx_frag_h_mpdu()
3196 spin_lock_bh(&ab->base_lock); in ath12k_dp_rx_frag_h_mpdu()
3197 peer = ath12k_peer_find_by_id(ab, peer_id); in ath12k_dp_rx_frag_h_mpdu()
3199 ath12k_warn(ab, "failed to find the peer to de-fragment received fragment peer_id %d\n", in ath12k_dp_rx_frag_h_mpdu()
3222 ath12k_dp_rx_h_sort_frags(ab, &rx_tid->rx_frags, msdu); in ath12k_dp_rx_frag_h_mpdu()
3237 ath12k_dp_rx_link_desc_return(ab, ring_desc, in ath12k_dp_rx_frag_h_mpdu()
3248 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_frag_h_mpdu()
3250 spin_lock_bh(&ab->base_lock); in ath12k_dp_rx_frag_h_mpdu()
3252 peer = ath12k_peer_find_by_id(ab, peer_id); in ath12k_dp_rx_frag_h_mpdu()
3275 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_frag_h_mpdu()
3283 struct ath12k_base *ab = ar->ab; in ath12k_dp_process_rx_err_buf() local
3288 u32 hal_rx_desc_sz = ab->hw_params->hal_desc_sz; in ath12k_dp_process_rx_err_buf()
3298 desc_info = ath12k_dp_get_rx_desc(ab, cookie); in ath12k_dp_process_rx_err_buf()
3300 ath12k_warn(ab, "Invalid cookie in manual desc retrival"); in ath12k_dp_process_rx_err_buf()
3306 ath12k_warn(ab, " RX Exception, Check HW CC implementation"); in ath12k_dp_process_rx_err_buf()
3310 spin_lock_bh(&ab->dp.rx_desc_lock); in ath12k_dp_process_rx_err_buf()
3311 list_move_tail(&desc_info->list, &ab->dp.rx_desc_free_list); in ath12k_dp_process_rx_err_buf()
3312 spin_unlock_bh(&ab->dp.rx_desc_lock); in ath12k_dp_process_rx_err_buf()
3315 dma_unmap_single(ar->ab->dev, rxcb->paddr, in ath12k_dp_process_rx_err_buf()
3325 if (!rcu_dereference(ar->ab->pdevs_active[ar->pdev_idx])) { in ath12k_dp_process_rx_err_buf()
3336 msdu_len = ath12k_dp_rx_h_msdu_len(ar->ab, rx_desc); in ath12k_dp_process_rx_err_buf()
3338 ath12k_warn(ar->ab, "invalid msdu leng %u", msdu_len); in ath12k_dp_process_rx_err_buf()
3339 ath12k_dbg_dump(ar->ab, ATH12K_DBG_DATA, NULL, "", rx_desc, in ath12k_dp_process_rx_err_buf()
3349 ath12k_dp_rx_link_desc_return(ar->ab, desc, in ath12k_dp_process_rx_err_buf()
3357 int ath12k_dp_rx_process_err(struct ath12k_base *ab, struct napi_struct *napi, in ath12k_dp_rx_process_err() argument
3380 dp = &ab->dp; in ath12k_dp_rx_process_err()
3384 srng = &ab->hal.srng_list[reo_except->ring_id]; in ath12k_dp_rx_process_err()
3388 ath12k_hal_srng_access_begin(ab, srng); in ath12k_dp_rx_process_err()
3391 (reo_desc = ath12k_hal_srng_dst_get_next_entry(ab, srng))) { in ath12k_dp_rx_process_err()
3392 ab->soc_stats.err_ring_pkts++; in ath12k_dp_rx_process_err()
3393 ret = ath12k_hal_desc_reo_parse_err(ab, reo_desc, &paddr, in ath12k_dp_rx_process_err()
3396 ath12k_warn(ab, "failed to parse error reo desc %d\n", in ath12k_dp_rx_process_err()
3406 rbm != ab->hw_params->hal_params->rx_buf_rbm) { in ath12k_dp_rx_process_err()
3407 ab->soc_stats.invalid_rbm++; in ath12k_dp_rx_process_err()
3408 ath12k_warn(ab, "invalid return buffer manager %d\n", rbm); in ath12k_dp_rx_process_err()
3409 ath12k_dp_rx_link_desc_return(ab, reo_desc, in ath12k_dp_rx_process_err()
3423 ath12k_dp_rx_link_desc_return(ab, reo_desc, in ath12k_dp_rx_process_err()
3431 ar = ab->pdevs[mac_id].ar; in ath12k_dp_rx_process_err()
3447 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_process_err()
3453 ath12k_dp_rx_bufs_replenish(ab, 0, rx_ring, tot_n_bufs_reaped, in ath12k_dp_rx_process_err()
3454 ab->hw_params->hal_params->rx_buf_rbm, true); in ath12k_dp_rx_process_err()
3468 (DP_RX_BUFFER_SIZE - ar->ab->hw_params->hal_desc_sz)); in ath12k_dp_rx_null_q_desc_sg_drop()
3487 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_null_q_desc() local
3492 u32 hal_rx_desc_sz = ar->ab->hw_params->hal_desc_sz; in ath12k_dp_rx_h_null_q_desc()
3494 msdu_len = ath12k_dp_rx_h_msdu_len(ab, desc); in ath12k_dp_rx_h_null_q_desc()
3495 peer_id = ath12k_dp_rx_h_peer_id(ab, desc); in ath12k_dp_rx_h_null_q_desc()
3497 if (!ath12k_peer_find_by_id(ab, peer_id)) { in ath12k_dp_rx_h_null_q_desc()
3498 ath12k_dbg(ab, ATH12K_DBG_DATA, "invalid peer id received in wbm err pkt%d\n", in ath12k_dp_rx_h_null_q_desc()
3517 if (!ath12k_dp_rx_h_msdu_done(ab, desc)) { in ath12k_dp_rx_h_null_q_desc()
3518 ath12k_warn(ar->ab, in ath12k_dp_rx_h_null_q_desc()
3536 l3pad_bytes = ath12k_dp_rx_h_l3pad(ab, desc); in ath12k_dp_rx_h_null_q_desc()
3548 rxcb->tid = ath12k_dp_rx_h_tid(ab, desc); in ath12k_dp_rx_h_null_q_desc()
3564 ar->ab->soc_stats.reo_error[rxcb->err_code]++; in ath12k_dp_rx_h_reo_err()
3591 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_tkip_mic_err() local
3596 u32 hal_rx_desc_sz = ar->ab->hw_params->hal_desc_sz; in ath12k_dp_rx_h_tkip_mic_err()
3598 rxcb->is_first_msdu = ath12k_dp_rx_h_first_msdu(ab, desc); in ath12k_dp_rx_h_tkip_mic_err()
3599 rxcb->is_last_msdu = ath12k_dp_rx_h_last_msdu(ab, desc); in ath12k_dp_rx_h_tkip_mic_err()
3601 l3pad_bytes = ath12k_dp_rx_h_l3pad(ab, desc); in ath12k_dp_rx_h_tkip_mic_err()
3602 msdu_len = ath12k_dp_rx_h_msdu_len(ab, desc); in ath12k_dp_rx_h_tkip_mic_err()
3618 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_rxdma_err() local
3624 ar->ab->soc_stats.rxdma_error[rxcb->err_code]++; in ath12k_dp_rx_h_rxdma_err()
3629 err_bitmap = ath12k_dp_rx_h_mpdu_err(ab, rx_desc); in ath12k_dp_rx_h_rxdma_err()
3675 int ath12k_dp_rx_process_wbm_err(struct ath12k_base *ab, in ath12k_dp_rx_process_wbm_err() argument
3679 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_process_wbm_err()
3692 for (i = 0; i < ab->num_radios; i++) in ath12k_dp_rx_process_wbm_err()
3695 srng = &ab->hal.srng_list[dp->rx_rel_ring.ring_id]; in ath12k_dp_rx_process_wbm_err()
3700 ath12k_hal_srng_access_begin(ab, srng); in ath12k_dp_rx_process_wbm_err()
3703 rx_desc = ath12k_hal_srng_dst_get_next_entry(ab, srng); in ath12k_dp_rx_process_wbm_err()
3707 ret = ath12k_hal_wbm_desc_parse_err(ab, rx_desc, &err_info); in ath12k_dp_rx_process_wbm_err()
3709 ath12k_warn(ab, in ath12k_dp_rx_process_wbm_err()
3719 desc_info = ath12k_dp_get_rx_desc(ab, err_info.cookie); in ath12k_dp_rx_process_wbm_err()
3721 ath12k_warn(ab, "Invalid cookie in manual desc retrival"); in ath12k_dp_rx_process_wbm_err()
3732 ath12k_warn(ab, "WBM RX err, Check HW CC implementation"); in ath12k_dp_rx_process_wbm_err()
3742 dma_unmap_single(ab->dev, rxcb->paddr, in ath12k_dp_rx_process_wbm_err()
3767 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_process_wbm_err()
3774 ath12k_dp_rx_bufs_replenish(ab, 0, rx_ring, num_buffs_reaped, in ath12k_dp_rx_process_wbm_err()
3775 ab->hw_params->hal_params->rx_buf_rbm, true); in ath12k_dp_rx_process_wbm_err()
3778 for (i = 0; i < ab->num_radios; i++) { in ath12k_dp_rx_process_wbm_err()
3779 if (!rcu_dereference(ab->pdevs_active[i])) { in ath12k_dp_rx_process_wbm_err()
3784 ar = ab->pdevs[i].ar; in ath12k_dp_rx_process_wbm_err()
3799 void ath12k_dp_rx_process_reo_status(struct ath12k_base *ab) in ath12k_dp_rx_process_reo_status() argument
3801 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_process_reo_status()
3809 srng = &ab->hal.srng_list[dp->reo_status_ring.ring_id]; in ath12k_dp_rx_process_reo_status()
3815 ath12k_hal_srng_access_begin(ab, srng); in ath12k_dp_rx_process_reo_status()
3817 while ((hdr = ath12k_hal_srng_dst_get_next_entry(ab, srng))) { in ath12k_dp_rx_process_reo_status()
3822 ath12k_hal_reo_status_queue_stats(ab, hdr, in ath12k_dp_rx_process_reo_status()
3826 ath12k_hal_reo_flush_queue_status(ab, hdr, in ath12k_dp_rx_process_reo_status()
3830 ath12k_hal_reo_flush_cache_status(ab, hdr, in ath12k_dp_rx_process_reo_status()
3834 ath12k_hal_reo_unblk_cache_status(ab, hdr, in ath12k_dp_rx_process_reo_status()
3838 ath12k_hal_reo_flush_timeout_list_status(ab, hdr, in ath12k_dp_rx_process_reo_status()
3842 ath12k_hal_reo_desc_thresh_reached_status(ab, hdr, in ath12k_dp_rx_process_reo_status()
3846 ath12k_hal_reo_update_rx_reo_queue_status(ab, hdr, in ath12k_dp_rx_process_reo_status()
3850 ath12k_warn(ab, "Unknown reo status type %d\n", tag); in ath12k_dp_rx_process_reo_status()
3873 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_process_reo_status()
3878 void ath12k_dp_rx_free(struct ath12k_base *ab) in ath12k_dp_rx_free() argument
3880 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_free()
3883 ath12k_dp_srng_cleanup(ab, &dp->rx_refill_buf_ring.refill_buf_ring); in ath12k_dp_rx_free()
3885 for (i = 0; i < ab->hw_params->num_rxmda_per_pdev; i++) { in ath12k_dp_rx_free()
3886 if (ab->hw_params->rx_mac_buf_ring) in ath12k_dp_rx_free()
3887 ath12k_dp_srng_cleanup(ab, &dp->rx_mac_buf_ring[i]); in ath12k_dp_rx_free()
3890 for (i = 0; i < ab->hw_params->num_rxdma_dst_ring; i++) in ath12k_dp_rx_free()
3891 ath12k_dp_srng_cleanup(ab, &dp->rxdma_err_dst_ring[i]); in ath12k_dp_rx_free()
3893 ath12k_dp_srng_cleanup(ab, &dp->rxdma_mon_buf_ring.refill_buf_ring); in ath12k_dp_rx_free()
3894 ath12k_dp_srng_cleanup(ab, &dp->tx_mon_buf_ring.refill_buf_ring); in ath12k_dp_rx_free()
3896 ath12k_dp_rxdma_buf_free(ab); in ath12k_dp_rx_free()
3899 void ath12k_dp_rx_pdev_free(struct ath12k_base *ab, int mac_id) in ath12k_dp_rx_pdev_free() argument
3901 struct ath12k *ar = ab->pdevs[mac_id].ar; in ath12k_dp_rx_pdev_free()
3906 int ath12k_dp_rxdma_ring_sel_config_qcn9274(struct ath12k_base *ab) in ath12k_dp_rxdma_ring_sel_config_qcn9274() argument
3908 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rxdma_ring_sel_config_qcn9274()
3912 u32 hal_rx_desc_sz = ab->hw_params->hal_desc_sz; in ath12k_dp_rxdma_ring_sel_config_qcn9274()
3925 ab->hw_params->hal_ops->rx_desc_get_mpdu_start_offset(); in ath12k_dp_rxdma_ring_sel_config_qcn9274()
3927 ab->hw_params->hal_ops->rx_desc_get_msdu_end_offset(); in ath12k_dp_rxdma_ring_sel_config_qcn9274()
3933 ret = ath12k_dp_tx_htt_rx_filter_setup(ab, ring_id, 0, in ath12k_dp_rxdma_ring_sel_config_qcn9274()
3941 int ath12k_dp_rxdma_ring_sel_config_wcn7850(struct ath12k_base *ab) in ath12k_dp_rxdma_ring_sel_config_wcn7850() argument
3943 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rxdma_ring_sel_config_wcn7850()
3947 u32 hal_rx_desc_sz = ab->hw_params->hal_desc_sz; in ath12k_dp_rxdma_ring_sel_config_wcn7850()
3963 ab->hw_params->hal_ops->rx_desc_get_mpdu_start_offset(); in ath12k_dp_rxdma_ring_sel_config_wcn7850()
3965 ab->hw_params->hal_ops->rx_desc_get_msdu_end_offset(); in ath12k_dp_rxdma_ring_sel_config_wcn7850()
3972 for (i = 0; i < ab->hw_params->num_rxmda_per_pdev; i++) { in ath12k_dp_rxdma_ring_sel_config_wcn7850()
3974 ret = ath12k_dp_tx_htt_rx_filter_setup(ab, ring_id, i, in ath12k_dp_rxdma_ring_sel_config_wcn7850()
3983 int ath12k_dp_rx_htt_setup(struct ath12k_base *ab) in ath12k_dp_rx_htt_setup() argument
3985 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_htt_setup()
3991 ret = ath12k_dp_tx_htt_srng_setup(ab, ring_id, 0, HAL_RXDMA_BUF); in ath12k_dp_rx_htt_setup()
3993 ath12k_warn(ab, "failed to configure rx_refill_buf_ring %d\n", in ath12k_dp_rx_htt_setup()
3998 if (ab->hw_params->rx_mac_buf_ring) { in ath12k_dp_rx_htt_setup()
3999 for (i = 0; i < ab->hw_params->num_rxmda_per_pdev; i++) { in ath12k_dp_rx_htt_setup()
4001 ret = ath12k_dp_tx_htt_srng_setup(ab, ring_id, in ath12k_dp_rx_htt_setup()
4004 ath12k_warn(ab, "failed to configure rx_mac_buf_ring%d %d\n", in ath12k_dp_rx_htt_setup()
4011 for (i = 0; i < ab->hw_params->num_rxdma_dst_ring; i++) { in ath12k_dp_rx_htt_setup()
4013 ret = ath12k_dp_tx_htt_srng_setup(ab, ring_id, in ath12k_dp_rx_htt_setup()
4016 ath12k_warn(ab, "failed to configure rxdma_err_dest_ring%d %d\n", in ath12k_dp_rx_htt_setup()
4022 if (ab->hw_params->rxdma1_enable) { in ath12k_dp_rx_htt_setup()
4024 ret = ath12k_dp_tx_htt_srng_setup(ab, ring_id, in ath12k_dp_rx_htt_setup()
4027 ath12k_warn(ab, "failed to configure rxdma_mon_buf_ring %d\n", in ath12k_dp_rx_htt_setup()
4033 ret = ath12k_dp_tx_htt_srng_setup(ab, ring_id, in ath12k_dp_rx_htt_setup()
4036 ath12k_warn(ab, "failed to configure rxdma_mon_buf_ring %d\n", in ath12k_dp_rx_htt_setup()
4042 ret = ab->hw_params->hw_ops->rxdma_ring_sel_config(ab); in ath12k_dp_rx_htt_setup()
4044 ath12k_warn(ab, "failed to setup rxdma ring selection config\n"); in ath12k_dp_rx_htt_setup()
4051 int ath12k_dp_rx_alloc(struct ath12k_base *ab) in ath12k_dp_rx_alloc() argument
4053 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_alloc()
4065 ret = ath12k_dp_srng_setup(ab, in ath12k_dp_rx_alloc()
4070 ath12k_warn(ab, "failed to setup rx_refill_buf_ring\n"); in ath12k_dp_rx_alloc()
4074 if (ab->hw_params->rx_mac_buf_ring) { in ath12k_dp_rx_alloc()
4075 for (i = 0; i < ab->hw_params->num_rxmda_per_pdev; i++) { in ath12k_dp_rx_alloc()
4076 ret = ath12k_dp_srng_setup(ab, in ath12k_dp_rx_alloc()
4081 ath12k_warn(ab, "failed to setup rx_mac_buf_ring %d\n", in ath12k_dp_rx_alloc()
4088 for (i = 0; i < ab->hw_params->num_rxdma_dst_ring; i++) { in ath12k_dp_rx_alloc()
4089 ret = ath12k_dp_srng_setup(ab, &dp->rxdma_err_dst_ring[i], in ath12k_dp_rx_alloc()
4093 ath12k_warn(ab, "failed to setup rxdma_err_dst_ring %d\n", i); in ath12k_dp_rx_alloc()
4098 if (ab->hw_params->rxdma1_enable) { in ath12k_dp_rx_alloc()
4099 ret = ath12k_dp_srng_setup(ab, in ath12k_dp_rx_alloc()
4104 ath12k_warn(ab, "failed to setup HAL_RXDMA_MONITOR_BUF\n"); in ath12k_dp_rx_alloc()
4108 ret = ath12k_dp_srng_setup(ab, in ath12k_dp_rx_alloc()
4113 ath12k_warn(ab, "failed to setup DP_TX_MONITOR_BUF_RING_SIZE\n"); in ath12k_dp_rx_alloc()
4118 ret = ath12k_dp_rxdma_buf_setup(ab); in ath12k_dp_rx_alloc()
4120 ath12k_warn(ab, "failed to setup rxdma ring\n"); in ath12k_dp_rx_alloc()
4127 int ath12k_dp_rx_pdev_alloc(struct ath12k_base *ab, int mac_id) in ath12k_dp_rx_pdev_alloc() argument
4129 struct ath12k *ar = ab->pdevs[mac_id].ar; in ath12k_dp_rx_pdev_alloc()
4135 if (!ab->hw_params->rxdma1_enable) in ath12k_dp_rx_pdev_alloc()
4140 ath12k_warn(ab, "failed to setup rx srngs\n"); in ath12k_dp_rx_pdev_alloc()
4144 for (i = 0; i < ab->hw_params->num_rxmda_per_pdev; i++) { in ath12k_dp_rx_pdev_alloc()
4146 ret = ath12k_dp_tx_htt_srng_setup(ab, ring_id, in ath12k_dp_rx_pdev_alloc()
4150 ath12k_warn(ab, in ath12k_dp_rx_pdev_alloc()
4157 ret = ath12k_dp_tx_htt_srng_setup(ab, ring_id, in ath12k_dp_rx_pdev_alloc()
4161 ath12k_warn(ab, in ath12k_dp_rx_pdev_alloc()
4193 ath12k_warn(ar->ab, "pdev_mon_status_attach() failed"); in ath12k_dp_rx_pdev_mon_attach()
4200 if (!ar->ab->hw_params->rxdma1_enable) in ath12k_dp_rx_pdev_mon_attach()
4210 int ath12k_dp_rx_pktlog_start(struct ath12k_base *ab) in ath12k_dp_rx_pktlog_start() argument
4213 mod_timer(&ab->mon_reap_timer, in ath12k_dp_rx_pktlog_start()
4219 int ath12k_dp_rx_pktlog_stop(struct ath12k_base *ab, bool stop_timer) in ath12k_dp_rx_pktlog_stop() argument
4224 del_timer_sync(&ab->mon_reap_timer); in ath12k_dp_rx_pktlog_stop()
4227 ret = ath12k_dp_purge_mon_ring(ab); in ath12k_dp_rx_pktlog_stop()
4229 ath12k_warn(ab, "failed to purge dp mon ring: %d\n", ret); in ath12k_dp_rx_pktlog_stop()