Pārlūkot izejas kodu

qcacld-3.0: Fix review comments provided for legacy serialization

During legacy serialization's code review, few comments were provided.
Fix them.

CRs-Fixed: 2005532
Change-Id: Id5daea23532f263aea1e1bb9c3daa4651274890f
Krunal Soni 8 gadi atpakaļ
vecāks
revīzija
d8e8e3d885

+ 1 - 1
core/sme/inc/sme_api.h

@@ -50,7 +50,7 @@
 #include "sme_rrm_internal.h"
 #include "sir_types.h"
 #include "scheduler_api.h"
-#include "wlan_serialization_api.h"
+#include "wlan_serialization_legacy_mcl_api.h"
 
 /*--------------------------------------------------------------------------
   Preprocessor definitions and constants

+ 1 - 1
core/sme/inc/sme_inside.h

@@ -48,7 +48,7 @@
 #include "sme_qos_internal.h"
 
 #include "sme_rrm_api.h"
-#include "wlan_serialization_api.h"
+#include "wlan_serialization_legacy_mcl_api.h"
 ePhyChanBondState csr_convert_cb_ini_value_to_phy_cb_state(uint32_t cbIniValue);
 
 /*--------------------------------------------------------------------------

+ 0 - 4
core/sme/inc/sme_internal.h

@@ -186,10 +186,6 @@ typedef struct tagSmeStruct {
 #ifdef FEATURE_WLAN_LPHB
 	void (*pLphbIndCb)(void *pHddCtx, tSirLPHBInd *indParam);
 #endif /* FEATURE_WLAN_LPHB */
-	/* pending scan command list */
-	tDblLinkList smeScanCmdPendingList;
-	/* active scan command list */
-	tDblLinkList smeScanCmdActiveList;
 	tSmePeerInfoHddCbkInfo peerInfoParams;
 #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
 	host_event_wlan_status_payload_type eventPayload;

+ 0 - 10
core/sme/src/common/sme_api.c

@@ -313,14 +313,6 @@ static QDF_STATUS init_sme_cmd_list(tpAniSirGlobal pMac)
 	pMac->sme.totalSmeCmd = SME_TOTAL_COMMAND;
 
 
-	status = csr_ll_open(pMac->hHdd, &pMac->sme.smeScanCmdActiveList);
-	if (!QDF_IS_STATUS_SUCCESS(status))
-		goto end;
-
-	status = csr_ll_open(pMac->hHdd, &pMac->sme.smeScanCmdPendingList);
-	if (!QDF_IS_STATUS_SUCCESS(status))
-		goto end;
-
 	status = csr_ll_open(pMac->hHdd, &pMac->sme.smeCmdFreeList);
 	if (!QDF_IS_STATUS_SUCCESS(status))
 		goto end;
@@ -385,8 +377,6 @@ static QDF_STATUS free_sme_cmd_list(tpAniSirGlobal pMac)
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 
 	purge_sme_cmd_list(pMac);
-	csr_ll_close(&pMac->sme.smeScanCmdPendingList);
-	csr_ll_close(&pMac->sme.smeScanCmdActiveList);
 	csr_ll_close(&pMac->sme.smeCmdFreeList);
 
 	status = qdf_mutex_acquire(&pMac->sme.lkSmeGlobalLock);

+ 29 - 14
core/sme/src/csr/csr_api_roam.c

