From ac57007ff5ff618e30b13ea558953f80dc3223ae Mon Sep 17 00:00:00 2001 From: Ganesh Kondabattini Date: Wed, 21 Dec 2016 12:45:48 +0530 Subject: [PATCH] qcacld-3.0: use tdls_frm_session_id while sending resp to sme This change addresses below two issues. 1) pe session entry may not exist in some cases where PE receives ack cnf after deleting the pe session. So use "lim.tdls_frm_session_id" instead of peSessionId while sending the tdls mgmt frames. 2) PE sends eWNI_SME_TDLS_SEND_MGMT_RSP with failure status to SME if mgmt tx fails before calling WDA_TxPacket. But SME is ignoring this failure and not indicating ack conf failure to HDD. Change-Id: I089be87fef71ebfb0327c47a301aaf5ede59d031 CRs-Fixed: 887676 --- core/mac/src/pe/lim/lim_process_tdls.c | 27 +++++++------------ .../src/pe/lim/lim_send_sme_rsp_messages.c | 5 ++-- core/mac/src/pe/lim/lim_types.h | 6 +++-- core/sme/src/csr/csr_tdls_process.c | 17 +++++++++++- 4 files changed, 32 insertions(+), 23 deletions(-) diff --git a/core/mac/src/pe/lim/lim_process_tdls.c b/core/mac/src/pe/lim/lim_process_tdls.c index 1a5d46f3ac1f..ea040820f5f2 100644 --- a/core/mac/src/pe/lim/lim_process_tdls.c +++ b/core/mac/src/pe/lim/lim_process_tdls.c @@ -515,24 +515,15 @@ static QDF_STATUS lim_mgmt_tdls_tx_complete(void *context, uint32_t tx_complete, void *params) { - tpPESession session_entry = NULL; tpAniSirGlobal mac_ctx = (tpAniSirGlobal)context; lim_log(mac_ctx, LOG1, FL("tdls_frm_session_id %x tx_complete %x"), mac_ctx->lim.tdls_frm_session_id, tx_complete); if (NO_SESSION != mac_ctx->lim.tdls_frm_session_id) { - session_entry = pe_find_session_by_session_id(mac_ctx, - mac_ctx->lim.tdls_frm_session_id); - if (!session_entry) { - lim_log(mac_ctx, LOGE, FL("session id %d is not found"), - mac_ctx->lim.tdls_frm_session_id); - if (buf) - qdf_nbuf_free(buf); - return QDF_STATUS_E_FAILURE; - } - lim_send_sme_mgmt_tx_completion(mac_ctx, session_entry, - tx_complete); + lim_send_sme_mgmt_tx_completion(mac_ctx, + mac_ctx->lim.tdls_frm_session_id, + tx_complete); mac_ctx->lim.tdls_frm_session_id = NO_SESSION; } @@ -711,7 +702,7 @@ static tSirRetStatus lim_send_tdls_dis_req_frame(tpAniSirGlobal pMac, lim_trace_tdls_action_string(SIR_MAC_TDLS_DIS_REQ), MAC_ADDR_ARRAY(peer_mac.bytes)); - pMac->lim.tdls_frm_session_id = psessionEntry->peSessionId; + pMac->lim.tdls_frm_session_id = psessionEntry->smeSessionId; qdf_status = wma_tx_frameWithTxComplete(pMac, pPacket, (uint16_t) nBytes, TXRX_FRM_802_11_DATA, @@ -1031,7 +1022,7 @@ static tSirRetStatus lim_send_tdls_dis_rsp_frame(tpAniSirGlobal pMac, lim_trace_tdls_action_string(SIR_MAC_TDLS_DIS_RSP), MAC_ADDR_ARRAY(peer_mac.bytes)); - pMac->lim.tdls_frm_session_id = psessionEntry->peSessionId; + pMac->lim.tdls_frm_session_id = psessionEntry->smeSessionId; /* * Transmit Discovery response and watch if this is delivered to * peer STA. @@ -1425,7 +1416,7 @@ tSirRetStatus lim_send_tdls_link_setup_req_frame(tpAniSirGlobal pMac, lim_trace_tdls_action_string(SIR_MAC_TDLS_SETUP_REQ), MAC_ADDR_ARRAY(peer_mac.bytes)); - pMac->lim.tdls_frm_session_id = psessionEntry->peSessionId; + pMac->lim.tdls_frm_session_id = psessionEntry->smeSessionId; qdf_status = wma_tx_frame_with_tx_complete_send(pMac, pPacket, (uint16_t) nBytes, @@ -1635,7 +1626,7 @@ tSirRetStatus lim_send_tdls_teardown_frame(tpAniSirGlobal pMac, "DIRECT"), MAC_ADDR_ARRAY(peer_mac.bytes)); - pMac->lim.tdls_frm_session_id = psessionEntry->peSessionId; + pMac->lim.tdls_frm_session_id = psessionEntry->smeSessionId; qdf_status = wma_tx_frame_with_tx_complete_send(pMac, pPacket, (uint16_t) nBytes, @@ -1913,7 +1904,7 @@ static tSirRetStatus lim_send_tdls_setup_rsp_frame(tpAniSirGlobal pMac, lim_trace_tdls_action_string(SIR_MAC_TDLS_SETUP_RSP), MAC_ADDR_ARRAY(peer_mac.bytes)); - pMac->lim.tdls_frm_session_id = psessionEntry->peSessionId; + pMac->lim.tdls_frm_session_id = psessionEntry->smeSessionId; qdf_status = wma_tx_frame_with_tx_complete_send(pMac, pPacket, (uint16_t) nBytes, @@ -2130,7 +2121,7 @@ tSirRetStatus lim_send_tdls_link_setup_cnf_frame(tpAniSirGlobal pMac, lim_trace_tdls_action_string(SIR_MAC_TDLS_SETUP_CNF), MAC_ADDR_ARRAY(peer_mac.bytes)); - pMac->lim.tdls_frm_session_id = psessionEntry->peSessionId; + pMac->lim.tdls_frm_session_id = psessionEntry->smeSessionId; qdf_status = wma_tx_frame_with_tx_complete_send(pMac, pPacket, (uint16_t) nBytes, diff --git a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c index 146bfb1ccce4..b3dadbae8415 100644 --- a/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c +++ b/core/mac/src/pe/lim/lim_send_sme_rsp_messages.c @@ -1277,7 +1277,8 @@ lim_send_sme_tdls_delete_all_peer_ind(tpAniSirGlobal pMac, tpPESession psessionE */ void lim_send_sme_mgmt_tx_completion(tpAniSirGlobal pMac, - tpPESession psessionEntry, uint32_t txCompleteStatus) + uint32_t sme_session_id, + uint32_t txCompleteStatus) { struct scheduler_msg mmhMsg; tSirMgmtTxCompletionInd *pSirMgmtTxCompletionInd; @@ -1296,7 +1297,7 @@ lim_send_sme_mgmt_tx_completion(tpAniSirGlobal pMac, pSirMgmtTxCompletionInd->length = sizeof(tSirMgmtTxCompletionInd); /* sessionId */ - pSirMgmtTxCompletionInd->sessionId = psessionEntry->smeSessionId; + pSirMgmtTxCompletionInd->sessionId = sme_session_id; pSirMgmtTxCompletionInd->txCompleteStatus = txCompleteStatus; diff --git a/core/mac/src/pe/lim/lim_types.h b/core/mac/src/pe/lim/lim_types.h index e7fc7d407a55..df6e7423853b 100644 --- a/core/mac/src/pe/lim/lim_types.h +++ b/core/mac/src/pe/lim/lim_types.h @@ -546,8 +546,10 @@ tSirRetStatus lim_process_sme_tdls_del_sta_req(tpAniSirGlobal pMac, uint32_t *pMsgBuf); void lim_send_sme_tdls_delete_all_peer_ind(tpAniSirGlobal pMac, tpPESession psessionEntry); -void lim_send_sme_mgmt_tx_completion(tpAniSirGlobal pMac, tpPESession psessionEntry, - uint32_t txCompleteStatus); +void lim_send_sme_mgmt_tx_completion( + tpAniSirGlobal pMac, + uint32_t sme_session_id, + uint32_t txCompleteStatus); tSirRetStatus lim_delete_tdls_peers(tpAniSirGlobal mac_ctx, tpPESession session_entry); QDF_STATUS lim_process_tdls_add_sta_rsp(tpAniSirGlobal pMac, void *msg, tpPESession); diff --git a/core/sme/src/csr/csr_tdls_process.c b/core/sme/src/csr/csr_tdls_process.c index 4b601d9a28f9..bc9540701575 100644 --- a/core/sme/src/csr/csr_tdls_process.c +++ b/core/sme/src/csr/csr_tdls_process.c @@ -702,13 +702,28 @@ QDF_STATUS tdls_msg_processor(tpAniSirGlobal pMac, uint16_t msgType, switch (msgType) { case eWNI_SME_TDLS_SEND_MGMT_RSP: + { + tSirSmeRsp *msg = (tSirSmeRsp *) pMsgBuf; + tCsrRoamInfo roam_info = {0}; + /* remove pending eSmeCommandTdlsDiscovery command */ QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_INFO, FL("sme_rsp->sessionId[%d] eSmeCommandTdlsSendMgmt"), sme_rsp->sessionId); csr_tdls_remove_sme_cmd(pMac, eSmeCommandTdlsSendMgmt, - sme_rsp->sessionId); + sme_rsp->sessionId); + + if (eSIR_SME_SUCCESS != msg->statusCode) { + /* Tx failed, so there wont be any ack confirmation*/ + /* Indicate ack failure to upper layer */ + roamInfo.reasonCode = 0; + csr_roam_call_callback(pMac, msg->sessionId, + &roam_info, 0, + eCSR_ROAM_RESULT_MGMT_TX_COMPLETE_IND, + 0); + } break; + } case eWNI_SME_TDLS_ADD_STA_RSP: qdf_copy_macaddr(&roamInfo.peerMac, &addStaRsp->peermac); roamInfo.staId = addStaRsp->staId;