summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhishek Singh <absingh@qti.qualcomm.com>2016-08-01 18:13:16 +0530
committerAnjaneedevi Kapparapu <akappa@codeaurora.org>2016-08-03 14:17:19 +0530
commit35dc2d5377502e27f05c46cce06aa9feb2adefb3 (patch)
tree6a34ecdfffd31c7a814e5cc1939c7eb8d4b3a61a
parent1b3fe27f3919d12ad08080dcc9c97612df9e4b02 (diff)
qcacld-2.0: Trigger bug report and SSR if stale PE session in present
If stale PE session is present during join and rejoin request, then trigger bug report and SSR. Change-Id: I0f6bd3996959184daa4672adb82f33a67c9b134f CRs-Fixed: 1049113
-rw-r--r--CORE/MAC/inc/aniGlobal.h1
-rw-r--r--CORE/MAC/src/pe/include/limSession.h2
-rw-r--r--CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c28
-rw-r--r--CORE/MAC/src/pe/lim/limSession.c28
-rw-r--r--CORE/VOSS/src/vos_api.c3
5 files changed, 60 insertions, 2 deletions
diff --git a/CORE/MAC/inc/aniGlobal.h b/CORE/MAC/inc/aniGlobal.h
index fb9fd50b78d3..ebeaa6c62656 100644
--- a/CORE/MAC/inc/aniGlobal.h
+++ b/CORE/MAC/inc/aniGlobal.h
@@ -237,6 +237,7 @@ enum log_event_host_reason_code {
WLAN_LOG_REASON_MGMT_FRAME_TIMEOUT,
WLAN_LOG_REASON_SME_OUT_OF_CMD_BUF,
WLAN_LOG_REASON_NO_SCAN_RESULTS,
+ WLAN_LOG_REASON_STALE_SESSION_FOUND,
};
diff --git a/CORE/MAC/src/pe/include/limSession.h b/CORE/MAC/src/pe/include/limSession.h
index b085edb4f27f..e55e4dcec6d0 100644
--- a/CORE/MAC/src/pe/include/limSession.h
+++ b/CORE/MAC/src/pe/include/limSession.h
@@ -648,6 +648,8 @@ void peDeleteSession(tpAniSirGlobal pMac, tpPESession psessionEntry);
*/
tpPESession pe_find_session_by_sme_session_id(tpAniSirGlobal mac_ctx,
uint8_t sme_session_id);
+uint8_t pe_count_session_with_sme_session_id(tpAniSirGlobal mac_ctx,
+ uint8_t sme_session_id);
int pe_get_active_session_count(tpAniSirGlobal mac_ctx);
#endif //#if !defined( __LIM_SESSION_H )
diff --git a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
index 7b8b8dc4ea68..9d6f7f4f2330 100644
--- a/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
+++ b/CORE/MAC/src/pe/lim/limProcessSmeReqMessages.c
@@ -1912,8 +1912,19 @@ __limProcessSmeJoinReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf)
*/
lim_update_rrm_capability(pMac, pSmeJoinReq);
- /* check for the existence of start BSS session */
+ if (pe_find_session_by_sme_session_id(pMac, pSmeJoinReq->sessionId)) {
+ limLog(pMac, LOGE,
+ FL("A session already exist for the SME session %d"),
+ pSmeJoinReq->sessionId);
+ vos_flush_logs(WLAN_LOG_TYPE_FATAL,
+ WLAN_LOG_INDICATOR_HOST_DRIVER,
+ WLAN_LOG_REASON_STALE_SESSION_FOUND,
+ true);
+ retCode = eSIR_SME_REFUSED;
+ goto end;
+ }
+ /* check for the existence of start BSS session */
if((psessionEntry = peFindSessionByBssid(pMac,pSmeJoinReq->bssDescription.bssId,&sessionId)) != NULL)
{
limLog(pMac, LOGE, FL("Session(%d) Already exists for BSSID: "
@@ -2417,6 +2428,7 @@ __limProcessSmeReassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf)
tpPESession psessionEntry = NULL;
tANI_U8 sessionId;
tANI_U8 smeSessionId;
+ uint8_t no_of_sessions;
tANI_U16 transactionId;
tPowerdBm localPowerConstraint = 0, regMax = 0;
tANI_U32 teleBcnEn = 0;
@@ -2451,6 +2463,20 @@ __limProcessSmeReassocReq(tpAniSirGlobal pMac, tANI_U32 *pMsgBuf)
goto end;
}
+ no_of_sessions =
+ pe_count_session_with_sme_session_id(pMac, pReassocReq->sessionId);
+ if (no_of_sessions > 1) {
+ limLog(pMac, LOGE,
+ FL("%d sessions exist for the SME session %d"),
+ no_of_sessions, pReassocReq->sessionId);
+ vos_flush_logs(WLAN_LOG_TYPE_FATAL,
+ WLAN_LOG_INDICATOR_HOST_DRIVER,
+ WLAN_LOG_REASON_STALE_SESSION_FOUND,
+ true);
+ retCode = eSIR_SME_REFUSED;
+ goto end;
+ }
+
if((psessionEntry = peFindSessionByBssid(pMac,pReassocReq->bssDescription.bssId,&sessionId))==NULL)
{
limLog(pMac, LOGE, FL("Session does not exist for given bssId"));
diff --git a/CORE/MAC/src/pe/lim/limSession.c b/CORE/MAC/src/pe/lim/limSession.c
index 9a5096a195b6..fc13b7e2e802 100644
--- a/CORE/MAC/src/pe/lim/limSession.c
+++ b/CORE/MAC/src/pe/lim/limSession.c
@@ -516,6 +516,34 @@ tpPESession pe_find_session_by_sme_session_id(tpAniSirGlobal mac_ctx,
return NULL;
}
+/**
+ * pe_count_session_with_sme_session_id() - count PE sessions for given sme
+ * session id
+ * @mac_ctx: pointer to global adapter context
+ * @sme_session_id: sme session id
+ *
+ * count PE sessions for given sme session id
+ *
+ * Return: number of pe session entry for given sme session
+ */
+uint8_t pe_count_session_with_sme_session_id(tpAniSirGlobal mac_ctx,
+ uint8_t sme_session_id)
+{
+ uint8_t i, count = 0;
+ for (i = 0; i < mac_ctx->lim.maxBssId; i++) {
+ if ((mac_ctx->lim.gpSession[i].valid) &&
+ (mac_ctx->lim.gpSession[i].smeSessionId ==
+ sme_session_id)) {
+ count++;
+ }
+ }
+ limLog(mac_ctx, LOG4,
+ FL("%d sessions found for smeSessionID: %d"),
+ count, sme_session_id);
+ return count;
+}
+
+
/*--------------------------------------------------------------------------
\brief peFindSessionBySessionId() - looks up the PE session given the session ID.
diff --git a/CORE/VOSS/src/vos_api.c b/CORE/VOSS/src/vos_api.c
index 110f106d328d..de027652b253 100644
--- a/CORE/VOSS/src/vos_api.c
+++ b/CORE/VOSS/src/vos_api.c
@@ -2764,7 +2764,8 @@ void vos_get_log_and_reset_completion(uint32_t *is_fatal,
if ((WLAN_LOG_INDICATOR_HOST_DRIVER == *indicator) &&
((WLAN_LOG_REASON_SME_OUT_OF_CMD_BUF == *reason_code) ||
- (WLAN_LOG_REASON_SME_COMMAND_STUCK == *reason_code)))
+ (WLAN_LOG_REASON_SME_COMMAND_STUCK == *reason_code) ||
+ (WLAN_LOG_REASON_STALE_SESSION_FOUND == *reason_code)))
*is_ssr_needed = true;
else
*is_ssr_needed = false;