From c1fbfdd72ce449934d2503fc588405dca62b5317 Mon Sep 17 00:00:00 2001 From: Srinivas Pitla Date: Wed, 25 Mar 2020 11:58:26 -0700 Subject: [PATCH] qca-wifi: fix TSF wrap around case in tx capture Handle wrap around correctly during TSF delta calculation. Change-Id: I1303053dbf33175e9f3c7beec0988a4aef03eb7f CRs-Fixed: 2651294 --- dp/wifi3.0/dp_tx_capture.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dp/wifi3.0/dp_tx_capture.c b/dp/wifi3.0/dp_tx_capture.c index 1406fe2930..f7567c756f 100644 --- a/dp/wifi3.0/dp_tx_capture.c +++ b/dp/wifi3.0/dp_tx_capture.c @@ -813,7 +813,7 @@ dp_update_msdu_to_list(struct dp_soc *soc, if (ts->tsf > ptr_msdu_info->tsf) tsf_delta = ts->tsf - ptr_msdu_info->tsf; else - tsf_delta = ptr_msdu_info->tsf - ts->tsf; + tsf_delta = LOWER_32_MASK - ptr_msdu_info->tsf + ts->tsf; if (tsf_delta < MAX_MSDU_THRESHOLD_TSF) break; @@ -2756,7 +2756,7 @@ get_mgmt_pkt_from_queue: if (start_tsf > ptr_comp_info->tx_tsf) tsf_delta = start_tsf - ptr_comp_info->tx_tsf; else - tsf_delta = ptr_comp_info->tx_tsf - start_tsf; + tsf_delta = LOWER_32_MASK - ptr_comp_info->tx_tsf + start_tsf; if (tsf_delta > MAX_MGMT_ENQ_DELAY) { /*