diff --git a/dp/wifi3.0/dp_internal.h b/dp/wifi3.0/dp_internal.h index c4d201ba0236..8534e95160f7 100644 --- a/dp/wifi3.0/dp_internal.h +++ b/dp/wifi3.0/dp_internal.h @@ -2728,4 +2728,15 @@ static inline QDF_STATUS dp_runtime_init(struct dp_soc *soc) } #endif +/** + * dp_peer_flush_frags() - Flush all fragments for a particular + * peer + * @soc_hdl - data path soc handle + * @vdev_id - vdev id + * @peer_addr - peer mac address + * + * Return: None + */ +void dp_peer_flush_frags(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, + uint8_t *peer_mac); #endif /* #ifndef _DP_INTERNAL_H_ */ diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 2403837b02a3..93c93c4d09cb 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -12073,6 +12073,7 @@ static struct cdp_peer_ops dp_ops_peer = { .get_vdev_by_peer_addr = dp_get_vdev_by_peer_addr, .peer_get_peer_mac_addr = dp_peer_get_peer_mac_addr, .get_peer_state = dp_get_peer_state, + .peer_flush_frags = dp_peer_flush_frags, }; #endif diff --git a/dp/wifi3.0/dp_peer.c b/dp/wifi3.0/dp_peer.c index 25acbf192924..3dbd8bcf4e0a 100644 --- a/dp/wifi3.0/dp_peer.c +++ b/dp/wifi3.0/dp_peer.c @@ -4503,3 +4503,30 @@ failed: dp_vdev_unref_delete(soc, vdev, DP_MOD_ID_GENERIC_STATS); } #endif /* DUMP_REO_QUEUE_INFO_IN_DDR */ + +void dp_peer_flush_frags(struct cdp_soc_t *soc_hdl, uint8_t vdev_id, + uint8_t *peer_mac) +{ + struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl); + struct dp_peer *peer = dp_peer_find_hash_find(soc, peer_mac, 0, + vdev_id, DP_MOD_ID_CDP); + struct dp_rx_tid *rx_tid; + uint8_t tid; + + if (!peer) + return; + + dp_info("Flushing fragments for peer " QDF_MAC_ADDR_FMT, + QDF_MAC_ADDR_REF(peer->mac_addr.raw)); + + for (tid = 0; tid < DP_MAX_TIDS; tid++) { + rx_tid = &peer->rx_tid[tid]; + + qdf_spin_lock_bh(&rx_tid->tid_lock); + dp_rx_defrag_waitlist_remove(peer, tid); + dp_rx_reorder_flush_frag(peer, tid); + qdf_spin_unlock_bh(&rx_tid->tid_lock); + } + + dp_peer_unref_delete(peer, DP_MOD_ID_CDP); +}