diff --git a/dp/cmn_dp_api/dp_cal_client_api.c b/dp/cmn_dp_api/dp_cal_client_api.c index 37217434ac6f..c6360d689e8d 100644 --- a/dp/cmn_dp_api/dp_cal_client_api.c +++ b/dp/cmn_dp_api/dp_cal_client_api.c @@ -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;