Browse Source

qca-wifi: fix TSF wrap around case in tx capture

Handle wrap around correctly during TSF delta calculation.

Change-Id: I1303053dbf33175e9f3c7beec0988a4aef03eb7f
CRs-Fixed: 2651294
Srinivas Pitla 5 years ago
parent
commit
c1fbfdd72c
1 changed files with 2 additions and 2 deletions
  1. 2 2
      dp/wifi3.0/dp_tx_capture.c

+ 2 - 2
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) {
 					/*