@@ -5049,13 +5049,13 @@ static void csr_set_abort_roaming_command(tpAniSirGlobal pMac, tSmeCmd *pCommand
 {
 	switch (pCommand->u.roamCmd.roamReason) {
 	case eCsrLostLink1:
-		pCommand->u.roamCmd.roamReason = eCsrLostLink1Abort;
+		pCommand->u.roamCmd.roamReason = eCsrLostLink1;
 		break;
 	case eCsrLostLink2:
-		pCommand->u.roamCmd.roamReason = eCsrLostLink2Abort;
+		pCommand->u.roamCmd.roamReason = eCsrLostLink2;
 		break;
 	case eCsrLostLink3:
-		pCommand->u.roamCmd.roamReason = eCsrLostLink3Abort;
+		pCommand->u.roamCmd.roamReason = eCsrLostLink3;
 		break;
 	default:
 		sms_log(pMac, LOGE,
@@ -18238,6 +18238,7 @@ void csr_release_command_buffer(tpAniSirGlobal pMac, tSmeCmd *pCommand)
 void csr_release_command(tpAniSirGlobal mac_ctx, tSmeCmd *sme_cmd)
 {
 	struct wlan_serialization_queued_cmd_info cmd_info;
+	struct wlan_serialization_command cmd;
 
 	if (!sme_cmd) {
 		sms_log(mac_ctx, LOGE, "sme_cmd is NULL");
@@ -18260,20 +18261,30 @@ void csr_release_command(tpAniSirGlobal mac_ctx, tSmeCmd *sme_cmd)
 	cmd_info.vdev = wlan_objmgr_get_vdev_by_id_from_psoc(
 			mac_ctx->psoc, sme_cmd->sessionId,
 			WLAN_LEGACY_SME_ID);
+	qdf_mem_zero(&cmd,
+			sizeof(struct wlan_serialization_command));
+	cmd.cmd_id = cmd_info.cmd_id;
+	cmd.cmd_type = cmd_info.cmd_type;
+	cmd.vdev = cmd_info.vdev;
 	if (wlan_serialization_is_cmd_present_in_active_queue(
-				mac_ctx->psoc, &cmd_info)) {
+				mac_ctx->psoc, &cmd)) {
 		sms_log(mac_ctx, LOG1,
-				FL("Releasing cmd from active queue"));
+				FL("Releasing active cmd_id[%d] cmd_type[%d]"),
+				cmd_info.cmd_id, cmd_info.cmd_type);
 		wlan_serialization_remove_cmd(&cmd_info);
 	} else if (wlan_serialization_is_cmd_present_in_pending_queue(
-				mac_ctx->psoc, &cmd_info)) {
+				mac_ctx->psoc, &cmd)) {
 		sms_log(mac_ctx, LOG1,
-				FL("Releasing cmd from pending queue"));
+				FL("Releasing pending cmd_id[%d] cmd_type[%d]"),
+				cmd_info.cmd_id, cmd_info.cmd_type);
 		wlan_serialization_cancel_request(&cmd_info);
 	} else {
 		sms_log(mac_ctx, LOG1,
-				FL("Can't find in any queue, its ok"));
+				FL("can't find cmd_id[%d] cmd_type[%d]"),
+				cmd_info.cmd_id, cmd_info.cmd_type);
 	}
+	if (cmd_info.vdev)
+		wlan_objmgr_vdev_release_ref(cmd_info.vdev, WLAN_LEGACY_SME_ID);
 }
 
 static enum wlan_serialization_cmd_type csr_get_scan_cmd_type(tSmeCmd *sme_cmd)
