Browse Source

qcacld-3.0: Refactor vdev delete code at wma layer

Before sending vdev delete command to target_if layer, attach vdev
delete params to wma_txrx_node's del_staself_req member in wma layer.
This helps while responding to vdev delete command in case wmi service
"wmi_service_sync_delete_cmds" is disabled.

VDEV delete command response is sent to upper layer even vdev_mlme
object is not found.

Change-Id: Idfd8b036ff1ea676dd3ad8be703512ff84f299b7
CRs-Fixed: 2510460
Abhishek Ambure 5 years ago
parent
commit
532bf97191
1 changed files with 7 additions and 15 deletions
  1. 7 15
      core/wma/src/wma_dev_if.c

+ 7 - 15
core/wma/src/wma_dev_if.c

@@ -695,7 +695,7 @@ static void wma_handle_monitor_mode_vdev_detach(tp_wma_handle wma,
 static QDF_STATUS wma_handle_vdev_detach(tp_wma_handle wma_handle,
 			struct del_vdev_params *del_vdev_req_param)
 {
-	QDF_STATUS status = QDF_STATUS_SUCCESS;
+	QDF_STATUS status = QDF_STATUS_E_FAILURE;
 	uint8_t vdev_id = del_vdev_req_param->vdev_id;
 	struct wma_txrx_node *iface = &wma_handle->interfaces[vdev_id];
 	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
@@ -703,7 +703,6 @@ static QDF_STATUS wma_handle_vdev_detach(tp_wma_handle wma_handle,
 
 	if (!soc) {
 		WMA_LOGE("%s:SOC context is NULL", __func__);
-		status = QDF_STATUS_E_FAILURE;
 		goto out;
 	}
 
@@ -711,36 +710,29 @@ static QDF_STATUS wma_handle_vdev_detach(tp_wma_handle wma_handle,
 	if (!vdev_mlme) {
 		wma_err("Failed to get vdev mlme obj for vdev id %d",
 			del_vdev_req_param->vdev_id);
-		qdf_mem_free(del_vdev_req_param);
-		return QDF_STATUS_E_INVAL;
+		wma_cdp_vdev_detach(soc, wma_handle, vdev_id);
+		goto out;
 	}
 
 	if (cds_get_conparam() == QDF_GLOBAL_MONITOR_MODE)
 		wma_handle_monitor_mode_vdev_detach(wma_handle, vdev_id);
 
+	iface->del_staself_req = del_vdev_req_param;
+	wlan_vdev_set_dp_handle(iface->vdev, NULL);
+	wma_cdp_vdev_detach(soc, wma_handle, vdev_id);
+
 	status = vdev_mgr_delete_send(vdev_mlme);
 	if (QDF_IS_STATUS_ERROR(status)) {
 		WMA_LOGE("Unable to remove an interface");
 		goto out;
 	}
-
-	WMA_LOGD("vdev_id:%hu", vdev_id);
-
-	del_vdev_req_param->status = status;
-	iface->del_staself_req = del_vdev_req_param;
-	WMA_LOGD("Call txrx detach with callback for vdev %d", vdev_id);
-	wlan_vdev_set_dp_handle(iface->vdev, NULL);
-	wma_cdp_vdev_detach(soc, wma_handle, vdev_id);
 	wma_release_vdev_ref(iface);
 
 	return status;
 
 out:
-	WMA_LOGE("Call txrx detach callback for vdev %d", vdev_id);
 	wlan_vdev_set_dp_handle(iface->vdev, NULL);
-	wma_cdp_vdev_detach(soc, wma_handle, vdev_id);
 	wma_release_vdev_ref(iface);
-
 	wma_vdev_deinit(iface);
 	qdf_mem_zero(iface, sizeof(*iface));
 	wma_vdev_init(iface);