diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c
index a85b660bcd..e76a3af1fa 100644
--- a/components/mlme/core/src/wlan_mlme_main.c
+++ b/components/mlme/core/src/wlan_mlme_main.c
@@ -1703,6 +1703,9 @@ static void mlme_init_sta_cfg(struct wlan_objmgr_psoc *psoc,
sta->allow_tpc_from_ap = cfg_get(psoc, CFG_TX_POWER_CTRL);
sta->sta_keepalive_method =
cfg_get(psoc, CFG_STA_KEEPALIVE_METHOD);
+ sta->max_li_modulated_dtim_time_ms =
+ cfg_get(psoc, CFG_MAX_LI_MODULATED_DTIM_MS);
+
mlme_init_sta_mlo_cfg(psoc, sta);
}
diff --git a/components/mlme/dispatcher/inc/cfg_mlme_sta.h b/components/mlme/dispatcher/inc/cfg_mlme_sta.h
index db543ea8d6..d2523406f6 100644
--- a/components/mlme/dispatcher/inc/cfg_mlme_sta.h
+++ b/components/mlme/dispatcher/inc/cfg_mlme_sta.h
@@ -512,6 +512,30 @@
CFG_VALUE_OR_DEFAULT, \
"Max modulated dtim")
+/*
+ *
+ * @Min: 0
+ * @Max: 2000
+ * @Default: 500
+ *
+ * This ini is used to set default ConDTIMSkipping_MaxTime in ms
+ *
+ * Related: None
+ *
+ * Supported Feature: STA
+ *
+ * Usage: External
+ *
+ *
+ */
+#define CFG_MAX_LI_MODULATED_DTIM_MS CFG_INI_UINT( \
+ "ConDTIMSkipping_MaxTime", \
+ 0, \
+ 2000, \
+ 500, \
+ CFG_VALUE_OR_DEFAULT, \
+ "DTIM skipping max time")
+
#ifdef WLAN_FEATURE_11BE_MLO
/*
*
@@ -560,6 +584,7 @@
CFG(CFG_WT_CNF_TIMEOUT) \
CFG(CFG_CURRENT_RSSI) \
CFG(CFG_TX_POWER_CTRL) \
- CFG_SINGLE_LINK_MLO_CONN_CFG
+ CFG_SINGLE_LINK_MLO_CONN_CFG \
+ CFG(CFG_MAX_LI_MODULATED_DTIM_MS)
#endif /* CFG_MLME_STA_H__ */
diff --git a/components/mlme/dispatcher/inc/wlan_mlme_api.h b/components/mlme/dispatcher/inc/wlan_mlme_api.h
index 3cc649129d..42ac21ab36 100644
--- a/components/mlme/dispatcher/inc/wlan_mlme_api.h
+++ b/components/mlme/dispatcher/inc/wlan_mlme_api.h
@@ -2301,6 +2301,18 @@ QDF_STATUS
wlan_mlme_get_sta_miracast_mcc_rest_time(struct wlan_objmgr_psoc *psoc,
uint32_t *value);
+/**
+ * wlan_mlme_get_max_modulated_dtim_ms() - get the max modulated dtim in ms
+ * restart
+ * @psoc: pointer to psoc object
+ * @value: Value that needs to be set from the caller
+ *
+ * Return: QDF Status
+ */
+QDF_STATUS
+wlan_mlme_get_max_modulated_dtim_ms(struct wlan_objmgr_psoc *psoc,
+ uint16_t *value);
+
/**
* wlan_mlme_get_scan_probe_unicast_ra() - Get scan probe unicast RA cfg
* @psoc: pointer to psoc object
diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h
index e279a7600b..c7019b7937 100644
--- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h
+++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h
@@ -1643,6 +1643,7 @@ enum station_prefer_bw {
* @usr_disabled_roaming: User config for roaming disable
* @usr_scan_probe_unicast_ra: User config unicast probe req in scan
* @single_link_mlo_conn: Single link mlo connection is configured
+ * @max_li_modulated_dtim_time_ms: Max modulated DTIM time in ms.
*/
struct wlan_mlme_sta_cfg {
uint32_t sta_keep_alive_period;
@@ -1672,6 +1673,7 @@ struct wlan_mlme_sta_cfg {
#ifdef WLAN_FEATURE_11BE_MLO
bool single_link_mlo_conn;
#endif
+ uint16_t max_li_modulated_dtim_time_ms;
};
/**
diff --git a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h
index 9711531edd..fd107e47c7 100644
--- a/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h
+++ b/components/mlme/dispatcher/inc/wlan_mlme_ucfg_api.h
@@ -3677,6 +3677,22 @@ ucfg_mlme_get_sta_miracast_mcc_rest_time(struct wlan_objmgr_psoc *psoc,
return wlan_mlme_get_sta_miracast_mcc_rest_time(psoc, value);
}
+/**
+ * ucfg_mlme_get_max_modulated_dtim_ms() - get sap max modulated dtim
+ * @psoc: pointer to psoc object
+ * @value: Value that needs to be set from the caller
+ *
+ * Inline UCFG API to be used by HDD/OSIF callers
+ *
+ * Return: QDF Status
+ */
+static inline QDF_STATUS
+ucfg_mlme_get_max_modulated_dtim_ms(struct wlan_objmgr_psoc *psoc,
+ uint16_t *value)
+{
+ return wlan_mlme_get_max_modulated_dtim_ms(psoc, value);
+}
+
/**
* ucfg_mlme_get_sap_mcc_chnl_avoid() - Check if SAP MCC needs to be avoided
*
diff --git a/components/mlme/dispatcher/src/wlan_mlme_api.c b/components/mlme/dispatcher/src/wlan_mlme_api.c
index 05c78e1381..c7d10a31fc 100644
--- a/components/mlme/dispatcher/src/wlan_mlme_api.c
+++ b/components/mlme/dispatcher/src/wlan_mlme_api.c
@@ -2731,6 +2731,21 @@ wlan_mlme_get_sta_miracast_mcc_rest_time(struct wlan_objmgr_psoc *psoc,
return QDF_STATUS_SUCCESS;
}
+QDF_STATUS
+wlan_mlme_get_max_modulated_dtim_ms(struct wlan_objmgr_psoc *psoc,
+ uint16_t *value)
+{
+ struct wlan_mlme_psoc_ext_obj *mlme_obj;
+
+ mlme_obj = mlme_get_psoc_ext_obj(psoc);
+ if (!mlme_obj)
+ return QDF_STATUS_E_FAILURE;
+
+ *value = mlme_obj->cfg.sta.max_li_modulated_dtim_time_ms;
+
+ return QDF_STATUS_SUCCESS;
+}
+
QDF_STATUS
wlan_mlme_get_scan_probe_unicast_ra(struct wlan_objmgr_psoc *psoc,
bool *value)
diff --git a/core/cds/inc/cds_config.h b/core/cds/inc/cds_config.h
index 4a0872bf23..baaffeee8c 100644
--- a/core/cds/inc/cds_config.h
+++ b/core/cds/inc/cds_config.h
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2016-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
@@ -50,6 +51,7 @@ enum cfg_sub_20_channel_width {
* @max_station: Max station supported
* @max_bssid: Max Bssid Supported
* @sta_maxlimod_dtim: station max listen interval
+ * @sta_maxlimod_dtim_ms: station max listen interval ms
* @driver_type: Enumeration of Driver Type whether FTM or Mission mode
* currently rest of bits are not used
* Indicates whether support is enabled or not
@@ -80,6 +82,7 @@ struct cds_config_info {
uint16_t max_station;
uint16_t max_bssid;
uint8_t sta_maxlimod_dtim;
+ uint16_t sta_maxlimod_dtim_ms;
enum qdf_driver_type driver_type;
uint8_t ap_maxoffload_peers;
uint8_t ap_maxoffload_reorderbuffs;
diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c
index 4df5792a30..9fb9e2063c 100644
--- a/core/hdd/src/wlan_hdd_main.c
+++ b/core/hdd/src/wlan_hdd_main.c
@@ -13822,6 +13822,9 @@ static int hdd_update_cds_config(struct hdd_context *hdd_ctx)
ucfg_mlme_get_sap_max_modulated_dtim(hdd_ctx->psoc,
&cds_cfg->sta_maxlimod_dtim);
+ ucfg_mlme_get_max_modulated_dtim_ms(hdd_ctx->psoc,
+ &cds_cfg->sta_maxlimod_dtim_ms);
+
status = ucfg_mlme_get_crash_inject(hdd_ctx->psoc, &crash_inject);
if (QDF_IS_STATUS_ERROR(status)) {
hdd_err("Failed to get crash inject ini config");
@@ -19453,7 +19456,6 @@ static int hdd_update_pmo_config(struct hdd_context *hdd_ctx)
ucfg_mlme_get_sap_max_modulated_dtim(hdd_ctx->psoc,
&psoc_cfg.sta_max_li_mod_dtim);
-
hdd_lpass_populate_pmo_config(&psoc_cfg, hdd_ctx);
status = ucfg_pmo_update_psoc_config(hdd_ctx->psoc, &psoc_cfg);
diff --git a/core/wma/inc/wma.h b/core/wma/inc/wma.h
index f3353966eb..96c074ce57 100644
--- a/core/wma/inc/wma.h
+++ b/core/wma/inc/wma.h
@@ -852,6 +852,7 @@ struct wma_wlm_stats_data {
* @RArateLimitInterval: RA rate limit interval
* @is_lpass_enabled: Flag to indicate if LPASS feature is enabled or not
* @staMaxLIModDtim: station max listen interval
+ * @sta_max_li_mod_dtim_ms: station max listen interval in ms
* @staModDtim: station mode DTIM
* @staDynamicDtim: station dynamic DTIM
* @hw_bd_id: hardware board id
@@ -975,6 +976,7 @@ typedef struct {
bool is_lpass_enabled;
#endif
uint8_t staMaxLIModDtim;
+ uint16_t sta_max_li_mod_dtim_ms;
uint8_t staModDtim;
uint8_t staDynamicDtim;
uint32_t hw_bd_id;
diff --git a/core/wma/src/wma_dev_if.c b/core/wma/src/wma_dev_if.c
index 98c83fc6b1..01941151c3 100644
--- a/core/wma/src/wma_dev_if.c
+++ b/core/wma/src/wma_dev_if.c
@@ -4990,6 +4990,7 @@ static void wma_add_sta_req_sta_mode(tp_wma_handle wma, tpAddStaParams params)
wmi_service_listen_interval_offload_support)) {
struct wlan_objmgr_vdev *vdev;
uint32_t moddtim;
+ bool is_connection_roaming_cfg_set = 0;
wma_debug("listen interval offload enabled, setting params");
status = wma_vdev_set_param(wma->wmi_handle,
@@ -5000,6 +5001,21 @@ static void wma_add_sta_req_sta_mode(tp_wma_handle wma, tpAddStaParams params)
wma_err("can't set MAX_LI for session: %d",
params->smesessionId);
}
+
+ ucfg_mlme_get_connection_roaming_ini_present(
+ wma->psoc,
+ &is_connection_roaming_cfg_set);
+ if (is_connection_roaming_cfg_set) {
+ status = wma_vdev_set_param(
+ wma->wmi_handle,
+ params->smesessionId,
+ WMI_VDEV_PARAM_MAX_LI_OF_MODDTIM_MS,
+ wma->sta_max_li_mod_dtim_ms);
+ if (status != QDF_STATUS_SUCCESS)
+ wma_err("can't set MAX_LI_MS for session: %d",
+ params->smesessionId);
+ }
+
status = wma_vdev_set_param(wma->wmi_handle,
params->smesessionId,
WMI_VDEV_PARAM_DYNDTIM_CNT,
diff --git a/core/wma/src/wma_main.c b/core/wma/src/wma_main.c
index 23a0d27002..8946a8339d 100644
--- a/core/wma/src/wma_main.c
+++ b/core/wma/src/wma_main.c
@@ -3439,6 +3439,7 @@ QDF_STATUS wma_open(struct wlan_objmgr_psoc *psoc,
wma_handle->powersave_mode =
ucfg_pmo_power_save_offload_enabled(wma_handle->psoc);
wma_handle->staMaxLIModDtim = cds_cfg->sta_maxlimod_dtim;
+ wma_handle->sta_max_li_mod_dtim_ms = cds_cfg->sta_maxlimod_dtim_ms;
wma_handle->staModDtim = ucfg_pmo_get_sta_mod_dtim(wma_handle->psoc);
wma_handle->staDynamicDtim =
ucfg_pmo_get_sta_dynamic_dtim(wma_handle->psoc);