mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 08:36:12 -04:00
qcacmn: Compute client inactive time from last one second tx/rx activity
If client is having non-zero tx/rx packets in last one second, reset inactive time to zero, else increment inactive time. Change-Id: Ie25fb43adec252e93ebc1bb1a7aa0fa207e7af1e
This commit is contained in:
parent
9a1368c4ca
commit
f0fa2f5beb
1 changed files with 9 additions and 1 deletions
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* Permission to use, copy, modify, and/or distribute this software for
|
||||
* any purpose with or without fee is hereby granted, provided that the
|
||||
|
|
@ -147,6 +147,14 @@ void dp_cal_client_update_peer_stats(struct cdp_peer_stats *peer_stats)
|
|||
peer_stats->tx.tx_data_ucast_rate = temp_tx_ucast_pkts -
|
||||
peer_stats->tx.tx_data_ucast_last;
|
||||
|
||||
/* Check tx and rx packets in last one second, and increment
|
||||
* inactive time for peer
|
||||
*/
|
||||
if (peer_stats->tx.tx_data_rate || peer_stats->rx.rx_data_rate)
|
||||
peer_stats->tx.inactive_time = 0;
|
||||
else
|
||||
peer_stats->tx.inactive_time++;
|
||||
|
||||
peer_stats->rx.rx_bytes_success_last = temp_rx_bytes;
|
||||
peer_stats->rx.rx_data_success_last = temp_rx_data;
|
||||
peer_stats->tx.tx_bytes_success_last = temp_tx_bytes;
|
||||
|
|
|
|||
Loading…
Reference in a new issue