Prechádzať zdrojové kódy

qcacmn: Enhance and update target_if/mlme/vdev_mgr

Enhance target_if/mlme/vdev_mgr by addressing
review comments and update response handling
APIs to handler timers and response bit maps
as expected

Change-Id: I8a5bf3f2931f0c36a367dfebfc898ed2621f3516
CRs-Fixed: 2397184
Naga 6 rokov pred
rodič
commit
7dd88340fe

+ 24 - 0
target_if/mlme/vdev_mgr/inc/target_if_vdev_mgr_rx_ops.h

@@ -29,6 +29,30 @@
 #include <wlan_objmgr_psoc_obj.h>
 #include <wlan_lmac_if_def.h>
 
+/**
+ * target_if_vdev_mgr_is_driver_unloading: API to driver unload status
+ *
+ * Return: TRUE or FALSE
+ */
+static inline bool target_if_vdev_mgr_is_driver_unloading(void)
+{
+	return false;
+}
+
+/**
+ * target_if_vdev_mgr_is_panic_on_bug: API to get panic on bug
+ *
+ * Return: TRUE or FALSE
+ */
+static inline bool target_if_vdev_mgr_is_panic_on_bug(void)
+{
+#ifdef PANIC_ON_BUG
+	return true;
+#else
+	return false;
+#endif
+}
+
 /**
  * target_if_vdev_mgr_get_rx_ops() - get rx ops
  * @psoc: pointer to psoc object

+ 9 - 13
target_if/mlme/vdev_mgr/inc/target_if_vdev_mgr_tx_ops.h

@@ -31,6 +31,15 @@
 #include <wlan_objmgr_psoc_obj.h>
 #include <wlan_lmac_if_def.h>
 
+/**
+ * target_if_vdev_mgr_wmi_handle_get() - API to get wmi handle from vdev
+ * @vdev: pointer to vdev
+ *
+ * Return: pointer to wmi_unified handle or NULL
+ */
+struct wmi_unified *target_if_vdev_mgr_wmi_handle_get(
+					struct wlan_objmgr_vdev *vdev);
+
 /**
  * target_if_vdev_mgr_get_tx_ops() - get tx ops
  * @psoc: pointer to psoc obj
@@ -43,19 +52,6 @@ target_if_vdev_mgr_get_tx_ops(struct wlan_objmgr_psoc *psoc)
 	return &psoc->soc_cb.tx_ops.mops;
 }
 
-/**
- * target_if_rsp_timer_mgmt() - function to handle response timer
- * @vdev: pointer to vdev object
- * @rsp_timer: pointer to response timer
- * @init: timer init status
- *
- * Return: status of operation.
- */
-QDF_STATUS target_if_vdev_mgr_rsp_timer_mgmt(
-					struct wlan_objmgr_vdev *vdev,
-					qdf_timer_t *rsp_timer,
-					bool init);
-
 /**
  * target_if_vdev_mgr_vdev_mlme_register_tx_ops() - define mlme lmac
  * tx ops functions

+ 72 - 76
target_if/mlme/vdev_mgr/src/target_if_vdev_mgr_rx_ops.c

@@ -29,6 +29,7 @@
 #include <wlan_mlme_dbg.h>
 #include <target_if.h>
 #include <qdf_platform.h>
+#include <wlan_vdev_mlme_main.h>
 
 void target_if_vdev_mgr_rsp_timer_mgmt_cb(void *arg)
 {
@@ -36,13 +37,19 @@ void target_if_vdev_mgr_rsp_timer_mgmt_cb(void *arg)
 	struct wlan_objmgr_psoc *psoc;
 	struct wlan_lmac_if_mlme_rx_ops *rx_ops;
 	struct vdev_response_timer *vdev_rsp;
+	struct crash_inject param;
+	struct wmi_unified *wmi_handle;
+	struct vdev_start_response start_rsp = {0};
+	struct vdev_stop_response stop_rsp = {0};
+	struct vdev_delete_response del_rsp = {0};
+	uint8_t vdev_id;
 
-	mlme_debug("Response timer expired for VDEV %d",
-		   wlan_vdev_get_id(vdev));
+	vdev_id = wlan_vdev_get_id(vdev);
+	mlme_debug("Response timer expired for VDEV %d", vdev_id);
 
 	psoc = wlan_vdev_get_psoc(vdev);
 	if (!psoc) {
-		QDF_ASSERT(0);
+		mlme_err("PSOC is NULL");
 		return;
 	}
 
@@ -52,21 +59,65 @@ void target_if_vdev_mgr_rsp_timer_mgmt_cb(void *arg)
 		return;
 	}
 
-	if (qdf_is_recovering()) {
-		mlme_debug("Recovery in progress");
+	vdev_rsp = rx_ops->vdev_mgr_get_response_timer_info(vdev);
+	if (!qdf_atomic_test_bit(START_RESPONSE_BIT, &vdev_rsp->rsp_status) &&
+	    !qdf_atomic_test_bit(RESTART_RESPONSE_BIT, &vdev_rsp->rsp_status) &&
+	    !qdf_atomic_test_bit(STOP_RESPONSE_BIT, &vdev_rsp->rsp_status) &&
+	    !qdf_atomic_test_bit(DELETE_RESPONSE_BIT, &vdev_rsp->rsp_status)) {
+		mlme_debug("No response bit is set, ignoring actions");
 		return;
 	}
 
-	vdev_rsp = rx_ops->vdev_mgr_get_response_timer_info(vdev);
-	qdf_atomic_clear_bit(START_RESPONSE_BIT, &vdev_rsp->rsp_status);
-	qdf_atomic_clear_bit(STOP_RESPONSE_BIT, &vdev_rsp->rsp_status);
-	qdf_atomic_clear_bit(DELETE_RESPONSE_BIT, &vdev_rsp->rsp_status);
+	if (target_if_vdev_mgr_is_driver_unloading() || qdf_is_recovering() ||
+	    qdf_is_fw_down()) {
+		/* this ensures stop timer will not be done in target_if */
+		vdev_rsp->timer_status = QDF_STATUS_E_TIMEOUT;
+		if (qdf_atomic_test_bit(START_RESPONSE_BIT,
+					&vdev_rsp->rsp_status) ||
+		    qdf_atomic_test_bit(RESTART_RESPONSE_BIT,
+					&vdev_rsp->rsp_status)) {
+			start_rsp.vdev_id = wlan_vdev_get_id(vdev);
+			start_rsp.status = WMI_HOST_VDEV_START_TIMEOUT;
+			if (qdf_atomic_test_bit(START_RESPONSE_BIT,
+						&vdev_rsp->rsp_status))
+				start_rsp.resp_type =
+					WMI_HOST_VDEV_START_RESP_EVENT;
+			else
+				start_rsp.resp_type =
+					WMI_HOST_VDEV_RESTART_RESP_EVENT;
+
+			rx_ops->vdev_mgr_start_response(psoc, &start_rsp);
+		}
+
+		if (qdf_atomic_test_bit(STOP_RESPONSE_BIT,
+					&vdev_rsp->rsp_status)) {
+			stop_rsp.vdev_id = wlan_vdev_get_id(vdev);
+			rx_ops->vdev_mgr_stop_response(psoc, &stop_rsp);
+		}
+
+		if (qdf_atomic_test_bit(DELETE_RESPONSE_BIT,
+					&vdev_rsp->rsp_status)) {
+			del_rsp.vdev_id = wlan_vdev_get_id(vdev);
+			rx_ops->vdev_mgr_delete_response(psoc, &del_rsp);
+		}
+
+		return;
+	}
 
