Prechádzať zdrojové kódy

Merge "qcacld-3.0: use tdls_frm_session_id while sending resp to sme" into wlan-cld3.driver.lnx.2.0-dev

Service qcabuildsw 8 rokov pred
rodič
commit
81f693d6df

+ 9 - 18
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,

+ 3 - 2
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;
 

+ 4 - 2
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);

+ 16 - 1
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;