diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h index 3868d80e5f85..4f43d91921c2 100644 --- a/core/hdd/inc/wlan_hdd_main.h +++ b/core/hdd/inc/wlan_hdd_main.h @@ -2069,6 +2069,7 @@ struct hdd_context { int current_pcie_gen_speed; qdf_workqueue_t *adapter_ops_wq; struct hdd_adapter_ops_history adapter_ops_history; + bool ll_stats_per_chan_rx_tx_time; }; /** diff --git a/core/hdd/src/wlan_hdd_debugfs_llstat.c b/core/hdd/src/wlan_hdd_debugfs_llstat.c index 916b84b884af..036284424257 100644 --- a/core/hdd/src/wlan_hdd_debugfs_llstat.c +++ b/core/hdd/src/wlan_hdd_debugfs_llstat.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2020 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 @@ -286,6 +286,17 @@ void hdd_debugfs_process_radio_stats(struct hdd_adapter *adapter, chan_stat->channel.center_freq0, chan_stat->channel.center_freq1, chan_stat->on_time, chan_stat->cca_busy_time); + + if (adapter->hdd_ctx && + adapter->hdd_ctx->ll_stats_per_chan_rx_tx_time) { + buffer += len; + ll_stats.len += len; + len = scnprintf( + buffer, + DEBUGFS_LLSTATS_BUF_SIZE - ll_stats.len, + "tx time %u rx time %u", + chan_stat->tx_time, chan_stat->rx_time); + } } radio_stat++; diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 31ed14123aff..45c56f61aad8 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -1668,6 +1668,8 @@ static void hdd_update_tgt_services(struct hdd_context *hdd_ctx, hdd_update_tdls_config(hdd_ctx); sme_update_tgt_services(hdd_ctx->mac_handle, cfg); hdd_ctx->roam_ch_from_fw_supported = cfg->is_roam_scan_ch_to_host; + hdd_ctx->ll_stats_per_chan_rx_tx_time = + cfg->ll_stats_per_chan_rx_tx_time; } /** diff --git a/core/mac/inc/sir_api.h b/core/mac/inc/sir_api.h index e2c887e304e7..cbf71b8d5067 100644 --- a/core/mac/inc/sir_api.h +++ b/core/mac/inc/sir_api.h @@ -3530,12 +3530,17 @@ struct wifi_rate_info { * struct wifi_channel_stats - channel statistics * @channel: channel for which the stats are applicable * @on_time: msecs the radio is awake - * @cca_busy_time: secs the CCA register is busy + * @cca_busy_time: secs the CCA register is busy excluding own tx_time + * @tx_time: msecs the radio is transmitting on this channel + * @rx_time: msecs the radio is in active receive on this channel */ struct wifi_channel_stats { struct wifi_channel_info channel; uint32_t on_time; uint32_t cca_busy_time; + uint32_t tx_time; + uint32_t rx_time; + }; /** diff --git a/core/wma/inc/wma_tgt_cfg.h b/core/wma/inc/wma_tgt_cfg.h index f14ccc6a4b17..faffe1e7a1ae 100644 --- a/core/wma/inc/wma_tgt_cfg.h +++ b/core/wma/inc/wma_tgt_cfg.h @@ -44,6 +44,7 @@ * @twt_responder: TWT responder capability * @bcn_reception_stats: Beacon Reception stats capability * @is_roam_scan_ch_to_host: Get roam scan channels from fw supported + * @ll_stats_per_chan_rx_tx_time: Per channel tx and rx time support in ll stats */ struct wma_tgt_services { uint32_t sta_power_save; @@ -77,6 +78,7 @@ struct wma_tgt_services { bool obss_scan_offload; bool bcn_reception_stats; bool is_roam_scan_ch_to_host; + bool ll_stats_per_chan_rx_tx_time; }; /** diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c index 7387ad9bcc33..e3cb206cfee7 100644 --- a/core/wma/src/wma_main.c +++ b/core/wma/src/wma_main.c @@ -4614,6 +4614,10 @@ static inline void wma_update_target_services(struct wmi_unified *wmi_handle, if (wmi_service_enabled(wmi_handle, wmi_roam_scan_chan_list_to_host_support)) cfg->is_roam_scan_ch_to_host = true; + + cfg->ll_stats_per_chan_rx_tx_time = + wmi_service_enabled(wmi_handle, + wmi_service_ll_stats_per_chan_rx_tx_time); } /** diff --git a/core/wma/src/wma_utils.c b/core/wma/src/wma_utils.c index 2e2dfaa324ab..349503a5c980 100644 --- a/core/wma/src/wma_utils.c +++ b/core/wma/src/wma_utils.c @@ -2155,12 +2155,22 @@ static int wma_unified_link_radio_stats_event_handler(void *handle, wma_debug("Channel Stats Info"); for (count = 0; count < radio_stats->num_channels; count++) { wma_nofl_debug("freq %u width %u freq0 %u freq1 %u awake time %u cca busy time %u", - channel_stats->center_freq, - channel_stats->channel_width, - channel_stats->center_freq0, - channel_stats->center_freq1, - channel_stats->radio_awake_time, - channel_stats->cca_busy_time); + channel_stats->center_freq, + channel_stats->channel_width, + channel_stats->center_freq0, + channel_stats->center_freq1, + channel_stats->radio_awake_time, + channel_stats->cca_busy_time); + if (wmi_service_enabled( + wma_handle->wmi_handle, + wmi_service_ll_stats_per_chan_rx_tx_time)) { + wma_nofl_debug("tx time %u rx time %u", + channel_stats->tx_time, + channel_stats->rx_time); + } else { + wma_nofl_debug("LL Stats per channel tx time and rx time are not supported."); + } + channel_stats++; qdf_mem_copy(chn_results,