diff --git a/dp/wifi3.0/dp_main.c b/dp/wifi3.0/dp_main.c index 9faf7374783d..49d92c37fd22 100644 --- a/dp/wifi3.0/dp_main.c +++ b/dp/wifi3.0/dp_main.c @@ -3399,6 +3399,32 @@ dp_get_host_peer_stats(struct cdp_pdev *pdev_handle, char *mac_addr) return; } +/* + * dp_enable_enhanced_stats()- API to enable enhanced statistcs + * @pdev_handle: DP_PDEV handle + * + * Return: void + */ +static void +dp_enable_enhanced_stats(struct cdp_pdev *pdev_handle) +{ + struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle; + pdev->enhanced_stats_en = 1; +} + +/* + * dp_disable_enhanced_stats()- API to disable enhanced statistcs + * @pdev_handle: DP_PDEV handle + * + * Return: void + */ +static void +dp_disable_enhanced_stats(struct cdp_pdev *pdev_handle) +{ + struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle; + pdev->enhanced_stats_en = 0; +} + /* * dp_get_fw_peer_stats()- function to print peer stats * @pdev_handle: DP_PDEV handle @@ -3871,6 +3897,8 @@ static struct cdp_mon_ops dp_ops_mon = { static struct cdp_host_stats_ops dp_ops_host_stats = { .txrx_per_peer_stats = dp_get_host_peer_stats, .get_fw_peer_stats = dp_get_fw_peer_stats, + .txrx_enable_enhanced_stats = dp_enable_enhanced_stats, + .txrx_disable_enhanced_stats = dp_disable_enhanced_stats, /* TODO */ }; diff --git a/dp/wifi3.0/dp_rx.c b/dp/wifi3.0/dp_rx.c index 32aeb0a8dd3a..a52de638c7bb 100644 --- a/dp/wifi3.0/dp_rx.c +++ b/dp/wifi3.0/dp_rx.c @@ -1123,6 +1123,8 @@ done: continue; } + pdev = vdev->pdev; + sgi = hal_rx_msdu_start_sgi_get(rx_tlv_hdr); mcs = hal_rx_msdu_start_rate_mcs_get(rx_tlv_hdr); tid = hal_rx_mpdu_start_tid_get(rx_tlv_hdr); @@ -1279,10 +1281,12 @@ done: DP_STATS_INCC_PKT(peer, rx.multicast, 1, pkt_len, hal_rx_msdu_end_da_is_mcbc_get( rx_tlv_hdr)); + DP_STATS_INC_PKT(peer, rx.to_stack, 1, pkt_len); - if (hal_rx_attn_first_mpdu_get(rx_tlv_hdr)) { + if ((pdev->enhanced_stats_en) && + hal_rx_attn_first_mpdu_get(rx_tlv_hdr)) { if (soc->cdp_soc.ol_ops->update_dp_stats) { soc->cdp_soc.ol_ops->update_dp_stats( vdev->pdev->osif_pdev, @@ -1302,7 +1306,7 @@ done: } if (qdf_unlikely(vdev->rx_decap_type == htt_cmn_pkt_type_raw) || - (vdev->rx_decap_type == htt_cmn_pkt_type_native_wifi)) + (vdev->rx_decap_type == htt_cmn_pkt_type_native_wifi)) dp_rx_deliver_raw(vdev, deliver_list_head); else if (qdf_likely(vdev->osif_rx) && deliver_list_head) vdev->osif_rx(vdev->osif_vdev, deliver_list_head); diff --git a/dp/wifi3.0/dp_tx.c b/dp/wifi3.0/dp_tx.c index afeaae7d81e9..21c4038a9524 100644 --- a/dp/wifi3.0/dp_tx.c +++ b/dp/wifi3.0/dp_tx.c @@ -1802,6 +1802,7 @@ static inline void dp_tx_comp_process_tx_status(struct dp_tx_desc_s *tx_desc, struct dp_soc *soc = NULL; struct dp_vdev *vdev = tx_desc->vdev; struct dp_peer *peer = NULL; + struct dp_pdev *pdev = NULL; uint8_t comp_status = 0; qdf_mem_zero(&ts, sizeof(struct hal_tx_completion_status)); hal_tx_comp_get_status(&tx_desc->comp, &ts); @@ -1931,15 +1932,19 @@ static inline void dp_tx_comp_process_tx_status(struct dp_tx_desc_s *tx_desc, /* TODO: This call is temporary. * Stats update has to be attached to the HTT PPDU message */ - if (soc->cdp_soc.ol_ops->update_dp_stats) - soc->cdp_soc.ol_ops->update_dp_stats(vdev->pdev->osif_pdev, - &peer->stats, ts.peer_id, UPDATE_PEER_STATS); - out: - dp_aggregate_vdev_stats(tx_desc->vdev); - if (soc->cdp_soc.ol_ops->update_dp_stats) + pdev = vdev->pdev; + + if (pdev->enhanced_stats_en && soc->cdp_soc.ol_ops->update_dp_stats) { + if (peer) { + soc->cdp_soc.ol_ops->update_dp_stats(pdev->osif_pdev, + &peer->stats, ts.peer_id, + UPDATE_PEER_STATS); + } + dp_aggregate_vdev_stats(tx_desc->vdev); soc->cdp_soc.ol_ops->update_dp_stats(vdev->pdev->osif_pdev, &vdev->stats, vdev->vdev_id, UPDATE_VDEV_STATS); + } fail: return; } diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index 7a472afd2393..9f907e2d5b62 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -779,7 +779,7 @@ struct dp_pdev { enum htt_pkt_type rx_decap_mode; /* Enhanced Stats is enabled */ - bool ap_stats_tx_cal_enable; + bool enhanced_stats_en; qdf_atomic_t num_tx_outstanding;