@@ -18543,6 +18554,7 @@ QDF_STATUS csr_queue_sme_command(tpAniSirGlobal mac_ctx, tSmeCmd *sme_cmd,
 				 bool high_priority)
 {
 	struct wlan_serialization_command cmd;
+	QDF_STATUS status;
 
 	if (!SME_IS_START(mac_ctx)) {
 		sms_log(mac_ctx, LOGE, FL("Sme in stop state"));
@@ -18568,19 +18580,22 @@ QDF_STATUS csr_queue_sme_command(tpAniSirGlobal mac_ctx, tSmeCmd *sme_cmd,
 	}
 
 	qdf_mem_zero(&cmd, sizeof(struct wlan_serialization_command));
-	if (QDF_STATUS_SUCCESS ==
-			csr_set_serialization_params_to_cmd(mac_ctx, sme_cmd,
-						&cmd, high_priority)) {
+	status = csr_set_serialization_params_to_cmd(mac_ctx, sme_cmd,
+					&cmd, high_priority);
+	if (QDF_STATUS_SUCCESS == status) {
 		if (WLAN_SER_CMD_DENIED_UNSPECIFIED ==
 				wlan_serialization_request(&cmd)) {
 			sms_log(mac_ctx, LOGE, FL("failed to enq to req"));
-			return QDF_STATUS_E_FAILURE;
+			status = QDF_STATUS_E_FAILURE;
 		}
+		if (cmd.vdev)
+			wlan_objmgr_vdev_release_ref(cmd.vdev,
+						WLAN_LEGACY_SME_ID);
 	} else {
 		sms_log(mac_ctx, LOGE, FL("failed to set ser params"));
-		return QDF_STATUS_E_FAILURE;
+		status = QDF_STATUS_E_FAILURE;
 	}
-	return QDF_STATUS_SUCCESS;
+	return status;
 }
 
 QDF_STATUS csr_roam_update_apwpsie(tpAniSirGlobal pMac, uint32_t sessionId,

+ 1 - 3
core/sme/src/csr/csr_api_scan.c

@@ -4197,8 +4197,7 @@ QDF_STATUS csr_get_active_scan_entry(tpAniSirGlobal mac_ctx,
 	}
 	localentry = csr_scan_active_ll_peek_head(mac_ctx,
 			LL_ACCESS_NOLOCK);
-	sms_log(mac_ctx, LOGE, FL("Entry %p outside while"), localentry);
-	 while (localentry) {
+	while (localentry) {
 		cmd = GET_BASE_ADDR(localentry, tSmeCmd, Link);
 		if (cmd->command == eSmeCommandScan)
 			cmd_scan_id = cmd->u.scanCmd.u.scanRequest.scan_id;
@@ -4213,7 +4212,6 @@ QDF_STATUS csr_get_active_scan_entry(tpAniSirGlobal mac_ctx,
 		}
 		localentry = csr_scan_active_ll_next(mac_ctx,
 				localentry, LL_ACCESS_NOLOCK);
-		sms_log(mac_ctx, LOGE, FL("Entry %p inside while"), localentry);
 	}
 	csr_scan_active_ll_unlock(mac_ctx);
 	sms_log(mac_ctx, LOGE, FL("Exit"));

+ 34 - 27
core/sme/src/csr/csr_util.c

@@ -42,7 +42,7 @@
 #include "wma_types.h"
 #include "cds_utils.h"
 #include "cds_concurrency.h"
-#include "wlan_serialization_api.h"
+#include "wlan_serialization_legacy_mcl_api.h"
 
 
 uint8_t csr_wpa_oui[][CSR_WPA_OUI_SIZE] = {
@@ -377,7 +377,7 @@ tListElem *csr_nonscan_active_ll_peek_head(struct sAniSirGlobal *mac_ctx,
 	struct wlan_serialization_command *cmd;
 	tSmeCmd *sme_cmd;
 
-	sms_log(mac_ctx, LOGE, FL("Enter"));
+	sms_log(mac_ctx, LOG3, FL("Enter"));
 	cmd = wlan_serialization_peek_head_active_cmd_using_psoc(mac_ctx->psoc,
 								 false);
 	if (!cmd) {
@@ -385,7 +385,7 @@ tListElem *csr_nonscan_active_ll_peek_head(struct sAniSirGlobal *mac_ctx,
 		return NULL;
 	}
 	sme_cmd = cmd->umac_cmd;
-	sms_log(mac_ctx, LOGE, FL("Exit"));
+	sms_log(mac_ctx, LOG3, FL("Exit"));
 
 	return &sme_cmd->Link;
 }
@@ -395,7 +395,7 @@ tListElem *csr_nonscan_pending_ll_peek_head(struct sAniSirGlobal *mac_ctx,
 	struct wlan_serialization_command *cmd;
 	tSmeCmd *sme_cmd;
 
-	sms_log(mac_ctx, LOGE, FL("Enter"));
+	sms_log(mac_ctx, LOG3, FL("Enter"));
 	cmd = wlan_serialization_peek_head_pending_cmd_using_psoc(mac_ctx->psoc,
 								  false);
 	if (!cmd) {
@@ -403,7 +403,7 @@ tListElem *csr_nonscan_pending_ll_peek_head(struct sAniSirGlobal *mac_ctx,
 		return NULL;
 	}
 	sme_cmd = cmd->umac_cmd;
-	sms_log(mac_ctx, LOGE, FL("Exit"));
+	sms_log(mac_ctx, LOG3, FL("Exit"));
 
 	return &sme_cmd->Link;
 }
@@ -414,7 +414,7 @@ tListElem *csr_scan_active_ll_peek_head(struct sAniSirGlobal *mac_ctx,
 	struct wlan_serialization_command *cmd;
 	tSmeCmd *sme_cmd;
 
-	sms_log(mac_ctx, LOGE, FL("Enter"));
+	sms_log(mac_ctx, LOG3, FL("Enter"));
 	cmd = wlan_serialization_peek_head_active_cmd_using_psoc(mac_ctx->psoc,
 			true);
 	if (!cmd) {
@@ -422,7 +422,7 @@ tListElem *csr_scan_active_ll_peek_head(struct sAniSirGlobal *mac_ctx,
 		return NULL;
 	}
 	sme_cmd = cmd->umac_cmd;
-	sms_log(mac_ctx, LOGE, FL("Exit"));
+	sms_log(mac_ctx, LOG3, FL("Exit"));
 
 	return &sme_cmd->Link;
 }
@@ -433,15 +433,15 @@ tListElem *csr_scan_pending_ll_peek_head(struct sAniSirGlobal *mac_ctx,
 	struct wlan_serialization_command *cmd;
 	tSmeCmd *sme_cmd;
 
-	sms_log(mac_ctx, LOGE, FL("Enter"));
+	sms_log(mac_ctx, LOG3, FL("Enter"));
 	cmd = wlan_serialization_peek_head_pending_cmd_using_psoc(mac_ctx->psoc,
 			true);
 	if (!cmd) {
-		sms_log(mac_ctx, LOGE, "No cmd found");
+		sms_log(mac_ctx, LOGE, FL("No cmd found"));
 		return NULL;
 	}
 	sme_cmd = cmd->umac_cmd;
-	sms_log(mac_ctx, LOGE, FL("Exit"));
+	sms_log(mac_ctx, LOG3, FL("Exit"));
 
 	return &sme_cmd->Link;
 }
@@ -451,28 +451,29 @@ bool csr_nonscan_active_ll_remove_entry(struct sAniSirGlobal *mac_ctx,
 {
 	tListElem *head;
 
-	sms_log(mac_ctx, LOGE, FL("Enter"));
+	sms_log(mac_ctx, LOG3, FL("Enter"));
 	head = csr_nonscan_active_ll_peek_head(mac_ctx, inter_locked);
 	if (head == entry) {
-		sms_log(mac_ctx, LOGE, "found and Exit");
+		sms_log(mac_ctx, LOG3, FL("found and Exit"));
 		return true;
 	} else {
-		sms_log(mac_ctx, LOGE, "not found and Exit");
+		sms_log(mac_ctx, LOG3, FL("not found and Exit"));
 		return false;
 	}
 }
+
 bool csr_nonscan_pending_ll_remove_entry(struct sAniSirGlobal *mac_ctx,
 		tListElem *entry, bool inter_locked)
 {
 	tListElem *head;
 
-	sms_log(mac_ctx, LOGE, FL("Enter"));
-	head = csr_nonscan_pending_ll_peek_head(mac_ctx, inter_locked);
+	sms_log(mac_ctx, LOG3, FL("Enter"));
+	head = csr_nonscan_pending_ll_next(mac_ctx, entry, inter_locked);
 	if (head == entry) {
-		sms_log(mac_ctx, LOGE, "found and Exit");
+		sms_log(mac_ctx, LOG3, FL("found and Exit"));
 		return true;
 	} else {
-		sms_log(mac_ctx, LOGE, "not found and Exit");
+		sms_log(mac_ctx, LOG3, FL("not found and Exit"));
 		return false;
 	}
 }
@@ -485,7 +486,7 @@ bool csr_scan_active_ll_remove_entry(struct sAniSirGlobal *mac_ctx,
 	struct wlan_serialization_command *cmd;
 
 	if (!entry) {
-		sms_log(mac_ctx, LOGE, "entry is null");
+		sms_log(mac_ctx, LOGE, FL("entry is null"));
 		return false;
 	}
 	sms_log(mac_ctx, LOGE, FL("Enter"));
@@ -494,16 +495,16 @@ bool csr_scan_active_ll_remove_entry(struct sAniSirGlobal *mac_ctx,
 				sme_cmd->sessionId, sme_cmd->u.scanCmd.scanID,
 				true);
 	if (!cmd) {
-		sms_log(mac_ctx, LOGE, "Can't find the entry");
+		sms_log(mac_ctx, LOGE, FL("Can't find the entry"));
 		return false;
 	}
 	sme_cmd = cmd->umac_cmd;
 	found_sme_cmd = &sme_cmd->Link;
 	if (found_sme_cmd == entry) {
-		sms_log(mac_ctx, LOGE, "found and Exit");
+		sms_log(mac_ctx, LOGE, FL("found and Exit"));
 		return true;
 	} else {
-		sms_log(mac_ctx, LOGE, "not found and Exit");
+		sms_log(mac_ctx, LOGE, FL("not found and Exit"));
 		return false;
 	}
 }
@@ -515,7 +516,7 @@ bool csr_scan_pending_ll_remove_entry(struct sAniSirGlobal *mac_ctx,
 	struct wlan_serialization_command *cmd;
 
 	if (!entry) {
-		sms_log(mac_ctx, LOGE, "entry is null");
+		sms_log(mac_ctx, LOGE, FL("entry is null"));
 		return false;
 	}
 	sms_log(mac_ctx, LOGE, FL("Enter"));
@@ -524,16 +525,16 @@ bool csr_scan_pending_ll_remove_entry(struct sAniSirGlobal *mac_ctx,
 				sme_cmd->sessionId, sme_cmd->u.scanCmd.scanID,
 				false);
 	if (!cmd) {
-		sms_log(mac_ctx, LOGE, "Can't find the entry");
+		sms_log(mac_ctx, LOGE, FL("Can't find the entry"));
 		return false;
 	}
 	sme_cmd = cmd->umac_cmd;
 	found_sme_cmd = &sme_cmd->Link;
 	if (found_sme_cmd == entry) {
-		sms_log(mac_ctx, LOGE, "found and Exit");
+		sms_log(mac_ctx, LOGE, FL("found and Exit"));
 		return true;
 	} else {
-		sms_log(mac_ctx, LOGE, "not found and Exit");
+		sms_log(mac_ctx, LOGE, FL("not found and Exit"));
 		return false;
 	}
 }
@@ -583,8 +584,10 @@ tListElem *csr_scan_active_ll_next(struct sAniSirGlobal *mac_ctx,
 				sme_cmd->sessionId, WLAN_LEGACY_SME_ID);
 	tcmd = wlan_serialization_get_active_list_next_node_using_psoc(
 				mac_ctx->psoc, &cmd, true);
+	if (cmd.vdev)
+		wlan_objmgr_vdev_release_ref(cmd.vdev, WLAN_LEGACY_SME_ID);
 	if (!tcmd) {
-		sms_log(mac_ctx, LOGE, "No cmd found");
+		sms_log(mac_ctx, LOGE, FL("No cmd found"));
 		return NULL;
 	}
 	sme_cmd = tcmd->umac_cmd;
@@ -612,6 +615,8 @@ tListElem *csr_scan_pending_ll_next(struct sAniSirGlobal *mac_ctx,
 				sme_cmd->sessionId, WLAN_LEGACY_SME_ID);
 	tcmd = wlan_serialization_get_pending_list_next_node_using_psoc(
 				mac_ctx->psoc, &cmd, true);
+	if (cmd.vdev)
+		wlan_objmgr_vdev_release_ref(cmd.vdev, WLAN_LEGACY_SME_ID);
 	if (!tcmd) {
 		sms_log(mac_ctx, LOGE, FL("No cmd found"));
 		return NULL;
@@ -641,8 +646,10 @@ tListElem *csr_nonscan_pending_ll_next(struct sAniSirGlobal *mac_ctx,
 				sme_cmd->sessionId, WLAN_LEGACY_SME_ID);
 	tcmd = wlan_serialization_get_pending_list_next_node_using_psoc(
 				mac_ctx->psoc, &cmd, false);
+	if (cmd.vdev)
+		wlan_objmgr_vdev_release_ref(cmd.vdev, WLAN_LEGACY_SME_ID);
 	if (!tcmd) {
-		sms_log(mac_ctx, LOGE, "No cmd found");
+		sms_log(mac_ctx, LOGE, FL("No cmd found"));
 		return NULL;
 	}
 	sme_cmd = tcmd->umac_cmd;