diff --git a/components/mlme/core/src/wlan_mlme_main.c b/components/mlme/core/src/wlan_mlme_main.c
index 337a7502db..974496440d 100644
--- a/components/mlme/core/src/wlan_mlme_main.c
+++ b/components/mlme/core/src/wlan_mlme_main.c
@@ -318,6 +318,13 @@ static void mlme_init_edca_params(struct wlan_mlme_edca_params *edca_params)
mlme_init_edca_etsi_cfg(edca_params);
}
+static void mlme_init_timeout_cfg(struct wlan_objmgr_psoc *psoc,
+ struct wlan_mlme_timeout *timeouts)
+{
+ timeouts->join_failure_timeout = cfg_get(psoc,
+ CFG_JOIN_FAILURE_TIMEOUT);
+}
+
static void mlme_init_ht_cap_in_cfg(struct wlan_objmgr_psoc *psoc,
struct wlan_mlme_ht_caps *ht_caps)
{
@@ -985,6 +992,7 @@ QDF_STATUS mlme_cfg_on_psoc_enable(struct wlan_objmgr_psoc *psoc)
mlme_cfg = &mlme_obj->cfg;
mlme_init_generic_cfg(psoc, &mlme_cfg->gen);
mlme_init_edca_params(&mlme_cfg->edca_params);
+ mlme_init_timeout_cfg(psoc, &mlme_cfg->timeouts);
mlme_init_ht_cap_in_cfg(psoc, &mlme_cfg->ht_caps);
mlme_init_mbo_cfg(psoc, &mlme_cfg->mbo_cfg);
mlme_init_qos_cfg(psoc, &mlme_cfg->qos_mlme_params);
diff --git a/components/mlme/dispatcher/inc/cfg_mlme.h b/components/mlme/dispatcher/inc/cfg_mlme.h
index 29f7aa591e..176072f4b4 100644
--- a/components/mlme/dispatcher/inc/cfg_mlme.h
+++ b/components/mlme/dispatcher/inc/cfg_mlme.h
@@ -34,6 +34,7 @@
#include "cfg_mlme_mbo.h"
#include "cfg_mlme_vht_caps.h"
#include "cfg_qos.h"
+#include "cfg_mlme_timeout.h"
#include "cfg_mlme_rates.h"
#include "wlan_mlme_product_details_cfg.h"
#include "cfg_mlme_sta.h"
@@ -66,6 +67,7 @@
CFG_SCORING_ALL \
CFG_STA_ALL \
CFG_THRESHOLD_ALL \
+ CFG_TIMEOUT_ALL \
CFG_VHT_CAPS_ALL \
CFG_VHT_CAPS_ALL \
CFG_WEP_PARAMS_ALL
diff --git a/components/mlme/dispatcher/inc/cfg_mlme_timeout.h b/components/mlme/dispatcher/inc/cfg_mlme_timeout.h
new file mode 100644
index 0000000000..2c2fb1dd27
--- /dev/null
+++ b/components/mlme/dispatcher/inc/cfg_mlme_timeout.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2011-2018 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
+ * above copyright notice and this permission notice appear in all
+ * copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
+ * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
+ * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
+ * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+ * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+
+/**
+ * DOC: This file contains centralized definitions of converged configuration.
+ */
+
+#ifndef __CFG_MLME_TIMEOUT_H
+#define __CFG_MLME_TIMEOUT_H
+
+/*
+ *
+ * join_failure_timeout - Join failure timeout value
+ * @Min: 0
+ * @Max: 65535
+ * @Default: 3000
+ *
+ * This cfg is used to configure the join failure timeout.
+ *
+ * Usage: Internal
+ *
+ *
+ */
+#define CFG_JOIN_FAILURE_TIMEOUT CFG_INI_UINT( \
+ "join_failure_timeout", \
+ 0, \
+ 65535, \
+ 3000, \
+ CFG_VALUE_OR_DEFAULT, \
+ "Join failure timeout")
+
+#define CFG_TIMEOUT_ALL \
+ CFG(CFG_JOIN_FAILURE_TIMEOUT)
+
+#endif /* __CFG_MLME_TIMEOUT_H */
diff --git a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h
index a21cca095e..21eeee5580 100644
--- a/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h
+++ b/components/mlme/dispatcher/inc/wlan_mlme_public_struct.h
@@ -839,6 +839,14 @@ struct wlan_mlme_threshold {
uint32_t frag_threshold;
};
+/*
+ * struct wlan_mlme_timeout - mlme timeout related config items
+ * @join_failure_timeout: join failure timeout
+ */
+struct wlan_mlme_timeout {
+ uint32_t join_failure_timeout;
+};
+
/**
* struct wlan_mlme_oce - OCE related config items
* @enable_bcast_probe_rsp: enable broadcast probe response
@@ -899,20 +907,25 @@ struct wlan_mlme_wep_cfg {
/**
* struct wlan_mlme_cfg - MLME config items
* @chainmask_cfg: VHT chainmask related cfg items
- * @ht_cfg: HT related CFG Items
+ * @edca_params: edca related CFG items
+ * @gen: Generic CFG items
+ * @ht_caps: HT related CFG Items
* @he_caps: HE related cfg items
* @lfr: LFR related CFG Items
* @obss_ht40:obss ht40 CFG Items
* @mbo_cfg: Multiband Operation related CFG items
* @vht_caps: VHT related CFG Items
+ * @qos_mlme_params: QOS CFG Items
* @rates: Rates related cfg items
* @product_details: product details related CFG Items
* @sap_protection_cfg: SAP erp protection related CFG items
- * @acs: ACS related CFG items
* @sap_cfg: sap CFG items
* @sta: sta CFG Items
* @scoring: BSS Scoring related CFG Items
+ * @oce: OCE related CFG items
* @threshold: threshold related cfg items
+ * @timeouts: mlme timeout related CFG items
+ * @acs: ACS related CFG items
* @feature_flags: Feature flag config items
* @wep_params: WEP related config items
*/
@@ -935,6 +948,7 @@ struct wlan_mlme_cfg {
struct wlan_mlme_scoring_cfg scoring;
struct wlan_mlme_oce oce;
struct wlan_mlme_threshold threshold;
+ struct wlan_mlme_timeout timeouts;
struct wlan_mlme_acs acs;
struct wlan_mlme_feature_flag feature_flags;
struct wlan_mlme_wep_cfg wep_params;
diff --git a/core/mac/inc/wni_cfg.h b/core/mac/inc/wni_cfg.h
index f26828a231..6fdab39506 100644
--- a/core/mac/inc/wni_cfg.h
+++ b/core/mac/inc/wni_cfg.h
@@ -32,7 +32,6 @@ enum {
WNI_CFG_DTIM_PERIOD,
WNI_CFG_ACTIVE_MAXIMUM_CHANNEL_TIME,
WNI_CFG_PASSIVE_MAXIMUM_CHANNEL_TIME,
- WNI_CFG_JOIN_FAILURE_TIMEOUT,
WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT,
WNI_CFG_AUTHENTICATE_RSP_TIMEOUT,
WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT,
@@ -325,10 +324,6 @@ enum {
#define WNI_CFG_PASSIVE_MAXIMUM_CHANNEL_TIME_STAMAX 65535
#define WNI_CFG_PASSIVE_MAXIMUM_CHANNEL_TIME_STADEF 110
-#define WNI_CFG_JOIN_FAILURE_TIMEOUT_STAMIN 0
-#define WNI_CFG_JOIN_FAILURE_TIMEOUT_STAMAX 65535
-#define WNI_CFG_JOIN_FAILURE_TIMEOUT_STADEF 3000
-
#define WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT_STAMIN 0
#define WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT_STAMAX 65535
#define WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT_STADEF 1000
diff --git a/core/mac/src/cfg/cfg_param_name.c b/core/mac/src/cfg/cfg_param_name.c
index 5b1d1fbc2d..c6535d9b04 100644
--- a/core/mac/src/cfg/cfg_param_name.c
+++ b/core/mac/src/cfg/cfg_param_name.c
@@ -47,7 +47,6 @@ const char *cfg_get_string(uint16_t cfg_id)
CASE_RETURN_STRING(WNI_CFG_DTIM_PERIOD);
CASE_RETURN_STRING(WNI_CFG_ACTIVE_MAXIMUM_CHANNEL_TIME);
CASE_RETURN_STRING(WNI_CFG_PASSIVE_MAXIMUM_CHANNEL_TIME);
- CASE_RETURN_STRING(WNI_CFG_JOIN_FAILURE_TIMEOUT);
CASE_RETURN_STRING(WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT);
CASE_RETURN_STRING(WNI_CFG_AUTHENTICATE_RSP_TIMEOUT);
CASE_RETURN_STRING(WNI_CFG_ASSOCIATION_FAILURE_TIMEOUT);
diff --git a/core/mac/src/cfg/cfg_proc_msg.c b/core/mac/src/cfg/cfg_proc_msg.c
index 2850256276..d860b78a34 100644
--- a/core/mac/src/cfg/cfg_proc_msg.c
+++ b/core/mac/src/cfg/cfg_proc_msg.c
@@ -63,11 +63,6 @@ cgstatic cfg_static[CFG_PARAM_MAX_NUM] = {
WNI_CFG_PASSIVE_MAXIMUM_CHANNEL_TIME_STAMIN,
WNI_CFG_PASSIVE_MAXIMUM_CHANNEL_TIME_STAMAX,
WNI_CFG_PASSIVE_MAXIMUM_CHANNEL_TIME_STADEF},
- {WNI_CFG_JOIN_FAILURE_TIMEOUT,
- CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT,
- WNI_CFG_JOIN_FAILURE_TIMEOUT_STAMIN,
- WNI_CFG_JOIN_FAILURE_TIMEOUT_STAMAX,
- WNI_CFG_JOIN_FAILURE_TIMEOUT_STADEF},
{WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT,
CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT,
WNI_CFG_AUTHENTICATE_FAILURE_TIMEOUT_STAMIN,
diff --git a/core/mac/src/pe/include/lim_global.h b/core/mac/src/pe/include/lim_global.h
index fe78fca27e..92ec54c54b 100644
--- a/core/mac/src/pe/include/lim_global.h
+++ b/core/mac/src/pe/include/lim_global.h
@@ -203,7 +203,6 @@ typedef struct sLimMlmAuthReq {
} tLimMlmAuthReq, *tpLimMlmAuthReq;
typedef struct sLimMlmJoinReq {
- uint32_t joinFailureTimeout;
tSirMacRateSet operationalRateSet;
uint8_t sessionId;
tSirBssDescription bssDescription;
diff --git a/core/mac/src/pe/lim/lim_process_sme_req_messages.c b/core/mac/src/pe/lim/lim_process_sme_req_messages.c
index 2c80d777fe..9d4e4f05e3 100644
--- a/core/mac/src/pe/lim/lim_process_sme_req_messages.c
+++ b/core/mac/src/pe/lim/lim_process_sme_req_messages.c
@@ -1582,15 +1582,6 @@ __lim_process_sme_join_req(tpAniSirGlobal mac_ctx, uint32_t *msg_buf)
/* PE SessionId is stored as a part of JoinReq */
mlm_join_req->sessionId = session->peSessionId;
- if (wlan_cfg_get_int(mac_ctx, WNI_CFG_JOIN_FAILURE_TIMEOUT,
- (uint32_t *) &mlm_join_req->joinFailureTimeout) !=
- QDF_STATUS_SUCCESS) {
- pe_err("couldn't retrieve JoinFailureTimer value"
- " setting to default value");
- mlm_join_req->joinFailureTimeout =
- WNI_CFG_JOIN_FAILURE_TIMEOUT_STADEF;
- }
-
/* copy operational rate from session */
qdf_mem_copy((void *)&session->rateSet,
(void *)&sme_join_req->operationalRateSet,
diff --git a/core/mac/src/pe/lim/lim_timer_utils.c b/core/mac/src/pe/lim/lim_timer_utils.c
index 67a824ac80..b22a5a4f0f 100644
--- a/core/mac/src/pe/lim/lim_timer_utils.c
+++ b/core/mac/src/pe/lim/lim_timer_utils.c
@@ -30,6 +30,7 @@
#include "lim_utils.h"
#include "lim_assoc_utils.h"
#include "lim_security_utils.h"
+#include "wlan_mlme_public_struct.h"
#include
/* channel Switch Timer in ticks */
@@ -92,10 +93,8 @@ static bool lim_create_non_ap_timers(tpAniSirGlobal pMac)
return false;
}
- if (wlan_cfg_get_int(pMac, WNI_CFG_JOIN_FAILURE_TIMEOUT,
- &cfgValue) != QDF_STATUS_SUCCESS)
- pe_err("could not retrieve JoinFailureTimeout value");
- cfgValue = SYS_MS_TO_TICKS(cfgValue);
+ cfgValue = SYS_MS_TO_TICKS(
+ pMac->mlme_cfg->timeouts.join_failure_timeout);
/* Create Join failure timer and activate it later */
if (tx_timer_create(pMac, &pMac->lim.limTimers.gLimJoinFailureTimer,
"JOIN FAILURE TIMEOUT",
@@ -596,15 +595,8 @@ void lim_deactivate_and_change_timer(tpAniSirGlobal pMac, uint32_t timerId)
pe_err("Unable to deactivate Join Failure timer");
}
- if (wlan_cfg_get_int(pMac, WNI_CFG_JOIN_FAILURE_TIMEOUT,
- &val) != QDF_STATUS_SUCCESS) {
- /**
- * Could not get JoinFailureTimeout value
- * from CFG. Log error.
- */
- pe_err("could not retrieve JoinFailureTimeout value");
- }
- val = SYS_MS_TO_TICKS(val);
+ val = SYS_MS_TO_TICKS(
+ pMac->mlme_cfg->timeouts.join_failure_timeout);
if (tx_timer_change(&pMac->lim.limTimers.gLimJoinFailureTimer,
val, 0) != TX_SUCCESS) {
diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c
index 44c120a03a..d7022ed6e2 100644
--- a/core/sme/src/csr/csr_api_roam.c
+++ b/core/sme/src/csr/csr_api_roam.c
@@ -39,6 +39,7 @@
#include "cds_utils.h"
#include "sir_types.h"
#include "cfg_api.h"
+#include "cfg_ucfg_api.h"
#include "sme_power_save_api.h"
#include "wma.h"
#include "wlan_policy_mgr_api.h"
@@ -405,7 +406,7 @@ static ePhyChanBondState csr_get_cb_mode_from_ies(tpAniSirGlobal pMac,
tDot11fBeaconIEs *pIes);
static void csr_roaming_state_config_cnf_processor(tpAniSirGlobal pMac,
- tSmeCmd *pCommand, uint32_t result, uint8_t session_id);
+ tSmeCmd *pCommand, uint8_t session_id);
static QDF_STATUS csr_roam_open(tpAniSirGlobal pMac);
static QDF_STATUS csr_roam_close(tpAniSirGlobal pMac);
static bool csr_roam_is_same_profile_keys(tpAniSirGlobal pMac,
@@ -4533,6 +4534,7 @@ QDF_STATUS csr_roam_prepare_bss_config(tpAniSirGlobal pMac,
tDot11fBeaconIEs *pIes)
{
enum csr_cfgdot11mode cfgDot11Mode;
+ uint32_t join_timeout;
QDF_ASSERT(pIes != NULL);
if (pIes == NULL)
@@ -4643,18 +4645,15 @@ QDF_STATUS csr_roam_prepare_bss_config(tpAniSirGlobal pMac,
* Join timeout: if we find a BeaconInterval in the BssDescription,
* then set the Join Timeout to be 10 x the BeaconInterval.
*/
+ pBssConfig->uJoinTimeOut = cfg_default(CFG_JOIN_FAILURE_TIMEOUT);
if (pBssDesc->beaconInterval) {
/* Make sure it is bigger than the minimal */
- pBssConfig->uJoinTimeOut =
- QDF_MAX(10 * pBssDesc->beaconInterval,
- CSR_JOIN_FAILURE_TIMEOUT_MIN);
- if (pBssConfig->uJoinTimeOut > CSR_JOIN_FAILURE_TIMEOUT_DEFAULT)
- pBssConfig->uJoinTimeOut =
- CSR_JOIN_FAILURE_TIMEOUT_DEFAULT;
- } else {
- pBssConfig->uJoinTimeOut =
- CSR_JOIN_FAILURE_TIMEOUT_DEFAULT;
+ join_timeout = QDF_MAX(10 * pBssDesc->beaconInterval,
+ cfg_min(CFG_JOIN_FAILURE_TIMEOUT));
+ if (join_timeout < pBssConfig->uJoinTimeOut)
+ pBssConfig->uJoinTimeOut = join_timeout;
}
+
/* validate CB */
if ((pBssConfig->uCfgDot11Mode == eCSR_CFG_DOT11_MODE_11N) ||
(pBssConfig->uCfgDot11Mode == eCSR_CFG_DOT11_MODE_11N_ONLY) ||
@@ -4778,7 +4777,7 @@ QDF_STATUS csr_roam_prepare_bss_config_from_profile(
pMac->roam.configParam.HeartbeatThresh24;
}
/* Join timeout */
- pBssConfig->uJoinTimeOut = CSR_JOIN_FAILURE_TIMEOUT_DEFAULT;
+ pBssConfig->uJoinTimeOut = cfg_default(CFG_JOIN_FAILURE_TIMEOUT);
return status;
}
@@ -5295,8 +5294,8 @@ static void csr_set_cfg_rate_set_from_profile(tpAniSirGlobal pMac,
ExtendedOperationalRatesLength);
}
-void csr_roam_ccm_cfg_set_callback(tpAniSirGlobal pMac, int32_t result,
- uint8_t session_id)
+static void csr_roam_ccm_cfg_set_callback(tpAniSirGlobal pMac,
+ uint8_t session_id)
{
tListElem *pEntry =
csr_nonscan_active_ll_peek_head(pMac, LL_ACCESS_LOCK);
@@ -5322,7 +5321,7 @@ void csr_roam_ccm_cfg_set_callback(tpAniSirGlobal pMac, int32_t result,
if (CSR_IS_ROAM_JOINING(pMac, sessionId)
&& CSR_IS_ROAM_SUBSTATE_CONFIG(pMac, sessionId)) {
csr_roaming_state_config_cnf_processor(pMac, pCommand,
- (uint32_t) result, session_id);
+ session_id);
}
}
@@ -5334,7 +5333,6 @@ QDF_STATUS csr_roam_set_bss_config_cfg(tpAniSirGlobal pMac, uint32_t sessionId,
struct sDot11fBeaconIEs *pIes,
bool resetCountry)
{
- QDF_STATUS status;
uint32_t cfgCb = WNI_CFG_CHANNEL_BONDING_MODE_DISABLE;
uint8_t channel = 0;
struct csr_roam_session *pSession = CSR_GET_SESSION(pMac, sessionId);
@@ -5397,8 +5395,9 @@ QDF_STATUS csr_roam_set_bss_config_cfg(tpAniSirGlobal pMac, uint32_t sessionId,
pProfile, pBssDesc, pIes);
else
csr_set_cfg_rate_set_from_profile(pMac, pProfile);
- status = cfg_set_int(pMac, WNI_CFG_JOIN_FAILURE_TIMEOUT,
- pBssConfig->uJoinTimeOut);
+
+ pMac->mlme_cfg->timeouts.join_failure_timeout =
+ pBssConfig->uJoinTimeOut;
/* Any roaming related changes should be above this line */
if (pSession && pSession->roam_synch_in_progress) {
sme_debug("Roam synch is in progress Session_id: %d",
@@ -5410,7 +5409,8 @@ QDF_STATUS csr_roam_set_bss_config_cfg(tpAniSirGlobal pMac, uint32_t sessionId,
*/
csr_roam_substate_change(pMac, eCSR_ROAM_SUBSTATE_CONFIG, sessionId);
- csr_roam_ccm_cfg_set_callback(pMac, status, sessionId);
+ csr_roam_ccm_cfg_set_callback(pMac, sessionId);
+
return QDF_STATUS_SUCCESS;
}
@@ -9670,7 +9670,8 @@ bool csr_is_roam_command_waiting_for_session(tpAniSirGlobal pMac,
static void
csr_roaming_state_config_cnf_processor(tpAniSirGlobal mac_ctx,
- tSmeCmd *cmd, uint32_t result, uint8_t sme_session_id)
+ tSmeCmd *cmd,
+ uint8_t sme_session_id)
{
struct tag_csrscan_result *scan_result = NULL;
tSirBssDescription *bss_desc = NULL;
@@ -9700,28 +9701,6 @@ csr_roaming_state_config_cnf_processor(tpAniSirGlobal mac_ctx,
return;
}
- if (!QDF_IS_STATUS_SUCCESS(result)) {
- /*
- * In the event the configuration failed, for infra let the roam
- * processor attempt to join something else...
- */
- if (cmd->u.roamCmd.pRoamBssEntry
- && CSR_IS_INFRASTRUCTURE(&cmd->u.roamCmd.roamProfile)) {
- csr_roam(mac_ctx, cmd);
- } else {
- /* We need to complete the command */
- if (csr_is_bss_type_ibss
- (cmd->u.roamCmd.roamProfile.BSSType)) {
- csr_roam_complete(mac_ctx, eCsrStartBssFailure,
- NULL, sme_session_id);
- } else {
- csr_roam_complete(mac_ctx, eCsrNothingToJoin,
- NULL, sme_session_id);
- }
- }
- return;
- }
-
/* we have active entry */
sme_debug("Cfg sequence complete");
/*
diff --git a/core/sme/src/csr/csr_inside_api.h b/core/sme/src/csr/csr_inside_api.h
index fe7a6b6d5e..49433802f9 100644
--- a/core/sme/src/csr/csr_inside_api.h
+++ b/core/sme/src/csr/csr_inside_api.h
@@ -375,9 +375,6 @@ bool csr_roam_is_channel_valid(tpAniSirGlobal pMac, uint8_t channel);
/* pNumChan is a caller allocated space with the sizeof pChannels */
QDF_STATUS csr_get_cfg_valid_channels(tpAniSirGlobal pMac, uint8_t *pChannels,
uint32_t *pNumChan);
-void csr_roam_ccm_cfg_set_callback(tpAniSirGlobal pMac, int32_t result,
- uint8_t session_id);
-
int8_t csr_get_cfg_max_tx_power(tpAniSirGlobal pMac, uint8_t channel);
/* To free the last roaming profile */