mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 08:07:32 -04:00
qcacmn: Fix last_per overflow issue
Check if ucast pkts count is more than success pkts count, compute last packet error rate only if ucast is less than success pkts. Change-Id: I0aa4d41d09b1691e4d554beab2f2ed7a7f2ceb1e CRs-Fixed: 2343479
This commit is contained in:
parent
c1ec49e685
commit
d577d09497
1 changed files with 11 additions and 4 deletions
|
|
@ -153,10 +153,17 @@ void dp_cal_client_update_peer_stats(struct cdp_peer_stats *peer_stats)
|
|||
peer_stats->tx.tx_data_success_last = temp_tx_data;
|
||||
peer_stats->tx.tx_data_ucast_last = temp_tx_ucast_pkts;
|
||||
|
||||
if (peer_stats->tx.tx_data_ucast_rate)
|
||||
peer_stats->tx.last_per = ((peer_stats->tx.tx_data_ucast_last -
|
||||
peer_stats->tx.tx_data_success_last) * 100) /
|
||||
peer_stats->tx.tx_data_ucast_last;
|
||||
if (peer_stats->tx.tx_data_ucast_rate) {
|
||||
if (peer_stats->tx.tx_data_ucast_rate >
|
||||
peer_stats->tx.tx_data_rate)
|
||||
peer_stats->tx.last_per =
|
||||
((peer_stats->tx.tx_data_ucast_rate -
|
||||
peer_stats->tx.tx_data_rate) * 100) /
|
||||
peer_stats->tx.tx_data_ucast_rate;
|
||||
else
|
||||
peer_stats->tx.last_per = 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
qdf_export_symbol(dp_cal_client_update_peer_stats);
|
||||
|
|
|
|||
Loading…
Reference in a new issue