diff --git a/dp/inc/cdp_txrx_cmn_struct.h b/dp/inc/cdp_txrx_cmn_struct.h index 168bb55d9b..4daf650e07 100644 --- a/dp/inc/cdp_txrx_cmn_struct.h +++ b/dp/inc/cdp_txrx_cmn_struct.h @@ -2248,6 +2248,7 @@ struct cdp_tx_completion_msdu { * @rx_ratekpbs - rx rate in kbps * @rix - rate index * @mpdu_retries - retries of mpdu in rx + * @rx_time_us - Rx duration */ struct cdp_rx_stats_ppdu_user { uint16_t peer_id; @@ -2287,6 +2288,7 @@ struct cdp_rx_stats_ppdu_user { uint32_t rx_ratekbps; uint32_t rix; uint32_t mpdu_retries; + uint16_t rx_time_us; }; /** diff --git a/dp/wifi3.0/monitor/dp_rx_mon.c b/dp/wifi3.0/monitor/dp_rx_mon.c index d80e34575b..08e140cc76 100644 --- a/dp/wifi3.0/monitor/dp_rx_mon.c +++ b/dp/wifi3.0/monitor/dp_rx_mon.c @@ -821,29 +821,29 @@ dp_ppdu_desc_user_rx_time_update(struct dp_pdev *pdev, { uint32_t nss_ru_width_sum = 0; struct dp_mon_peer *mon_peer = NULL; - uint16_t rx_time_us; if (!pdev || !ppdu_desc || !user || !peer) return; - mon_peer = peer->monitor_peer; - if (qdf_unlikely(!mon_peer)) - return; - nss_ru_width_sum = ppdu_desc->usr_nss_sum * ppdu_desc->usr_ru_tones_sum; if (!nss_ru_width_sum) nss_ru_width_sum = 1; if (ppdu_desc->u.ppdu_type == HAL_RX_TYPE_MU_OFDMA || ppdu_desc->u.ppdu_type == HAL_RX_TYPE_MU_MIMO) { - rx_time_us = (ppdu_desc->duration * - user->nss * user->ofdma_ru_width) / nss_ru_width_sum; + user->rx_time_us = (ppdu_desc->duration * + user->nss * user->ofdma_ru_width) / + nss_ru_width_sum; } else { - rx_time_us = ppdu_desc->duration; + user->rx_time_us = ppdu_desc->duration; } + mon_peer = peer->monitor_peer; + if (qdf_unlikely(!mon_peer)) + return; + DP_STATS_INC(mon_peer, airtime_consumption.consumption, - rx_time_us); + user->rx_time_us); } #else static inline void diff --git a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h index 3f146dc766..268fdb3dc5 100644 --- a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h +++ b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h @@ -1767,7 +1767,8 @@ struct wlan_lmac_if_p2p_rx_ops { * @atf_peer_unblk_txtraffic: Unblock peer tx traffic * @atf_set_token_allocated: Set atf token allocated * @atf_set_token_utilized: Set atf token utilized - * @atf_process_ppdu_stats: Process PPDU stats to get ATF stats + * @atf_process_tx_ppdu_stats: Process Tx PPDU stats to get ATF stats + * @atf_process_rx_ppdu_stats: Process Rx PPDU stats to get ATF stats * @atf_is_stats_enabled: Check ATF stats enabled or not */ struct wlan_lmac_if_atf_rx_ops { @@ -1806,8 +1807,10 @@ struct wlan_lmac_if_atf_rx_ops { uint16_t value); void (*atf_set_token_utilized)(struct wlan_objmgr_peer *peer, uint16_t value); - void (*atf_process_ppdu_stats)(struct wlan_objmgr_pdev *pdev, - qdf_nbuf_t msg); + void (*atf_process_tx_ppdu_stats)(struct wlan_objmgr_pdev *pdev, + qdf_nbuf_t msg); + void (*atf_process_rx_ppdu_stats)(struct wlan_objmgr_pdev *pdev, + qdf_nbuf_t msg); uint8_t (*atf_is_stats_enabled)(struct wlan_objmgr_pdev *pdev); }; #endif diff --git a/umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c b/umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c index 8baa01e1d2..eb45a62aa9 100644 --- a/umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c +++ b/umac/global_umac_dispatcher/lmac_if/src/wlan_lmac_if.c @@ -212,7 +212,8 @@ wlan_lmac_if_atf_rx_ops_register(struct wlan_lmac_if_rx_ops *rx_ops) atf_rx_ops->atf_peer_unblk_txtraffic = tgt_atf_peer_unblk_txtraffic; atf_rx_ops->atf_set_token_allocated = tgt_atf_set_token_allocated; atf_rx_ops->atf_set_token_utilized = tgt_atf_set_token_utilized; - atf_rx_ops->atf_process_ppdu_stats = tgt_atf_process_ppdu_stats; + atf_rx_ops->atf_process_tx_ppdu_stats = tgt_atf_process_tx_ppdu_stats; + atf_rx_ops->atf_process_rx_ppdu_stats = tgt_atf_process_rx_ppdu_stats; atf_rx_ops->atf_is_stats_enabled = tgt_atf_is_stats_enabled; } #else