From e1fbbe0f6456a34153c7d34f6595c2b424cee976 Mon Sep 17 00:00:00 2001 From: Naveen Rawat Date: Tue, 5 Sep 2017 12:01:56 -0700 Subject: [PATCH] qcacld-3.0: Make sure join timeout value is less than max allowed Join timeout value is taken as 10 times beacon interval, however if beacon interval is very large, this will make join timeout value to exceed allowed max, causing join process failure. Make sure to keep join timeout value less than max allowed. Change-Id: If2167e602e3231403fbe2ab1936769f2a1b31383 CRs-Fixed: 2100819 --- core/sme/src/csr/csr_api_roam.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/core/sme/src/csr/csr_api_roam.c b/core/sme/src/csr/csr_api_roam.c index 203e5f2f025c..f00c8f4f2aa4 100644 --- a/core/sme/src/csr/csr_api_roam.c +++ b/core/sme/src/csr/csr_api_roam.c @@ -4308,14 +4308,19 @@ 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. */ - if (pBssDesc->beaconInterval) + if (pBssDesc->beaconInterval) { /* Make sure it is bigger than the minimal */ pBssConfig->uJoinTimeOut = QDF_MAX(10 * pBssDesc->beaconInterval, CSR_JOIN_FAILURE_TIMEOUT_MIN); - else + /* make sure it is less than max allowed */ + pBssConfig->uJoinTimeOut = + QDF_MIN(pBssConfig->uJoinTimeOut, + WNI_CFG_JOIN_FAILURE_TIMEOUT_STAMAX); + } else { pBssConfig->uJoinTimeOut = CSR_JOIN_FAILURE_TIMEOUT_DEFAULT; + } /* validate CB */ if ((pBssConfig->uCfgDot11Mode == eCSR_CFG_DOT11_MODE_11N) || (pBssConfig->uCfgDot11Mode == eCSR_CFG_DOT11_MODE_11N_ONLY) ||