summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBapiraju Alla <balla@codeaurora.org>2020-07-20 14:11:16 +0530
committerVictor Hsu <hsuvictor@google.com>2020-10-27 14:05:18 +0800
commit88b6dbedf7885bea54e8999feb10245e27f619ca (patch)
tree6cbabbc2eac0f97d52b57e2fc3ede6f7fc3d0854
parent17508694a1c933dcb32f7625612edf955f368c45 (diff)
downloadqcacld-88b6dbedf7885bea54e8999feb10245e27f619ca.tar.gz
qcacld-3.0: Add support for tx and rx time in wifi_channel_stats
Currently wifi_channel_stats has cca_busy_time statistic which is measured after excluding own tx_time but not own rx_time. By definition, CCA busy time means amount of time for which channel is detected as busy after excluding it's own tx and rx time. Add support for tx and rx time in the channel statistics. This will enable provision to calculate CCA busy time with including/excluding channel tx and rx time. Bug: 160239223 Change-Id: I8e295ed4cd7b2ceca44b64140977603a4d8e8764 CRs-Fixed: 2732018 Signed-off-by: Victor Hsu <hsuvictor@google.com>
-rw-r--r--core/hdd/inc/wlan_hdd_main.h1
-rw-r--r--core/hdd/src/wlan_hdd_debugfs_llstat.c13
-rw-r--r--core/hdd/src/wlan_hdd_main.c2
-rw-r--r--core/mac/inc/sir_api.h7
-rw-r--r--core/wma/inc/wma_tgt_cfg.h2
-rw-r--r--core/wma/src/wma_main.c4
-rw-r--r--core/wma/src/wma_utils.c24
7 files changed, 44 insertions, 9 deletions
diff --git a/core/hdd/inc/wlan_hdd_main.h b/core/hdd/inc/wlan_hdd_main.h
index be3730140a..b1a59e179a 100644
--- a/core/hdd/inc/wlan_hdd_main.h
+++ b/core/hdd/inc/wlan_hdd_main.h
@@ -2025,6 +2025,7 @@ struct hdd_context {
#ifdef FW_THERMAL_THROTTLE_SUPPORT
uint8_t dutycycle_off_percent;
#endif
+ 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 916b84b884..0362844242 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 d65126452d..ff544375d3 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -1499,6 +1499,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 dca3a3dc67..ba1c5875c9 100644
--- a/core/mac/inc/sir_api.h
+++ b/core/mac/inc/sir_api.h
@@ -3736,12 +3736,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 9cab66be5d..c15b9abb0c 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 defbcd33b2..6d2186cfcf 100644
--- a/core/wma/src/wma_main.c
+++ b/core/wma/src/wma_main.c
@@ -5148,6 +5148,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 25522ddb62..de6b560bde 100644
--- a/core/wma/src/wma_utils.c
+++ b/core/wma/src/wma_utils.c
@@ -2147,13 +2147,23 @@ static int wma_unified_link_radio_stats_event_handler(void *handle,
next_chan_offset = WMI_TLV_HDR_SIZE;
WMA_LOGD("Channel Stats Info");
for (count = 0; count < radio_stats->num_channels; count++) {
- WMA_LOGD("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);
+ 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);
+ 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,