summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhishek Singh <absingh@codeaurora.org>2016-10-04 12:03:18 +0530
committerAnjaneedevi Kapparapu <akappa@codeaurora.org>2016-10-14 11:48:33 +0530
commit42872bdf7d2685c71efeb42a74f1fb0539dcc3c6 (patch)
tree807b6d3ed926bc4968978112c832bc70a49e9660
parent9ed6c2cab65e0588b8bfdea5227c281e2cb0b0c5 (diff)
qcacld-2.0: Enable cfg80211 layer to control power save
prima to qcacld-2.0 propagation In PS non-offload case the "remainInPowerActiveTillDHCP" flag allows cfg80211 layer to control BMPS and it should not be modified by SME/CSR. SME/CSR use remainInPowerActiveTillDHCP to block BMPS till set key is not completed. Due to this cfg80211 layer is not in full control of BMPS. To fix this add a new variable to block BMPS until set key is done and let remainInPowerActiveTillDHCP be be controlled by cfg80211 layer based on whether DHCP in progress or not. Change-Id: I48315893a881d8da4db79a8b9366525617e8c898 CRs-Fixed: 1072635
-rw-r--r--CORE/SME/inc/pmc.h4
-rw-r--r--CORE/SME/src/csr/csrApiRoam.c13
-rw-r--r--CORE/SME/src/pmc/pmc.c12
-rw-r--r--CORE/SME/src/pmc/pmcApi.c1
-rw-r--r--CORE/SME/src/sme_common/sme_Api.c6
5 files changed, 21 insertions, 15 deletions
diff --git a/CORE/SME/inc/pmc.h b/CORE/SME/inc/pmc.h
index be81d8beee54..ef85339fc447 100644
--- a/CORE/SME/inc/pmc.h
+++ b/CORE/SME/inc/pmc.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2015 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -155,6 +155,8 @@ typedef struct sPmcInfo
tANI_BOOLEAN bmpsRequestQueued; /*If a enter BMPS request is queued*/
tANI_BOOLEAN smpsEnabled; /* TRUE if SMPS is enabled */
tANI_BOOLEAN remainInPowerActiveTillDHCP; /* Remain in Power active till DHCP completes */
+ /* Remain in Power active till set key is done */
+ bool full_power_till_set_key;
tANI_U32 remainInPowerActiveThreshold; /*Remain in Power active till DHCP threshold*/
tANI_U32 impsPeriod; /* amount of time to remain in IMPS */
void (*impsCallbackRoutine) (void *callbackContext, eHalStatus status); /* routine to call when IMPS period
diff --git a/CORE/SME/src/csr/csrApiRoam.c b/CORE/SME/src/csr/csrApiRoam.c
index 9a6139775798..86dc496f1867 100644
--- a/CORE/SME/src/csr/csrApiRoam.c
+++ b/CORE/SME/src/csr/csrApiRoam.c
@@ -5870,11 +5870,11 @@ static tANI_BOOLEAN csrRoamProcessResults( tpAniSirGlobal pMac, tSmeCmd *pComman
*/
//csrRoamStateChange( pMac, eCSR_ROAMING_STATE_JOINED );
- /* Reset remainInPowerActiveTillDHCP as it might have been set
+ /* Reset full_power_till_set_key as it might have been set
* by last failed secured connection.
* It should be set only for secured connection.
*/
- pMac->pmc.remainInPowerActiveTillDHCP = FALSE;
+ pMac->pmc.full_power_till_set_key = false;
if( CSR_IS_INFRASTRUCTURE( pProfile ) )
{
pSession->connectState = eCSR_ASSOC_STATE_TYPE_INFRA_ASSOCIATED;
@@ -6221,15 +6221,14 @@ static tANI_BOOLEAN csrRoamProcessResults( tpAniSirGlobal pMac, tSmeCmd *pComman
//enough to let security and DHCP handshake succeed before entry into BMPS
if (!pMac->psOffloadEnabled && pmcShouldBmpsTimerRun(pMac))
{
- /* Set remainInPowerActiveTillDHCP to make sure we wait for
+ /* Set full_power_till_set_key to make sure we wait for
* until keys are set before going into BMPS.
*/
if(eANI_BOOLEAN_TRUE == roamInfo.fAuthRequired)
{
- pMac->pmc.remainInPowerActiveTillDHCP = TRUE;
- smsLog(pMac, LOG1, FL("Set remainInPowerActiveTillDHCP "
- "to make sure we wait until keys are set before"
- " going to BMPS"));
+ pMac->pmc.full_power_till_set_key = true;
+ smsLog(pMac, LOG1,
+ FL("Set full_power_till_set_key to make sure we wait until keys are set before going to BMPS"));
}
if (pmcStartTrafficTimer(pMac, BMPS_TRAFFIC_TIMER_ALLOW_SECURITY_DHCP)
!= eHAL_STATUS_SUCCESS)
diff --git a/CORE/SME/src/pmc/pmc.c b/CORE/SME/src/pmc/pmc.c
index ac04c8e30ee3..dbd4df07385d 100644
--- a/CORE/SME/src/pmc/pmc.c
+++ b/CORE/SME/src/pmc/pmc.c
@@ -982,10 +982,13 @@ void pmcTrafficTimerExpired (tHalHandle hHal)
return;
}
- /* Until DHCP is not completed remain in power active */
- if(pMac->pmc.remainInPowerActiveTillDHCP)
- {
- pmcLog(pMac, LOG2, FL("BMPS Traffic Timer expired before DHCP completion ignore enter BMPS"));
+ /* Untill DHCP and set key is not completed remain in power active */
+ if (pMac->pmc.remainInPowerActiveTillDHCP ||
+ pMac->pmc.full_power_till_set_key) {
+ pmcLog(pMac, LOG2,
+ FL("BMPS Traffic Timer expired before DHCP(%d) or set key (%d) completion ignore enter BMPS"),
+ pMac->pmc.remainInPowerActiveTillDHCP,
+ pMac->pmc.full_power_till_set_key);
pMac->pmc.remainInPowerActiveThreshold++;
if( pMac->pmc.remainInPowerActiveThreshold >= DHCP_REMAIN_POWER_ACTIVE_THRESHOLD)
{
@@ -993,6 +996,7 @@ void pmcTrafficTimerExpired (tHalHandle hHal)
FL("Remain in power active DHCP threshold reached FALLBACK to enable enter BMPS"));
/*FALLBACK: reset the flag to make BMPS entry possible*/
pMac->pmc.remainInPowerActiveTillDHCP = FALSE;
+ pMac->pmc.full_power_till_set_key = false;
pMac->pmc.remainInPowerActiveThreshold = 0;
}
//Activate the Traffic Timer again for entering into BMPS
diff --git a/CORE/SME/src/pmc/pmcApi.c b/CORE/SME/src/pmc/pmcApi.c
index bfc30c9fbe40..c1f7653b2f4d 100644
--- a/CORE/SME/src/pmc/pmcApi.c
+++ b/CORE/SME/src/pmc/pmcApi.c
@@ -204,6 +204,7 @@ eHalStatus pmcStart (tHalHandle hHal)
pMac->pmc.wowlModeRequired = FALSE;
pMac->pmc.bmpsRequestedByHdd = FALSE;
pMac->pmc.remainInPowerActiveTillDHCP = FALSE;
+ pMac->pmc.full_power_till_set_key = false;
pMac->pmc.remainInPowerActiveThreshold = 0;
/* WLAN Switch initial states. */
diff --git a/CORE/SME/src/sme_common/sme_Api.c b/CORE/SME/src/sme_common/sme_Api.c
index 2f2dc164c990..b219ac87395d 100644
--- a/CORE/SME/src/sme_common/sme_Api.c
+++ b/CORE/SME/src/sme_common/sme_Api.c
@@ -5877,10 +5877,10 @@ eHalStatus sme_RoamSetKey(tHalHandle hHal, tANI_U8 sessionId, tCsrRoamSetKey *pS
smsLog(pMac, LOGE, FL("Invalid key length %d"), pSetKey->keyLength);
return eHAL_STATUS_FAILURE;
}
- /*Once Setkey is done, we can go in BMPS*/
+ /*Once Setkey is done, we can go in BMPS */
if(pSetKey->keyLength) {
- pMac->pmc.remainInPowerActiveTillDHCP = FALSE;
- smsLog(pMac, LOG1, FL("Reset remainInPowerActiveTillDHCP"
+ pMac->pmc.full_power_till_set_key = false;
+ smsLog(pMac, LOG1, FL("Reset full_power_till_set_key"
" to allow BMPS"));
}