Lines Matching full: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_da_mcbc(struct ath12k_base *ab, in ath12k_dp_rx_h_is_da_mcbc() argument
199 return (ath12k_dp_rx_h_first_msdu(ab, desc) && in ath12k_dp_rx_h_is_da_mcbc()
200 ab->hw_params->hal_ops->rx_desc_is_da_mcbc(desc)); in ath12k_dp_rx_h_is_da_mcbc()
203 static bool ath12k_dp_rxdesc_mac_addr2_valid(struct ath12k_base *ab, in ath12k_dp_rxdesc_mac_addr2_valid() argument
206 return ab->hw_params->hal_ops->rx_desc_mac_addr2_valid(desc); in ath12k_dp_rxdesc_mac_addr2_valid()
209 static u8 *ath12k_dp_rxdesc_get_mpdu_start_addr2(struct ath12k_base *ab, in ath12k_dp_rxdesc_get_mpdu_start_addr2() argument
212 return ab->hw_params->hal_ops->rx_desc_mpdu_start_addr2(desc); in ath12k_dp_rxdesc_get_mpdu_start_addr2()
215 static void ath12k_dp_rx_desc_get_dot11_hdr(struct ath12k_base *ab, in ath12k_dp_rx_desc_get_dot11_hdr() argument
219 ab->hw_params->hal_ops->rx_desc_get_dot11_hdr(desc, hdr); in ath12k_dp_rx_desc_get_dot11_hdr()
222 static void ath12k_dp_rx_desc_get_crypto_header(struct ath12k_base *ab, in ath12k_dp_rx_desc_get_crypto_header() argument
227 ab->hw_params->hal_ops->rx_desc_get_crypto_header(desc, crypto_hdr, enctype); in ath12k_dp_rx_desc_get_crypto_header()
230 static u16 ath12k_dp_rxdesc_get_mpdu_frame_ctrl(struct ath12k_base *ab, in ath12k_dp_rxdesc_get_mpdu_frame_ctrl() argument
233 return ab->hw_params->hal_ops->rx_desc_get_mpdu_frame_ctl(desc); in ath12k_dp_rxdesc_get_mpdu_frame_ctrl()
236 static int ath12k_dp_purge_mon_ring(struct ath12k_base *ab) in ath12k_dp_purge_mon_ring() argument
242 for (i = 0; i < ab->hw_params->num_rxmda_per_pdev; i++) in ath12k_dp_purge_mon_ring()
243 reaped += ath12k_dp_mon_process_ring(ab, i, NULL, in ath12k_dp_purge_mon_ring()
253 ath12k_warn(ab, "dp mon ring purge timeout"); in ath12k_dp_purge_mon_ring()
259 int ath12k_dp_rx_bufs_replenish(struct ath12k_base *ab, int mac_id, in ath12k_dp_rx_bufs_replenish() argument
273 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_bufs_replenish()
278 srng = &ab->hal.srng_list[rx_ring->refill_buf_ring.ring_id]; in ath12k_dp_rx_bufs_replenish()
282 ath12k_hal_srng_access_begin(ab, srng); in ath12k_dp_rx_bufs_replenish()
284 num_free = ath12k_hal_srng_src_num_free(ab, srng, true); in ath12k_dp_rx_bufs_replenish()
304 paddr = dma_map_single(ab->dev, skb->data, in ath12k_dp_rx_bufs_replenish()
307 if (dma_mapping_error(ab->dev, paddr)) in ath12k_dp_rx_bufs_replenish()
346 desc = ath12k_hal_srng_src_get_next_entry(ab, srng); in ath12k_dp_rx_bufs_replenish()
357 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_bufs_replenish()
376 dma_unmap_single(ab->dev, paddr, skb->len + skb_tailroom(skb), in ath12k_dp_rx_bufs_replenish()
381 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_bufs_replenish()
388 static int ath12k_dp_rxdma_buf_ring_free(struct ath12k_base *ab, in ath12k_dp_rxdma_buf_ring_free() argument
400 dma_unmap_single(ab->dev, ATH12K_SKB_RXCB(skb)->paddr, in ath12k_dp_rxdma_buf_ring_free()
411 static int ath12k_dp_rxdma_buf_free(struct ath12k_base *ab) in ath12k_dp_rxdma_buf_free() argument
413 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rxdma_buf_free()
416 ath12k_dp_rxdma_buf_ring_free(ab, rx_ring); in ath12k_dp_rxdma_buf_free()
419 ath12k_dp_rxdma_buf_ring_free(ab, rx_ring); in ath12k_dp_rxdma_buf_free()
422 ath12k_dp_rxdma_buf_ring_free(ab, rx_ring); in ath12k_dp_rxdma_buf_free()
427 static int ath12k_dp_rxdma_ring_buf_setup(struct ath12k_base *ab, in ath12k_dp_rxdma_ring_buf_setup() argument
434 ath12k_hal_srng_get_entrysize(ab, ringtype); in ath12k_dp_rxdma_ring_buf_setup()
438 ath12k_dp_mon_buf_replenish(ab, rx_ring, num_entries); in ath12k_dp_rxdma_ring_buf_setup()
440 ath12k_dp_rx_bufs_replenish(ab, 0, rx_ring, num_entries, in ath12k_dp_rxdma_ring_buf_setup()
441 ab->hw_params->hal_params->rx_buf_rbm, in ath12k_dp_rxdma_ring_buf_setup()
446 static int ath12k_dp_rxdma_buf_setup(struct ath12k_base *ab) in ath12k_dp_rxdma_buf_setup() argument
448 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rxdma_buf_setup()
452 ret = ath12k_dp_rxdma_ring_buf_setup(ab, rx_ring, in ath12k_dp_rxdma_buf_setup()
455 ath12k_warn(ab, in ath12k_dp_rxdma_buf_setup()
460 if (ab->hw_params->rxdma1_enable) { in ath12k_dp_rxdma_buf_setup()
462 ret = ath12k_dp_rxdma_ring_buf_setup(ab, rx_ring, in ath12k_dp_rxdma_buf_setup()
465 ath12k_warn(ab, in ath12k_dp_rxdma_buf_setup()
471 ret = ath12k_dp_rxdma_ring_buf_setup(ab, rx_ring, in ath12k_dp_rxdma_buf_setup()
474 ath12k_warn(ab, in ath12k_dp_rxdma_buf_setup()
486 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_pdev_srng_free() local
489 for (i = 0; i < ab->hw_params->num_rxmda_per_pdev; i++) { in ath12k_dp_rx_pdev_srng_free()
490 ath12k_dp_srng_cleanup(ab, &dp->rxdma_mon_dst_ring[i]); in ath12k_dp_rx_pdev_srng_free()
491 ath12k_dp_srng_cleanup(ab, &dp->tx_mon_dst_ring[i]); in ath12k_dp_rx_pdev_srng_free()
495 void ath12k_dp_rx_pdev_reo_cleanup(struct ath12k_base *ab) in ath12k_dp_rx_pdev_reo_cleanup() argument
497 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_pdev_reo_cleanup()
501 ath12k_dp_srng_cleanup(ab, &dp->reo_dst_ring[i]); in ath12k_dp_rx_pdev_reo_cleanup()
504 int ath12k_dp_rx_pdev_reo_setup(struct ath12k_base *ab) in ath12k_dp_rx_pdev_reo_setup() argument
506 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_pdev_reo_setup()
511 ret = ath12k_dp_srng_setup(ab, &dp->reo_dst_ring[i], in ath12k_dp_rx_pdev_reo_setup()
515 ath12k_warn(ab, "failed to setup reo_dst_ring\n"); in ath12k_dp_rx_pdev_reo_setup()
523 ath12k_dp_rx_pdev_reo_cleanup(ab); in ath12k_dp_rx_pdev_reo_setup()
531 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_pdev_srng_alloc() local
536 for (i = 0; i < ab->hw_params->num_rxmda_per_pdev; i++) { in ath12k_dp_rx_pdev_srng_alloc()
537 ret = ath12k_dp_srng_setup(ar->ab, in ath12k_dp_rx_pdev_srng_alloc()
543 ath12k_warn(ar->ab, in ath12k_dp_rx_pdev_srng_alloc()
548 ret = ath12k_dp_srng_setup(ar->ab, in ath12k_dp_rx_pdev_srng_alloc()
554 ath12k_warn(ar->ab, in ath12k_dp_rx_pdev_srng_alloc()
563 void ath12k_dp_rx_reo_cmd_list_cleanup(struct ath12k_base *ab) in ath12k_dp_rx_reo_cmd_list_cleanup() argument
565 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_reo_cmd_list_cleanup()
572 dma_unmap_single(ab->dev, cmd->data.paddr, in ath12k_dp_rx_reo_cmd_list_cleanup()
582 dma_unmap_single(ab->dev, cmd_cache->data.paddr, in ath12k_dp_rx_reo_cmd_list_cleanup()
596 ath12k_warn(dp->ab, "failed to flush rx tid hw desc, tid %d status %d\n", in ath12k_dp_reo_cmd_free()
599 dma_unmap_single(dp->ab->dev, rx_tid->paddr, rx_tid->size, in ath12k_dp_reo_cmd_free()
605 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
611 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_reo_cmd_send()
616 cmd_ring = &ab->hal.srng_list[dp->reo_cmd_ring.ring_id]; in ath12k_dp_reo_cmd_send()
617 cmd_num = ath12k_hal_reo_cmd_send(ab, cmd_ring, type, cmd); in ath12k_dp_reo_cmd_send()
650 static void ath12k_dp_reo_cache_flush(struct ath12k_base *ab, in ath12k_dp_reo_cache_flush() argument
664 ret = ath12k_dp_reo_cmd_send(ab, rx_tid, in ath12k_dp_reo_cache_flush()
668 ath12k_warn(ab, in ath12k_dp_reo_cache_flush()
677 ret = ath12k_dp_reo_cmd_send(ab, rx_tid, in ath12k_dp_reo_cache_flush()
681 ath12k_err(ab, "failed to send HAL_REO_CMD_FLUSH_CACHE cmd, tid %d (%d)\n", in ath12k_dp_reo_cache_flush()
683 dma_unmap_single(ab->dev, rx_tid->paddr, rx_tid->size, in ath12k_dp_reo_cache_flush()
693 struct ath12k_base *ab = dp->ab; in ath12k_dp_rx_tid_del_func() local
701 ath12k_warn(ab, "failed to delete rx tid %d hw descriptor %d\n", in ath12k_dp_rx_tid_del_func()
736 ath12k_dp_reo_cache_flush(ab, &elem->data); in ath12k_dp_rx_tid_del_func()
745 dma_unmap_single(ab->dev, rx_tid->paddr, rx_tid->size, in ath12k_dp_rx_tid_del_func()
751 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
755 struct ath12k_dp *dp = &ab->dp; in ath12k_peer_rx_tid_qref_setup()
757 if (!ab->hw_params->reoq_lut_support) in ath12k_peer_rx_tid_qref_setup()
773 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
776 struct ath12k_dp *dp = &ab->dp; in ath12k_peer_rx_tid_qref_reset()
778 if (!ab->hw_params->reoq_lut_support) in ath12k_peer_rx_tid_qref_reset()
806 ret = ath12k_dp_reo_cmd_send(ar->ab, rx_tid, in ath12k_dp_rx_peer_tid_delete()
810 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()
812 dma_unmap_single(ar->ab->dev, rx_tid->paddr, rx_tid->size, in ath12k_dp_rx_peer_tid_delete()
818 ath12k_peer_rx_tid_qref_reset(ar->ab, peer->peer_id, tid); in ath12k_dp_rx_peer_tid_delete()
827 static int ath12k_dp_rx_link_desc_return(struct ath12k_base *ab, in ath12k_dp_rx_link_desc_return() argument
833 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_link_desc_return()
837 srng = &ab->hal.srng_list[dp->wbm_desc_rel_ring.ring_id]; in ath12k_dp_rx_link_desc_return()
841 ath12k_hal_srng_access_begin(ab, srng); in ath12k_dp_rx_link_desc_return()
843 desc = ath12k_hal_srng_src_get_next_entry(ab, srng); in ath12k_dp_rx_link_desc_return()
849 ath12k_hal_rx_msdu_link_desc_set(ab, desc, link_desc, action); in ath12k_dp_rx_link_desc_return()
852 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_link_desc_return()
862 struct ath12k_base *ab = rx_tid->ab; in ath12k_dp_rx_frags_cleanup() local
864 lockdep_assert_held(&ab->base_lock); in ath12k_dp_rx_frags_cleanup()
868 ath12k_dp_rx_link_desc_return(ab, rx_tid->dst_ring_desc, in ath12k_dp_rx_frags_cleanup()
885 lockdep_assert_held(&ar->ab->base_lock); in ath12k_dp_rx_peer_tid_cleanup()
893 spin_unlock_bh(&ar->ab->base_lock); in ath12k_dp_rx_peer_tid_cleanup()
895 spin_lock_bh(&ar->ab->base_lock); in ath12k_dp_rx_peer_tid_cleanup()
919 ret = ath12k_dp_reo_cmd_send(ar->ab, rx_tid, in ath12k_peer_rx_tid_reo_update()
923 ath12k_warn(ar->ab, "failed to update rx tid queue, tid %d (%d)\n", in ath12k_peer_rx_tid_reo_update()
937 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_peer_tid_setup() local
938 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_peer_tid_setup()
947 spin_lock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
949 peer = ath12k_peer_find(ab, vdev_id, peer_mac); in ath12k_dp_rx_peer_tid_setup()
951 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
952 ath12k_warn(ab, "failed to find the peer to set up rx tid\n"); in ath12k_dp_rx_peer_tid_setup()
956 if (ab->hw_params->reoq_lut_support && !dp->reoq_lut.vaddr) { in ath12k_dp_rx_peer_tid_setup()
957 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
958 ath12k_warn(ab, "reo qref table is not setup\n"); in ath12k_dp_rx_peer_tid_setup()
963 ath12k_warn(ab, "peer id of peer %d or tid %d doesn't allow reoq setup\n", in ath12k_dp_rx_peer_tid_setup()
965 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
975 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
977 ath12k_warn(ab, "failed to update reo for rx tid %d\n", tid); in ath12k_dp_rx_peer_tid_setup()
981 if (!ab->hw_params->reoq_lut_support) { in ath12k_dp_rx_peer_tid_setup()
987 ath12k_warn(ab, "failed to setup peer rx reorder queuefor tid %d: %d\n", in ath12k_dp_rx_peer_tid_setup()
1010 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
1019 paddr = dma_map_single(ab->dev, addr_aligned, hw_desc_sz, in ath12k_dp_rx_peer_tid_setup()
1022 ret = dma_mapping_error(ab->dev, paddr); in ath12k_dp_rx_peer_tid_setup()
1024 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
1033 if (ab->hw_params->reoq_lut_support) { in ath12k_dp_rx_peer_tid_setup()
1037 ath12k_peer_rx_tid_qref_setup(ab, peer->peer_id, tid, paddr); in ath12k_dp_rx_peer_tid_setup()
1038 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
1040 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_tid_setup()
1056 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_ampdu_start() local
1065 ath12k_warn(ab, "failed to setup rx tid %d\n", ret); in ath12k_dp_rx_ampdu_start()
1073 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_ampdu_stop() local
1080 spin_lock_bh(&ab->base_lock); in ath12k_dp_rx_ampdu_stop()
1082 peer = ath12k_peer_find(ab, vdev_id, params->sta->addr); in ath12k_dp_rx_ampdu_stop()
1084 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_ampdu_stop()
1085 ath12k_warn(ab, "failed to find the peer to stop rx aggregation\n"); in ath12k_dp_rx_ampdu_stop()
1092 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_ampdu_stop()
1097 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_ampdu_stop()
1099 ath12k_warn(ab, "failed to update reo for rx tid %d: %d\n", in ath12k_dp_rx_ampdu_stop()
1113 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_peer_pn_replay_config() local
1149 spin_lock_bh(&ab->base_lock); in ath12k_dp_rx_peer_pn_replay_config()
1151 peer = ath12k_peer_find(ab, arvif->vdev_id, peer_addr); in ath12k_dp_rx_peer_pn_replay_config()
1153 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_pn_replay_config()
1154 ath12k_warn(ab, "failed to find the peer %pM to configure pn replay detection\n", in ath12k_dp_rx_peer_pn_replay_config()
1165 ret = ath12k_dp_reo_cmd_send(ab, rx_tid, in ath12k_dp_rx_peer_pn_replay_config()
1169 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()
1175 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_pn_replay_config()
1197 static int ath12k_htt_tlv_ppdu_stats_parse(struct ath12k_base *ab, in ath12k_htt_tlv_ppdu_stats_parse() argument
1214 ath12k_warn(ab, "Invalid len %d for the tag 0x%x\n", in ath12k_htt_tlv_ppdu_stats_parse()
1223 ath12k_warn(ab, "Invalid len %d for the tag 0x%x\n", in ath12k_htt_tlv_ppdu_stats_parse()
1242 ath12k_warn(ab, "Invalid len %d for the tag 0x%x\n", in ath12k_htt_tlv_ppdu_stats_parse()
1263 ath12k_warn(ab, "Invalid len %d for the tag 0x%x\n", in ath12k_htt_tlv_ppdu_stats_parse()
1286 static int ath12k_dp_htt_tlv_iter(struct ath12k_base *ab, const void *ptr, size_t len, in ath12k_dp_htt_tlv_iter() argument
1288 static int ath12k_dp_htt_tlv_iter(struct ath12k_base *ab, const u8 *ptr, size_t len, in ath12k_dp_htt_tlv_iter()
1305 ath12k_err(ab, "htt tlv parse failure at byte %zd (%zu bytes left, %zu expected)\n", in ath12k_dp_htt_tlv_iter()
1320 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()
1324 ret = iter(ab, tlv_tag, tlv_len, ptr, data); in ath12k_dp_htt_tlv_iter()
1338 struct ath12k_base *ab = ar->ab; in ath12k_update_per_peer_tx_stats() local
1390 ath12k_warn(ab, "Invalid HE mcs %d peer stats", mcs); in ath12k_update_per_peer_tx_stats()
1395 ath12k_warn(ab, "Invalid VHT mcs %d peer stats", mcs); in ath12k_update_per_peer_tx_stats()
1400 ath12k_warn(ab, "Invalid HT mcs %d nss %d peer stats", in ath12k_update_per_peer_tx_stats()
1415 spin_lock_bh(&ab->base_lock); in ath12k_update_per_peer_tx_stats()
1416 peer = ath12k_peer_find_by_id(ab, usr_stats->peer_id); in ath12k_update_per_peer_tx_stats()
1419 spin_unlock_bh(&ab->base_lock); in ath12k_update_per_peer_tx_stats()
1479 spin_unlock_bh(&ab->base_lock); in ath12k_update_per_peer_tx_stats()
1555 static int ath12k_htt_pull_ppdu_stats(struct ath12k_base *ab, in ath12k_htt_pull_ppdu_stats() argument
1574 ar = ath12k_mac_get_ar_by_pdev_id(ab, pdev_id); in ath12k_htt_pull_ppdu_stats()
1589 ret = ath12k_dp_htt_tlv_iter(ab, msg->data, len, in ath12k_htt_pull_ppdu_stats()
1594 ath12k_warn(ab, "Failed to parse tlv %d\n", ret); in ath12k_htt_pull_ppdu_stats()
1604 spin_lock_bh(&ab->base_lock); in ath12k_htt_pull_ppdu_stats()
1605 peer = ath12k_peer_find_by_id(ab, peer_id); in ath12k_htt_pull_ppdu_stats()
1607 spin_unlock_bh(&ab->base_lock); in ath12k_htt_pull_ppdu_stats()
1614 spin_unlock_bh(&ab->base_lock); in ath12k_htt_pull_ppdu_stats()
1623 spin_lock_bh(&ab->base_lock); in ath12k_htt_pull_ppdu_stats()
1624 peer = ath12k_peer_find_by_id(ab, peer_id); in ath12k_htt_pull_ppdu_stats()
1626 spin_unlock_bh(&ab->base_lock); in ath12k_htt_pull_ppdu_stats()
1633 spin_unlock_bh(&ab->base_lock); in ath12k_htt_pull_ppdu_stats()
1645 static void ath12k_htt_mlo_offset_event_handler(struct ath12k_base *ab, in ath12k_htt_mlo_offset_event_handler() argument
1656 ar = ath12k_mac_get_ar_by_pdev_id(ab, pdev_id); in ath12k_htt_mlo_offset_event_handler()
1659 ath12k_warn(ab, "invalid pdev id %d on htt mlo offset\n", pdev_id); in ath12k_htt_mlo_offset_event_handler()
1678 void ath12k_dp_htt_htc_t2h_msg_handler(struct ath12k_base *ab, in ath12k_dp_htt_htc_t2h_msg_handler() argument
1681 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_htt_htc_t2h_msg_handler()
1693 ath12k_dbg(ab, ATH12K_DBG_DP_HTT, "dp_htt rx msg type :0x%0x\n", type); in ath12k_dp_htt_htc_t2h_msg_handler()
1713 ath12k_peer_map_event(ab, vdev_id, peer_id, mac_addr, 0, 0); in ath12k_dp_htt_htc_t2h_msg_handler()
1728 ath12k_peer_map_event(ab, vdev_id, peer_id, mac_addr, ast_hash, in ath12k_dp_htt_htc_t2h_msg_handler()
1740 ath12k_peer_map_event(ab, vdev_id, peer_id, mac_addr, ast_hash, in ath12k_dp_htt_htc_t2h_msg_handler()
1747 ath12k_peer_unmap_event(ab, peer_id); in ath12k_dp_htt_htc_t2h_msg_handler()
1750 ath12k_htt_pull_ppdu_stats(ab, skb); in ath12k_dp_htt_htc_t2h_msg_handler()
1755 ath12k_htt_mlo_offset_event_handler(ab, skb); in ath12k_dp_htt_htc_t2h_msg_handler()
1758 ath12k_dbg(ab, ATH12K_DBG_DP_HTT, "dp_htt event %d not handled\n", in ath12k_dp_htt_htc_t2h_msg_handler()
1771 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_msdu_coalesce() local
1777 u32 hal_rx_desc_sz = ar->ab->hw_params->hal_desc_sz; in ath12k_dp_rx_msdu_coalesce()
1793 rxcb->is_first_msdu = ath12k_dp_rx_h_first_msdu(ab, ldesc); in ath12k_dp_rx_msdu_coalesce()
1794 rxcb->is_last_msdu = ath12k_dp_rx_h_last_msdu(ab, ldesc); in ath12k_dp_rx_msdu_coalesce()
1806 ath12k_dp_rx_desc_end_tlv_copy(ab, rxcb->rx_desc, ldesc); in ath12k_dp_rx_msdu_coalesce()
1872 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_csum_offload() local
1875 ip_csum_fail = ath12k_dp_rx_h_ip_cksum_fail(ab, rxcb->rx_desc); in ath12k_dp_rx_h_csum_offload()
1876 l4_csum_fail = ath12k_dp_rx_h_l4_cksum_fail(ab, rxcb->rx_desc); in ath12k_dp_rx_h_csum_offload()
1905 ath12k_warn(ar->ab, "unsupported encryption type %d for mic len\n", enctype); in ath12k_dp_rx_crypto_mic_len()
1933 ath12k_warn(ar->ab, "unsupported encryption type %d\n", enctype); in ath12k_dp_rx_crypto_param_len()
1958 ath12k_warn(ar->ab, "unsupported encryption type %d\n", enctype); in ath12k_dp_rx_crypto_icv_len()
1967 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_undecap_nwifi() local
1988 if (ath12k_dp_rx_h_mesh_ctl_present(ab, rxcb->rx_desc)) in ath12k_dp_rx_h_undecap_nwifi()
1999 ath12k_dp_rx_desc_get_crypto_header(ar->ab, in ath12k_dp_rx_h_undecap_nwifi()
2075 struct ath12k_base *ab = ar->ab; in ath12k_get_dot11_hdr_from_rx_desc() local
2085 ath12k_dp_rx_desc_get_crypto_header(ab, rx_desc, crypto_hdr, enctype); in ath12k_get_dot11_hdr_from_rx_desc()
2088 fc = cpu_to_le16(ath12k_dp_rxdesc_get_mpdu_frame_ctrl(ab, rx_desc)); in ath12k_get_dot11_hdr_from_rx_desc()
2095 ath12k_dp_rx_desc_get_dot11_hdr(ab, rx_desc, hdr); in ath12k_get_dot11_hdr_from_rx_desc()
2103 if (ath12k_dp_rx_h_mesh_ctl_present(ab, rx_desc)) in ath12k_get_dot11_hdr_from_rx_desc()
2147 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_undecap() local
2151 decap = ath12k_dp_rx_h_decap_type(ab, rx_desc); in ath12k_dp_rx_h_undecap()
2184 ath12k_dp_rx_h_find_peer(struct ath12k_base *ab, struct sk_buff *msdu) in ath12k_dp_rx_h_find_peer() argument
2190 lockdep_assert_held(&ab->base_lock); in ath12k_dp_rx_h_find_peer()
2193 peer = ath12k_peer_find_by_id(ab, rxcb->peer_id); in ath12k_dp_rx_h_find_peer()
2198 if (!rx_desc || !(ath12k_dp_rxdesc_mac_addr2_valid(ab, rx_desc))) in ath12k_dp_rx_h_find_peer()
2201 peer = ath12k_peer_find_by_addr(ab, in ath12k_dp_rx_h_find_peer()
2202 ath12k_dp_rxdesc_get_mpdu_start_addr2(ab, in ath12k_dp_rx_h_find_peer()
2213 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_mpdu() local
2223 fill_crypto_hdr = ath12k_dp_rx_h_is_da_mcbc(ar->ab, rx_desc); in ath12k_dp_rx_h_mpdu()
2227 rxcb->peer_id = ath12k_dp_rx_h_peer_id(ar->ab, rx_desc); in ath12k_dp_rx_h_mpdu()
2229 spin_lock_bh(&ar->ab->base_lock); in ath12k_dp_rx_h_mpdu()
2230 peer = ath12k_dp_rx_h_find_peer(ar->ab, msdu); in ath12k_dp_rx_h_mpdu()
2239 spin_unlock_bh(&ar->ab->base_lock); in ath12k_dp_rx_h_mpdu()
2241 err_bitmap = ath12k_dp_rx_h_mpdu_err(ab, rx_desc); in ath12k_dp_rx_h_mpdu()
2243 is_decrypted = ath12k_dp_rx_h_is_decrypted(ab, rx_desc); in ath12k_dp_rx_h_mpdu()
2275 if (ath12k_dp_rx_h_decap_type(ar->ab, rx_desc) != in ath12k_dp_rx_h_mpdu()
2285 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_rate() local
2293 pkt_type = ath12k_dp_rx_h_pkt_type(ab, rx_desc); in ath12k_dp_rx_h_rate()
2294 bw = ath12k_dp_rx_h_rx_bw(ab, rx_desc); in ath12k_dp_rx_h_rate()
2295 rate_mcs = ath12k_dp_rx_h_rate_mcs(ab, rx_desc); in ath12k_dp_rx_h_rate()
2296 nss = ath12k_dp_rx_h_nss(ab, rx_desc); in ath12k_dp_rx_h_rate()
2297 sgi = ath12k_dp_rx_h_sgi(ab, rx_desc); in ath12k_dp_rx_h_rate()
2310 ath12k_warn(ar->ab, in ath12k_dp_rx_h_rate()
2324 ath12k_warn(ar->ab, in ath12k_dp_rx_h_rate()
2337 ath12k_warn(ar->ab, in ath12k_dp_rx_h_rate()
2353 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_ppdu() local
2367 meta_data = ath12k_dp_rx_h_freq(ab, rx_desc); in ath12k_dp_rx_h_ppdu()
2386 ath12k_dbg_dump(ar->ab, ATH12K_DBG_DATA, NULL, "rx_desc: ", in ath12k_dp_rx_h_ppdu()
2400 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_deliver_msdu() local
2423 decap = ath12k_dp_rx_h_decap_type(ab, rxcb->rx_desc); in ath12k_dp_rx_deliver_msdu()
2425 spin_lock_bh(&ab->base_lock); in ath12k_dp_rx_deliver_msdu()
2426 peer = ath12k_dp_rx_h_find_peer(ab, msdu); in ath12k_dp_rx_deliver_msdu()
2430 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_deliver_msdu()
2432 ath12k_dbg(ab, ATH12K_DBG_DATA, in ath12k_dp_rx_deliver_msdu()
2439 ath12k_dp_rx_h_seq_no(ab, rxcb->rx_desc), in ath12k_dp_rx_deliver_msdu()
2456 ath12k_dbg_dump(ab, ATH12K_DBG_DP_RX, NULL, "dp rx msdu: ", in ath12k_dp_rx_deliver_msdu()
2481 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_process_msdu() local
2488 u32 hal_rx_desc_sz = ar->ab->hw_params->hal_desc_sz; in ath12k_dp_rx_process_msdu()
2492 ath12k_warn(ab, in ath12k_dp_rx_process_msdu()
2500 if (!ath12k_dp_rx_h_msdu_done(ab, lrx_desc)) { in ath12k_dp_rx_process_msdu()
2501 ath12k_warn(ab, "msdu_done bit in msdu_end is not set\n"); in ath12k_dp_rx_process_msdu()
2508 msdu_len = ath12k_dp_rx_h_msdu_len(ab, lrx_desc); in ath12k_dp_rx_process_msdu()
2509 l3_pad_bytes = ath12k_dp_rx_h_l3pad(ab, lrx_desc); in ath12k_dp_rx_process_msdu()
2516 ath12k_warn(ab, "invalid msdu len %u\n", msdu_len); in ath12k_dp_rx_process_msdu()
2517 ath12k_dbg_dump(ab, ATH12K_DBG_DATA, NULL, "", rx_desc, in ath12k_dp_rx_process_msdu()
2528 ath12k_warn(ab, in ath12k_dp_rx_process_msdu()
2545 static void ath12k_dp_rx_process_received_packets(struct ath12k_base *ab, in ath12k_dp_rx_process_received_packets() argument
2565 pdev_id = ath12k_hw_mac_id_to_pdev_id(ab->hw_params, mac_id); in ath12k_dp_rx_process_received_packets()
2566 ar = ab->pdevs[pdev_id].ar; in ath12k_dp_rx_process_received_packets()
2567 if (!rcu_dereference(ab->pdevs_active[pdev_id])) { in ath12k_dp_rx_process_received_packets()
2579 ath12k_dbg(ab, ATH12K_DBG_DATA, in ath12k_dp_rx_process_received_packets()
2591 int ath12k_dp_rx_process(struct ath12k_base *ab, int ring_id, in ath12k_dp_rx_process() argument
2595 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_process()
2610 srng = &ab->hal.srng_list[dp->reo_dst_ring[ring_id].ring_id]; in ath12k_dp_rx_process()
2615 ath12k_hal_srng_access_begin(ab, srng); in ath12k_dp_rx_process()
2617 while ((desc = ath12k_hal_srng_dst_get_next_entry(ab, srng))) { in ath12k_dp_rx_process()
2633 desc_info = ath12k_dp_get_rx_desc(ab, cookie); in ath12k_dp_rx_process()
2635 ath12k_warn(ab, "Invalid cookie in manual desc retrieval"); in ath12k_dp_rx_process()
2641 ath12k_warn(ab, "Check HW CC implementation"); in ath12k_dp_rx_process()
2651 dma_unmap_single(ab->dev, rxcb->paddr, in ath12k_dp_rx_process()
2662 ab->soc_stats.hal_reo_error[dp->reo_dst_ring[ring_id].ring_id]++; in ath12k_dp_rx_process()
2697 if (!done && ath12k_hal_srng_dst_num_free(ab, srng, true)) { in ath12k_dp_rx_process()
2698 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_process()
2702 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_process()
2710 ath12k_dp_rx_bufs_replenish(ab, 0, rx_ring, num_buffs_reaped, in ath12k_dp_rx_process()
2711 ab->hw_params->hal_params->rx_buf_rbm, true); in ath12k_dp_rx_process()
2713 ath12k_dp_rx_process_received_packets(ab, napi, &msdu_list, in ath12k_dp_rx_process()
2724 spin_lock_bh(&rx_tid->ab->base_lock); in ath12k_dp_rx_frag_timer()
2727 spin_unlock_bh(&rx_tid->ab->base_lock); in ath12k_dp_rx_frag_timer()
2731 spin_unlock_bh(&rx_tid->ab->base_lock); in ath12k_dp_rx_frag_timer()
2736 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_peer_frag_setup() local
2746 spin_lock_bh(&ab->base_lock); in ath12k_dp_rx_peer_frag_setup()
2748 peer = ath12k_peer_find(ab, vdev_id, peer_mac); in ath12k_dp_rx_peer_frag_setup()
2750 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_frag_setup()
2751 ath12k_warn(ab, "failed to find the peer to set up fragment info\n"); in ath12k_dp_rx_peer_frag_setup()
2757 rx_tid->ab = ab; in ath12k_dp_rx_peer_frag_setup()
2763 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_peer_frag_setup()
2812 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_verify_tkip_mic() local
2820 u32 hdr_len, hal_rx_desc_sz = ar->ab->hw_params->hal_desc_sz; in ath12k_dp_rx_h_verify_tkip_mic()
2824 if (ath12k_dp_rx_h_enctype(ab, rx_desc) != HAL_ENCRYPT_TYPE_TKIP_MIC) in ath12k_dp_rx_h_verify_tkip_mic()
2870 u32 hal_rx_desc_sz = ar->ab->hw_params->hal_desc_sz; in ath12k_dp_rx_h_undecap_frag()
2900 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_defrag() local
2908 u32 flags, hal_rx_desc_sz = ar->ab->hw_params->hal_desc_sz; in ath12k_dp_rx_h_defrag()
2918 enctype = ath12k_dp_rx_h_enctype(ab, rx_desc); in ath12k_dp_rx_h_defrag()
2920 is_decrypted = ath12k_dp_rx_h_is_decrypted(ab, in ath12k_dp_rx_h_defrag()
2968 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_defrag_reo_reinject() local
2969 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_h_defrag_reo_reinject()
2984 hal_rx_desc_sz = ab->hw_params->hal_desc_sz; in ath12k_dp_rx_h_defrag_reo_reinject()
2988 ath12k_hal_rx_reo_ent_paddr_get(ab, &reo_dest_ring->buf_addr_info, in ath12k_dp_rx_h_defrag_reo_reinject()
3016 ath12k_dp_rxdesc_set_msdu_len(ab, rx_desc, defrag_skb->len - hal_rx_desc_sz); in ath12k_dp_rx_h_defrag_reo_reinject()
3018 buf_paddr = dma_map_single(ab->dev, defrag_skb->data, in ath12k_dp_rx_h_defrag_reo_reinject()
3021 if (dma_mapping_error(ab->dev, buf_paddr)) in ath12k_dp_rx_h_defrag_reo_reinject()
3030 ath12k_warn(ab, "failed to find rx desc for reinject\n"); in ath12k_dp_rx_h_defrag_reo_reinject()
3048 srng = &ab->hal.srng_list[dp->reo_reinject_ring.ring_id]; in ath12k_dp_rx_h_defrag_reo_reinject()
3051 ath12k_hal_srng_access_begin(ab, srng); in ath12k_dp_rx_h_defrag_reo_reinject()
3053 reo_ent_ring = ath12k_hal_srng_src_get_next_entry(ab, srng); in ath12k_dp_rx_h_defrag_reo_reinject()
3055 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_h_defrag_reo_reinject()
3093 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_h_defrag_reo_reinject()
3105 dma_unmap_single(ab->dev, buf_paddr, defrag_skb->len + skb_tailroom(defrag_skb), in ath12k_dp_rx_h_defrag_reo_reinject()
3110 static int ath12k_dp_rx_h_cmp_frags(struct ath12k_base *ab, in ath12k_dp_rx_h_cmp_frags() argument
3115 frag1 = ath12k_dp_rx_h_frag_no(ab, a); in ath12k_dp_rx_h_cmp_frags()
3116 frag2 = ath12k_dp_rx_h_frag_no(ab, b); in ath12k_dp_rx_h_cmp_frags()
3121 static void ath12k_dp_rx_h_sort_frags(struct ath12k_base *ab, in ath12k_dp_rx_h_sort_frags() argument
3129 cmp = ath12k_dp_rx_h_cmp_frags(ab, skb, cur_frag); in ath12k_dp_rx_h_sort_frags()
3143 u32 hal_rx_desc_sz = ar->ab->hw_params->hal_desc_sz; in ath12k_dp_rx_h_get_pn()
3161 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_defrag_validate_incr_pn() local
3171 encrypt_type = ath12k_dp_rx_h_enctype(ab, desc); in ath12k_dp_rx_h_defrag_validate_incr_pn()
3195 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_frag_h_mpdu() local
3207 peer_id = ath12k_dp_rx_h_peer_id(ab, rx_desc); in ath12k_dp_rx_frag_h_mpdu()
3208 tid = ath12k_dp_rx_h_tid(ab, rx_desc); in ath12k_dp_rx_frag_h_mpdu()
3209 seqno = ath12k_dp_rx_h_seq_no(ab, rx_desc); in ath12k_dp_rx_frag_h_mpdu()
3210 frag_no = ath12k_dp_rx_h_frag_no(ab, msdu); in ath12k_dp_rx_frag_h_mpdu()
3211 more_frags = ath12k_dp_rx_h_more_frags(ab, msdu); in ath12k_dp_rx_frag_h_mpdu()
3213 if (!ath12k_dp_rx_h_seq_ctrl_valid(ab, rx_desc) || in ath12k_dp_rx_frag_h_mpdu()
3214 !ath12k_dp_rx_h_fc_valid(ab, rx_desc) || in ath12k_dp_rx_frag_h_mpdu()
3226 spin_lock_bh(&ab->base_lock); in ath12k_dp_rx_frag_h_mpdu()
3227 peer = ath12k_peer_find_by_id(ab, peer_id); in ath12k_dp_rx_frag_h_mpdu()
3229 ath12k_warn(ab, "failed to find the peer to de-fragment received fragment peer_id %d\n", in ath12k_dp_rx_frag_h_mpdu()
3252 ath12k_dp_rx_h_sort_frags(ab, &rx_tid->rx_frags, msdu); in ath12k_dp_rx_frag_h_mpdu()
3267 ath12k_dp_rx_link_desc_return(ab, ring_desc, in ath12k_dp_rx_frag_h_mpdu()
3278 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_frag_h_mpdu()
3280 spin_lock_bh(&ab->base_lock); in ath12k_dp_rx_frag_h_mpdu()
3282 peer = ath12k_peer_find_by_id(ab, peer_id); in ath12k_dp_rx_frag_h_mpdu()
3305 spin_unlock_bh(&ab->base_lock); in ath12k_dp_rx_frag_h_mpdu()
3313 struct ath12k_base *ab = ar->ab; in ath12k_dp_process_rx_err_buf() local
3318 u32 hal_rx_desc_sz = ab->hw_params->hal_desc_sz; in ath12k_dp_process_rx_err_buf()
3328 desc_info = ath12k_dp_get_rx_desc(ab, cookie); in ath12k_dp_process_rx_err_buf()
3330 ath12k_warn(ab, "Invalid cookie in manual desc retrieval"); in ath12k_dp_process_rx_err_buf()
3336 ath12k_warn(ab, " RX Exception, Check HW CC implementation"); in ath12k_dp_process_rx_err_buf()
3340 spin_lock_bh(&ab->dp.rx_desc_lock); in ath12k_dp_process_rx_err_buf()
3341 list_move_tail(&desc_info->list, &ab->dp.rx_desc_free_list); in ath12k_dp_process_rx_err_buf()
3342 spin_unlock_bh(&ab->dp.rx_desc_lock); in ath12k_dp_process_rx_err_buf()
3345 dma_unmap_single(ar->ab->dev, rxcb->paddr, in ath12k_dp_process_rx_err_buf()
3355 if (!rcu_dereference(ar->ab->pdevs_active[ar->pdev_idx])) { in ath12k_dp_process_rx_err_buf()
3366 msdu_len = ath12k_dp_rx_h_msdu_len(ar->ab, rx_desc); in ath12k_dp_process_rx_err_buf()
3368 ath12k_warn(ar->ab, "invalid msdu leng %u", msdu_len); in ath12k_dp_process_rx_err_buf()
3369 ath12k_dbg_dump(ar->ab, ATH12K_DBG_DATA, NULL, "", rx_desc, in ath12k_dp_process_rx_err_buf()
3379 ath12k_dp_rx_link_desc_return(ar->ab, desc, in ath12k_dp_process_rx_err_buf()
3387 int ath12k_dp_rx_process_err(struct ath12k_base *ab, struct napi_struct *napi, in ath12k_dp_rx_process_err() argument
3411 dp = &ab->dp; in ath12k_dp_rx_process_err()
3415 srng = &ab->hal.srng_list[reo_except->ring_id]; in ath12k_dp_rx_process_err()
3419 ath12k_hal_srng_access_begin(ab, srng); in ath12k_dp_rx_process_err()
3422 (reo_desc = ath12k_hal_srng_dst_get_next_entry(ab, srng))) { in ath12k_dp_rx_process_err()
3423 ab->soc_stats.err_ring_pkts++; in ath12k_dp_rx_process_err()
3424 ret = ath12k_hal_desc_reo_parse_err(ab, reo_desc, &paddr, in ath12k_dp_rx_process_err()
3427 ath12k_warn(ab, "failed to parse error reo desc %d\n", in ath12k_dp_rx_process_err()
3442 rbm != ab->hw_params->hal_params->rx_buf_rbm) { in ath12k_dp_rx_process_err()
3443 ab->soc_stats.invalid_rbm++; in ath12k_dp_rx_process_err()
3444 ath12k_warn(ab, "invalid return buffer manager %d\n", rbm); in ath12k_dp_rx_process_err()
3445 ath12k_dp_rx_link_desc_return(ab, reo_desc, in ath12k_dp_rx_process_err()
3459 ath12k_dp_rx_link_desc_return(ab, reo_desc, in ath12k_dp_rx_process_err()
3467 pdev_id = ath12k_hw_mac_id_to_pdev_id(ab->hw_params, mac_id); in ath12k_dp_rx_process_err()
3468 ar = ab->pdevs[pdev_id].ar; in ath12k_dp_rx_process_err()
3484 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_process_err()
3490 ath12k_dp_rx_bufs_replenish(ab, 0, rx_ring, tot_n_bufs_reaped, in ath12k_dp_rx_process_err()
3491 ab->hw_params->hal_params->rx_buf_rbm, true); in ath12k_dp_rx_process_err()
3505 (DP_RX_BUFFER_SIZE - ar->ab->hw_params->hal_desc_sz)); in ath12k_dp_rx_null_q_desc_sg_drop()
3524 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_null_q_desc() local
3529 u32 hal_rx_desc_sz = ar->ab->hw_params->hal_desc_sz; in ath12k_dp_rx_h_null_q_desc()
3531 msdu_len = ath12k_dp_rx_h_msdu_len(ab, desc); in ath12k_dp_rx_h_null_q_desc()
3532 peer_id = ath12k_dp_rx_h_peer_id(ab, desc); in ath12k_dp_rx_h_null_q_desc()
3534 spin_lock(&ab->base_lock); in ath12k_dp_rx_h_null_q_desc()
3535 if (!ath12k_peer_find_by_id(ab, peer_id)) { in ath12k_dp_rx_h_null_q_desc()
3536 spin_unlock(&ab->base_lock); in ath12k_dp_rx_h_null_q_desc()
3537 ath12k_dbg(ab, ATH12K_DBG_DATA, "invalid peer id received in wbm err pkt%d\n", in ath12k_dp_rx_h_null_q_desc()
3541 spin_unlock(&ab->base_lock); in ath12k_dp_rx_h_null_q_desc()
3557 if (!ath12k_dp_rx_h_msdu_done(ab, desc)) { in ath12k_dp_rx_h_null_q_desc()
3558 ath12k_warn(ar->ab, in ath12k_dp_rx_h_null_q_desc()
3576 l3pad_bytes = ath12k_dp_rx_h_l3pad(ab, desc); in ath12k_dp_rx_h_null_q_desc()
3588 rxcb->tid = ath12k_dp_rx_h_tid(ab, desc); in ath12k_dp_rx_h_null_q_desc()
3604 ar->ab->soc_stats.reo_error[rxcb->err_code]++; in ath12k_dp_rx_h_reo_err()
3631 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_tkip_mic_err() local
3636 u32 hal_rx_desc_sz = ar->ab->hw_params->hal_desc_sz; in ath12k_dp_rx_h_tkip_mic_err()
3638 rxcb->is_first_msdu = ath12k_dp_rx_h_first_msdu(ab, desc); in ath12k_dp_rx_h_tkip_mic_err()
3639 rxcb->is_last_msdu = ath12k_dp_rx_h_last_msdu(ab, desc); in ath12k_dp_rx_h_tkip_mic_err()
3641 l3pad_bytes = ath12k_dp_rx_h_l3pad(ab, desc); in ath12k_dp_rx_h_tkip_mic_err()
3642 msdu_len = ath12k_dp_rx_h_msdu_len(ab, desc); in ath12k_dp_rx_h_tkip_mic_err()
3658 struct ath12k_base *ab = ar->ab; in ath12k_dp_rx_h_rxdma_err() local
3664 ar->ab->soc_stats.rxdma_error[rxcb->err_code]++; in ath12k_dp_rx_h_rxdma_err()
3669 err_bitmap = ath12k_dp_rx_h_mpdu_err(ab, rx_desc); in ath12k_dp_rx_h_rxdma_err()
3715 int ath12k_dp_rx_process_wbm_err(struct ath12k_base *ab, in ath12k_dp_rx_process_wbm_err() argument
3719 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_process_wbm_err()
3732 for (i = 0; i < ab->num_radios; i++) in ath12k_dp_rx_process_wbm_err()
3735 srng = &ab->hal.srng_list[dp->rx_rel_ring.ring_id]; in ath12k_dp_rx_process_wbm_err()
3740 ath12k_hal_srng_access_begin(ab, srng); in ath12k_dp_rx_process_wbm_err()
3743 rx_desc = ath12k_hal_srng_dst_get_next_entry(ab, srng); in ath12k_dp_rx_process_wbm_err()
3747 ret = ath12k_hal_wbm_desc_parse_err(ab, rx_desc, &err_info); in ath12k_dp_rx_process_wbm_err()
3749 ath12k_warn(ab, in ath12k_dp_rx_process_wbm_err()
3759 desc_info = ath12k_dp_get_rx_desc(ab, err_info.cookie); in ath12k_dp_rx_process_wbm_err()
3761 ath12k_warn(ab, "Invalid cookie in manual desc retrieval"); in ath12k_dp_rx_process_wbm_err()
3772 ath12k_warn(ab, "WBM RX err, Check HW CC implementation"); in ath12k_dp_rx_process_wbm_err()
3782 dma_unmap_single(ab->dev, rxcb->paddr, in ath12k_dp_rx_process_wbm_err()
3807 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_process_wbm_err()
3814 ath12k_dp_rx_bufs_replenish(ab, 0, rx_ring, num_buffs_reaped, in ath12k_dp_rx_process_wbm_err()
3815 ab->hw_params->hal_params->rx_buf_rbm, true); in ath12k_dp_rx_process_wbm_err()
3818 for (i = 0; i < ab->num_radios; i++) { in ath12k_dp_rx_process_wbm_err()
3819 if (!rcu_dereference(ab->pdevs_active[i])) { in ath12k_dp_rx_process_wbm_err()
3824 ar = ab->pdevs[i].ar; in ath12k_dp_rx_process_wbm_err()
3839 void ath12k_dp_rx_process_reo_status(struct ath12k_base *ab) in ath12k_dp_rx_process_reo_status() argument
3841 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_process_reo_status()
3849 srng = &ab->hal.srng_list[dp->reo_status_ring.ring_id]; in ath12k_dp_rx_process_reo_status()
3855 ath12k_hal_srng_access_begin(ab, srng); in ath12k_dp_rx_process_reo_status()
3857 while ((hdr = ath12k_hal_srng_dst_get_next_entry(ab, srng))) { in ath12k_dp_rx_process_reo_status()
3862 ath12k_hal_reo_status_queue_stats(ab, hdr, in ath12k_dp_rx_process_reo_status()
3866 ath12k_hal_reo_flush_queue_status(ab, hdr, in ath12k_dp_rx_process_reo_status()
3870 ath12k_hal_reo_flush_cache_status(ab, hdr, in ath12k_dp_rx_process_reo_status()
3874 ath12k_hal_reo_unblk_cache_status(ab, hdr, in ath12k_dp_rx_process_reo_status()
3878 ath12k_hal_reo_flush_timeout_list_status(ab, hdr, in ath12k_dp_rx_process_reo_status()
3882 ath12k_hal_reo_desc_thresh_reached_status(ab, hdr, in ath12k_dp_rx_process_reo_status()
3886 ath12k_hal_reo_update_rx_reo_queue_status(ab, hdr, in ath12k_dp_rx_process_reo_status()
3890 ath12k_warn(ab, "Unknown reo status type %d\n", tag); in ath12k_dp_rx_process_reo_status()
3913 ath12k_hal_srng_access_end(ab, srng); in ath12k_dp_rx_process_reo_status()
3918 void ath12k_dp_rx_free(struct ath12k_base *ab) in ath12k_dp_rx_free() argument
3920 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_free()
3923 ath12k_dp_srng_cleanup(ab, &dp->rx_refill_buf_ring.refill_buf_ring); in ath12k_dp_rx_free()
3925 for (i = 0; i < ab->hw_params->num_rxmda_per_pdev; i++) { in ath12k_dp_rx_free()
3926 if (ab->hw_params->rx_mac_buf_ring) in ath12k_dp_rx_free()
3927 ath12k_dp_srng_cleanup(ab, &dp->rx_mac_buf_ring[i]); in ath12k_dp_rx_free()
3930 for (i = 0; i < ab->hw_params->num_rxdma_dst_ring; i++) in ath12k_dp_rx_free()
3931 ath12k_dp_srng_cleanup(ab, &dp->rxdma_err_dst_ring[i]); in ath12k_dp_rx_free()
3933 ath12k_dp_srng_cleanup(ab, &dp->rxdma_mon_buf_ring.refill_buf_ring); in ath12k_dp_rx_free()
3934 ath12k_dp_srng_cleanup(ab, &dp->tx_mon_buf_ring.refill_buf_ring); in ath12k_dp_rx_free()
3936 ath12k_dp_rxdma_buf_free(ab); in ath12k_dp_rx_free()
3939 void ath12k_dp_rx_pdev_free(struct ath12k_base *ab, int mac_id) in ath12k_dp_rx_pdev_free() argument
3941 struct ath12k *ar = ab->pdevs[mac_id].ar; in ath12k_dp_rx_pdev_free()
3946 int ath12k_dp_rxdma_ring_sel_config_qcn9274(struct ath12k_base *ab) in ath12k_dp_rxdma_ring_sel_config_qcn9274() argument
3948 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rxdma_ring_sel_config_qcn9274()
3952 u32 hal_rx_desc_sz = ab->hw_params->hal_desc_sz; in ath12k_dp_rxdma_ring_sel_config_qcn9274()
3965 ab->hw_params->hal_ops->rx_desc_get_mpdu_start_offset(); in ath12k_dp_rxdma_ring_sel_config_qcn9274()
3967 ab->hw_params->hal_ops->rx_desc_get_msdu_end_offset(); in ath12k_dp_rxdma_ring_sel_config_qcn9274()
3973 ret = ath12k_dp_tx_htt_rx_filter_setup(ab, ring_id, 0, in ath12k_dp_rxdma_ring_sel_config_qcn9274()
3981 int ath12k_dp_rxdma_ring_sel_config_wcn7850(struct ath12k_base *ab) in ath12k_dp_rxdma_ring_sel_config_wcn7850() argument
3983 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rxdma_ring_sel_config_wcn7850()
3987 u32 hal_rx_desc_sz = ab->hw_params->hal_desc_sz; in ath12k_dp_rxdma_ring_sel_config_wcn7850()
4003 ab->hw_params->hal_ops->rx_desc_get_mpdu_start_offset(); in ath12k_dp_rxdma_ring_sel_config_wcn7850()
4005 ab->hw_params->hal_ops->rx_desc_get_msdu_end_offset(); in ath12k_dp_rxdma_ring_sel_config_wcn7850()
4012 for (i = 0; i < ab->hw_params->num_rxmda_per_pdev; i++) { in ath12k_dp_rxdma_ring_sel_config_wcn7850()
4014 ret = ath12k_dp_tx_htt_rx_filter_setup(ab, ring_id, i, in ath12k_dp_rxdma_ring_sel_config_wcn7850()
4023 int ath12k_dp_rx_htt_setup(struct ath12k_base *ab) in ath12k_dp_rx_htt_setup() argument
4025 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_htt_setup()
4031 ret = ath12k_dp_tx_htt_srng_setup(ab, ring_id, 0, HAL_RXDMA_BUF); in ath12k_dp_rx_htt_setup()
4033 ath12k_warn(ab, "failed to configure rx_refill_buf_ring %d\n", in ath12k_dp_rx_htt_setup()
4038 if (ab->hw_params->rx_mac_buf_ring) { in ath12k_dp_rx_htt_setup()
4039 for (i = 0; i < ab->hw_params->num_rxmda_per_pdev; i++) { in ath12k_dp_rx_htt_setup()
4041 ret = ath12k_dp_tx_htt_srng_setup(ab, ring_id, in ath12k_dp_rx_htt_setup()
4044 ath12k_warn(ab, "failed to configure rx_mac_buf_ring%d %d\n", in ath12k_dp_rx_htt_setup()
4051 for (i = 0; i < ab->hw_params->num_rxdma_dst_ring; i++) { in ath12k_dp_rx_htt_setup()
4053 ret = ath12k_dp_tx_htt_srng_setup(ab, ring_id, in ath12k_dp_rx_htt_setup()
4056 ath12k_warn(ab, "failed to configure rxdma_err_dest_ring%d %d\n", in ath12k_dp_rx_htt_setup()
4062 if (ab->hw_params->rxdma1_enable) { in ath12k_dp_rx_htt_setup()
4064 ret = ath12k_dp_tx_htt_srng_setup(ab, ring_id, in ath12k_dp_rx_htt_setup()
4067 ath12k_warn(ab, "failed to configure rxdma_mon_buf_ring %d\n", in ath12k_dp_rx_htt_setup()
4073 ret = ath12k_dp_tx_htt_srng_setup(ab, ring_id, in ath12k_dp_rx_htt_setup()
4076 ath12k_warn(ab, "failed to configure rxdma_mon_buf_ring %d\n", in ath12k_dp_rx_htt_setup()
4082 ret = ab->hw_params->hw_ops->rxdma_ring_sel_config(ab); in ath12k_dp_rx_htt_setup()
4084 ath12k_warn(ab, "failed to setup rxdma ring selection config\n"); in ath12k_dp_rx_htt_setup()
4091 int ath12k_dp_rx_alloc(struct ath12k_base *ab) in ath12k_dp_rx_alloc() argument
4093 struct ath12k_dp *dp = &ab->dp; in ath12k_dp_rx_alloc()
4105 ret = ath12k_dp_srng_setup(ab, in ath12k_dp_rx_alloc()
4110 ath12k_warn(ab, "failed to setup rx_refill_buf_ring\n"); in ath12k_dp_rx_alloc()
4114 if (ab->hw_params->rx_mac_buf_ring) { in ath12k_dp_rx_alloc()
4115 for (i = 0; i < ab->hw_params->num_rxmda_per_pdev; i++) { in ath12k_dp_rx_alloc()
4116 ret = ath12k_dp_srng_setup(ab, in ath12k_dp_rx_alloc()
4121 ath12k_warn(ab, "failed to setup rx_mac_buf_ring %d\n", in ath12k_dp_rx_alloc()
4128 for (i = 0; i < ab->hw_params->num_rxdma_dst_ring; i++) { in ath12k_dp_rx_alloc()
4129 ret = ath12k_dp_srng_setup(ab, &dp->rxdma_err_dst_ring[i], in ath12k_dp_rx_alloc()
4133 ath12k_warn(ab, "failed to setup rxdma_err_dst_ring %d\n", i); in ath12k_dp_rx_alloc()
4138 if (ab->hw_params->rxdma1_enable) { in ath12k_dp_rx_alloc()
4139 ret = ath12k_dp_srng_setup(ab, in ath12k_dp_rx_alloc()
4144 ath12k_warn(ab, "failed to setup HAL_RXDMA_MONITOR_BUF\n"); in ath12k_dp_rx_alloc()
4148 ret = ath12k_dp_srng_setup(ab, in ath12k_dp_rx_alloc()
4153 ath12k_warn(ab, "failed to setup DP_TX_MONITOR_BUF_RING_SIZE\n"); in ath12k_dp_rx_alloc()
4158 ret = ath12k_dp_rxdma_buf_setup(ab); in ath12k_dp_rx_alloc()
4160 ath12k_warn(ab, "failed to setup rxdma ring\n"); in ath12k_dp_rx_alloc()
4167 int ath12k_dp_rx_pdev_alloc(struct ath12k_base *ab, int mac_id) in ath12k_dp_rx_pdev_alloc() argument
4169 struct ath12k *ar = ab->pdevs[mac_id].ar; in ath12k_dp_rx_pdev_alloc()
4175 if (!ab->hw_params->rxdma1_enable) in ath12k_dp_rx_pdev_alloc()
4180 ath12k_warn(ab, "failed to setup rx srngs\n"); in ath12k_dp_rx_pdev_alloc()
4184 for (i = 0; i < ab->hw_params->num_rxmda_per_pdev; i++) { in ath12k_dp_rx_pdev_alloc()
4186 ret = ath12k_dp_tx_htt_srng_setup(ab, ring_id, in ath12k_dp_rx_pdev_alloc()
4190 ath12k_warn(ab, in ath12k_dp_rx_pdev_alloc()
4197 ret = ath12k_dp_tx_htt_srng_setup(ab, ring_id, in ath12k_dp_rx_pdev_alloc()
4201 ath12k_warn(ab, in ath12k_dp_rx_pdev_alloc()
4233 ath12k_warn(ar->ab, "pdev_mon_status_attach() failed"); in ath12k_dp_rx_pdev_mon_attach()
4240 if (!ar->ab->hw_params->rxdma1_enable) in ath12k_dp_rx_pdev_mon_attach()
4250 int ath12k_dp_rx_pktlog_start(struct ath12k_base *ab) in ath12k_dp_rx_pktlog_start() argument
4253 mod_timer(&ab->mon_reap_timer, in ath12k_dp_rx_pktlog_start()
4259 int ath12k_dp_rx_pktlog_stop(struct ath12k_base *ab, bool stop_timer) in ath12k_dp_rx_pktlog_stop() argument
4264 del_timer_sync(&ab->mon_reap_timer); in ath12k_dp_rx_pktlog_stop()
4267 ret = ath12k_dp_purge_mon_ring(ab); in ath12k_dp_rx_pktlog_stop()
4269 ath12k_warn(ab, "failed to purge dp mon ring: %d\n", ret); in ath12k_dp_rx_pktlog_stop()