diff --git a/dp/inc/cdp_txrx_hist_struct.h b/dp/inc/cdp_txrx_hist_struct.h index 6bdf32be02..7bdefa5133 100644 --- a/dp/inc/cdp_txrx_hist_struct.h +++ b/dp/inc/cdp_txrx_hist_struct.h @@ -62,11 +62,14 @@ enum cdp_hist_bucket_index { * @CDP_HIST_TYPE_SW_ENQEUE_DELAY: From stack to HW enqueue delay * @CDP_HIST_TYPE_HW_COMP_DELAY: From HW enqueue to completion delay * @CDP_HIST_TYPE_REAP_STACK: Rx HW reap to stack deliver delay + * @CDP_HIST_TYPE_HW_TX_COMP_DELAY: Tx completion delay based on the timestamp + * provided by HW */ enum cdp_hist_types { CDP_HIST_TYPE_SW_ENQEUE_DELAY, CDP_HIST_TYPE_HW_COMP_DELAY, CDP_HIST_TYPE_REAP_STACK, + CDP_HIST_TYPE_HW_TX_COMP_DELAY, CDP_HIST_TYPE_MAX, }; diff --git a/dp/wifi3.0/dp_hist.c b/dp/wifi3.0/dp_hist.c index 69073b7bb2..bda5e78798 100644 --- a/dp/wifi3.0/dp_hist.c +++ b/dp/wifi3.0/dp_hist.c @@ -79,6 +79,41 @@ static uint16_t dp_hist_fw2hw_dbucket[CDP_HIST_BUCKET_MAX] = { static uint16_t dp_hist_reap2stack_bucket[CDP_HIST_BUCKET_MAX] = { 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60}; +/* + * dp_hist_hw_tx_comp_dbucket: Tx HW Completion Delay bucket in us + * @index_0 = 0_250 us + * @index_1 = 250_500 us + * @index_2 = 500_750 us + * @index_3 = 750_1000 us + * @index_4 = 1000_1500 us + * @index_5 = 1500_2000 us + * @index_6 = 2000_2500 us + * @index_7 = 2500_5000 us + * @index_8 = 5000_6000 us + * @index_9 = 6000_7000 us + * @index_10 = 7000_8000 us + * @index_11 = 8000_9000 us + * @index_12 = 9000+ us + */ +static uint16_t dp_hist_hw_tx_comp_dbucket[CDP_HIST_BUCKET_MAX] = { + 0, 250, 500, 750, 1000, 1500, 2000, 2500, 5000, 6000, 7000, 8000, 9000}; + +static const char *dp_hist_hw_tx_comp_dbucket_str[CDP_HIST_BUCKET_MAX + 1] = { + "0 to 250 us", "250 to 500 us", + "500 to 750 us", "750 to 1000 us", + "1000 to 1500 us", "1500 to 2000 us", + "2000 to 2500 us", "2500 to 5000 us", + "5000 to 6000 us", "6000 to 7000 ms", + "7000 to 8000 us", "8000 to 9000 us", "9000+ us" +}; + +const char *dp_hist_tx_hw_delay_str(uint8_t index) +{ + if (index > CDP_HIST_BUCKET_MAX) + return "Invalid index"; + return dp_hist_hw_tx_comp_dbucket_str[index]; +} + /* * dp_hist_find_bucket_idx: Find the bucket index * @bucket_array: Bucket array @@ -129,6 +164,10 @@ static void dp_hist_fill_buckets(struct cdp_hist_bucket *hist_bucket, int value) idx = dp_hist_find_bucket_idx( &dp_hist_reap2stack_bucket[0], value); break; + case CDP_HIST_TYPE_HW_TX_COMP_DELAY: + idx = dp_hist_find_bucket_idx( + &dp_hist_hw_tx_comp_dbucket[0], value); + break; default: break; } diff --git a/dp/wifi3.0/dp_hist.h b/dp/wifi3.0/dp_hist.h index 6419e79ada..8290f86375 100644 --- a/dp/wifi3.0/dp_hist.h +++ b/dp/wifi3.0/dp_hist.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. 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 @@ -40,4 +41,5 @@ void dp_accumulate_hist_stats(struct cdp_hist_stats *src_hist_stats, struct cdp_hist_stats *dst_hist_stats); void dp_copy_hist_stats(struct cdp_hist_stats *src_hist_stats, struct cdp_hist_stats *dst_hist_stats); +const char *dp_hist_tx_hw_delay_str(uint8_t index); #endif /* __DP_HIST_H_ */