qcacld-3.0: Add INI to exclude self tx time from cca busy time

Add new INI support to deduct self tx time from cca busy time.

Change-Id: I3e113a859321c31c31c92e8aa2f6c3f014a7376b
CRs-Fixed: 3576927
This commit is contained in:
Asutosh Mohapatra
2023-07-26 13:32:53 +05:30
committed by Rahul Choudhary
parent acf0f770ca
commit c0f37ee9ac
8 changed files with 85 additions and 2 deletions

View File

@@ -100,6 +100,7 @@ struct wlan_cds_feature_set {
* @enable_tx_compl_tsf64:
* @cds_feature_set: CDS feature set structure.
* @get_wifi_features: Get wifi features from fw
* @exclude_selftx_from_cca_busy: Exclude selx tx time from cca busy time
*/
struct cds_config_info {
@@ -136,5 +137,6 @@ struct cds_config_info {
struct wlan_cds_feature_set cds_feature_set;
bool get_wifi_features;
#endif
bool exclude_selftx_from_cca_busy;
};
#endif /* !defined( __CDS_CONFIG_H ) */

View File

@@ -691,6 +691,21 @@ static qdf_notif_block cds_hang_event_notifier = {
.notif_block.notifier_call = cds_hang_event_notifier_call,
};
/**
* cds_set_exclude_selftx_from_cca_busy_time() - Set exclude self tx time
* from cca busy time bool in cds config
* @exclude_selftx_from_cca_busy: Bool to be stored in cds config
* @cds_cfg: Pointer to cds config
*
* Return: None
*/
static void
cds_set_exclude_selftx_from_cca_busy_time(bool exclude_selftx_from_cca_busy,
struct cds_config_info *cds_cfg)
{
cds_cfg->exclude_selftx_from_cca_busy = exclude_selftx_from_cca_busy;
}
/**
* cds_open() - open the CDS Module
*
@@ -807,6 +822,9 @@ QDF_STATUS cds_open(struct wlan_objmgr_psoc *psoc)
goto err_htc_close;
}
cds_set_exclude_selftx_from_cca_busy_time(
hdd_ctx->config->exclude_selftx_from_cca_busy,
cds_cfg);
/*Open the WMA module */
status = wma_open(psoc, hdd_update_tgt_cfg, cds_cfg,
hdd_ctx->target_type);

View File

@@ -1291,6 +1291,25 @@ enum host_log_level {
#define CFG_DYNAMIC_MAC_ADDR_UPDATE_SUPPORTED_ALL
#endif
/*
* <ini>
* exclude_selftx_from_cca_busy_time - Exclude self tx time from cca busy time
* @Default: false
*
* This ini is used to exclude self tx time from cca busy time.
*
* false: Don't exclude self tx time from cca busy time.
* true: Deduct tx time from cca busy time.
*
* Usage: External
*
* </ini>
*/
#define CFG_EXCLUDE_SELFTX_FROM_CCA_BUSY_TIME CFG_INI_BOOL( \
"exclude_selftx_from_cca_busy_time", \
false, \
"This ini is used to exclude self tx time from CCA busy time")
#define CFG_HDD_ALL \
CFG_DYNAMIC_MAC_ADDR_UPDATE_SUPPORTED_ALL \
CFG_ENABLE_PACKET_LOG_ALL \
@@ -1328,5 +1347,6 @@ enum host_log_level {
CFG(CFG_ENABLE_HOST_MODULE_LOG_LEVEL) \
SAR_SAFETY_FEATURE_ALL \
CFG_GET_WIFI_FEATURES_ALL \
CFG_CPU_CXPC_THRESHOLD_ALL
CFG_CPU_CXPC_THRESHOLD_ALL \
CFG(CFG_EXCLUDE_SELFTX_FROM_CCA_BUSY_TIME)
#endif

View File

@@ -206,6 +206,7 @@ struct hdd_config {
#ifdef FEATURE_RUNTIME_PM
uint16_t cpu_cxpc_threshold;
#endif
bool exclude_selftx_from_cca_busy;
};
/**

View File

@@ -14236,6 +14236,9 @@ static void hdd_cfg_params_init(struct hdd_context *hdd_ctx)
hdd_get_wifi_features_cfg_update(config, psoc);
hdd_init_cpu_cxpc_threshold_cfg(config, psoc);
config->exclude_selftx_from_cca_busy =
cfg_get(psoc, CFG_EXCLUDE_SELFTX_FROM_CCA_BUSY_TIME);
}
#ifdef CONNECTION_ROAMING_CFG

View File

@@ -765,11 +765,13 @@ struct mac_ss_bw_info {
/**
* struct wma_ini_config - Structure to hold wma ini configuration
* @max_no_of_peers: Max Number of supported
* @exclude_selftx_from_cca_busy: Exclude self tx time from cca busy time flag.
*
* Placeholder for WMA ini parameters.
*/
struct wma_ini_config {
uint8_t max_no_of_peers;
bool exclude_selftx_from_cca_busy;
};
/**

View File

@@ -3402,6 +3402,28 @@ wma_get_service_cap_per_link_mlo_stats(struct wmi_unified *wmi_handle,
}
#endif
/**
* wma_set_exclude_selftx_from_cca_busy_time() - Set exclude self tx time from
* cca busy time bool
* @exclude_selftx_from_cca_busy: Bool to update in in wma ini config
* @wma_handle: WMA handle
*
* Return: None
*/
static void
wma_set_exclude_selftx_from_cca_busy_time(bool exclude_selftx_from_cca_busy,
tp_wma_handle wma_handle)
{
struct wma_ini_config *cfg = wma_get_ini_handle(wma_handle);
if (!cfg) {
wma_err("NULL WMA ini handle");
return;
}
cfg->exclude_selftx_from_cca_busy = exclude_selftx_from_cca_busy;
}
/**
* wma_open() - Allocate wma context and initialize it.
* @cds_context: cds context
@@ -3928,6 +3950,9 @@ QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc,
wma_register_wlm_latency_level_event(wma_handle);
wma_register_mws_coex_events(wma_handle);
wma_trace_init();
wma_set_exclude_selftx_from_cca_busy_time(
cds_cfg->exclude_selftx_from_cca_busy,
wma_handle);
return QDF_STATUS_SUCCESS;
err_dbglog_init:

View File

@@ -2214,14 +2214,22 @@ __wma_unified_link_radio_stats_event_handler(tp_wma_handle wma_handle,
uint8_t *info;
uint32_t stats_len = 0;
int ret;
struct mac_context *mac = cds_get_context(QDF_MODULE_ID_PE);
struct wma_ini_config *cfg = wma_get_ini_handle(wma_handle);
bool exclude_selftx_from_cca_busy;
if (!mac) {
wma_debug("NULL mac ptr. Exiting");
return -EINVAL;
}
if (!cfg) {
wma_err("NULL WMA ini handle");
return 0;
}
exclude_selftx_from_cca_busy = cfg->exclude_selftx_from_cca_busy;
if (!mac->sme.link_layer_stats_cb) {
wma_debug("HDD callback is null");
return -EINVAL;
@@ -2385,6 +2393,10 @@ __wma_unified_link_radio_stats_event_handler(tp_wma_handle wma_handle,
}
for (count = 0; count < radio_stats->num_channels; count++) {
if (exclude_selftx_from_cca_busy)
channel_stats->cca_busy_time -=
channel_stats->tx_time;
ret = qdf_scnprintf(info + stats_len,
WMI_MAX_RADIO_STATS_LOGS - stats_len,
" %d[%d][%d][%d]",