Kaynağa Gözat

qcacld-3.0: Remove the vdev reference count from set_hw_mode logic

Remove the vdev reference count logic from set_hw_mode request & response
path.

Change-Id: I4d57dab114c15e8b2389d5c261c451542f573996
CRs-Fixed: 2142770
Tushnim Bhattacharyya 7 yıl önce
ebeveyn
işleme
4a03db81ef

+ 3 - 23
core/sme/src/common/sme_api.c

@@ -166,18 +166,18 @@ static QDF_STATUS sme_process_set_hw_mode_resp(tpAniSirGlobal mac, uint8_t *msg)
 	entry = csr_nonscan_active_ll_peek_head(mac, LL_ACCESS_LOCK);
 	if (!entry) {
 		sme_err("No cmd found in active list");
-		goto error_path;
+		return QDF_STATUS_E_FAILURE;
 	}
 
 	command = GET_BASE_ADDR(entry, tSmeCmd, Link);
 	if (!command) {
 		sme_err("Base address is NULL");
-		goto error_path;
+		return QDF_STATUS_E_FAILURE;
 	}
 
 	if (e_sme_command_set_hw_mode != command->command) {
 		sme_err("Command mismatch!");
-		goto error_path;
+		return QDF_STATUS_E_FAILURE;
 	}
 
 	callback = command->u.set_hw_mode_cmd.set_hw_mode_cb;
@@ -229,9 +229,6 @@ static QDF_STATUS sme_process_set_hw_mode_resp(tpAniSirGlobal mac, uint8_t *msg)
 	}
 
 end:
-	wlan_objmgr_vdev_release_ref(command->u.set_hw_mode_cmd.vdev,
-		WLAN_LEGACY_SME_ID);
-
 	found = csr_nonscan_active_ll_remove_entry(mac, entry,
 			LL_ACCESS_LOCK);
 	if (found)
@@ -239,11 +236,6 @@ end:
 		csr_release_command(mac, command);
 
 	return QDF_STATUS_SUCCESS;
-
-error_path:
-	wlan_objmgr_vdev_release_ref(command->u.set_hw_mode_cmd.vdev,
-		WLAN_LEGACY_SME_ID);
-	return QDF_STATUS_E_FAILURE;
 }
 
 /**
@@ -13424,7 +13416,6 @@ QDF_STATUS sme_pdev_set_hw_mode(struct policy_mgr_hw_mode msg)
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	tpAniSirGlobal mac = sme_get_mac_context();
 	tSmeCmd *cmd = NULL;
-	struct wlan_objmgr_vdev *vdev = NULL;
 
 	status = sme_acquire_global_lock(&mac->sme);
 	if (!QDF_IS_STATUS_SUCCESS(status)) {
@@ -13432,19 +13423,9 @@ QDF_STATUS sme_pdev_set_hw_mode(struct policy_mgr_hw_mode msg)
 		return QDF_STATUS_E_RESOURCES;
 	}
 
-	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(mac->psoc, msg.session_id,
-		WLAN_LEGACY_SME_ID);
-	if (!vdev) {
-		sme_err("vdev is NULL for sme_session, no need to proceed with cmd Qing:%d",
-		msg.session_id);
-		sme_release_global_lock(&mac->sme);
-		return QDF_STATUS_E_NULL_VALUE;
-	}
-
 	cmd = csr_get_command_buffer(mac);
 	if (!cmd) {
 		sme_err("Get command buffer failed");
-		wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_SME_ID);
 		sme_release_global_lock(&mac->sme);
 		return QDF_STATUS_E_NULL_VALUE;
 	}
@@ -13455,7 +13436,6 @@ QDF_STATUS sme_pdev_set_hw_mode(struct policy_mgr_hw_mode msg)
 	cmd->u.set_hw_mode_cmd.set_hw_mode_cb = msg.set_hw_mode_cb;
 	cmd->u.set_hw_mode_cmd.reason = msg.reason;
 	cmd->u.set_hw_mode_cmd.session_id = msg.session_id;
-	cmd->u.set_hw_mode_cmd.vdev = vdev;
 	cmd->u.set_hw_mode_cmd.context = msg.context;
 
 	sme_debug("Queuing set hw mode to CSR, session: %d reason: %d",

+ 0 - 4
core/sme/src/csr/csr_api_roam.c

@@ -20424,8 +20424,6 @@ void csr_process_set_hw_mode(tpAniSirGlobal mac, tSmeCmd *command)
 		policy_mgr_set_hw_mode_change_in_progress(mac->psoc,
 			POLICY_MGR_HW_MODE_NOT_IN_PROGRESS);
 		sme_err("Posting to PE failed");
-		wlan_objmgr_vdev_release_ref(command->u.set_hw_mode_cmd.vdev,
-			WLAN_LEGACY_SME_ID);
 		return;
 	}
 	return;
@@ -20436,8 +20434,6 @@ fail:
 	if (!param) {
 		sme_err(
 			"Malloc fail: Fail to send response to SME");
-		wlan_objmgr_vdev_release_ref(command->u.set_hw_mode_cmd.vdev,
-			WLAN_LEGACY_SME_ID);
 		return;
 	}
 	sme_err("Sending set HW fail response to SME");

+ 1 - 0
core/wma/src/wma_main.c

@@ -3199,6 +3199,7 @@ static int wma_pdev_set_hw_mode_resp_evt_handler(void *handle,
 	}
 
 	wma_release_wakelock(&wma->wmi_cmd_rsp_wake_lock);
+	wma_remove_req(wma, 0, WMA_PDEV_SET_HW_MODE_RESP);
 
 	hw_mode_resp = qdf_mem_malloc(sizeof(*hw_mode_resp));
 	if (!hw_mode_resp) {