-	if (rx_ops->vdev_mgr_response_timeout_cb)
-		rx_ops->vdev_mgr_response_timeout_cb(vdev);
+	if (target_if_vdev_mgr_is_panic_on_bug()) {
+		mlme_err("VDEV_%d: Panic on bug enabled, rsp status:%d",
+			 vdev_id, vdev_rsp->rsp_status);
+		QDF_BUG(0);
+	} else {
+		mlme_err("VDEV_%d: Trigger Self recovery, rsp status%d",
+			 vdev_id, vdev_rsp->rsp_status);
+		wmi_handle = target_if_vdev_mgr_wmi_handle_get(vdev);
 
-	/* Implementation need to be done based on build type */
-	QDF_ASSERT(0);
+		qdf_mem_set(&param, sizeof(param), 0);
+		/* RECOVERY_SIM_SELF_RECOVERY*/
+		param.type = 0x08;
+		wmi_crash_inject(wmi_handle, &param);
+	}
 }
 
 static int target_if_vdev_mgr_start_response_handler(
@@ -88,7 +139,7 @@ static int target_if_vdev_mgr_start_response_handler(
 
 	psoc = target_if_get_psoc_from_scn_hdl(scn);
 	if (!psoc) {
-		QDF_ASSERT(0);
+		mlme_err("PSOC is NULL");
 		return -EINVAL;
 	}
 
@@ -143,7 +194,7 @@ static int target_if_vdev_mgr_stop_response_handler(
 
 	psoc = target_if_get_psoc_from_scn_hdl(scn);
 	if (!psoc) {
-		QDF_ASSERT(0);
+		mlme_err("PSOC is NULL");
 		return -EINVAL;
 	}
 
@@ -176,13 +227,11 @@ static int target_if_vdev_mgr_delete_response_handler(
 						uint32_t datalen)
 {
 	QDF_STATUS status;
-	struct wlan_objmgr_vdev *vdev;
 	struct wlan_objmgr_psoc *psoc;
 	struct wmi_unified *wmi_handle;
 	struct wlan_lmac_if_mlme_rx_ops *rx_ops;
 	struct vdev_delete_response rsp = {0};
 	struct wmi_host_vdev_delete_resp vdev_del_resp;
-	struct vdev_response_timer *vdev_rsp;
 
 	if (!scn || !data) {
 		mlme_err("scn: 0x%pK, data: 0x%pK", scn, data);
@@ -191,7 +240,7 @@ static int target_if_vdev_mgr_delete_response_handler(
 
 	psoc = target_if_get_psoc_from_scn_hdl(scn);
 	if (!psoc) {
-		QDF_ASSERT(0);
+		mlme_err("PSOC is NULL");
 		return -EINVAL;
 	}
 
@@ -213,23 +262,9 @@ static int target_if_vdev_mgr_delete_response_handler(
 		return -EINVAL;
 	}
 
-	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc,
-						    vdev_del_resp.vdev_id,
-						    WLAN_MLME_SB_ID);
-	if (!vdev) {
-		QDF_ASSERT(0);
-		return -EINVAL;
-	}
-
 	rsp.vdev_id = vdev_del_resp.vdev_id;
 	status = rx_ops->vdev_mgr_delete_response(psoc, &rsp);
 
-	vdev_rsp = rx_ops->vdev_mgr_get_response_timer_info(vdev);
-	if (vdev_rsp && QDF_IS_STATUS_SUCCESS(status))
-		target_if_vdev_mgr_rsp_timer_mgmt(vdev, &vdev_rsp->rsp_timer,
-						  false);
-
-	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_SB_ID);
 	return qdf_status_to_os_return(status);
 }
 
@@ -250,7 +285,7 @@ static int target_if_vdev_mgr_offload_bcn_tx_status_handler(
 	}
 	psoc = target_if_get_psoc_from_scn_hdl(scn);
 	if (!psoc) {
-		QDF_ASSERT(0);
+		mlme_err("PSOC is NULL");
 		return -EINVAL;
 	}
 
@@ -296,7 +331,7 @@ static int target_if_vdev_mgr_tbttoffset_update_handler(
 	}
 	psoc = target_if_get_psoc_from_scn_hdl(scn);
 	if (!psoc) {
-		QDF_ASSERT(0);
+		mlme_err("PSOC is NULL");
 		return -EINVAL;
 	}
 
@@ -339,7 +374,7 @@ static int target_if_vdev_mgr_ext_tbttoffset_update_handler(
 	}
 	psoc = target_if_get_psoc_from_scn_hdl(scn);
 	if (!psoc) {
-		QDF_ASSERT(0);
+		mlme_err("PSOC is NULL");
 		return -EINVAL;
 	}
 
@@ -373,7 +408,7 @@ QDF_STATUS target_if_vdev_mgr_wmi_event_register(
 	struct wmi_unified *wmi_handle;
 
 	if (!psoc) {
-		QDF_ASSERT(0);
+		mlme_err("PSOC is NULL");
 		return QDF_STATUS_E_NULL_VALUE;
 	}
 
@@ -383,7 +418,6 @@ QDF_STATUS target_if_vdev_mgr_wmi_event_register(
 		return QDF_STATUS_E_INVAL;
 	}
 
-#if CMN_VDEV_MGR_TGT_IF_ENABLE_PHASE /* to be implemented in next phase */
 	retval = wmi_unified_register_event_handler(
 				wmi_handle,
 				wmi_vdev_stopped_event_id,
@@ -408,31 +442,6 @@ QDF_STATUS target_if_vdev_mgr_wmi_event_register(
 	if (retval)
 		mlme_err("failed to register for start response");
 
-	retval = wmi_unified_register_event_handler(
-			wmi_handle,
-			wmi_offload_bcn_tx_status_event_id,
-			target_if_vdev_mgr_offload_bcn_tx_status_handler,
-			WMI_RX_UMAC_CTX);
-	if (retval)
-		mlme_err("failed to register for bcn tx status response");
-
-	retval = wmi_unified_register_event_handler(
-				wmi_handle,
-				wmi_tbttoffset_update_event_id,
-				target_if_vdev_mgr_tbttoffset_update_handler,
-				WMI_RX_UMAC_CTX);
-	if (retval)
-		mlme_err("failed to register for tbttoffset update");
-
-	retval = wmi_unified_register_event_handler(
-			wmi_handle,
-			wmi_ext_tbttoffset_update_event_id,
-			target_if_vdev_mgr_ext_tbttoffset_update_handler,
-			WMI_RX_UMAC_CTX);
-	if (retval)
-		mlme_err("failed to register for ext tbttoffset update");
-#endif
-
 	return qdf_status_from_os_return(retval);
 }
 
@@ -442,7 +451,7 @@ QDF_STATUS target_if_vdev_mgr_wmi_event_unregister(
 	struct wmi_unified *wmi_handle;
 
 	if (!psoc) {
-		QDF_ASSERT(0);
+		mlme_err("PSOC is NULL");
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -452,7 +461,6 @@ QDF_STATUS target_if_vdev_mgr_wmi_event_unregister(
 		return QDF_STATUS_E_INVAL;
 	}
 
-#if CMN_VDEV_MGR_TGT_IF_ENABLE_PHASE
 	wmi_unified_unregister_event_handler(wmi_handle,
 					     wmi_vdev_stopped_event_id);
 
@@ -462,17 +470,5 @@ QDF_STATUS target_if_vdev_mgr_wmi_event_unregister(
 	wmi_unified_unregister_event_handler(wmi_handle,
 					     wmi_vdev_start_resp_event_id);
 
-	wmi_unified_unregister_event_handler(wmi_handle,
-					     wmi_tbttoffset_update_event_id);
-
-	wmi_unified_unregister_event_handler(
-				wmi_handle,
-				wmi_ext_tbttoffset_update_event_id);
-
-	wmi_unified_unregister_event_handler(
-				wmi_handle,
-				wmi_offload_bcn_tx_status_event_id);
-#endif
-
 	return QDF_STATUS_SUCCESS;
 }

+ 276 - 209
target_if/mlme/vdev_mgr/src/target_if_vdev_mgr_tx_ops.c

@@ -47,37 +47,125 @@ static QDF_STATUS target_if_vdev_mgr_unregister_event_handler(
 	return target_if_vdev_mgr_wmi_event_unregister(psoc);
 }
 
-QDF_STATUS target_if_vdev_mgr_rsp_timer_mgmt(
+static QDF_STATUS target_if_vdev_mgr_rsp_timer_mod(
 					struct wlan_objmgr_vdev *vdev,
-					qdf_timer_t *rsp_timer,
-					bool init)
+					struct vdev_response_timer *vdev_rsp,
+					int mseconds)
 {
-	if (init) {
-		qdf_timer_init(NULL, rsp_timer,
-			       target_if_vdev_mgr_rsp_timer_mgmt_cb,
-			       (void *)vdev, QDF_TIMER_TYPE_WAKE_APPS);
-		wlan_objmgr_vdev_get_ref(vdev, WLAN_MLME_SB_ID);
-	} else {
-		qdf_timer_free(rsp_timer);
-		wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_SB_ID);
+	if (!vdev || !vdev_rsp) {
+		mlme_err("Invalid input");
+		return QDF_STATUS_E_FAILURE;
 	}
 
+	qdf_timer_mod(&vdev_rsp->rsp_timer, mseconds);
+	return QDF_STATUS_SUCCESS;
+}
+
+static QDF_STATUS target_if_vdev_mgr_rsp_timer_stop(
+					struct wlan_objmgr_vdev *vdev,
+					struct vdev_response_timer *vdev_rsp,
+					uint8_t clear_bit)
+{
+	if (qdf_atomic_test_and_clear_bit(clear_bit, &vdev_rsp->rsp_status)) {
+		/*
+		 * This is triggered from timer expiry case only for
+		 * which timer stop is not required
+		 */
+		if (vdev_rsp->timer_status != QDF_STATUS_E_TIMEOUT)
+			qdf_timer_stop(&vdev_rsp->rsp_timer);
+
+		/*
+		 * Releasing reference taken at the time of
+		 * starting response timer
+		 */
+		wlan_objmgr_vdev_release_ref(vdev, WLAN_VDEV_TARGET_IF_ID);
+		return QDF_STATUS_SUCCESS;
+	}
+
+	return QDF_STATUS_E_FAILURE;
+}
+
+static QDF_STATUS target_if_vdev_mgr_rsp_timer_start(
+					struct wlan_objmgr_vdev *vdev,
+					struct vdev_response_timer *vdev_rsp,
+					uint8_t set_bit)
+{
+	uint8_t vdev_id;
+	uint8_t rsp_pos;
+
+	vdev_id = wlan_vdev_get_id(vdev);
+	/* it is expected to be only one command with FW at a time */
+	for (rsp_pos = START_RESPONSE_BIT; rsp_pos <= RESPONSE_BIT_MAX;
+	     rsp_pos++) {
+		if (rsp_pos != set_bit) {
+			if (qdf_atomic_test_bit(rsp_pos,
+						&vdev_rsp->rsp_status)) {
+				mlme_err("VDEV_%d: Response bit is set %d",
+					 vdev_id, vdev_rsp->rsp_status);
+				QDF_ASSERT(0);
+			}
+		}
+	}
+
+	if (qdf_atomic_test_and_set_bit(set_bit, &vdev_rsp->rsp_status)) {
+		mlme_err("VDEV_%d: Response bit is set %d",
+			 vdev_id, vdev_rsp->rsp_status);
+		QDF_ASSERT(0);
+	}
+
+	/* reference taken for timer start, will be released with stop */
+	wlan_objmgr_vdev_get_ref(vdev, WLAN_VDEV_TARGET_IF_ID);
+	qdf_timer_start(&vdev_rsp->rsp_timer, vdev_rsp->expire_time);
+
+	return QDF_STATUS_SUCCESS;
+}
+
+static QDF_STATUS target_if_vdev_mgr_rsp_timer_init(
+					struct wlan_objmgr_vdev *vdev,
+					qdf_timer_t *rsp_timer)
+{
+	if (!vdev || !rsp_timer) {
+		mlme_err("Invalid input");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	qdf_timer_init(NULL, rsp_timer,
+		       target_if_vdev_mgr_rsp_timer_mgmt_cb,
+		       (void *)vdev, QDF_TIMER_TYPE_WAKE_APPS);
+	mlme_debug("VDEV_%d: Response timer initialized",
+		   wlan_vdev_get_id(vdev));
+
+	return QDF_STATUS_SUCCESS;
+}
+
+static QDF_STATUS target_if_vdev_mgr_rsp_timer_deinit(
+					struct wlan_objmgr_vdev *vdev,
+					qdf_timer_t *rsp_timer)
+{
+	if (!vdev || !rsp_timer) {
+		mlme_err("Invalid input");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	qdf_timer_free(rsp_timer);
+	mlme_debug("VDEV_%d: Response timer free", wlan_vdev_get_id(vdev));
+
 	return QDF_STATUS_SUCCESS;
 }
 
 struct wmi_unified
 *target_if_vdev_mgr_wmi_handle_get(struct wlan_objmgr_vdev *vdev)
 {
-	struct wlan_objmgr_psoc *psoc;
+	struct wlan_objmgr_pdev *pdev;
 	struct wmi_unified *wmi_handle;
 
-	psoc = wlan_vdev_get_psoc(vdev);
-	if (!psoc) {
-		QDF_ASSERT(0);
+	pdev = wlan_vdev_get_pdev(vdev);
+	if (!pdev) {
+		mlme_err("PDEV is NULL");
 		return NULL;
 	}
 
-	wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
+	wmi_handle = get_wmi_unified_hdl_from_pdev(pdev);
 	if (!wmi_handle) {
 		mlme_err("wmi_handle is null");
 		return NULL;
@@ -86,13 +174,13 @@ struct wmi_unified
 	return wmi_handle;
 }
 
-static QDF_STATUS target_if_check_is_pre_lithium(
+static bool target_if_check_is_pre_lithium(
 					struct wlan_objmgr_psoc *psoc)
 {
 	if (lmac_get_tgt_type(psoc) < TARGET_TYPE_QCA8074)
-		return QDF_STATUS_SUCCESS;
+		return true;
 	else
-		return QDF_STATUS_E_INVAL;
+		return false;
 }
 
 static inline uint32_t
@@ -175,134 +263,6 @@ target_if_vdev_mlme_id_2_wmi(uint32_t cfg_id)
 	return wmi_id;
 }
 
-static enum wlan_phymode
-target_if_wmi_phymode_from_wlan_phymode(struct wlan_objmgr_vdev *vdev,
-					uint32_t phy_mode,
-					bool is_2gvht_en,
-					bool is_11ax_stub_enabled)
-{
-	static uint32_t phy_2_wmi[WLAN_PHYMODE_11AXA_HE80_80 + 1] = {
-		[WLAN_PHYMODE_AUTO] = WMI_HOST_MODE_UNKNOWN,
-		[WLAN_PHYMODE_11A] = WMI_HOST_MODE_11A,
-		[WLAN_PHYMODE_11B] = WMI_HOST_MODE_11B,
-		[WLAN_PHYMODE_11G] = WMI_HOST_MODE_11G,
-		[WLAN_PHYMODE_11NA_HT20] = WMI_HOST_MODE_11NA_HT20,
-		[WLAN_PHYMODE_11NG_HT20] = WMI_HOST_MODE_11NG_HT20,
-		[WLAN_PHYMODE_11NA_HT40PLUS] = WMI_HOST_MODE_11NA_HT40,
-		[WLAN_PHYMODE_11NA_HT40MINUS] = WMI_HOST_MODE_11NA_HT40,
-		[WLAN_PHYMODE_11NG_HT40PLUS] = WMI_HOST_MODE_11NG_HT40,
-		[WLAN_PHYMODE_11NG_HT40MINUS] = WMI_HOST_MODE_11NG_HT40,
-		[WLAN_PHYMODE_11NG_HT40] = WMI_HOST_MODE_11NG_HT40,
-		[WLAN_PHYMODE_11NA_HT40] = WMI_HOST_MODE_11NA_HT40,
-		[WLAN_PHYMODE_11AC_VHT20] = WMI_HOST_MODE_11AC_VHT20,
-		[WLAN_PHYMODE_11AC_VHT40PLUS] = WMI_HOST_MODE_11AC_VHT40,
-		[WLAN_PHYMODE_11AC_VHT40MINUS] = WMI_HOST_MODE_11AC_VHT40,
-		[WLAN_PHYMODE_11AC_VHT40] = WMI_HOST_MODE_11AC_VHT40,
-		[WLAN_PHYMODE_11AC_VHT80] = WMI_HOST_MODE_11AC_VHT80,
-		[WLAN_PHYMODE_11AC_VHT160] = WMI_HOST_MODE_11AC_VHT160,
-		[WLAN_PHYMODE_11AC_VHT80_80] = WMI_HOST_MODE_11AC_VHT80_80,
-		[WLAN_PHYMODE_11AXA_HE20] = WMI_HOST_MODE_11AX_HE20,
-		[WLAN_PHYMODE_11AXG_HE20] = WMI_HOST_MODE_11AX_HE20_2G,
-		[WLAN_PHYMODE_11AXA_HE40PLUS] = WMI_HOST_MODE_11AX_HE40,
-		[WLAN_PHYMODE_11AXA_HE40MINUS] = WMI_HOST_MODE_11AX_HE40,
-		[WLAN_PHYMODE_11AXG_HE40PLUS] = WMI_HOST_MODE_11AX_HE40_2G,
-		[WLAN_PHYMODE_11AXG_HE40MINUS] = WMI_HOST_MODE_11AX_HE40_2G,
-		[WLAN_PHYMODE_11AXA_HE40] = WMI_HOST_MODE_11AX_HE40,
-		[WLAN_PHYMODE_11AXG_HE40] = WMI_HOST_MODE_11AX_HE40_2G,
-		[WLAN_PHYMODE_11AXA_HE80] = WMI_HOST_MODE_11AX_HE80,
-		[WLAN_PHYMODE_11AXA_HE160] = WMI_HOST_MODE_11AX_HE160,
-		[WLAN_PHYMODE_11AXA_HE80_80] = WMI_HOST_MODE_11AX_HE80_80,
-	};
-	uint32_t temp_phymode;
-	enum wmi_target_type target;
-	struct wlan_objmgr_psoc *psoc = wlan_vdev_get_psoc(vdev);
-	uint32_t target_type;
-
-	if (phy_mode < WLAN_PHYMODE_11A ||
-	    phy_mode > WLAN_PHYMODE_11AXA_HE80_80) {
-		temp_phymode = WMI_HOST_MODE_UNKNOWN;
-		return temp_phymode;
-	}
-
-	target_type = lmac_get_tgt_type(psoc);
-
-	/*
-	 * 802.11ax stubbing is enabled only if the enable_11ax_stub module
-	 * parameter is set to 1, and only for QCA9984.
-	 */
-	if (is_11ax_stub_enabled && (target_type == TARGET_TYPE_QCA9984)) {
-		/* re-map 802.11ax modes to equivalent 802.11n/ac modes. */
-		phy_2_wmi[WLAN_PHYMODE_11AXA_HE20] =
-						WMI_HOST_MODE_11AC_VHT20;
-		phy_2_wmi[WLAN_PHYMODE_11AXG_HE20] =
-						WMI_HOST_MODE_11NG_HT20;
-		phy_2_wmi[WLAN_PHYMODE_11AXA_HE40PLUS] =
-						WMI_HOST_MODE_11AC_VHT40;
-		phy_2_wmi[WLAN_PHYMODE_11AXA_HE40MINUS] =
-						WMI_HOST_MODE_11AC_VHT40;
-		phy_2_wmi[WLAN_PHYMODE_11AXG_HE40PLUS] =
-						WMI_HOST_MODE_11NG_HT40;
-		phy_2_wmi[WLAN_PHYMODE_11AXG_HE40MINUS] =
-						WMI_HOST_MODE_11NG_HT40;
-		phy_2_wmi[WLAN_PHYMODE_11AXA_HE40] =
-						WMI_HOST_MODE_11AC_VHT40;
-		phy_2_wmi[WLAN_PHYMODE_11AXG_HE40] =
-						WMI_HOST_MODE_11NG_HT40;
-		phy_2_wmi[WLAN_PHYMODE_11AXA_HE80] =
-						WMI_HOST_MODE_11AC_VHT80;
-		phy_2_wmi[WLAN_PHYMODE_11AXA_HE160] =
-						WMI_HOST_MODE_11AC_VHT160;
-		phy_2_wmi[WLAN_PHYMODE_11AXA_HE80_80] =
-						WMI_HOST_MODE_11AC_VHT80_80;
-	}
-
-	switch (target_type) {
-	case TARGET_TYPE_AR6002:
-	case TARGET_TYPE_AR6003:
-	case TARGET_TYPE_AR6004:
-	case TARGET_TYPE_AR6006:
-	case TARGET_TYPE_AR9888:
-	case TARGET_TYPE_AR6320:
-	case TARGET_TYPE_AR900B:
-	case TARGET_TYPE_QCA9984:
-	case TARGET_TYPE_QCA9888:
-	case TARGET_TYPE_IPQ4019:
-		target = WMI_NON_TLV_TARGET;
-		break;
-	case TARGET_TYPE_QCA8074:
-	case TARGET_TYPE_QCA8074V2:
-		target = WMI_TLV_TARGET;
-		break;
-	case TARGET_TYPE_QCA6290:
-		target = WMI_TLV_TARGET;
-		break;
-	case TARGET_TYPE_QCA6018:
-		target = WMI_TLV_TARGET;
-		break;
-	default:
-		temp_phymode = WMI_HOST_MODE_UNKNOWN;
-		return temp_phymode;
-	}
-
-	temp_phymode = phy_2_wmi[phy_mode];
-
-	if ((target == WMI_TLV_TARGET) && (is_2gvht_en == true)) {
-		switch (phy_mode) {
-		case WLAN_PHYMODE_11NG_HT20:
-			temp_phymode = WMI_HOST_MODE_11AC_VHT20_2G;
-			break;
-
-		case WLAN_PHYMODE_11NG_HT40PLUS:
-		case WLAN_PHYMODE_11NG_HT40MINUS:
-		case WLAN_PHYMODE_11NG_HT40:
-			temp_phymode = WMI_HOST_MODE_11AC_VHT40_2G;
-			break;
-		}
-	}
-
-	return temp_phymode;
-}
-
 static QDF_STATUS target_if_vdev_mgr_set_param_send(
 					struct wlan_objmgr_vdev *vdev,
 					struct vdev_set_params *param)
@@ -312,7 +272,7 @@ static QDF_STATUS target_if_vdev_mgr_set_param_send(
 	int param_id;
 
 	if (!vdev || !param) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -338,7 +298,7 @@ static QDF_STATUS target_if_vdev_mgr_create_send(
 	uint8_t vap_addr[QDF_MAC_ADDR_SIZE] = {0};
 
 	if (!vdev || !param) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -363,13 +323,11 @@ static QDF_STATUS target_if_vdev_mgr_start_send(
 	struct wmi_unified *wmi_handle;
 	struct wlan_objmgr_psoc *psoc;
 	struct wlan_lmac_if_mlme_rx_ops *rx_ops;
-	enum wlan_phymode phy_mode;
-	uint32_t is_2gvht;
-	uint32_t is_11ax_stub_enabled;
 	struct vdev_response_timer *vdev_rsp;
+	uint8_t vdev_id;
 
 	if (!vdev || !param) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -379,48 +337,69 @@ static QDF_STATUS target_if_vdev_mgr_start_send(
 		return QDF_STATUS_E_INVAL;
 	}
 
+	vdev_id = wlan_vdev_get_id(vdev);
 	psoc = wlan_vdev_get_psoc(vdev);
 	rx_ops = target_if_vdev_mgr_get_rx_ops(psoc);
 	if (!rx_ops && !rx_ops->vdev_mgr_get_response_timer_info) {
-		mlme_err("No Rx Ops");
+		mlme_err("VDEV_%d: No Rx Ops", vdev_id);
 		return QDF_STATUS_E_INVAL;
 	}
 
 	vdev_rsp = rx_ops->vdev_mgr_get_response_timer_info(vdev);
-	if (vdev_rsp)
-		qdf_timer_start(&vdev_rsp->rsp_timer, START_RESPONSE_TIMER);
-
-	wlan_util_vdev_get_param(vdev, WLAN_MLME_CFG_2G_VHT, &is_2gvht);
-	wlan_util_vdev_get_param(vdev, WLAN_MLME_CFG_11AX_STUB,
-				 &is_11ax_stub_enabled);
+	if (vdev_rsp) {
+		vdev_rsp->expire_time = START_RESPONSE_TIMER;
+		if (param->is_restart)
+			target_if_vdev_mgr_rsp_timer_start(
+							vdev, vdev_rsp,
+							RESTART_RESPONSE_BIT);
+		else
+			target_if_vdev_mgr_rsp_timer_start(
+							vdev, vdev_rsp,
+							START_RESPONSE_BIT);
+	}
 
-	phy_mode = target_if_wmi_phymode_from_wlan_phymode(
-							vdev,
-							param->channel.phy_mode,
-							is_2gvht,
-							is_11ax_stub_enabled);
-	param->channel.phy_mode = phy_mode;
 	status = wmi_unified_vdev_start_send(wmi_handle, param);
-	if (QDF_IS_STATUS_SUCCESS(status)) {
-		if (qdf_atomic_test_and_set_bit(START_RESPONSE_BIT,
-						&vdev_rsp->rsp_status))
-			mlme_debug("Response bit already set");
-	} else {
-		qdf_timer_stop(&vdev_rsp->rsp_timer);
+	if (QDF_IS_STATUS_ERROR(status) && vdev_rsp) {
+		vdev_rsp->timer_status = QDF_STATUS_E_CANCELED;
+		vdev_rsp->expire_time = 0;
+		if (param->is_restart)
+			target_if_vdev_mgr_rsp_timer_stop(vdev, vdev_rsp,
+							  RESTART_RESPONSE_BIT);
+		else
+			target_if_vdev_mgr_rsp_timer_stop(vdev, vdev_rsp,
+							  START_RESPONSE_BIT);
 	}
 
 	return status;
 }
 
+static QDF_STATUS target_if_vdev_mgr_delete_response_send(
+				struct wlan_objmgr_vdev *vdev,
+				struct wlan_lmac_if_mlme_rx_ops *rx_ops)
+{
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
+	struct wlan_objmgr_psoc *psoc = wlan_vdev_get_psoc(vdev);
+	struct vdev_delete_response rsp = {0};
+
+	rsp.vdev_id = wlan_vdev_get_id(vdev);
+	status = rx_ops->vdev_mgr_delete_response(psoc, &rsp);
+
+	return status;
+}
+
 static QDF_STATUS target_if_vdev_mgr_delete_send(
 					struct wlan_objmgr_vdev *vdev,
 					struct vdev_delete_params *param)
 {
 	QDF_STATUS status;
+	struct wlan_objmgr_psoc *psoc;
 	struct wmi_unified *wmi_handle;
+	struct vdev_response_timer *vdev_rsp;
+	struct wlan_lmac_if_mlme_rx_ops *rx_ops;
+	uint8_t vdev_id;
 
 	if (!vdev || !param) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -430,7 +409,39 @@ static QDF_STATUS target_if_vdev_mgr_delete_send(
 		return QDF_STATUS_E_INVAL;
 	}
 
+	vdev_id = wlan_vdev_get_id(vdev);
+	psoc = wlan_vdev_get_psoc(vdev);
+	rx_ops = target_if_vdev_mgr_get_rx_ops(psoc);
+	if (!rx_ops && !rx_ops->vdev_mgr_get_response_timer_info) {
+		mlme_err("VDEV_%d: No Rx Ops", vdev_id);
+		return QDF_STATUS_E_INVAL;
+	}
+
+	vdev_rsp = rx_ops->vdev_mgr_get_response_timer_info(vdev);
+	if (vdev_rsp) {
+		vdev_rsp->expire_time = DELETE_RESPONSE_TIMER;
+		target_if_vdev_mgr_rsp_timer_start(vdev, vdev_rsp,
+						   DELETE_RESPONSE_BIT);
+	}
+
 	status = wmi_unified_vdev_delete_send(wmi_handle, param->vdev_id);
+	if (QDF_IS_STATUS_SUCCESS(status)) {
+		/*
+		 * pre lithium chipsets doesn't have a delete response
+		 * hence fake response is sent
+		 */
+		if (target_if_check_is_pre_lithium(psoc) ||
+		    wlan_psoc_nif_feat_cap_get(psoc,
+					       WLAN_SOC_F_TESTMODE_ENABLE))
+			target_if_vdev_mgr_delete_response_send(vdev, rx_ops);
+	} else {
+		if (vdev_rsp) {
+			vdev_rsp->expire_time = 0;
+			vdev_rsp->timer_status = QDF_STATUS_E_CANCELED;
+			target_if_vdev_mgr_rsp_timer_stop(vdev, vdev_rsp,
+							  DELETE_RESPONSE_BIT);
+		}
+	}
 
 	return status;
 }
@@ -444,9 +455,10 @@ static QDF_STATUS target_if_vdev_mgr_stop_send(
 	struct wlan_lmac_if_mlme_rx_ops *rx_ops;
 	struct wlan_objmgr_psoc *psoc;
 	struct vdev_response_timer *vdev_rsp;
+	uint8_t vdev_id;
 
 	if (!vdev || !param) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -456,25 +468,28 @@ static QDF_STATUS target_if_vdev_mgr_stop_send(
 		return QDF_STATUS_E_INVAL;
 	}
 
+	vdev_id = wlan_vdev_get_id(vdev);
 	psoc = wlan_vdev_get_psoc(vdev);
 	rx_ops = target_if_vdev_mgr_get_rx_ops(psoc);
 
 	if (!rx_ops && !rx_ops->vdev_mgr_get_response_timer_info) {
-		mlme_err("No Rx Ops");
+		mlme_err("VDEV_%d: No Rx Ops", vdev_id);
 		return QDF_STATUS_E_INVAL;
 	}
 
 	vdev_rsp = rx_ops->vdev_mgr_get_response_timer_info(vdev);
-	if (vdev_rsp)
-		qdf_timer_start(&vdev_rsp->rsp_timer, STOP_RESPONSE_TIMER);
+	if (vdev_rsp) {
+		vdev_rsp->expire_time = STOP_RESPONSE_TIMER;
+		target_if_vdev_mgr_rsp_timer_start(vdev, vdev_rsp,
+						   STOP_RESPONSE_BIT);
+	}
 
 	status = wmi_unified_vdev_stop_send(wmi_handle, param->vdev_id);
-	if (QDF_IS_STATUS_SUCCESS(status)) {
-		if (qdf_atomic_test_and_set_bit(STOP_RESPONSE_BIT,
-						&vdev_rsp->rsp_status))
-			mlme_debug("Response bit already set");
-	} else {
-		qdf_timer_stop(&vdev_rsp->rsp_timer);
+	if (QDF_IS_STATUS_ERROR(status) && vdev_rsp) {
+		vdev_rsp->expire_time = 0;
+		vdev_rsp->timer_status = QDF_STATUS_E_CANCELED;
+		target_if_vdev_mgr_rsp_timer_stop(vdev, vdev_rsp,
+						  STOP_RESPONSE_BIT);
 	}
 
 	return status;
@@ -488,7 +503,7 @@ static QDF_STATUS target_if_vdev_mgr_down_send(
 	struct wmi_unified *wmi_handle;
 
 	if (!vdev || !param) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -510,13 +525,11 @@ static QDF_STATUS target_if_vdev_mgr_up_send(
 	QDF_STATUS status;
 	struct wmi_unified *wmi_handle;
 	struct vdev_set_params sparam = {0};
-	uint8_t bssid_null[] = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
-	uint8_t *bssid = wlan_vdev_mlme_get_macaddr(vdev);
-	uint8_t *bssid_send;
-	enum QDF_OPMODE opmode;
+	uint8_t bssid[QDF_MAC_ADDR_SIZE];
+	uint8_t vdev_id;
 
 	if (!vdev || !param) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -526,24 +539,26 @@ static QDF_STATUS target_if_vdev_mgr_up_send(
 		return QDF_STATUS_E_INVAL;
 	}
 
-	sparam.vdev_id = wlan_vdev_get_id(vdev);
+	vdev_id = wlan_vdev_get_id(vdev);
+	sparam.vdev_id = vdev_id;
 
 	sparam.param_id = WLAN_MLME_CFG_BEACON_INTERVAL;
 	wlan_util_vdev_get_param(vdev, WLAN_MLME_CFG_BEACON_INTERVAL,
 				 &sparam.param_value);
 	status = target_if_vdev_mgr_set_param_send(vdev, &sparam);
 	if (QDF_IS_STATUS_ERROR(status))
-		mlme_err("Failed to set beacon interval!");
+		mlme_err("VDEV_%d: Failed to set beacon interval!", vdev_id);
 
 	sparam.param_id = WLAN_MLME_CFG_SUBFEE;
 	wlan_util_vdev_get_param(vdev, WLAN_MLME_CFG_SUBFEE,
 				 &sparam.param_value);
 	status = target_if_vdev_mgr_set_param_send(vdev, &sparam);
 	if (QDF_IS_STATUS_ERROR(status))
-		mlme_err("Failed to set SU beam formee!");
+		mlme_err("VDEV_%d: Failed to set SU beam formee!", vdev_id);
 
-	bssid_send = (opmode == QDF_MONITOR_MODE) ? bssid_null : bssid;
-	status = wmi_unified_vdev_up_send(wmi_handle, bssid_send, param);
+	ucfg_wlan_vdev_mgr_get_param_bssid(vdev, bssid);
+
+	status = wmi_unified_vdev_up_send(wmi_handle, bssid, param);
 
 	return status;
 }
@@ -556,7 +571,7 @@ static QDF_STATUS target_if_vdev_mgr_beacon_tmpl_send(
 	struct wmi_unified *wmi_handle;
 
 	if (!vdev || !param) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -578,7 +593,7 @@ static QDF_STATUS target_if_vdev_mgr_set_nac_rssi_send(
 	struct wmi_unified *wmi_handle;
 
 	if (!vdev || !param) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -602,7 +617,7 @@ static QDF_STATUS target_if_vdev_mgr_set_neighbour_rx_cmd_send(
 	struct wmi_unified *wmi_handle;
 
 	if (!vdev || !param) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -626,7 +641,7 @@ static QDF_STATUS target_if_vdev_mgr_sifs_trigger_send(
 	struct wmi_unified *wmi_handle;
 
 	if (!vdev || !param) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -649,7 +664,7 @@ static QDF_STATUS target_if_vdev_mgr_set_custom_aggr_size_cmd_send(
 	struct wmi_unified *wmi_handle;
 
 	if (!vdev || !param) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -673,7 +688,7 @@ static QDF_STATUS target_if_vdev_mgr_config_ratemask_cmd_send(
 	struct wmi_unified *wmi_handle;
 
 	if (!vdev || !param) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -697,7 +712,7 @@ static QDF_STATUS target_if_vdev_mgr_peer_flush_tids_send(
 	struct wmi_unified *wmi_handle;
 
 	if (!vdev || !param) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -720,26 +735,72 @@ static QDF_STATUS target_if_vdev_mgr_multiple_vdev_restart_req_cmd(
 	QDF_STATUS status;
 	struct wmi_unified *wmi_handle;
 	struct wlan_objmgr_psoc *psoc;
+	struct vdev_response_timer *vdev_rsp = NULL;
+	struct wlan_objmgr_vdev *vdev;
+	struct wlan_lmac_if_mlme_rx_ops *rx_ops;
+	uint32_t vdev_id;
 
 	if (!pdev || !param) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
 	psoc = wlan_pdev_get_psoc(pdev);
 	if (!psoc) {
-		QDF_ASSERT(0);
+		mlme_err("PSOC is NULL");
 		return QDF_STATUS_E_INVAL;
 	}
 
-	wmi_handle = get_wmi_unified_hdl_from_psoc(psoc);
+	wmi_handle = get_wmi_unified_hdl_from_pdev(pdev);
 	if (!wmi_handle) {
 		mlme_err("PDEV WMI Handle is NULL!");
 		return QDF_STATUS_E_INVAL;
 	}
 
+	rx_ops = target_if_vdev_mgr_get_rx_ops(psoc);
+	if (!rx_ops && !rx_ops->vdev_mgr_get_response_timer_info) {
+		mlme_err("VDEV_%d: No Rx Ops", vdev_id);
+		return QDF_STATUS_E_INVAL;
+	}
+
+	for (vdev_id = 0; vdev_id < param->num_vdevs ; vdev_id++) {
+		vdev = wlan_objmgr_get_vdev_by_id_from_pdev(
+						pdev,
+						param->vdev_ids[vdev_id],
+						WLAN_VDEV_TARGET_IF_ID);
+		if (vdev) {
+			vdev_rsp =
+				rx_ops->vdev_mgr_get_response_timer_info(vdev);
+			if (vdev_rsp)
+				target_if_vdev_mgr_rsp_timer_start(
+							vdev, vdev_rsp,
+							RESTART_RESPONSE_BIT);
+			wlan_objmgr_vdev_release_ref(vdev,
+						     WLAN_VDEV_TARGET_IF_ID);
+		}
+	}
+
 	status = wmi_unified_send_multiple_vdev_restart_req_cmd(wmi_handle,
 								param);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		for (vdev_id = 0; vdev_id < param->num_vdevs ; vdev_id++) {
+			vdev = wlan_objmgr_get_vdev_by_id_from_pdev(
+						pdev,
+						param->vdev_ids[vdev_id],
+						WLAN_VDEV_TARGET_IF_ID);
+			iv(vdev) {
+				vdev_rsp =
+				rx_ops->vdev_mgr_get_response_timer_info(vdev);
+				if (vdev_rsp)
+					target_if_vdev_mgr_rsp_timer_stop(
+							vdev, vdev_rsp,
+							RESTART_RESPONSE_BIT);
+				wlan_objmgr_vdev_release_ref(
+							vdev,
+							WLAN_VDEV_TARGET_IF_ID);
+			}
+		}
+	}
 
 	return status;
 }
@@ -752,7 +813,7 @@ static QDF_STATUS target_if_vdev_mgr_beacon_send(
 	struct wmi_unified *wmi_handle;
 
 	if (!vdev || !param) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -776,7 +837,7 @@ static QDF_STATUS target_if_vdev_mgr_sta_ps_param_send(
 	int param_id;
 
 	if (!vdev || !param) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -800,7 +861,7 @@ target_if_vdev_mgr_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
 	struct wlan_lmac_if_mlme_tx_ops *mlme_tx_ops;
 
 	if (!tx_ops) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -842,8 +903,14 @@ target_if_vdev_mgr_register_tx_ops(struct wlan_lmac_if_tx_ops *tx_ops)
 			target_if_vdev_mgr_sta_ps_param_send;
 	mlme_tx_ops->target_is_pre_lithium =
 			target_if_check_is_pre_lithium;
-	mlme_tx_ops->vdev_mgr_resp_timer_mgmt =
-			target_if_vdev_mgr_rsp_timer_mgmt;
+	mlme_tx_ops->vdev_mgr_rsp_timer_init =
+			target_if_vdev_mgr_rsp_timer_init;
+	mlme_tx_ops->vdev_mgr_rsp_timer_deinit =
+			target_if_vdev_mgr_rsp_timer_deinit;
+	mlme_tx_ops->vdev_mgr_rsp_timer_mod =
+			target_if_vdev_mgr_rsp_timer_mod;
+	mlme_tx_ops->vdev_mgr_rsp_timer_stop =
+			target_if_vdev_mgr_rsp_timer_stop;
 
 	return QDF_STATUS_SUCCESS;
 }

+ 1 - 0
umac/cmn_services/obj_mgr/inc/wlan_objmgr_cmn.h

@@ -287,6 +287,7 @@ typedef enum {
 	WLAN_MLME_SER_IF_ID        = 46,
 	WLAN_SCHEDULER_ID          = 47,
 	WLAN_CFR_ID                = 48,
+	WLAN_VDEV_TARGET_IF_ID     = 49,
 	WLAN_REF_ID_MAX,
 } wlan_objmgr_ref_dbgid;
 

+ 20 - 12
umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h

@@ -187,7 +187,10 @@ struct wlan_lmac_if_ftm_tx_ops {
  * @get_wifi_iface_id: function to get wifi interface id
  * @vdev_mlme_attach: function to register events
  * @vdev_mlme_detach: function to unregister events
- * @vdev_mlme_rsp_timer_mgmt: function to manage vdev response timer
+ * @vdev_mgr_rsp_timer_init: function to initialize vdev response timer
+ * @vdev_mgr_rsp_timer_deinit: function to free vdev response timer
+ * @vdev_mgr_rsp_timer_mod: function to timer_mod vdev response timer
+ * @vdev_mgr_rsp_timer_stop: function to stop vdev response timer
  * @vdev_create_send: function to send vdev create
  * @vdev_start_send: function to send vdev start
  * @vdev_up_send: function to send vdev up
@@ -207,7 +210,6 @@ struct wlan_lmac_if_ftm_tx_ops {
  * @vdev_bcn_miss_offload_send: function to send beacon miss offload
  * @vdev_sta_ps_param_send: function to sent STA power save config
  * @target_is_pre_lithium: function to get target type status
- * @vdev_mgr_resp_timer_mgmt: function to manage response timer
  */
 struct wlan_lmac_if_mlme_tx_ops {
 	void (*scan_sta_power_events)(struct wlan_objmgr_pdev *pdev,
@@ -215,12 +217,23 @@ struct wlan_lmac_if_mlme_tx_ops {
 	void (*scan_connection_lost)(struct wlan_objmgr_pdev *pdev);
 	void (*scan_end)(struct wlan_objmgr_pdev *pdev);
 	uint32_t (*get_wifi_iface_id) (struct wlan_objmgr_pdev *pdev);
-#ifdef CMN_VDEV_MGR_TGT_IF_ENABLE
 	QDF_STATUS (*vdev_mlme_attach)(struct wlan_objmgr_psoc *psoc);
 	QDF_STATUS (*vdev_mlme_detach)(struct wlan_objmgr_psoc *psoc);
-	QDF_STATUS (*vdev_mlme_rsp_timer_mgmt)(struct wlan_objmgr_vdev *vdev,
-					       qdf_timer_t *rsp_timer,
-					       bool flag);
+#ifdef CMN_VDEV_MGR_TGT_IF_ENABLE
+	QDF_STATUS (*vdev_mgr_rsp_timer_init)(
+					struct wlan_objmgr_vdev *vdev,
+					qdf_timer_t *rsp_timer);
+	QDF_STATUS (*vdev_mgr_rsp_timer_deinit)(
+					struct wlan_objmgr_vdev *vdev,
+					qdf_timer_t *rsp_timer);
+	QDF_STATUS (*vdev_mgr_rsp_timer_mod)(
+					struct wlan_objmgr_vdev *vdev,
+					struct vdev_response_timer *vdev_rsp,
+					int mseconds);
+	QDF_STATUS (*vdev_mgr_rsp_timer_stop)(
+					struct wlan_objmgr_vdev *vdev,
+					struct vdev_response_timer *vdev_rsp,
+					uint8_t clear_bit);
 	QDF_STATUS (*vdev_create_send)(struct wlan_objmgr_vdev *vdev,
 				       struct vdev_create_params *param);
 	QDF_STATUS (*vdev_start_send)(struct wlan_objmgr_vdev *vdev,
@@ -264,10 +277,7 @@ struct wlan_lmac_if_mlme_tx_ops {
 	QDF_STATUS (*vdev_bcn_miss_offload_send)(struct wlan_objmgr_vdev *vdev);
 	QDF_STATUS (*vdev_sta_ps_param_send)(struct wlan_objmgr_vdev *vdev,
 					     struct sta_ps_params *param);
-	QDF_STATUS (*target_is_pre_lithium)(struct wlan_objmgr_psoc *psoc);
-	QDF_STATUS (*vdev_mgr_resp_timer_mgmt)(struct wlan_objmgr_vdev *vdev,
-					     qdf_timer_t *rsp_timer,
-					     bool init);
+	bool (*target_is_pre_lithium)(struct wlan_objmgr_psoc *psoc);
 #endif
 };
 
@@ -1359,7 +1369,6 @@ struct wlan_lmac_if_dfs_rx_ops {
  * @mlme_response_timeout_cb: function to trigger on response time expiry
  * @mlme_start_response: function to handle vdev start response
  * @mlme_stop_response: function to handle vdev stop response
- * @mlme_delete_response: function to handle vdev delete response
  * @mlme_offload_bcn_tx_status_event_handle: function to get offload beacon tx
  * status
  * @mlme_tbttoffset_update_handle: function to handle tbttoffset event
@@ -1425,7 +1434,6 @@ struct wlan_lmac_if_mlme_rx_ops {
 #ifdef CMN_VDEV_MGR_TGT_IF_ENABLE
 	struct vdev_response_timer *(*vdev_mgr_get_response_timer_info)(
 					struct wlan_objmgr_vdev *vdev);
-	void (*vdev_mgr_response_timeout_cb)(struct wlan_objmgr_vdev *vdev);
 	QDF_STATUS (*vdev_mgr_start_response)(
 					struct wlan_objmgr_psoc *psoc,
 					struct vdev_start_response *rsp);

+ 13 - 10
umac/mlme/include/wlan_vdev_mlme.h

@@ -202,6 +202,7 @@ struct vdev_mlme_proto {
  * @is_11ax_stub_enabled: 11AX stub status indication flag
  * @nss_2g: 2G spatial streams
  * @nss_5g: 5G spatial streams
+ * @bssid: bssid
  */
 struct vdev_mlme_mgmt_generic {
 	uint32_t rts_threshold;
@@ -235,6 +236,7 @@ struct vdev_mlme_mgmt_generic {
 	uint8_t is_11ax_stub_enabled;
 	uint8_t nss_2g;
 	uint8_t nss_5g;
+	uint8_t bssid[QDF_MAC_ADDR_SIZE];
 };
 
 /**
@@ -410,6 +412,16 @@ enum vdev_cmd_type {
 	DELETE_REQ,
 };
 
+/**
+ * enum vdev_start_resp_type - start respone type
+ * @START_RESPONSE:  Start response
+ * @RESTART_RESPONSE: Restart response
+ */
+enum vdev_start_resp_type {
+	START_RESPONSE = 0,
+	RESTART_RESPONSE,
+};
+
 /**
  * enum vdev_rsp_type - Response type
  * @START_RSP:      Start Response
@@ -418,7 +430,7 @@ enum vdev_cmd_type {
  * @DELETE_RSP: DELETE Response
  */
 enum vdev_rsp_type {
-	START_RSP,
+	START_RSP = 0,
 	RESTART_RSP,
 	STOP_RSP,
 	DELETE_RSP,
@@ -511,15 +523,6 @@ struct vdev_mlme_ops {
 	QDF_STATUS (*mlme_vdev_notify_down_complete)(
 				struct vdev_mlme_obj *vdev_mlme,
 				uint16_t event_data_len, void *event_data);
-	QDF_STATUS (*mlme_vdev_ext_hdl_create)(
-				struct vdev_mlme_obj *vdev_mlme);
-	QDF_STATUS (*mlme_vdev_ext_hdl_post_create)(
-				struct vdev_mlme_obj *vdev_mlme);
-	QDF_STATUS (*mlme_vdev_ext_hdl_destroy)(
-				struct vdev_mlme_obj *vdev_mlme);
-	QDF_STATUS (*mlme_vdev_enqueue_exp_cmd)(
-				struct vdev_mlme_obj *vdev_mlme,
-				uint8_t cmd_type);
 	QDF_STATUS (*mlme_vdev_ext_delete_rsp)(
 				struct vdev_mlme_obj *vdev_mlme,
 				struct vdev_delete_response *rsp);

+ 15 - 0
umac/mlme/mlme_objmgr/dispatcher/inc/wlan_vdev_mlme_main.h

@@ -21,6 +21,21 @@
 #ifndef _WLAN_VDEV_MLME_MAIN_H_
 #define _WLAN_VDEV_MLME_MAIN_H_
 
+#include <wlan_objmgr_psoc_obj.h>
+#include <wlan_lmac_if_def.h>
+
+/**
+ * wlan_mlme_get_lmac_tx_ops() - get tx ops
+ * @psoc: pointer to psoc obj
+ *
+ * Return: pointer to tx ops
+ */
+static inline struct wlan_lmac_if_mlme_tx_ops *
+wlan_mlme_get_lmac_tx_ops(struct wlan_objmgr_psoc *psoc)
+{
+	return &psoc->soc_cb.tx_ops.mops;
+}
+
 #ifdef CMN_VDEV_MLME_SM_ENABLE
 /**
  * enum wlan_vdev_state - VDEV state

+ 12 - 0
umac/mlme/mlme_objmgr/dispatcher/src/wlan_vdev_mlme_main.c

@@ -159,6 +159,7 @@ static void mlme_scan_serialization_comp_info_cb(
 QDF_STATUS wlan_mlme_psoc_enable(struct wlan_objmgr_psoc *psoc)
 {
 	QDF_STATUS status;
+	struct wlan_lmac_if_mlme_tx_ops *tx_ops;
 
 	status = wlan_serialization_register_comp_info_cb
 			(psoc,
@@ -170,12 +171,18 @@ QDF_STATUS wlan_mlme_psoc_enable(struct wlan_objmgr_psoc *psoc)
 		return status;
 	}
 
+	/* Register for WMI events into target_if rx  */
+	tx_ops = wlan_mlme_get_lmac_tx_ops(psoc);
+	if (tx_ops && tx_ops->vdev_mlme_attach)
+		tx_ops->vdev_mlme_attach(psoc);
+
 	return QDF_STATUS_SUCCESS;
 }
 
 QDF_STATUS wlan_mlme_psoc_disable(struct wlan_objmgr_psoc *psoc)
 {
 	QDF_STATUS status;
+	struct wlan_lmac_if_mlme_tx_ops *tx_ops;
 
 	status = wlan_serialization_deregister_comp_info_cb
 						(psoc,
@@ -186,6 +193,11 @@ QDF_STATUS wlan_mlme_psoc_disable(struct wlan_objmgr_psoc *psoc)
 		return status;
 	}
 
+	/* Unregister WMI events  */
+	tx_ops = wlan_mlme_get_lmac_tx_ops(psoc);
+	if (tx_ops && tx_ops->vdev_mlme_detach)
+		tx_ops->vdev_mlme_detach(psoc);
+
 	return QDF_STATUS_SUCCESS;
 }
 

+ 18 - 16
umac/mlme/vdev_mgr/core/src/vdev_mgr_ops.c

@@ -44,13 +44,13 @@ static QDF_STATUS vdev_mgr_create_param_update(
 
 	vdev = mlme_obj->vdev;
 	if (!vdev) {
-		QDF_ASSERT(0);
+		mlme_err("VDEV is NULL");
 		return QDF_STATUS_E_INVAL;
 	}
 
 	pdev = wlan_vdev_get_pdev(vdev);
 	if (!pdev) {
-		QDF_ASSERT(0);
+		mlme_err("PDEV is NULL");
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -73,7 +73,7 @@ QDF_STATUS vdev_mgr_create_send(struct vdev_mlme_obj *mlme_obj)
 	struct vdev_create_params param = {0};
 
 	if (!mlme_obj) {
-		QDF_ASSERT(0);
+		mlme_err("VDEV_MLME is NULL");
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -102,13 +102,13 @@ static QDF_STATUS vdev_mgr_start_param_update(
 
 	vdev = mlme_obj->vdev;
 	if (!vdev) {
-		QDF_ASSERT(0);
+		mlme_err("VDEV is NULL");
 		return QDF_STATUS_E_INVAL;
 	}
 
 	pdev = wlan_vdev_get_pdev(vdev);
 	if (!pdev) {
-		QDF_ASSERT(0);
+		mlme_err("PDEV is NULL");
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -191,7 +191,7 @@ QDF_STATUS vdev_mgr_start_send(
 	struct vdev_start_params param = {0};
 
 	if (!mlme_obj) {
-		QDF_ASSERT(0);
+		mlme_err("VDEV_MLME is NULL");
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -215,7 +215,7 @@ static QDF_STATUS vdev_mgr_delete_param_update(
 
 	vdev = mlme_obj->vdev;
 	if (!vdev) {
-		QDF_ASSERT(0);
+		mlme_err("VDEV is NULL");
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -229,7 +229,7 @@ QDF_STATUS vdev_mgr_delete_send(struct vdev_mlme_obj *mlme_obj)
 	struct vdev_delete_params param;
 
 	if (!mlme_obj) {
-		QDF_ASSERT(0);
+		mlme_err("VDEV_MLME is NULL");
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -252,7 +252,7 @@ static QDF_STATUS vdev_mgr_stop_param_update(
 
 	vdev = mlme_obj->vdev;
 	if (!vdev) {
-		QDF_ASSERT(0);
+		mlme_err("VDEV is NULL");
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -267,7 +267,7 @@ QDF_STATUS vdev_mgr_stop_send(struct vdev_mlme_obj *mlme_obj)
 	struct vdev_stop_params param = {0};
 
 	if (!mlme_obj) {
-		QDF_ASSERT(0);
+		mlme_err("VDEV_MLME is NULL");
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -350,13 +350,13 @@ QDF_STATUS vdev_mgr_up_send(struct vdev_mlme_obj *mlme_obj)
 	struct wlan_objmgr_vdev *vdev;
 
 	if (!mlme_obj) {
-		QDF_ASSERT(0);
+		mlme_err("VDEV_MLME is NULL");
 		return QDF_STATUS_E_INVAL;
 	}
 
 	vdev = mlme_obj->vdev;
 	if (!vdev) {
-		QDF_ASSERT(0);
+		mlme_err("VDEV is NULL");
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -391,7 +391,7 @@ static QDF_STATUS vdev_mgr_down_param_update(
 
 	vdev = mlme_obj->vdev;
 	if (!vdev) {
-		QDF_ASSERT(0);
+		mlme_err("VDEV is NULL");
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -406,7 +406,7 @@ QDF_STATUS vdev_mgr_down_send(struct vdev_mlme_obj *mlme_obj)
 	struct vdev_down_params param = {0};
 
 	if (!mlme_obj) {
-		QDF_ASSERT(0);
+		mlme_err("VDEV_MLME is NULL");
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -431,7 +431,7 @@ static QDF_STATUS vdev_mgr_peer_flush_tids_param_update(
 
 	vdev = mlme_obj->vdev;
 	if (!vdev) {
-		QDF_ASSERT(0);
+		mlme_err("VDEV is NULL");
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -449,7 +449,7 @@ QDF_STATUS vdev_mgr_peer_flush_tids_send(struct vdev_mlme_obj *mlme_obj,
 	struct peer_flush_params param = {0};
 
 	if (!mlme_obj || !mac) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -502,3 +502,5 @@ QDF_STATUS vdev_mgr_multiple_restart_send(struct wlan_objmgr_pdev *pdev,
 
 	return tgt_vdev_mgr_multiple_vdev_restart_send(pdev, &param);
 }
+
+qdf_export_symbol(vdev_mgr_multiple_restart_send);

+ 2 - 2
umac/mlme/vdev_mgr/core/src/vdev_mgr_ops.h

@@ -172,7 +172,7 @@ QDF_STATUS vdev_mgr_config_ratemask_cmd_send(
 				uint32_t lower32_2);
 
 /**
- * vdev_mgr_beacon_stop() – MLME API to stop beacn
+ * vdev_mgr_beacon_stop() – MLME API to stop beacon
  * @mlme_obj: pointer to vdev_mlme_obj
  *
  * Return: QDF_STATUS - Success or Failure
@@ -180,7 +180,7 @@ QDF_STATUS vdev_mgr_config_ratemask_cmd_send(
 QDF_STATUS vdev_mgr_beacon_stop(struct vdev_mlme_obj *mlme_obj);
 
 /**
- * vdev_mgr_beacon_free() – MLME API to free beacn
+ * vdev_mgr_beacon_free() – MLME API to free beacon
  * @mlme_obj: pointer to vdev_mlme_obj
  *
  * Return: QDF_STATUS - Success or Failure

+ 9 - 2
umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_rx_defs.h

@@ -29,8 +29,11 @@
 #include <qdf_timer.h>
 
 #define START_RESPONSE_BIT  0x1
-#define STOP_RESPONSE_BIT   0x2
-#define DELETE_RESPONSE_BIT 0x3
+#define RESTART_RESPONSE_BIT  0x2
+#define STOP_RESPONSE_BIT   0x3
+#define DELETE_RESPONSE_BIT 0x4
+#define RESPONSE_BIT_MAX (START_RESPONSE_BIT | RESTART_RESPONSE_BIT |\
+			  STOP_RESPONSE_BIT | DELETE_RESPONSE_BIT)
 
 #define START_RESPONSE_TIMER 6000 /* 6 seconds */
 #define STOP_RESPONSE_TIMER  2000 /* 2 seconds */
@@ -40,10 +43,14 @@
  * struct vdev_response_timer - vdev mgmt response ops timer
  * @rsp_timer: VDEV MLME mgmt response timer
  * @rsp_status: variable to check response status
+ * @expire_time: time to expire timer
+ * @timer_status: status of timer
  */
 struct vdev_response_timer {
 	qdf_timer_t rsp_timer;
 	unsigned long rsp_status;
+	uint32_t expire_time;
+	QDF_STATUS timer_status;
 };
 
 /**

+ 0 - 13
umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_tx_api.h

@@ -32,19 +32,6 @@
 #include <wlan_vdev_mgr_tgt_if_tx_defs.h>
 #include <include/wlan_vdev_mlme.h>
 
-/**
- * tgt_vdev_mgr_rsp_timer_mgmt() – API to handle response timer, responsible
- * for initializing and freeing
- * @vdev: pointer to vdev
- * @rsp_timer: response timer
- * @init: flag to indicate whether to init/free
- *
- * Return: QDF_STATUS - Success or Failure
- */
-QDF_STATUS tgt_vdev_mgr_rsp_timer_mgmt(
-				struct wlan_objmgr_vdev *vdev,
-				qdf_timer_t *rsp_timer, bool init);
-
 /**
  * tgt_vdev_mgr_create_send() – API to send create command
  * @mlme_obj: pointer to vdev_mlme_obj

+ 11 - 0
umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_ucfg_api.h

@@ -155,6 +155,17 @@ void ucfg_wlan_vdev_mgr_get_param_ssid(struct wlan_objmgr_vdev *vdev,
 				       uint8_t *ssid,
 				       uint8_t *ssid_len);
 
+/**
+ * ucfg_wlan_vdev_mgr_get_param_bssid() – ucfg MLME API to
+ * get bssid from mlme vdev mgr component
+ * @vdev: pointer to vdev object
+ * @bssid: pointer to store the bssid
+ *
+ */
+void ucfg_wlan_vdev_mgr_get_param_bssid(
+				struct wlan_objmgr_vdev *vdev,
+				uint8_t *bssid);
+
 /**
  * ucfg_wlan_vdev_mgr_get_beacon_buffer() – ucfg MLME API to
  * get beacon buffer from mlme vdev mgr component

+ 1 - 1
umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_utils_api.h

@@ -68,7 +68,7 @@ void wlan_util_vdev_mlme_get_param(struct vdev_mlme_obj *vdev_mlme,
 /**
  * wlan_util_vdev_get_param() – common MLME API to get common
  * parameters of vdev_mlme object
- * @vdev_mlme: pointer to vdev_mlme object
+ * @vdev: pointer to vdev object
  * @param_id: param id for which the value should be set
  * @param_value: value that should bem set to the parameter
  *

+ 69 - 65
umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mgr_tgt_if_rx_api.c

@@ -27,11 +27,7 @@
 #include <include/wlan_vdev_mlme.h>
 #include <wlan_mlme_dbg.h>
 #include <wlan_vdev_mlme_api.h>
-
-static void tgt_vdev_mgr_response_timeout_handler(
-					struct wlan_objmgr_vdev *vdev)
-{
-}
+#include <target_if_vdev_mgr_tx_ops.h>
 
 static struct vdev_response_timer *
 tgt_vdev_mgr_get_response_timer_info(struct wlan_objmgr_vdev *vdev)
@@ -40,14 +36,14 @@ tgt_vdev_mgr_get_response_timer_info(struct wlan_objmgr_vdev *vdev)
 
 	vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
 	if (!vdev_mlme) {
-		QDF_ASSERT(0);
+		mlme_err("VDEV_%d: VDEV_MLME is NULL", wlan_vdev_get_id(vdev));
 		return NULL;
 	}
 
 	return &vdev_mlme->vdev_rt;
 }
 
-static QDF_STATUS tgt_vdev_mgr_start_response_handle(
+static QDF_STATUS tgt_vdev_mgr_start_response_handler(
 					struct wlan_objmgr_psoc *psoc,
 					struct vdev_start_response *rsp)
 {
@@ -55,47 +51,52 @@ static QDF_STATUS tgt_vdev_mgr_start_response_handle(
 	struct vdev_mlme_obj *vdev_mlme;
 	struct wlan_objmgr_vdev *vdev;
 	struct vdev_response_timer *vdev_rsp;
+	struct wlan_lmac_if_mlme_tx_ops *tx_ops;
 
 	if (!rsp || !psoc) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
 	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, rsp->vdev_id,
-						    WLAN_MLME_SB_ID);
+						    WLAN_VDEV_TARGET_IF_ID);
 	if (!vdev) {
-		QDF_ASSERT(0);
+		mlme_err("VDEV is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
 
 	vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
 	if (!vdev_mlme) {
-		QDF_ASSERT(0);
-		goto tgt_vdev_mgr_start_response_handle_end;
+		mlme_err("VDEV_%d: VDEV_MLME is NULL", rsp->vdev_id);
+		goto tgt_vdev_mgr_start_response_handler_end;
 	}
 
 	vdev_rsp = &vdev_mlme->vdev_rt;
 	if (!vdev_rsp)
-		goto tgt_vdev_mgr_start_response_handle_end;
-
-	if (!qdf_atomic_test_and_clear_bit(START_RESPONSE_BIT,
-					   &vdev_rsp->rsp_status)) {
-		mlme_info("Unexpected response");
-		goto tgt_vdev_mgr_start_response_handle_end;
+		goto tgt_vdev_mgr_start_response_handler_end;
+
+	tx_ops = target_if_vdev_mgr_get_tx_ops(psoc);
+	if (rsp->resp_type == RESTART_RESPONSE)
+		status = tx_ops->vdev_mgr_rsp_timer_stop(vdev, vdev_rsp,
+							 RESTART_RESPONSE_BIT);
+	else
+		status = tx_ops->vdev_mgr_rsp_timer_stop(vdev, vdev_rsp,
+							 START_RESPONSE_BIT);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		mlme_err("VDEV_%d: Unexpected response", rsp->vdev_id);
+		goto tgt_vdev_mgr_start_response_handler_end;
 	}
 
-	qdf_timer_stop(&vdev_rsp->rsp_timer);
-
 	if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_ext_start_rsp)
 		status = vdev_mlme->ops->mlme_vdev_ext_start_rsp(
 								vdev_mlme,
 								rsp);
-tgt_vdev_mgr_start_response_handle_end:
-	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_SB_ID);
+tgt_vdev_mgr_start_response_handler_end:
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_VDEV_TARGET_IF_ID);
 	return status;
 }
 
-static QDF_STATUS tgt_vdev_mgr_stop_response_handle(
+static QDF_STATUS tgt_vdev_mgr_stop_response_handler(
 					struct wlan_objmgr_psoc *psoc,
 					struct vdev_stop_response *rsp)
 {
@@ -103,47 +104,48 @@ static QDF_STATUS tgt_vdev_mgr_stop_response_handle(
 	struct vdev_mlme_obj *vdev_mlme;
 	struct wlan_objmgr_vdev *vdev;
 	struct vdev_response_timer *vdev_rsp;
+	struct wlan_lmac_if_mlme_tx_ops *tx_ops;
 
 	if (!rsp || !psoc) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
 	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, rsp->vdev_id,
-						    WLAN_MLME_SB_ID);
+						    WLAN_VDEV_TARGET_IF_ID);
 	if (!vdev) {
-		QDF_ASSERT(0);
+		mlme_err("VDEV is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
 
 	vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
 	if (!vdev_mlme) {
-		QDF_ASSERT(0);
-		goto tgt_vdev_mgr_stop_response_handle_end;
+		mlme_err("VDEV_%d: VDEV_MLME is NULL", rsp->vdev_id);
+		goto tgt_vdev_mgr_stop_response_handler_end;
 	}
 
 	vdev_rsp = &vdev_mlme->vdev_rt;
 	if (!vdev_rsp)
-		goto tgt_vdev_mgr_stop_response_handle_end;
-
-	if (!qdf_atomic_test_and_clear_bit(STOP_RESPONSE_BIT,
-					   &vdev_rsp->rsp_status)) {
-		mlme_info("Unexpected response");
-		goto tgt_vdev_mgr_stop_response_handle_end;
+		goto tgt_vdev_mgr_stop_response_handler_end;
+
+	tx_ops = target_if_vdev_mgr_get_tx_ops(psoc);
+	status = tx_ops->vdev_mgr_rsp_timer_stop(vdev, vdev_rsp,
+						 STOP_RESPONSE_BIT);
+	if (QDF_IS_STATUS_ERROR(status)) {
+		mlme_err("VDEV_%d: Unexpected response", rsp->vdev_id);
+		goto tgt_vdev_mgr_stop_response_handler_end;
 	}
 
-	qdf_timer_stop(&vdev_rsp->rsp_timer);
-
 	if ((vdev_mlme->ops) && vdev_mlme->ops->mlme_vdev_ext_stop_rsp)
 		status = vdev_mlme->ops->mlme_vdev_ext_stop_rsp(
 								vdev_mlme,
 								rsp);
-tgt_vdev_mgr_stop_response_handle_end:
-	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_SB_ID);
+tgt_vdev_mgr_stop_response_handler_end:
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_VDEV_TARGET_IF_ID);
 	return status;
 }
 
-static QDF_STATUS tgt_vdev_mgr_delete_response_handle(
+QDF_STATUS tgt_vdev_mgr_delete_response_handler(
 					struct wlan_objmgr_psoc *psoc,
 					struct vdev_delete_response *rsp)
 {
@@ -151,51 +153,55 @@ static QDF_STATUS tgt_vdev_mgr_delete_response_handle(
 	struct vdev_mlme_obj *vdev_mlme;
 	struct wlan_objmgr_vdev *vdev;
 	struct vdev_response_timer *vdev_rsp;
+	struct wlan_lmac_if_mlme_tx_ops *tx_ops;
 
 	if (!rsp || !psoc) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
-	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc, rsp->vdev_id,
-						    WLAN_MLME_SB_ID);
+	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(psoc,
+						    rsp->vdev_id,
+						    WLAN_VDEV_TARGET_IF_ID);
 	if (!vdev) {
-		QDF_ASSERT(0);
+		mlme_err("VDEV is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
 
 	vdev_mlme = wlan_vdev_mlme_get_cmpt_obj(vdev);
 	if (!vdev_mlme) {
-		QDF_ASSERT(0);
-		goto tgt_vdev_mgr_delete_response_handle_end;
+		mlme_err("VDEV_%d: VDEV_MLME is NULL", rsp->vdev_id);
+		goto tgt_vdev_mgr_delete_response_handler_end;
 	}
 
 	vdev_rsp = &vdev_mlme->vdev_rt;
 	if (!vdev_rsp)
-		goto tgt_vdev_mgr_delete_response_handle_end;
-
-	if (!qdf_atomic_test_and_clear_bit(DELETE_RESPONSE_BIT,
-					   &vdev_rsp->rsp_status)) {
-		mlme_info("Unexpected response");
-		goto tgt_vdev_mgr_delete_response_handle_end;
+		goto tgt_vdev_mgr_delete_response_handler_end;
+
+	tx_ops = target_if_vdev_mgr_get_tx_ops(psoc);
+	status = tx_ops->vdev_mgr_rsp_timer_stop(vdev, vdev_rsp,
+						 DELETE_RESPONSE_BIT);
+	if (QDF_IS_STATUS_SUCCESS(status)) {
+		tx_ops->vdev_mgr_rsp_timer_deinit(vdev, &vdev_rsp->rsp_timer);
+	} else {
+		mlme_err("VDEV_%d: Unexpected response", rsp->vdev_id);
+		goto tgt_vdev_mgr_delete_response_handler_end;
 	}
 
-	qdf_timer_stop(&vdev_rsp->rsp_timer);
-
 	if ((vdev_mlme->ops) &&
 	    vdev_mlme->ops->mlme_vdev_ext_delete_rsp)
 		status = vdev_mlme->ops->mlme_vdev_ext_delete_rsp(
 								vdev_mlme,
 								rsp);
 
-tgt_vdev_mgr_delete_response_handle_end:
-	wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_SB_ID);
+tgt_vdev_mgr_delete_response_handler_end:
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_VDEV_TARGET_IF_ID);
 	return status;
 }
 
 static QDF_STATUS
-tgt_vdev_mgr_offload_bcn_tx_status_event_handle(uint32_t vdev_id,
-						uint32_t tx_status)
+tgt_vdev_mgr_offload_bcn_tx_status_event_handler(uint32_t vdev_id,
+						 uint32_t tx_status)
 {
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
 
@@ -203,7 +209,7 @@ tgt_vdev_mgr_offload_bcn_tx_status_event_handle(uint32_t vdev_id,
 }
 
 static QDF_STATUS
-tgt_vdev_mgr_tbttoffset_update_handle(uint32_t num_vdevs, bool is_ext)
+tgt_vdev_mgr_tbttoffset_update_handler(uint32_t num_vdevs, bool is_ext)
 {
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
 
@@ -223,17 +229,15 @@ void tgt_vdev_mgr_register_rx_ops(struct wlan_lmac_if_rx_ops *rx_ops)
 	struct wlan_lmac_if_mlme_rx_ops *mlme_rx_ops = &rx_ops->mops;
 
 	mlme_rx_ops->vdev_mgr_offload_bcn_tx_status_event_handle =
-		tgt_vdev_mgr_offload_bcn_tx_status_event_handle;
+		tgt_vdev_mgr_offload_bcn_tx_status_event_handler;
 	mlme_rx_ops->vdev_mgr_tbttoffset_update_handle =
-		tgt_vdev_mgr_tbttoffset_update_handle;
+		tgt_vdev_mgr_tbttoffset_update_handler;
 	mlme_rx_ops->vdev_mgr_start_response =
-		tgt_vdev_mgr_start_response_handle;
+		tgt_vdev_mgr_start_response_handler;
 	mlme_rx_ops->vdev_mgr_stop_response =
-		tgt_vdev_mgr_stop_response_handle;
+		tgt_vdev_mgr_stop_response_handler;
 	mlme_rx_ops->vdev_mgr_delete_response =
-		tgt_vdev_mgr_delete_response_handle;
+		tgt_vdev_mgr_delete_response_handler;
 	mlme_rx_ops->vdev_mgr_get_response_timer_info =
 		tgt_vdev_mgr_get_response_timer_info;
-	mlme_rx_ops->vdev_mgr_response_timeout_cb =
-		tgt_vdev_mgr_response_timeout_handler;
 }

+ 121 - 141
umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mgr_tgt_if_tx_api.c

@@ -35,6 +35,7 @@
 #include <wlan_dfs_utils_api.h>
 #include <wlan_vdev_mgr_utils_api.h>
 #include <wlan_vdev_mgr_ucfg_api.h>
+#include <wlan_vdev_mlme_main.h>
 
 static inline struct wlan_lmac_if_mlme_tx_ops
 *wlan_vdev_mlme_get_lmac_txops(struct wlan_objmgr_vdev *vdev)
@@ -46,22 +47,6 @@ static inline struct wlan_lmac_if_mlme_tx_ops
 	return target_if_vdev_mgr_get_tx_ops(psoc);
 }
 
-QDF_STATUS tgt_vdev_mgr_rsp_timer_mgmt(
-				struct wlan_objmgr_vdev *vdev,
-				qdf_timer_t *rsp_timer,
-				bool init)
-{
-	struct wlan_lmac_if_mlme_tx_ops *txops;
-
-	txops = wlan_vdev_mlme_get_lmac_txops(vdev);
-	if (!txops || !txops->vdev_mlme_rsp_timer_mgmt) {
-		mlme_err("No Tx Ops");
-		return QDF_STATUS_E_INVAL;
-	}
-
-	return txops->vdev_mlme_rsp_timer_mgmt(vdev, rsp_timer, init);
-}
-
 QDF_STATUS tgt_vdev_mgr_create_send(
 				struct vdev_mlme_obj *mlme_obj,
 				struct vdev_create_params *param)
@@ -80,52 +65,46 @@ QDF_STATUS tgt_vdev_mgr_create_send(
 	struct vdev_response_timer *vdev_rsp;
 
 	if (!param) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
 	vdev = mlme_obj->vdev;
+	vdev_id = wlan_vdev_get_id(vdev);
 	txops = wlan_vdev_mlme_get_lmac_txops(vdev);
 	if (!txops || !txops->vdev_create_send ||
-	    !txops->vdev_mgr_resp_timer_mgmt) {
-		mlme_err("No Tx Ops");
+	    !txops->vdev_mgr_rsp_timer_init) {
+		mlme_err("VDEV_%d: No Tx Ops", vdev_id);
 		return QDF_STATUS_E_INVAL;
 	}
 
+	status = txops->vdev_create_send(vdev, param);
+	if (QDF_IS_STATUS_SUCCESS(status)) {
+		vdev_rsp = &mlme_obj->vdev_rt;
+		txops->vdev_mgr_rsp_timer_init(vdev, &vdev_rsp->rsp_timer);
+	} else {
+		mlme_err("VDEV_%d: Tx Ops Error : %d", vdev_id, status);
+		return status;
+	}
+
 	cdp_txrx_opmode = wlan_util_vdev_get_cdp_txrx_opmode(vdev);
-	vdev_id = wlan_vdev_get_id(vdev);
 	vdev_addr = wlan_vdev_mlme_get_macaddr(vdev);
 	psoc = wlan_vdev_get_psoc(vdev);
 	pdev = wlan_vdev_get_pdev(vdev);
 	soc_txrx_handle = wlan_psoc_get_dp_handle(psoc);
 	pdev_txrx_handle = wlan_pdev_get_dp_handle(pdev);
 	if (!soc_txrx_handle || !pdev_txrx_handle)
-		goto tgt_vdev_mgr_create_end;
+		return QDF_STATUS_E_FAILURE;
 
 	vdev_txrx_handle = cdp_vdev_attach(soc_txrx_handle,
 					   pdev_txrx_handle,
 					   vdev_addr, vdev_id,
 					   cdp_txrx_opmode);
 	if (!vdev_txrx_handle)
-		goto tgt_vdev_mgr_create_end;
+		return QDF_STATUS_E_FAILURE;
 
 	wlan_vdev_set_dp_handle(vdev, vdev_txrx_handle);
-	status = txops->vdev_create_send(vdev, param);
-	if (QDF_IS_STATUS_ERROR(status)) {
-		mlme_err("Tx Ops Error : %d", status);
-		goto tgt_vdev_mgr_create_send_end;
-	} else {
-		vdev_rsp = &mlme_obj->vdev_rt;
-		txops->vdev_mgr_resp_timer_mgmt(vdev, &vdev_rsp->rsp_timer,
-						true);
-	}
-
-	return status;
 
-tgt_vdev_mgr_create_send_end:
-	wlan_vdev_set_dp_handle(vdev, NULL);
-	cdp_vdev_detach(soc_txrx_handle, vdev_txrx_handle, NULL, NULL);
-tgt_vdev_mgr_create_end:
 	return status;
 }
 
@@ -136,12 +115,14 @@ QDF_STATUS tgt_vdev_mgr_create_complete(struct vdev_mlme_obj *vdev_mlme)
 	struct vdev_set_params param = {0};
 	struct wlan_lmac_if_mlme_tx_ops *txops;
 	struct vdev_mlme_inactivity_params *inactivity;
+	uint8_t vdev_id;
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 
 	vdev = vdev_mlme->vdev;
+	vdev_id = wlan_vdev_get_id(vdev);
 	txops = wlan_vdev_mlme_get_lmac_txops(vdev);
 	if (!txops || !txops->vdev_set_param_send) {
-		mlme_err("No Tx Ops");
+		mlme_err("VDEV_%d: No Tx Ops", vdev_id);
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -154,29 +135,33 @@ QDF_STATUS tgt_vdev_mgr_create_complete(struct vdev_mlme_obj *vdev_mlme)
 		param.param_id = WLAN_MLME_CFG_BCN_TX_RATE;
 		status = txops->vdev_set_param_send(vdev, &param);
 		if (QDF_IS_STATUS_ERROR(status))
-			mlme_err("Failed to set beacon rate!");
+			mlme_err("VDEV_%d: Failed to set beacon rate!",
+				 vdev_id);
+	}
 
-		param.param_value =
-			inactivity->keepalive_min_idle_inactive_time_secs;
-		param.param_id = WLAN_MLME_CFG_MIN_IDLE_INACTIVE_TIME;
-		status = txops->vdev_set_param_send(vdev, &param);
-		if (QDF_IS_STATUS_ERROR(status))
-			mlme_err("Failed to set min idle inactive time!");
+	param.param_value =
+		inactivity->keepalive_min_idle_inactive_time_secs;
+	param.param_id = WLAN_MLME_CFG_MIN_IDLE_INACTIVE_TIME;
+	status = txops->vdev_set_param_send(vdev, &param);
+	if (QDF_IS_STATUS_ERROR(status))
+		mlme_err("VDEV_%d: Failed to set min idle inactive time!",
+			 vdev_id);
 
-		param.param_value =
-			inactivity->keepalive_max_idle_inactive_time_secs;
-		param.param_id = WLAN_MLME_CFG_MAX_IDLE_INACTIVE_TIME;
-		status = txops->vdev_set_param_send(vdev, &param);
-		if (QDF_IS_STATUS_ERROR(status))
-			mlme_err("Failed to set max idle inactive time!");
+	param.param_value =
+		inactivity->keepalive_max_idle_inactive_time_secs;
+	param.param_id = WLAN_MLME_CFG_MAX_IDLE_INACTIVE_TIME;
+	status = txops->vdev_set_param_send(vdev, &param);
+	if (QDF_IS_STATUS_ERROR(status))
+		mlme_err("VDEV_%d: Failed to set max idle inactive time!",
+			 vdev_id);
 
-		param.param_value =
-			inactivity->keepalive_max_unresponsive_time_secs;
-		param.param_id = WLAN_MLME_CFG_MAX_UNRESPONSIVE_INACTIVE_TIME;
-		status = txops->vdev_set_param_send(vdev, &param);
-		if (QDF_IS_STATUS_ERROR(status))
-			mlme_err("Failed to set max unresponsive inactive time!");
-	}
+	param.param_value =
+		inactivity->keepalive_max_unresponsive_time_secs;
+	param.param_id = WLAN_MLME_CFG_MAX_UNRESPONSIVE_INACTIVE_TIME;
+	status = txops->vdev_set_param_send(vdev, &param);
+	if (QDF_IS_STATUS_ERROR(status))
+		mlme_err("VDEV_%d: Failed to set max unresponse inactive time!",
+			 vdev_id);
 
 	return status;
 }
@@ -188,22 +173,24 @@ QDF_STATUS tgt_vdev_mgr_start_send(
 	QDF_STATUS status;
 	struct wlan_lmac_if_mlme_tx_ops *txops;
 	struct wlan_objmgr_vdev *vdev;
+	uint8_t vdev_id;
 
 	if (!param) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
 	vdev = mlme_obj->vdev;
+	vdev_id = wlan_vdev_get_id(vdev);
 	txops = wlan_vdev_mlme_get_lmac_txops(vdev);
 	if (!txops || !txops->vdev_start_send) {
-		mlme_err("No Tx Ops");
+		mlme_err("VDEV_%d: No Tx Ops", vdev_id);
 		return QDF_STATUS_E_INVAL;
 	}
 
 	status = txops->vdev_start_send(vdev, param);
 	if (QDF_IS_STATUS_ERROR(status))
-		mlme_err("Tx Ops Error : %d", status);
+		mlme_err("VDEV_%d: Tx Ops Error : %d", vdev_id, status);
 
 	return status;
 }
@@ -218,52 +205,33 @@ QDF_STATUS tgt_vdev_mgr_delete_send(
 	struct wlan_objmgr_psoc *psoc;
 	ol_txrx_soc_handle soc_txrx_handle;
 	struct cdp_vdev *vdev_txrx_handle;
-	struct vdev_response_timer *vdev_rsp;
+	uint8_t vdev_id;
 
 	if (!param) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
 	vdev = mlme_obj->vdev;
-	psoc = wlan_vdev_get_psoc(vdev);
+	vdev_id = wlan_vdev_get_id(vdev);
 	txops = wlan_vdev_mlme_get_lmac_txops(vdev);
-	if (!txops || !txops->vdev_delete_send ||
-	    !txops->vdev_mgr_resp_timer_mgmt) {
-		mlme_err("No Tx Ops");
+	if (!txops || !txops->vdev_delete_send) {
+		mlme_err("VDEV_%d: No Tx Ops", vdev_id);
 		return QDF_STATUS_E_INVAL;
 	}
 
-	vdev_rsp = &mlme_obj->vdev_rt;
-	if (vdev_rsp)
-		qdf_timer_start(&vdev_rsp->rsp_timer, DELETE_RESPONSE_TIMER);
+	psoc = wlan_vdev_get_psoc(vdev);
+	soc_txrx_handle = wlan_psoc_get_dp_handle(psoc);
+	vdev_txrx_handle = wlan_vdev_get_dp_handle(vdev);
+	if (soc_txrx_handle && vdev_txrx_handle) {
+		wlan_vdev_set_dp_handle(vdev, NULL);
+		cdp_vdev_detach(soc_txrx_handle, vdev_txrx_handle,
+				NULL, NULL);
+	}
 
 	status = txops->vdev_delete_send(vdev, param);
-	if (QDF_IS_STATUS_ERROR(status)) {
-		mlme_err("Tx Ops Error : %d", status);
-		qdf_timer_stop(&vdev_rsp->rsp_timer);
-		soc_txrx_handle = wlan_psoc_get_dp_handle(psoc);
-		vdev_txrx_handle = wlan_vdev_get_dp_handle(vdev);
-		if (soc_txrx_handle && vdev_txrx_handle) {
-			wlan_vdev_set_dp_handle(vdev, NULL);
-			cdp_vdev_detach(soc_txrx_handle, vdev_txrx_handle,
-					NULL, NULL);
-		}
-	} else {
-		if (!qdf_atomic_test_and_set_bit(DELETE_RESPONSE_BIT,
-						 &vdev_rsp->rsp_status))
-			mlme_debug("Cmd Bit already set");
-
-		/* pre lithium chipsets doesn't have delete response */
-		if (!txops->target_is_pre_lithium(psoc)) {
-			qdf_timer_stop(&vdev_rsp->rsp_timer);
-			txops->vdev_mgr_resp_timer_mgmt(vdev,
-							&vdev_rsp->rsp_timer,
-							false);
-			qdf_atomic_clear_bit(DELETE_RESPONSE_BIT,
-					     &vdev_rsp->rsp_status);
-		}
-	}
+	if (QDF_IS_STATUS_ERROR(status))
+		mlme_err("VDEV_%d: Tx Ops Error : %d", vdev_id, status);
 
 	return status;
 }
@@ -275,22 +243,24 @@ QDF_STATUS tgt_vdev_mgr_peer_flush_tids_send(
 	QDF_STATUS status;
 	struct wlan_lmac_if_mlme_tx_ops *txops;
 	struct wlan_objmgr_vdev *vdev;
+	uint8_t vdev_id;
 
 	if (!param) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
 	vdev = mlme_obj->vdev;
+	vdev_id = wlan_vdev_get_id(vdev);
 	txops = wlan_vdev_mlme_get_lmac_txops(vdev);
 	if (!txops || !txops->peer_flush_tids_send) {
-		mlme_err("No Tx Ops");
+		mlme_err("VDEV_%d: No Tx Ops", vdev_id);
 		return QDF_STATUS_E_INVAL;
 	}
 
 	status = txops->peer_flush_tids_send(vdev, param);
 	if (QDF_IS_STATUS_ERROR(status))
-		mlme_err("Tx Ops Error: %d", status);
+		mlme_err("VDEV_%d: Tx Ops Error : %d", vdev_id, status);
 
 	return QDF_STATUS_SUCCESS;
 }
@@ -302,22 +272,24 @@ QDF_STATUS tgt_vdev_mgr_stop_send(
 	QDF_STATUS status;
 	struct wlan_lmac_if_mlme_tx_ops *txops;
 	struct wlan_objmgr_vdev *vdev;
+	uint8_t vdev_id;
 
 	if (!param) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
 	vdev = mlme_obj->vdev;
+	vdev_id = wlan_vdev_get_id(vdev);
 	txops = wlan_vdev_mlme_get_lmac_txops(vdev);
 	if (!txops || !txops->vdev_stop_send) {
-		mlme_err("No Tx Ops");
+		mlme_err("VDEV_%d: No Tx Ops", vdev_id);
 		return QDF_STATUS_E_INVAL;
 	}
 
 	status = txops->vdev_stop_send(vdev, param);
 	if (QDF_IS_STATUS_ERROR(status))
-		mlme_err("Tx Ops Error: %d", status);
+		mlme_err("VDEV_%d: Tx Ops Error : %d", vdev_id, status);
 
 	return status;
 }
@@ -342,16 +314,18 @@ QDF_STATUS tgt_vdev_mgr_up_send(
 	struct cdp_vdev *vdev_txrx_handle;
 	struct wlan_objmgr_psoc *psoc;
 	struct wlan_objmgr_vdev *vdev;
+	uint8_t vdev_id;
 
 	if (!param) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
 	vdev = mlme_obj->vdev;
+	vdev_id = wlan_vdev_get_id(vdev);
 	txops = wlan_vdev_mlme_get_lmac_txops(vdev);
 	if (!txops || !txops->vdev_up_send) {
-		mlme_err("No Tx Ops");
+		mlme_err("VDEV_%d: No Tx Ops", vdev_id);
 		return QDF_STATUS_E_INVAL;
 	}
 
@@ -359,10 +333,8 @@ QDF_STATUS tgt_vdev_mgr_up_send(
 	psoc = wlan_vdev_get_psoc(vdev);
 	soc_txrx_handle = wlan_psoc_get_dp_handle(psoc);
 	vdev_txrx_handle = wlan_vdev_get_dp_handle(vdev);
-	if (!soc_txrx_handle || !vdev_txrx_handle) {
-		QDF_ASSERT(0);
+	if (!soc_txrx_handle || !vdev_txrx_handle)
 		return QDF_STATUS_E_INVAL;
-	}
 
 	cdp_set_vdev_rx_decap_type(soc_txrx_handle,
 				   (struct cdp_vdev *)vdev_txrx_handle,
@@ -373,7 +345,7 @@ QDF_STATUS tgt_vdev_mgr_up_send(
 
 	status = txops->vdev_up_send(vdev, param);
 	if (QDF_IS_STATUS_ERROR(status))
-		mlme_err("Tx Ops Error: %d", status);
+		mlme_err("VDEV_%d: Tx Ops Error : %d", vdev_id, status);
 
 	return status;
 }
@@ -386,41 +358,39 @@ QDF_STATUS tgt_vdev_mgr_down_send(
 	struct wlan_lmac_if_mlme_tx_ops *txops;
 	struct wlan_objmgr_pdev *pdev;
 	struct wlan_objmgr_vdev *vdev;
+	enum QDF_OPMODE opmode;
+	uint8_t vdev_id;
 
 	if (!param) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
 	vdev = mlme_obj->vdev;
+	vdev_id = wlan_vdev_get_id(vdev);
 	txops = wlan_vdev_mlme_get_lmac_txops(vdev);
 	if (!txops || !txops->vdev_down_send) {
-		mlme_err("No Tx Ops");
+		mlme_err("VDEV_%d: No Tx Ops", vdev_id);
 		return QDF_STATUS_E_INVAL;
 	}
 
 	pdev = wlan_vdev_get_pdev(vdev);
 	if (!pdev) {
-		QDF_ASSERT(0);
+		mlme_err("PDEV is NULL");
 		return QDF_STATUS_E_INVAL;
 	}
 
-	if (wlan_util_is_vdev_active(pdev, WLAN_MLME_SB_ID) ==
+	opmode = wlan_vdev_mlme_get_opmode(vdev);
+	if (wlan_util_is_vdev_active(pdev, WLAN_VDEV_TARGET_IF_ID) ==
 						QDF_STATUS_SUCCESS) {
-		status = wlan_objmgr_pdev_try_get_ref(pdev,
-						      WLAN_MLME_SB_ID);
-		if (QDF_IS_STATUS_ERROR(status)) {
-			mlme_err("PDEV Reference error: %d", status);
-			return status;
-		}
 
-		utils_dfs_start_precac_timer(pdev);
-		wlan_objmgr_pdev_release_ref(pdev, WLAN_MLME_SB_ID);
+		if (opmode == QDF_SAP_MODE)
+			utils_dfs_cancel_precac_timer(pdev);
 	}
 
 	status = txops->vdev_down_send(vdev, param);
 	if (QDF_IS_STATUS_ERROR(status))
-		mlme_err("Tx Ops Error: %d", status);
+		mlme_err("VDEV_%d: Tx Ops Error : %d", vdev_id, status);
 
 	return status;
 }
@@ -446,22 +416,24 @@ QDF_STATUS tgt_vdev_mgr_sifs_trigger_send(
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
 	struct wlan_lmac_if_mlme_tx_ops *txops;
 	struct wlan_objmgr_vdev *vdev;
+	uint8_t vdev_id;
 
 	if (!param) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
 	vdev = mlme_obj->vdev;
+	vdev_id = wlan_vdev_get_id(vdev);
 	txops = wlan_vdev_mlme_get_lmac_txops(vdev);
 	if (!txops || !txops->vdev_sifs_trigger_send) {
-		mlme_err("No Tx Ops");
+		mlme_err("VDEV_%d: No Tx Ops", vdev_id);
 		return QDF_STATUS_E_INVAL;
 	}
 
 	status = txops->vdev_sifs_trigger_send(vdev, param);
 	if (QDF_IS_STATUS_ERROR(status))
-		mlme_err("Tx Ops Error: %d", status);
+		mlme_err("VDEV_%d: Tx Ops Error : %d", vdev_id, status);
 
 	return status;
 }
@@ -473,22 +445,24 @@ QDF_STATUS tgt_vdev_mgr_set_custom_aggr_size_send(
 	QDF_STATUS status;
 	struct wlan_lmac_if_mlme_tx_ops *txops;
 	struct wlan_objmgr_vdev *vdev;
+	uint8_t vdev_id;
 
 	if (!param) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
 	vdev = mlme_obj->vdev;
+	vdev_id = wlan_vdev_get_id(vdev);
 	txops = wlan_vdev_mlme_get_lmac_txops(vdev);
 	if (!txops || !txops->vdev_set_custom_aggr_size_cmd_send) {
-		mlme_err("No Tx Ops");
+		mlme_err("VDEV_%d: No Tx Ops", vdev_id);
 		return QDF_STATUS_E_INVAL;
 	}
 
 	status = txops->vdev_set_custom_aggr_size_cmd_send(vdev, param);
 	if (QDF_IS_STATUS_ERROR(status))
-		mlme_err("Tx Ops Error: %d", status);
+		mlme_err("VDEV_%d: Tx Ops Error : %d", vdev_id, status);
 
 	return status;
 }
@@ -500,17 +474,19 @@ QDF_STATUS tgt_vdev_mgr_config_ratemask_cmd_send(
 	QDF_STATUS status;
 	struct wlan_lmac_if_mlme_tx_ops *txops;
 	struct wlan_objmgr_vdev *vdev;
+	uint8_t vdev_id;
 
 	vdev = mlme_obj->vdev;
+	vdev_id = wlan_vdev_get_id(vdev);
 	txops = wlan_vdev_mlme_get_lmac_txops(vdev);
 	if (!txops || !txops->vdev_config_ratemask_cmd_send) {
-		mlme_err("No Tx Ops");
+		mlme_err("VDEV_%d: No Tx Ops", vdev_id);
 		return QDF_STATUS_E_INVAL;
 	}
 
 	status = txops->vdev_config_ratemask_cmd_send(vdev, param);
 	if (QDF_IS_STATUS_ERROR(status))
-		mlme_err("Tx Ops Error: %d", status);
+		mlme_err("VDEV_%d: Tx Ops Error : %d", vdev_id, status);
 
 	return status;
 }
@@ -538,18 +514,19 @@ QDF_STATUS tgt_vdev_mgr_multiple_vdev_restart_send(
 	struct wlan_objmgr_vdev *vdev;
 
 	if (!param) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
 	vdev = wlan_objmgr_get_vdev_by_id_from_pdev(pdev,
 						    param->vdev_ids[0],
-						    WLAN_MLME_SB_ID);
-	if (!vdev) {
+						    WLAN_VDEV_TARGET_IF_ID);
+	if (vdev) {
 		txops = wlan_vdev_mlme_get_lmac_txops(vdev);
 		if (!txops || !txops->multiple_vdev_restart_req_cmd) {
-			mlme_err("No Tx Ops");
-			wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_SB_ID);
+			mlme_err("VDEV_%d: No Tx Ops", wlan_vdev_get_id(vdev));
+			wlan_objmgr_vdev_release_ref(vdev,
+						     WLAN_VDEV_TARGET_IF_ID);
 			return QDF_STATUS_E_INVAL;
 		}
 
@@ -557,7 +534,7 @@ QDF_STATUS tgt_vdev_mgr_multiple_vdev_restart_send(
 		if (QDF_IS_STATUS_ERROR(status))
 			mlme_err("Tx Ops Error: %d", status);
 
-		wlan_objmgr_vdev_release_ref(vdev, WLAN_MLME_SB_ID);
+		wlan_objmgr_vdev_release_ref(vdev, WLAN_VDEV_TARGET_IF_ID);
 	}
 
 	return status;
@@ -570,23 +547,24 @@ QDF_STATUS tgt_vdev_mgr_set_param_send(
 	QDF_STATUS status;
 	struct wlan_lmac_if_mlme_tx_ops *txops;
 	struct wlan_objmgr_vdev *vdev;
+	uint8_t vdev_id;
 
 	if (!param) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
 	vdev = mlme_obj->vdev;
+	vdev_id = wlan_vdev_get_id(vdev);
 	txops = wlan_vdev_mlme_get_lmac_txops(vdev);
 	if (!txops || !txops->vdev_set_param_send) {
-		mlme_err("No Tx Ops");
+		mlme_err("VDEV_%d: No Tx Ops", vdev_id);
 		return QDF_STATUS_E_INVAL;
 	}
 
 	status = txops->vdev_set_param_send(vdev, param);
 	if (QDF_IS_STATUS_ERROR(status))
-		mlme_err("Tx Ops Error %d for param %d",
-			 status, param->param_id);
+		mlme_err("VDEV_%d: Tx Ops Error : %d", vdev_id, status);
 
 	return status;
 }
@@ -598,22 +576,24 @@ QDF_STATUS tgt_vdev_mgr_sta_ps_param_send(
 	QDF_STATUS status;
 	struct wlan_lmac_if_mlme_tx_ops *txops;
 	struct wlan_objmgr_vdev *vdev;
+	uint8_t vdev_id;
 
 	if (!param) {
-		QDF_ASSERT(0);
+		mlme_err("Invalid input");
 		return QDF_STATUS_E_INVAL;
 	}
 
 	vdev = mlme_obj->vdev;
+	vdev_id = wlan_vdev_get_id(vdev);
 	txops = wlan_vdev_mlme_get_lmac_txops(vdev);
 	if (!txops || !txops->vdev_sta_ps_param_send) {
-		mlme_err("No Tx Ops");
+		mlme_err("VDEV_%d: No Tx Ops", vdev_id);
 		return QDF_STATUS_E_INVAL;
 	}
 
 	status = txops->vdev_sta_ps_param_send(vdev, param);
 	if (QDF_IS_STATUS_ERROR(status))
-		mlme_err("Tx Ops Error: %d", status);
+		mlme_err("VDEV_%d: Tx Ops Error : %d", vdev_id, status);
 
 	return status;
 }

+ 23 - 2
umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mgr_ucfg_api.c

@@ -29,6 +29,29 @@
 #include <wlan_vdev_mgr_utils_api.h>
 #include <wlan_vdev_mlme_api.h>
 
+void ucfg_wlan_vdev_mgr_get_param_bssid(
+				struct wlan_objmgr_vdev *vdev,
+				uint8_t *bssid)
+{
+	struct vdev_mlme_mgmt *mlme_mgmt;
+	struct vdev_mlme_obj *vdev_mlme;
+
+	vdev_mlme = wlan_objmgr_vdev_get_comp_private_obj(
+						vdev, WLAN_UMAC_COMP_MLME);
+
+	if (!vdev_mlme) {
+		mlme_err("VDEV_MLME is NULL");
+		return;
+	}
+
+	mlme_mgmt = &vdev_mlme->mgmt;
+
+	qdf_mem_copy(bssid, mlme_mgmt->generic.bssid,
+		     QDF_MAC_ADDR_SIZE);
+}
+
+qdf_export_symbol(ucfg_wlan_vdev_mgr_get_param_bssid);
+
 void ucfg_wlan_vdev_mgr_get_param_ssid(
 				struct wlan_objmgr_vdev *vdev,
 				uint8_t *ssid, uint8_t *ssid_len)
@@ -146,8 +169,6 @@ void ucfg_wlan_vdev_mgr_get_param(
 {
 	struct vdev_mlme_obj *vdev_mlme;
 
-	mlme_info("paramId: %d", param_id);
-	mlme_info("paramId: %d", param_id);
 	vdev_mlme = wlan_objmgr_vdev_get_comp_private_obj(
 							vdev,
 							WLAN_UMAC_COMP_MLME);

+ 1 - 0
umac/mlme/vdev_mgr/dispatcher/src/wlan_vdev_mgr_utils_api.c

@@ -25,6 +25,7 @@
 #include <wlan_vdev_mgr_utils_api.h>
 #include <wlan_vdev_mgr_tgt_if_tx_api.h>
 #include <cdp_txrx_cmn_struct.h>
+#include <wlan_mlme_dbg.h>
 
 enum wlan_op_mode
 wlan_util_vdev_get_cdp_txrx_opmode(struct wlan_objmgr_vdev *vdev)

+ 1 - 0
wmi/inc/wmi_unified_param.h

@@ -467,6 +467,7 @@ typedef enum {
 	WMI_HOST_VDEV_START_CHAN_INVALID,
 	WMI_HOST_VDEV_START_CHAN_BLOCKED,
 	WMI_HOST_VDEV_START_CHAN_DFS_VIOLATION,
+	WMI_HOST_VDEV_START_TIMEOUT,
 } WMI_HOST_VDEV_START_STATUS;
 
 /*