Kaynağa Gözat

qcacld-3.0: Maintain session id for TDLS functionality in lim struct

qcacld-2.0 to qcacld-3.0 propagation

Currently, since we are using same member from lim structure for p2p and
TDLS there could be possibilities that session id is overwritten
by p2p which would lead in not sending Tx completion indication from
lim to hdd thus leading to Tx timeout though we have received tx completion
indication from FW.

Fix is to create new session id for TDLS frames transmission

Change-Id: I1f78f24ac01e0b26c92238dbe831af88aa267bd5
CRs-Fixed: 991455
Masti, Narayanraddi 8 yıl önce
ebeveyn
işleme
6319f063aa

+ 3 - 3
core/hdd/src/wlan_hdd_tdls.c

@@ -4057,9 +4057,9 @@ static int __wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy,
 					 msecs_to_jiffies(WAIT_TIME_TDLS_MGMT));
 
 	if ((0 == rc) || (true != pAdapter->mgmtTxCompletionStatus)) {
-		QDF_TRACE(QDF_MODULE_ID_HDD, QDF_TRACE_LEVEL_ERROR,
-			  "%s: Mgmt Tx Completion timed out TxCompletion %u",
-			  __func__, pAdapter->mgmtTxCompletionStatus);
+		hdd_err("%s rc %ld mgmtTxCompletionStatus %u",
+			!rc ? "Mgmt Tx Completion timed out" : "Mgmt Tx Completion failed",
+			rc, pAdapter->mgmtTxCompletionStatus);
 
 		if (cds_is_driver_recovering()) {
 			hdd_err("Recovery in Progress. State: 0x%x Ignore!!!",

+ 1 - 0
core/mac/inc/ani_global.h

@@ -815,6 +815,7 @@ typedef struct sAniSirLim {
 	qdf_mutex_t lim_frame_register_lock;
 	qdf_list_t gLimMgmtFrameRegistratinQueue;
 	uint32_t mgmtFrameSessionId;
+	uint32_t tdls_frm_session_id;
 
 	tpPESession pSessionEntry;
 	uint8_t reAssocRetryAttempt;

+ 1 - 0
core/mac/src/pe/lim/lim_api.c

@@ -726,6 +726,7 @@ tSirRetStatus pe_open(tpAniSirGlobal pMac, struct cds_config_info *cds_cfg)
 		    sizeof(tPESession) * pMac->lim.maxBssId, 0);
 
 	pMac->lim.mgmtFrameSessionId = 0xff;
+	pMac->lim.tdls_frm_session_id = NO_SESSION;
 	pMac->lim.deferredMsgCnt = 0;
 
 	if (!QDF_IS_STATUS_SUCCESS(qdf_mutex_create(&pMac->lim.lkPeGlobalLock))) {

+ 40 - 31
core/mac/src/pe/lim/lim_process_tdls.c

@@ -318,25 +318,34 @@ static uint32_t lim_prepare_tdls_frame_header(tpAniSirGlobal pMac, uint8_t *pFra
 	return header_offset;
 }
 
-/*
- * TX Complete for Management frames
+/**
+ * lim_mgmt_tdls_tx_complete - callback to indicate Tx completion
+ * @mac_ctx: pointer to mac structure
+ * @tx_complete: indicates tx sucess/failure
+ *
+ * function will be invoked on receiving tx completion indication
+ *
+ * return: success: eHAL_STATUS_SUCCESS failure: eHAL_STATUS_FAILURE
  */
-QDF_STATUS lim_mgmt_tx_complete(tpAniSirGlobal pMac, uint32_t txCompleteSuccess)
+QDF_STATUS lim_mgmt_tdls_tx_complete(tpAniSirGlobal mac_ctx,
+				     uint32_t tx_complete)
 {
-	tpPESession psessionEntry = NULL;
-
-	if (0xff != pMac->lim.mgmtFrameSessionId) {
-		psessionEntry =
-			pe_find_session_by_session_id(pMac,
-						      pMac->lim.mgmtFrameSessionId);
-		if (NULL == psessionEntry) {
-			lim_log(pMac, LOGE, FL("sessionID %d is not found"),
-				pMac->lim.mgmtFrameSessionId);
+	tpPESession session_entry = NULL;
+
+	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);
 			return QDF_STATUS_E_FAILURE;
 		}
-		lim_send_sme_mgmt_tx_completion(pMac, psessionEntry,
-						txCompleteSuccess);
-		pMac->lim.mgmtFrameSessionId = 0xff;
+		lim_send_sme_mgmt_tx_completion(mac_ctx, session_entry,
+						tx_complete);
+		mac_ctx->lim.tdls_frm_session_id = NO_SESSION;
 	}
 	return QDF_STATUS_SUCCESS;
 }
@@ -510,17 +519,17 @@ 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.mgmtFrameSessionId = psessionEntry->peSessionId;
+	pMac->lim.tdls_frm_session_id = psessionEntry->peSessionId;
 	qdf_status = wma_tx_frameWithTxComplete(pMac, pPacket, (uint16_t) nBytes,
 					      TXRX_FRM_802_11_DATA,
 					      ANI_TXDIR_TODS,
 					      TID_AC_VI,
 					      lim_tx_complete, pFrame,
-					      lim_mgmt_tx_complete,
+					      lim_mgmt_tdls_tx_complete,
 					      HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME,
 					      smeSessionId, false, 0);
 	if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
-		pMac->lim.mgmtFrameSessionId = 0xff;
+		pMac->lim.tdls_frm_session_id = NO_SESSION;
 		lim_log(pMac, LOGE,
 			FL("could not send TDLS Discovery Request frame"));
 		return eSIR_FAILURE;
@@ -827,7 +836,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.mgmtFrameSessionId = psessionEntry->peSessionId;
+	pMac->lim.tdls_frm_session_id = psessionEntry->peSessionId;
 	/*
 	 * Transmit Discovery response and watch if this is delivered to
 	 * peer STA.
@@ -841,11 +850,11 @@ static tSirRetStatus lim_send_tdls_dis_rsp_frame(tpAniSirGlobal pMac,
 					      ANI_TXDIR_IBSS,
 					      0,
 					      lim_tx_complete, pFrame,
-					      lim_mgmt_tx_complete,
+					      lim_mgmt_tdls_tx_complete,
 					      HAL_USE_SELF_STA_REQUESTED_MASK,
 					      smeSessionId, false, 0);
 	if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
-		pMac->lim.mgmtFrameSessionId = 0xff;
+		pMac->lim.tdls_frm_session_id = NO_SESSION;
 		lim_log(pMac, LOGE,
 			FL("could not send TDLS Discovery Response frame!"));
 		return eSIR_FAILURE;
@@ -924,7 +933,7 @@ wma_tx_frame_with_tx_complete_send(tpAniSirGlobal pMac, void *pPacket,
 					  ANI_TXDIR_TODS,
 					  tid,
 					  lim_tx_complete, pFrame,
-					  lim_mgmt_tx_complete,
+					  lim_mgmt_tdls_tx_complete,
 					  HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME,
 					  smeSessionId, flag, 0);
 }
@@ -943,7 +952,7 @@ wma_tx_frame_with_tx_complete_send(tpAniSirGlobal pMac, void *pPacket,
 					  ANI_TXDIR_TODS,
 					  tid,
 					  lim_tx_complete, pFrame,
-					  lim_mgmt_tx_complete,
+					  lim_mgmt_tdls_tx_complete,
 					  HAL_USE_BD_RATE2_FOR_MANAGEMENT_FRAME,
 					  smeSessionId, false, 0);
 }
@@ -1208,7 +1217,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.mgmtFrameSessionId = psessionEntry->peSessionId;
+	pMac->lim.tdls_frm_session_id = psessionEntry->peSessionId;
 
 	qdf_status = wma_tx_frame_with_tx_complete_send(pMac, pPacket,
 						     (uint16_t) nBytes,
@@ -1217,7 +1226,7 @@ tSirRetStatus lim_send_tdls_link_setup_req_frame(tpAniSirGlobal pMac,
 						     smeSessionId, true);
 
 	if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
-		pMac->lim.mgmtFrameSessionId = 0xff;
+		pMac->lim.tdls_frm_session_id = NO_SESSION;
 		lim_log(pMac, LOGE,
 			FL("could not send TDLS Setup Request frame!"));
 		return eSIR_FAILURE;
@@ -1407,7 +1416,7 @@ tSirRetStatus lim_send_tdls_teardown_frame(tpAniSirGlobal pMac,
 		    "DIRECT"),
 		MAC_ADDR_ARRAY(peer_mac.bytes));
 
-	pMac->lim.mgmtFrameSessionId = psessionEntry->peSessionId;
+	pMac->lim.tdls_frm_session_id = psessionEntry->peSessionId;
 
 	qdf_status = wma_tx_frame_with_tx_complete_send(pMac, pPacket,
 						     (uint16_t) nBytes,
@@ -1418,7 +1427,7 @@ tSirRetStatus lim_send_tdls_teardown_frame(tpAniSirGlobal pMac,
 						     ? true : false);
 
 	if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
-		pMac->lim.mgmtFrameSessionId = 0xff;
+		pMac->lim.tdls_frm_session_id = NO_SESSION;
 		lim_log(pMac, LOGE,
 			FL("could not send TDLS Teardown frame"));
 		return eSIR_FAILURE;
@@ -1684,7 +1693,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.mgmtFrameSessionId = psessionEntry->peSessionId;
+	pMac->lim.tdls_frm_session_id = psessionEntry->peSessionId;
 
 	qdf_status = wma_tx_frame_with_tx_complete_send(pMac, pPacket,
 						     (uint16_t) nBytes,
@@ -1693,7 +1702,7 @@ static tSirRetStatus lim_send_tdls_setup_rsp_frame(tpAniSirGlobal pMac,
 						     smeSessionId, true);
 
 	if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
-		pMac->lim.mgmtFrameSessionId = 0xff;
+		pMac->lim.tdls_frm_session_id = NO_SESSION;
 		lim_log(pMac, LOGE,
 			FL("could not send TDLS Dis Request frame!"));
 		return eSIR_FAILURE;
@@ -1901,7 +1910,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.mgmtFrameSessionId = psessionEntry->peSessionId;
+	pMac->lim.tdls_frm_session_id = psessionEntry->peSessionId;
 
 	qdf_status = wma_tx_frame_with_tx_complete_send(pMac, pPacket,
 						     (uint16_t) nBytes,
@@ -1910,7 +1919,7 @@ tSirRetStatus lim_send_tdls_link_setup_cnf_frame(tpAniSirGlobal pMac,
 						     smeSessionId, true);
 
 	if (!QDF_IS_STATUS_SUCCESS(qdf_status)) {
-		pMac->lim.mgmtFrameSessionId = 0xff;
+		pMac->lim.tdls_frm_session_id = NO_SESSION;
 		lim_log(pMac, LOGE,
 			FL("could not send TDLS Setup Confirm frame"));
 		return eSIR_FAILURE;