Browse Source

qcacld-3.0: Fix non-scan active queue stuck issue

1\ The command content is wrongly reset and cause
   the corresponding command could not find from the
   active queue.
2\ It should release the command in time before issue
   the next command.

Change-Id: I094a6ce0e34f4698222d85a785cb6424852e25f8
CRs-Fixed: 2144630
Paul Zhang 7 years ago
parent
commit
4362697ced

+ 1 - 1
core/sme/src/csr/csr_api_roam.c

@@ -8257,7 +8257,7 @@ QDF_STATUS csr_dequeue_roam_command(tpAniSirGlobal pMac,
 				pCommand->u.roamCmd.roamReason);
 			if (csr_nonscan_active_ll_remove_entry(pMac, pEntry,
 				    LL_ACCESS_LOCK)) {
-				csr_release_command_preauth(pMac, pCommand);
+				csr_release_command(pMac, pCommand);
 			}
 		} else if ((eSmeCommandRoam == pCommand->command) &&
 			   (eCsrSmeIssuedFTReassoc == reason)) {

+ 26 - 0
core/sme/src/csr/csr_host_scan_roam.c

@@ -76,6 +76,7 @@ QDF_STATUS csr_roam_issue_reassociate_cmd(tpAniSirGlobal pMac,
 	bool fHighPriority = true;
 	bool fRemoveCmd = false;
 	tListElem *pEntry;
+	tSmeCmd *tmp_command;
 
 	pEntry = csr_nonscan_active_ll_peek_head(pMac, LL_ACCESS_LOCK);
 	if (pEntry) {
@@ -102,6 +103,31 @@ QDF_STATUS csr_roam_issue_reassociate_cmd(tpAniSirGlobal pMac,
 		return QDF_STATUS_E_RESOURCES;
 	}
 	do {
+		/*
+		 * Get a new sme command to save the necessary info for
+		 * the following roaming process, such as BSS list and
+		 * roam profile. Or those info will be freed in function
+		 * csr_reinit_roam_cmd when releasing the current command.
+		 */
+		tmp_command = csr_get_command_buffer(pMac);
+		if (tmp_command == NULL) {
+			sme_err("fail to get cmd buf!");
+			csr_release_command(pMac, pCommand);
+			return QDF_STATUS_E_RESOURCES;
+		}
+		qdf_mem_copy(tmp_command, pCommand, sizeof(*pCommand));
+		pCommand->u.roamCmd.fReleaseBssList = false;
+		pCommand->u.roamCmd.hBSSList = CSR_INVALID_SCANRESULT_HANDLE;
+		pCommand->u.roamCmd.fReleaseProfile = false;
+		/*
+		 * Invoking csr_release_command to release the current command
+		 * or the following command will be stuck in pending queue.
+		 * Because the API csr_nonscan_active_ll_remove_entry does
+		 * not remove the current command from active queue.
+		 */
+		csr_release_command(pMac, pCommand);
+
+		pCommand = tmp_command;
 		/* Change the substate in case it is wait-for-key */
 		if (CSR_IS_WAIT_FOR_KEY(pMac, sessionId)) {
 			csr_roam_stop_wait_for_key_timer(pMac);

+ 0 - 4
core/sme/src/csr/csr_inside_api.h

@@ -1033,14 +1033,10 @@ csr_send_chng_mcc_beacon_interval(tpAniSirGlobal pMac, uint32_t sessionId);
 #ifdef WLAN_FEATURE_HOST_ROAM
 void csr_roam_ft_pre_auth_rsp_processor(tHalHandle hHal,
 		tpSirFTPreAuthRsp pFTPreAuthRsp);
-void csr_release_command_preauth(tpAniSirGlobal mac_ctx, tSmeCmd *command);
 #else
 static inline void csr_roam_ft_pre_auth_rsp_processor(tHalHandle hHal,
 		tpSirFTPreAuthRsp pFTPreAuthRsp)
 {}
-static inline void csr_release_command_preauth(tpAniSirGlobal mac_ctx,
-		tSmeCmd *command)
-{}
 #endif
 
 #if defined(FEATURE_WLAN_ESE)

+ 2 - 14
core/sme/src/csr/csr_roam_preauth.c

@@ -119,19 +119,6 @@ static void csr_reinit_preauth_cmd(tpAniSirGlobal mac_ctx, tSmeCmd *command)
 	qdf_mem_set(&command->u.roamCmd, sizeof(struct roam_cmd), 0);
 }
 
-/**
- * csr_release_command_preauth() - Release the preauth command
- * @mac_ctx: Global MAC context
- * @command: Command to be released
- *
- * Return: None
- */
-void csr_release_command_preauth(tpAniSirGlobal mac_ctx, tSmeCmd *command)
-{
-	csr_reinit_preauth_cmd(mac_ctx, command);
-	csr_release_command(mac_ctx, command);
-}
-
 /**
  * csr_roam_enqueue_preauth() - Put the preauth command in the queue
  * @mac_ctx: Global MAC Context
@@ -161,10 +148,11 @@ QDF_STATUS csr_roam_enqueue_preauth(tpAniSirGlobal mac_ctx,
 			command->u.roamCmd.pLastRoamBss = bss_desc;
 			status = csr_queue_sme_command(mac_ctx, command,
 					immediate);
-			if (!QDF_IS_STATUS_SUCCESS(status))
+			if (!QDF_IS_STATUS_SUCCESS(status)) {
 				sme_err("fail to queue preauth,status: %d",
 					status);
 				csr_reinit_preauth_cmd(mac_ctx, command);
+			}
 		} else {
 			status = QDF_STATUS_E_RESOURCES;
 		}