qcacld-3.0: Limit unicast probe req during join timeout in MCC

Currently probe request is sent every 200ms during join timeout
this can lead to 16+ probe req, send during join time.

Change logic to send max 5 probe req during join time,
if candidate freq can lead to MCC concurrency scenario.

Change-Id: I7956771e2cf6724754f59c6db5b07fb45426ae41
CRs-Fixed: 3338329
This commit is contained in:
Abhishek Singh
2022-11-16 12:25:06 +05:30
committed by Madan Koyyalamudi
parent 6b3dee0b65
commit eee0c37e9d
7 changed files with 68 additions and 10 deletions

View File

@@ -2730,6 +2730,17 @@ void policy_mgr_hw_mode_transition_cb(uint32_t old_hw_mode_index,
struct policy_mgr_pdev_mac_freq_map *mac_freq_range,
struct wlan_objmgr_psoc *context);
/**
* policy_mgr_will_freq_lead_to_mcc() - Check if the given freq can lead to
* MCC scenario with existing connection
* @psoc: psoc pointer
* @freq: freq to check with existing connections
*
* Return: true or false
*/
bool policy_mgr_will_freq_lead_to_mcc(struct wlan_objmgr_psoc *psoc,
qdf_freq_t freq);
/**
* policy_mgr_current_concurrency_is_scc() - To check the current
* concurrency combination if it is doing SCC

View File

@@ -6852,6 +6852,34 @@ QDF_STATUS policy_mgr_set_user_cfg(struct wlan_objmgr_psoc *psoc,
return QDF_STATUS_SUCCESS;
}
bool policy_mgr_will_freq_lead_to_mcc(struct wlan_objmgr_psoc *psoc,
qdf_freq_t freq)
{
bool is_mcc = false;
uint32_t conn_index;
struct policy_mgr_psoc_priv_obj *pm_ctx;
pm_ctx = policy_mgr_get_context(psoc);
if (!pm_ctx) {
policy_mgr_err("Invalid Context");
return is_mcc;
}
qdf_mutex_acquire(&pm_ctx->qdf_conc_list_lock);
for (conn_index = 0; conn_index < MAX_NUMBER_OF_CONC_CONNECTIONS;
conn_index++) {
if (pm_conc_connection_list[conn_index].in_use &&
policy_mgr_2_freq_always_on_same_mac(psoc, freq,
pm_conc_connection_list[conn_index].freq)) {
is_mcc = true;
break;
}
}
qdf_mutex_release(&pm_ctx->qdf_conc_list_lock);
return is_mcc;
}
/**
* policy_mgr_is_two_connection_mcc() - Check if MCC scenario
* when there are two connections

View File

@@ -34,6 +34,9 @@
#include "wlan_connectivity_logging.h"
#define MAC_MAX_ADD_IE_LENGTH 2048
/* Join probe request Retry timer default (200)ms */
#define JOIN_PROBE_REQ_TIMER_MS 200
#define MAX_JOIN_PROBE_REQ 5
/*
* Following time is used to program WOW_TIMER_PATTERN to FW so that FW will

View File

@@ -864,6 +864,7 @@ static void mlme_init_timeout_cfg(struct wlan_objmgr_psoc *psoc,
timeouts->join_failure_timeout =
cfg_get(psoc, CFG_JOIN_FAILURE_TIMEOUT);
timeouts->join_failure_timeout_ori = timeouts->join_failure_timeout;
timeouts->probe_req_retry_timeout = JOIN_PROBE_REQ_TIMER_MS;
timeouts->auth_failure_timeout =
cfg_get(psoc, CFG_AUTH_FAILURE_TIMEOUT);
timeouts->auth_rsp_timeout =

View File

@@ -2328,6 +2328,7 @@ struct wlan_mlme_power {
/*
* struct wlan_mlme_timeout - mlme timeout related config items
* @join_failure_timeout: join failure timeout (can be changed in connect req)
* @probe_req_retry_timeout: Probe req retry timeout during join time
* @join_failure_timeout_ori: original value of above join timeout
* @auth_failure_timeout: authenticate failure timeout
* @auth_rsp_timeout: authenticate response timeout
@@ -2343,6 +2344,7 @@ struct wlan_mlme_power {
*/
struct wlan_mlme_timeout {
uint32_t join_failure_timeout;
uint32_t probe_req_retry_timeout;
uint32_t join_failure_timeout_ori;
uint32_t auth_failure_timeout;
uint32_t auth_rsp_timeout;

View File

@@ -2987,7 +2987,7 @@ lim_fill_pe_session(struct mac_context *mac_ctx, struct pe_session *session,
struct ps_global_info *ps_global_info = &mac_ctx->sme.ps_global_info;
struct ps_params *ps_param =
&ps_global_info->ps_params[session->vdev_id];
uint32_t join_timeout;
uint32_t timeout;
uint8_t programmed_country[REG_ALPHA2_LEN + 1];
enum reg_6g_ap_type power_type_6g;
bool ctry_code_match;
@@ -3072,14 +3072,27 @@ lim_fill_pe_session(struct mac_context *mac_ctx, struct pe_session *session,
* Join timeout: if we find a BeaconInterval in the BssDescription,
* then set the Join Timeout to be 10 x the BeaconInterval.
*/
join_timeout = mac_ctx->mlme_cfg->timeouts.join_failure_timeout_ori;
timeout = mac_ctx->mlme_cfg->timeouts.join_failure_timeout_ori;
if (bss_desc->beaconInterval)
join_timeout = QDF_MAX(10 * bss_desc->beaconInterval,
join_timeout);
timeout = QDF_MAX(10 * bss_desc->beaconInterval, timeout);
mac_ctx->mlme_cfg->timeouts.join_failure_timeout =
QDF_MIN(join_timeout,
QDF_MIN(timeout,
mac_ctx->mlme_cfg->timeouts.join_failure_timeout_ori);
/*
* Calculate probe request retry timeout,
* Change probe req retry to MAX_JOIN_PROBE_REQ if sta freq
* can cause MCC
*/
timeout = JOIN_PROBE_REQ_TIMER_MS;
if (policy_mgr_will_freq_lead_to_mcc(mac_ctx->psoc,
bss_desc->chan_freq)) {
/* Send MAX_JOIN_PROBE_REQ probe req during join timeout */
timeout = mac_ctx->mlme_cfg->timeouts.join_failure_timeout/
MAX_JOIN_PROBE_REQ;
timeout = QDF_MAX(JOIN_PROBE_REQ_TIMER_MS, timeout);
}
mac_ctx->mlme_cfg->timeouts.probe_req_retry_timeout = timeout;
lim_join_req_update_ht_vht_caps(mac_ctx, session, bss_desc,
ie_struct);

View File

@@ -40,8 +40,6 @@
#define LIM_QUIET_BSS_TIMER_TICK 100
/* Lim KeepAlive timer default (3000)ms */
#define LIM_KEEPALIVE_TIMER_MS 3000
/* Lim JoinProbeRequest Retry timer default (200)ms */
#define LIM_JOIN_PROBE_REQ_TIMER_MS 200
/* Lim Periodic Auth Retry timer default 60 ms */
#define LIM_AUTH_RETRY_TIMER_MS 60
@@ -68,13 +66,15 @@ static bool lim_create_non_ap_timers(struct mac_context *mac)
pe_err("could not create Join failure timer");
return false;
}
cfgValue = SYS_MS_TO_TICKS(
mac->mlme_cfg->timeouts.probe_req_retry_timeout);
/* Send unicast probe req frame every 200 ms */
if (tx_timer_create(mac,
&mac->lim.lim_timers.gLimPeriodicJoinProbeReqTimer,
"Periodic Join Probe Request Timer",
lim_timer_handler,
SIR_LIM_PERIODIC_JOIN_PROBE_REQ_TIMEOUT,
SYS_MS_TO_TICKS(LIM_JOIN_PROBE_REQ_TIMER_MS), 0,
cfgValue, 0,
TX_NO_ACTIVATE) != TX_SUCCESS) {
pe_err("could not create Periodic Join Probe Request tmr");
return false;
@@ -533,8 +533,8 @@ void lim_deactivate_and_change_timer(struct mac_context *mac, uint32_t timerId)
/* Could not deactivate periodic join req Times. */
pe_err("Unable to deactivate periodic join request timer");
}
val = SYS_MS_TO_TICKS(LIM_JOIN_PROBE_REQ_TIMER_MS);
val = SYS_MS_TO_TICKS(
mac->mlme_cfg->timeouts.probe_req_retry_timeout);
if (tx_timer_change
(&mac->lim.lim_timers.gLimPeriodicJoinProbeReqTimer,
val, 0) != TX_SUCCESS) {