wifi: ath12k: Move ath12k_dp_rx_frags_cleanup API to Wi-Fi 7

The API ath12k_dp_rx_frags_cleanup uses rx hw structure that is specific to
Wi-Fi 7. Hence move the API to Wi-Fi 7 and use ops infra to reach it from the
common code.

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.4.1-00199-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3

Signed-off-by: Pavankumar Nandeshwar <quic_pnandesh@quicinc.com>
Signed-off-by: Ripan Deuri <quic_rdeuri@quicinc.com>
Reviewed-by: Karthikeyan Periyasamy <karthikeyan.periyasamy@oss.qualcomm.com>
Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com>
Link: https://patch.msgid.link/20251103112111.2260639-8-quic_rdeuri@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
This commit is contained in:
Pavankumar Nandeshwar 2025-11-03 16:51:06 +05:30 committed by Jeff Johnson
parent c870602510
commit d43133a38b
6 changed files with 42 additions and 31 deletions

View File

@ -408,6 +408,8 @@ struct ath12k_dp_arch_ops {
int (*rx_link_desc_return)(struct ath12k_base *ab,
struct ath12k_buffer_addr *buf_addr_info,
enum hal_wbm_rel_bm_act action);
void (*rx_frags_cleanup)(struct ath12k_dp_rx_tid *rx_tid,
bool rel_link_desc);
int (*peer_rx_tid_reo_update)(struct ath12k_dp *dp,
struct ath12k_dp_link_peer *peer,
struct ath12k_dp_rx_tid *rx_tid,
@ -588,6 +590,14 @@ int ath12k_dp_arch_rx_link_desc_return(struct ath12k_dp *dp,
return dp->ops->rx_link_desc_return(dp->ab, buf_addr_info, action);
}
static inline
void ath12k_dp_arch_rx_frags_cleanup(struct ath12k_dp *dp,
struct ath12k_dp_rx_tid *rx_tid,
bool rel_link_desc)
{
dp->ops->rx_frags_cleanup(rx_tid, rel_link_desc);
}
static inline int ath12k_dp_arch_peer_rx_tid_reo_update(struct ath12k_dp *dp,
struct ath12k_dp_link_peer *peer,
struct ath12k_dp_rx_tid *rx_tid,

View File

@ -445,30 +445,6 @@ void ath12k_dp_rx_tid_del_func(struct ath12k_dp *dp, void *ctx,
rx_tid->qbuf.vaddr = NULL;
}
void ath12k_dp_rx_frags_cleanup(struct ath12k_dp_rx_tid *rx_tid,
bool rel_link_desc)
{
enum hal_wbm_rel_bm_act act = HAL_WBM_REL_BM_ACT_PUT_IN_IDLE;
struct ath12k_buffer_addr *buf_addr_info;
struct ath12k_dp *dp = rx_tid->dp;
lockdep_assert_held(&dp->dp_lock);
if (rx_tid->dst_ring_desc) {
if (rel_link_desc) {
buf_addr_info = &rx_tid->dst_ring_desc->buf_addr_info;
ath12k_dp_arch_rx_link_desc_return(dp, buf_addr_info, act);
}
kfree(rx_tid->dst_ring_desc);
rx_tid->dst_ring_desc = NULL;
}
rx_tid->cur_sn = 0;
rx_tid->last_frag_no = 0;
rx_tid->rx_frag_bitmap = 0;
__skb_queue_purge(&rx_tid->rx_frags);
}
void ath12k_dp_rx_peer_tid_cleanup(struct ath12k *ar, struct ath12k_dp_link_peer *peer)
{
struct ath12k_dp_rx_tid *rx_tid;
@ -485,7 +461,7 @@ void ath12k_dp_rx_peer_tid_cleanup(struct ath12k *ar, struct ath12k_dp_link_peer
rx_tid = &peer->dp_peer->rx_tid[i];
ath12k_dp_arch_rx_peer_tid_delete(dp, peer, i);
ath12k_dp_rx_frags_cleanup(rx_tid, true);
ath12k_dp_arch_rx_frags_cleanup(dp, rx_tid, true);
spin_unlock_bh(&dp->dp_lock);
timer_delete_sync(&rx_tid->frag_timer);
@ -1327,7 +1303,7 @@ static void ath12k_dp_rx_frag_timer(struct timer_list *timer)
spin_unlock_bh(&rx_tid->dp->dp_lock);
return;
}
ath12k_dp_rx_frags_cleanup(rx_tid, true);
ath12k_dp_arch_rx_frags_cleanup(rx_tid->dp, rx_tid, true);
spin_unlock_bh(&rx_tid->dp->dp_lock);
}

View File

@ -183,8 +183,6 @@ void ath12k_dp_rx_h_sort_frags(struct ath12k_base *ab,
struct sk_buff *cur_frag);
void ath12k_dp_rx_h_undecap_frag(struct ath12k_pdev_dp *dp_pdev, struct sk_buff *msdu,
enum hal_encrypt_type enctype, u32 flags);
void ath12k_dp_rx_frags_cleanup(struct ath12k_dp_rx_tid *rx_tid,
bool rel_link_desc);
int ath12k_dp_rx_h_michael_mic(struct crypto_shash *tfm, u8 *key,
struct ieee80211_hdr *hdr, u8 *data,
size_t data_len, u8 *mic);

View File

@ -144,6 +144,7 @@ static struct ath12k_dp_arch_ops ath12k_wifi7_dp_arch_ops = {
.rx_peer_tid_delete = ath12k_wifi7_dp_rx_peer_tid_delete,
.reo_cache_flush = ath12k_wifi7_dp_reo_cache_flush,
.rx_link_desc_return = ath12k_wifi7_dp_rx_link_desc_return,
.rx_frags_cleanup = ath12k_wifi7_dp_rx_frags_cleanup,
.peer_rx_tid_reo_update = ath12k_wifi7_peer_rx_tid_reo_update,
.rx_assign_reoq = ath12k_wifi7_dp_rx_assign_reoq,
.peer_rx_tid_qref_setup = ath12k_wifi7_peer_rx_tid_qref_setup,

View File

@ -1100,6 +1100,30 @@ static int ath12k_wifi7_dp_rx_h_defrag(struct ath12k_pdev_dp *dp_pdev,
return 0;
}
void ath12k_wifi7_dp_rx_frags_cleanup(struct ath12k_dp_rx_tid *rx_tid,
bool rel_link_desc)
{
enum hal_wbm_rel_bm_act act = HAL_WBM_REL_BM_ACT_PUT_IN_IDLE;
struct ath12k_buffer_addr *buf_addr_info;
struct ath12k_dp *dp = rx_tid->dp;
lockdep_assert_held(&dp->dp_lock);
if (rx_tid->dst_ring_desc) {
if (rel_link_desc) {
buf_addr_info = &rx_tid->dst_ring_desc->buf_addr_info;
ath12k_wifi7_dp_rx_link_desc_return(dp->ab, buf_addr_info, act);
}
kfree(rx_tid->dst_ring_desc);
rx_tid->dst_ring_desc = NULL;
}
rx_tid->cur_sn = 0;
rx_tid->last_frag_no = 0;
rx_tid->rx_frag_bitmap = 0;
__skb_queue_purge(&rx_tid->rx_frags);
}
static int ath12k_wifi7_dp_rx_frag_h_mpdu(struct ath12k_pdev_dp *dp_pdev,
struct sk_buff *msdu,
struct hal_reo_dest_ring *ring_desc,
@ -1154,7 +1178,7 @@ static int ath12k_wifi7_dp_rx_frag_h_mpdu(struct ath12k_pdev_dp *dp_pdev,
if ((!skb_queue_empty(&rx_tid->rx_frags) && seqno != rx_tid->cur_sn) ||
skb_queue_empty(&rx_tid->rx_frags)) {
/* Flush stored fragments and start a new sequence */
ath12k_dp_rx_frags_cleanup(rx_tid, true);
ath12k_wifi7_dp_rx_frags_cleanup(rx_tid, true);
rx_tid->cur_sn = seqno;
}
@ -1214,12 +1238,12 @@ static int ath12k_wifi7_dp_rx_frag_h_mpdu(struct ath12k_pdev_dp *dp_pdev,
if (ath12k_wifi7_dp_rx_h_defrag_reo_reinject(dp, rx_tid, defrag_skb))
goto err_frags_cleanup;
ath12k_dp_rx_frags_cleanup(rx_tid, false);
ath12k_wifi7_dp_rx_frags_cleanup(rx_tid, false);
goto out_unlock;
err_frags_cleanup:
dev_kfree_skb_any(defrag_skb);
ath12k_dp_rx_frags_cleanup(rx_tid, true);
ath12k_wifi7_dp_rx_frags_cleanup(rx_tid, true);
out_unlock:
spin_unlock_bh(&dp->dp_lock);
return ret;

View File

@ -31,6 +31,8 @@ int ath12k_wifi7_dp_rx_assign_reoq(struct ath12k_base *ab, struct ath12k_dp_peer
int ath12k_wifi7_dp_rx_link_desc_return(struct ath12k_base *ab,
struct ath12k_buffer_addr *buf_addr_info,
enum hal_wbm_rel_bm_act action);
void ath12k_wifi7_dp_rx_frags_cleanup(struct ath12k_dp_rx_tid *rx_tid,
bool rel_link_desc);
void ath12k_wifi7_peer_rx_tid_qref_setup(struct ath12k_base *ab, u16 peer_id, u16 tid,
dma_addr_t paddr);
void ath12k_wifi7_dp_rx_peer_tid_delete(struct ath12k_base *ab,