summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhishek Singh <absingh@qti.qualcomm.com>2016-06-28 13:52:53 +0530
committerAnjaneedevi Kapparapu <akappa@codeaurora.org>2016-07-01 11:54:20 +0530
commita586875ef58dbe7a3fce66b7bea6f677c5c971b5 (patch)
tree23d4fba5b89f7dbf2cf1a151ec6f4cf31d0a9976
parentb3be607829c9edac382eb48bb258c65143fdf42e (diff)
qcacld-2.0: Avoid sending P2P action frame confirmation twice
P2P action frame confirmation can be called from work queue wma_mgmt_tx_ack_work_handler as well as from MC thread during remain on channel completion. So it can lead to race condition where frame confirmation is called twice and driver tries to free frame buffer twice. To avoid this use PE global lock to detected duplicate call for P2P action frame confirmation. Change-Id: Id193b5a979fad5effa7c6b00d89452ad876ae00e CRs-Fixed: 1035077
-rw-r--r--CORE/MAC/src/pe/lim/limP2P.c36
1 files changed, 27 insertions, 9 deletions
diff --git a/CORE/MAC/src/pe/lim/limP2P.c b/CORE/MAC/src/pe/lim/limP2P.c
index 832d907ca940..0bbb9c397802 100644
--- a/CORE/MAC/src/pe/lim/limP2P.c
+++ b/CORE/MAC/src/pe/lim/limP2P.c
@@ -717,20 +717,38 @@ send_frame:
return;
} /*** end limSendSmeListenRsp() ***/
-
+/**
+ * limP2PActionCnf() - handle P2P Action frame confirmation
+ * @pMac: mac context
+ * @txCompleteSuccess: P2P Action frame status
+ *
+ * Return: 0 on success or error code on failure
+ */
eHalStatus limP2PActionCnf(tpAniSirGlobal pMac, tANI_U32 txCompleteSuccess)
{
- if (pMac->lim.mgmtFrameSessionId != 0xff)
- {
- /* The session entry might be invalid(0xff) action confirmation received after
- * remain on channel timer expired */
- if (pMac->p2p_ack_ind_cb)
- pMac->p2p_ack_ind_cb(pMac->lim.mgmtFrameSessionId,
- txCompleteSuccess);
+ eHalStatus status;
+ uint32_t mgmt_frame_sessionId;
+
+ status = pe_AcquireGlobalLock(&pMac->lim);
+ if (HAL_STATUS_SUCCESS(status)) {
+ mgmt_frame_sessionId = pMac->lim.mgmtFrameSessionId;
pMac->lim.mgmtFrameSessionId = 0xff;
+ pe_ReleaseGlobalLock(&pMac->lim);
+ if (mgmt_frame_sessionId != 0xff) {
+ /*
+ * The session entry might be invalid(0xff)
+ * action confirmation received after
+ * remain on channel timer expired
+ */
+ limLog(pMac, LOG1,
+ FL("mgmt_frame_sessionId %d"), mgmt_frame_sessionId);
+ if (pMac->p2p_ack_ind_cb)
+ pMac->p2p_ack_ind_cb(mgmt_frame_sessionId,
+ txCompleteSuccess);
+ }
}
- return eHAL_STATUS_SUCCESS;
+ return status;
}