Merge "qca-wifi: Correct the condition for dump_lut in CFR"
diff --git a/dp/inc/dp_rate_stats.h b/dp/inc/dp_rate_stats.h
index 2ad7394..b840c57 100644
--- a/dp/inc/dp_rate_stats.h
+++ b/dp/inc/dp_rate_stats.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -84,7 +84,6 @@
 	struct wlan_peer_rx_rate_stats rx;
 	uint8_t mac_addr[WLAN_MAC_ADDR_LEN];
 	uint64_t peer_cookie;
-	struct cdp_pdev *pdev;
 	uint8_t pdev_id;
 };
 
diff --git a/dp/wifi3.0/dp_rx_mon_feature.c b/dp/wifi3.0/dp_rx_mon_feature.c
index 903a003..4ab7f1c 100644
--- a/dp/wifi3.0/dp_rx_mon_feature.c
+++ b/dp/wifi3.0/dp_rx_mon_feature.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -597,9 +597,8 @@
  * Return: 0 for success. nonzero for failure.
  */
 QDF_STATUS
-dp_config_enh_rx_capture(struct cdp_pdev *pdev_handle, uint32_t val)
+dp_config_enh_rx_capture(struct dp_pdev *pdev, uint32_t val)
 {
-	struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
 	uint8_t rx_cap_mode = (val & CDP_RX_ENH_CAPTURE_MODE_MASK);
 	uint32_t rx_enh_capture_peer;
 	bool is_mpdu_hdr = false;
@@ -625,7 +624,7 @@
 		pdev->rx_enh_monitor_vdev = pdev->monitor_vdev;
 	}
 
-	dp_reset_monitor_mode(pdev_handle);
+	dp_reset_monitor_mode((struct cdp_soc_t *)pdev->soc, pdev->pdev_id);
 
 	if (pdev->rx_enh_capture_mode != CDP_RX_ENH_CAPTURE_DISABLED &&
 	    rx_cap_mode == CDP_RX_ENH_CAPTURE_DISABLED) {
@@ -646,4 +645,9 @@
 	return dp_pdev_configure_monitor_rings(pdev);
 }
 
+void
+dp_peer_set_rx_capture_enabled(struct dp_peer *peer, bool value)
+{
+	peer->rx_cap_enabled = value;
+}
 #endif /* WLAN_RX_PKT_CAPTURE_ENH */
diff --git a/dp/wifi3.0/dp_rx_mon_feature.h b/dp/wifi3.0/dp_rx_mon_feature.h
index 0d27222..f21135a 100644
--- a/dp/wifi3.0/dp_rx_mon_feature.h
+++ b/dp/wifi3.0/dp_rx_mon_feature.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -66,12 +66,22 @@
 
 /*
  * dp_config_enh_rx_capture()- API to enable/disable enhanced rx capture
- * @pdev_handle: DP_PDEV handle
+ * @pdev: DP_PDEV handle
  * @val: user provided value
  *
  * Return: 0 for success. nonzero for failure.
  */
 QDF_STATUS
-dp_config_enh_rx_capture(struct cdp_pdev *pdev_handle, uint8_t val);
+dp_config_enh_rx_capture(struct dp_pdev *pdev, uint8_t val);
+
+/**
+ * dp_peer_set_rx_capture_enabled: Set rx_cap_enabled bit in peer
+ * @peer_handle: Peer handle
+ * @value: Enable/disable setting for rx_cap_enabled
+ *
+ * Return: None
+ */
+void
+dp_peer_set_rx_capture_enabled(struct dp_peer *peer, bool value);
 #endif /* WLAN_RX_PKT_CAPTURE_ENH */
 #endif /* _DP_RX_MON_FEATURE_H_ */
diff --git a/dp/wifi3.0/dp_rx_tag.c b/dp/wifi3.0/dp_rx_tag.c
index fbf2518..0b3f600 100644
--- a/dp/wifi3.0/dp_rx_tag.c
+++ b/dp/wifi3.0/dp_rx_tag.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -321,15 +321,14 @@
 /**
  * dp_summarize_tag_stats - sums up the given protocol type's counters
  * across all the rings and dumps the same
- * @pdev_handle: cdp_pdev handle
+ * @pdev: dp_pdev handle
  * @protocol_type: protocol type for which stats should be displayed
  *
  * Return: none
  */
-uint64_t dp_summarize_tag_stats(struct cdp_pdev *pdev_handle,
+uint64_t dp_summarize_tag_stats(struct dp_pdev *pdev,
 				uint16_t protocol_type)
 {
-	struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
 	uint8_t ring_idx;
 	uint64_t total_tag_cnt = 0;
 
@@ -348,16 +347,23 @@
 /**
  * dp_dump_pdev_rx_protocol_tag_stats - dump the number of packets tagged for
  * given protocol type (RX_PROTOCOL_TAG_ALL indicates for all protocol)
- * @pdev_handle: cdp_pdev handle
+ * @soc: cdp_soc handle
+ * @pdev_id: id of cdp_pdev handle
  * @protocol_type: protocol type for which stats should be displayed
  *
  * Return: none
  */
 void
-dp_dump_pdev_rx_protocol_tag_stats(struct cdp_pdev *pdev_handle,
+dp_dump_pdev_rx_protocol_tag_stats(struct cdp_soc_t  *soc, uint8_t pdev_id,
 				   uint16_t protocol_type)
 {
 	uint16_t proto_idx;
+	struct dp_pdev *pdev =
+		dp_get_pdev_from_soc_pdev_id_wifi3((struct dp_soc *)soc,
+						   pdev_id);
+
+	if (!pdev)
+		return;
 
 	if (protocol_type != RX_PROTOCOL_TAG_ALL &&
 	    protocol_type >= RX_PROTOCOL_TAG_MAX) {
@@ -367,57 +373,76 @@
 
 	/* protocol_type in [0 ... RX_PROTOCOL_TAG_MAX] */
 	if (protocol_type != RX_PROTOCOL_TAG_ALL) {
-		dp_summarize_tag_stats(pdev_handle, protocol_type);
+		dp_summarize_tag_stats(pdev, protocol_type);
 		return;
 	}
 
 	/* protocol_type == RX_PROTOCOL_TAG_ALL */
 	for (proto_idx = 0; proto_idx < RX_PROTOCOL_TAG_MAX; proto_idx++)
-		dp_summarize_tag_stats(pdev_handle, proto_idx);
+		dp_summarize_tag_stats(pdev, proto_idx);
 }
 #endif /* WLAN_SUPPORT_RX_TAG_STATISTICS */
 
 #ifdef WLAN_SUPPORT_RX_TAG_STATISTICS
-/**
- * dp_reset_pdev_rx_protocol_tag_stats - resets the stats counters for
- * given protocol type
- * @pdev_handle: cdp_pdev handle
- * @protocol_type: protocol type for which stats should be reset
- *
- * Return: none
- */
-void
-dp_reset_pdev_rx_protocol_tag_stats(struct cdp_pdev *pdev_handle,
-				    uint16_t protocol_type)
+static void
+__dp_reset_pdev_rx_protocol_tag_stats(struct dp_pdev *pdev,
+				      uint16_t protocol_type)
 {
-	struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
 	uint8_t ring_idx;
 
 	for (ring_idx = 0; ring_idx < MAX_REO_DEST_RINGS; ring_idx++)
 		pdev->reo_proto_tag_stats[ring_idx][protocol_type].tag_ctr = 0;
 	pdev->rx_err_proto_tag_stats[protocol_type].tag_ctr = 0;
 }
+
+/**
+ * dp_reset_pdev_rx_protocol_tag_stats - resets the stats counters for
+ * given protocol type
+ * @soc: soc handle
+ * @pdev_id: id of cdp_pdev handle
+ * @protocol_type: protocol type for which stats should be reset
+ *
+ * Return: none
+ */
+static void
+dp_reset_pdev_rx_protocol_tag_stats(struct cdp_soc_t  *soc, uint8_t pdev_id,
+				    uint16_t protocol_type)
+{
+	struct dp_pdev *pdev =
+		dp_get_pdev_from_soc_pdev_id_wifi3((struct dp_soc *)soc,
+						   pdev_id);
+	if (!pdev)
+		return;
+
+	__dp_reset_pdev_rx_protocol_tag_stats(pdev, protocol_type);
+}
 #endif /* WLAN_SUPPORT_RX_TAG_STATISTICS */
 
 /**
  * dp_update_pdev_rx_protocol_tag - Add/remove a protocol tag that should be
  * applied to the desired protocol type packets
- * @txrx_pdev_handle: cdp_pdev handle
+ * @soc: soc handle
+ * @pdev_id: id of cdp_pdev handle
  * @enable_rx_protocol_tag - bitmask that indicates what protocol types
  * are enabled for tagging. zero indicates disable feature, non-zero indicates
  * enable feature
  * @protocol_type: new protocol type for which the tag is being added
  * @tag: user configured tag for the new protocol
  *
- * Return: QDF_STATUS
+ * Return: Success
  */
 QDF_STATUS
-dp_update_pdev_rx_protocol_tag(struct cdp_pdev *pdev_handle,
+dp_update_pdev_rx_protocol_tag(struct cdp_soc_t  *soc, uint8_t pdev_id,
 			       uint32_t enable_rx_protocol_tag,
 			       uint16_t protocol_type,
 			       uint16_t tag)
 {
-	struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
+	struct dp_pdev *pdev =
+		dp_get_pdev_from_soc_pdev_id_wifi3((struct dp_soc *)soc,
+						   pdev_id);
+	if (!pdev)
+		return QDF_STATUS_E_FAILURE;
+
 	/*
 	 * dynamically enable/disable tagging based on enable_rx_protocol_tag
 	 * flag.
@@ -434,7 +459,7 @@
 	}
 
 	/** Reset stats counter across all rings for given protocol */
-	dp_reset_pdev_rx_protocol_tag_stats(pdev_handle, protocol_type);
+	__dp_reset_pdev_rx_protocol_tag_stats(pdev, protocol_type);
 
 	pdev->rx_proto_tag_map[protocol_type].tag = tag;
 
@@ -445,17 +470,25 @@
 #ifdef WLAN_SUPPORT_RX_FLOW_TAG
 /**
  * dp_set_rx_flow_tag - add/delete a flow
- * @pdev_handle: cdp_pdev handle
+ * @soc: soc handle
+ * @pdev_id: id of cdp_pdev handle
  * @flow_info: flow tuple that is to be added to/deleted from flow search table
  *
- * Return: 0 for success, nonzero for failure
+ * Return: Success
  */
 QDF_STATUS
-dp_set_rx_flow_tag(struct cdp_pdev *pdev_handle,
+dp_set_rx_flow_tag(struct cdp_soc_t *soc, uint8_t pdev_id,
 		   struct cdp_rx_flow_info *flow_info)
 {
-	struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
-	struct wlan_cfg_dp_soc_ctxt *cfg = pdev->soc->wlan_cfg_ctx;
+	struct dp_pdev *pdev =
+		dp_get_pdev_from_soc_pdev_id_wifi3((struct dp_soc *)soc,
+						   pdev_id);
+	struct wlan_cfg_dp_soc_ctxt *cfg;
+
+	if (qdf_unlikely(!pdev))
+		return QDF_STATUS_E_FAILURE;
+
+	cfg = pdev->soc->wlan_cfg_ctx;
 
 	if (qdf_unlikely(!wlan_cfg_is_rx_flow_tag_enabled(cfg))) {
 		dp_err("RX Flow tag feature disabled");
@@ -473,20 +506,27 @@
 /**
  * dp_dump_rx_flow_tag_stats - dump the number of packets tagged for
  * given flow 5-tuple
- * @pdev_handle: cdp_pdev handle
+ * @cdp_soc: soc handle
+ * @pdev_id: id of cdp_pdev handle
  * @flow_info: flow 5-tuple for which stats should be displayed
  *
- * Return: 0 for success, nonzero for failure
+ * Return: Success
  */
 QDF_STATUS
-dp_dump_rx_flow_tag_stats(struct cdp_pdev *pdev_handle,
+dp_dump_rx_flow_tag_stats(struct cdp_soc_t *soc, uint8_t pdev_id,
 			  struct cdp_rx_flow_info *flow_info)
 {
 	QDF_STATUS status;
 	struct cdp_flow_stats stats;
-	struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
-	struct wlan_cfg_dp_soc_ctxt *cfg = pdev->soc->wlan_cfg_ctx;
+	struct wlan_cfg_dp_soc_ctxt *cfg;
+	struct dp_pdev *pdev =
+		dp_get_pdev_from_soc_pdev_id_wifi3((struct dp_soc *)soc,
+						   pdev_id);
 
+	if (!pdev)
+		return QDF_STATUS_E_FAILURE;
+
+	cfg = pdev->soc->wlan_cfg_ctx;
 	if (qdf_unlikely(!wlan_cfg_is_rx_flow_tag_enabled(cfg))) {
 		dp_err("RX Flow tag feature disabled");
 		return QDF_STATUS_E_NOSUPPORT;
diff --git a/dp/wifi3.0/dp_rx_tag.h b/dp/wifi3.0/dp_rx_tag.h
index 7de52fb..a3b79e8 100644
--- a/dp/wifi3.0/dp_rx_tag.h
+++ b/dp/wifi3.0/dp_rx_tag.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -26,17 +26,18 @@
 /**
  * dp_update_pdev_rx_protocol_tag - Add/remove a protocol tag that should be
  * applied to the desired protocol type packets
- * @txrx_pdev_handle: cdp_pdev handle
+ * @soc: soc handle
+ * @pdev_id: id of cdp_pdev handle
  * @enable_rx_protocol_tag - bitmask that indicates what protocol types
  * are enabled for tagging. zero indicates disable feature, non-zero indicates
  * enable feature
  * @protocol_type: new protocol type for which the tag is being added
  * @tag: user configured tag for the new protocol
  *
- * Return: QDF_STATUS
+ * Return: Success
  */
 QDF_STATUS
-dp_update_pdev_rx_protocol_tag(struct cdp_pdev *pdev_handle,
+dp_update_pdev_rx_protocol_tag(struct cdp_soc_t  *soc, uint8_t pdev_id,
 			       uint32_t enable_rx_protocol_tag,
 			       uint16_t protocol_type,
 			       uint16_t tag);
@@ -69,7 +70,7 @@
  * Return: none
  */
 void
-dp_dump_pdev_rx_protocol_tag_stats(struct cdp_pdev *pdev_handle,
+dp_dump_pdev_rx_protocol_tag_stats(struct cdp_soc_t  *soc, uint8_t pdev_id,
 				   uint16_t protocol_type);
 #endif /* WLAN_SUPPORT_RX_TAG_STATISTICS */
 #endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG */
@@ -92,25 +93,27 @@
 
 /**
  * dp_set_rx_flow_tag - add/delete a flow
- * @pdev_handle: cdp_pdev handle
+ * @soc: soc handle
+ * @pdev_id: id of cdp_pdev handle
  * @flow_info: flow tuple that is to be added to/deleted from flow search table
  *
- * Return: 0 for success, nonzero for failure
+ * Return: Success
  */
 QDF_STATUS
-dp_set_rx_flow_tag(struct cdp_pdev *pdev_handle,
+dp_set_rx_flow_tag(struct cdp_soc_t *cdp_soc, uint8_t pdev_id,
 		   struct cdp_rx_flow_info *flow_info);
 
 /**
  * dp_dump_rx_flow_tag_stats - dump the number of packets tagged for
  * given flow 5-tuple
- * @pdev_handle: cdp_pdev handle
+ * @cdp_soc: soc handle
+ * @pdev_id: id of cdp_pdev handle
  * @flow_info: flow 5-tuple for which stats should be displayed
  *
- * Return: 0 for success, nonzero for failure
+ * Return: Success
  */
 QDF_STATUS
-dp_dump_rx_flow_tag_stats(struct cdp_pdev *pdev_handle,
+dp_dump_rx_flow_tag_stats(struct cdp_soc_t *cdp_soc, uint8_t pdev_id,
 			  struct cdp_rx_flow_info *flow_info);
 
 /**
diff --git a/dp/wifi3.0/dp_tx_capture.c b/dp/wifi3.0/dp_tx_capture.c
index 53f6864..6b47a84 100644
--- a/dp/wifi3.0/dp_tx_capture.c
+++ b/dp/wifi3.0/dp_tx_capture.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -119,12 +119,22 @@
 
 	ptr_tx_cap = &(pdev->tx_capture);
 
-	DP_PRINT_STATS("tx capture stats\n");
+	DP_PRINT_STATS("tx capture stats:");
+	DP_PRINT_STATS(" mgmt control enqueue stats:");
 	for (i = 0; i < TXCAP_MAX_TYPE; i++) {
 		for (j = 0; j < TXCAP_MAX_SUBTYPE; j++) {
 			if (ptr_tx_cap->ctl_mgmt_q[i][j].qlen)
-				DP_PRINT_STATS(" ctl_mgmt_q[%d][%d] = queue_len[%d]\n",
-				       i, j, ptr_tx_cap->ctl_mgmt_q[i][j].qlen);
+				DP_PRINT_STATS(" ctl_mgmt_q[%d][%d] = queue_len[%d]",
+				i, j, ptr_tx_cap->ctl_mgmt_q[i][j].qlen);
+		}
+	}
+	DP_PRINT_STATS(" mgmt control retry queue stats:");
+	for (i = 0; i < TXCAP_MAX_TYPE; i++) {
+		for (j = 0; j < TXCAP_MAX_SUBTYPE; j++) {
+			if (ptr_tx_cap->ctl_mgmt_q[i][j].qlen)
+				DP_PRINT_STATS(" retries_ctl_mgmt_q[%d][%d] = queue_len[%d]",
+				i, j,
+				ptr_tx_cap->retries_ctl_mgmt_q[i][j].qlen);
 		}
 	}
 
@@ -180,6 +190,23 @@
 	}
 }
 
+static
+void dp_peer_tx_cap_tid_queue_flush(struct dp_peer *peer)
+{
+	int tid;
+	struct dp_tx_tid *tx_tid;
+
+	for (tid = 0; tid < DP_MAX_TIDS; tid++) {
+		tx_tid = &peer->tx_capture.tx_tid[tid];
+
+		qdf_spin_lock_bh(&tx_tid->tid_lock);
+		qdf_nbuf_queue_free(&tx_tid->msdu_comp_q);
+		qdf_spin_unlock_bh(&tx_tid->tid_lock);
+
+		tx_tid->max_ppdu_id = 0;
+	}
+}
+
 /*
  * dp_peer_tid_queue_cleanup() – remove ppdu stats queue per TID
  * @peer: Datapath peer
@@ -262,7 +289,8 @@
 		subtype = (wh->i_fc[0] & IEEE80211_FC0_SUBTYPE_MASK) >>
 			IEEE80211_FC0_SUBTYPE_SHIFT;
 
-		if (!ptr_mgmt_hdr->ppdu_id || !ptr_mgmt_hdr->tx_tsf) {
+		if (!ptr_mgmt_hdr->ppdu_id || !ptr_mgmt_hdr->tx_tsf ||
+		    (!type && !subtype)) {
 			/*
 			 * if either ppdu_id and tx_tsf are zero then
 			 * storing the payload won't be useful
@@ -468,7 +496,7 @@
 {
 	int ret = QDF_STATUS_E_FAILURE;
 
-	if ((desc->pdev->tx_capture_enabled != CDP_TX_ENH_CAPTURE_DISABLED) &&
+	if (peer && dp_peer_or_pdev_tx_cap_enabled(desc->pdev, peer) &&
 	    ((ts->status == HAL_TX_TQM_RR_FRAME_ACKED) ||
 	    (ts->status == HAL_TX_TQM_RR_REM_CMD_TX) ||
 	    ((ts->status == HAL_TX_TQM_RR_REM_CMD_AGED) && ts->transmit_cnt))) {
@@ -681,9 +709,8 @@
  * Return: QDF_STATUS
  */
 QDF_STATUS
-dp_config_enh_tx_capture(struct cdp_pdev *pdev_handle, uint8_t val)
+dp_config_enh_tx_capture(struct dp_pdev *pdev, uint8_t val)
 {
-	struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
 	int i, j;
 
 	qdf_spin_lock(&pdev->tx_capture.config_lock);
@@ -2233,6 +2260,7 @@
 				wh->i_fc[1] = (frame_ctrl_le & 0xFF00) >> 8;
 				wh->i_fc[0] = (frame_ctrl_le & 0xFF);
 
+				tx_capture_info.ppdu_desc = tmp_ppdu_desc;
 				/*
 				 * send MPDU to osif layer
 				 */
@@ -2265,6 +2293,7 @@
 			wh->i_fc[1] = (frame_ctrl_le & 0xFF00) >> 8;
 			wh->i_fc[0] = (frame_ctrl_le & 0xFF);
 
+			tx_capture_info.ppdu_desc = ppdu_desc;
 			/*
 			 * send MPDU to osif layer
 			 */
@@ -3167,4 +3196,19 @@
 
 	return QDF_STATUS_SUCCESS;
 }
+
+/**
+ * dp_peer_set_tx_capture_enabled: Set tx_cap_enabled bit in peer
+ * @peer: Peer handle
+ * @value: Enable/disable setting for tx_cap_enabled
+ *
+ * Return: None
+ */
+void
+dp_peer_set_tx_capture_enabled(struct dp_peer *peer, bool value)
+{
+	peer->tx_cap_enabled = value;
+	if (!value)
+		dp_peer_tx_cap_tid_queue_flush(peer);
+}
 #endif
diff --git a/dp/wifi3.0/dp_tx_capture.h b/dp/wifi3.0/dp_tx_capture.h
index 637c318..605c42e 100644
--- a/dp/wifi3.0/dp_tx_capture.h
+++ b/dp/wifi3.0/dp_tx_capture.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -179,7 +179,7 @@
  * Return: QDF_STATUS
  */
 QDF_STATUS
-dp_config_enh_tx_capture(struct cdp_pdev *pdev_handle, uint8_t val);
+dp_config_enh_tx_capture(struct dp_pdev *pdev_handle, uint8_t val);
 
 /*
  * dp_deliver_mgmt_frm: Process
@@ -255,5 +255,15 @@
 QDF_STATUS dp_send_ack_frame_to_stack(struct dp_soc *soc,
 				      struct dp_pdev *pdev,
 				      struct hal_rx_ppdu_info *ppdu_info);
+
+/**
+ * dp_peer_set_tx_capture_enabled: Set tx_cap_enabled bit in peer
+ * @peer: Peer handle
+ * @value: Enable/disable setting for tx_cap_enabled
+ *
+ * Return: None
+ */
+void
+dp_peer_set_tx_capture_enabled(struct dp_peer *peer, bool value);
 #endif
 #endif
diff --git a/dp/wifi3.0/dp_txrx_me.c b/dp/wifi3.0/dp_txrx_me.c
index 8587ae3..b6d8b1d 100644
--- a/dp/wifi3.0/dp_txrx_me.c
+++ b/dp/wifi3.0/dp_txrx_me.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -18,6 +18,7 @@
 
 #include "hal_hw_headers.h"
 #include "dp_types.h"
+#include "dp_peer.h"
 #include "qdf_nbuf.h"
 #include "qdf_atomic.h"
 #include "qdf_types.h"
@@ -96,14 +97,19 @@
 
 /**
  * dp_tx_me_alloc_descriptor():Allocate ME descriptor
- * @pdev_handle: DP PDEV handle
+ * @soc: DP SOC handle
+ * @pdev_id: id of DP PDEV handle
  *
  * Return:void
  */
-void
-dp_tx_me_alloc_descriptor(struct cdp_pdev *pdev_handle)
+void dp_tx_me_alloc_descriptor(struct cdp_soc_t *soc, uint8_t pdev_id)
 {
-	struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
+	struct dp_pdev *pdev =
+		dp_get_pdev_from_soc_pdev_id_wifi3((struct dp_soc *)soc,
+						   pdev_id);
+
+	if (!pdev)
+		return;
 
 	if (qdf_atomic_read(&pdev->mc_num_vap_attached) == 0) {
 		dp_tx_me_init(pdev);
@@ -162,20 +168,27 @@
 
 /**
  * dp_tx_me_free_descriptor():free ME descriptor
- * @pdev_handle:DP_PDEV handle
+ * @soc: DP SOC handle
+ * @pdev_id: id of DP PDEV handle
  *
  * Return:void
  */
 void
-dp_tx_me_free_descriptor(struct cdp_pdev *pdev_handle)
+dp_tx_me_free_descriptor(struct cdp_soc_t *soc, uint8_t pdev_id)
 {
-	struct dp_pdev *pdev = (struct dp_pdev *)pdev_handle;
+	struct dp_pdev *pdev =
+		dp_get_pdev_from_soc_pdev_id_wifi3((struct dp_soc *)soc,
+						   pdev_id);
 
-	qdf_atomic_dec(&pdev->mc_num_vap_attached);
-	if (atomic_read(&pdev->mc_num_vap_attached) == 0) {
-		dp_tx_me_exit(pdev);
-		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO,
-			  "Disable MCAST_TO_UCAST");
+	if (!pdev)
+		return;
+
+	if (atomic_read(&pdev->mc_num_vap_attached)) {
+		if (qdf_atomic_dec_and_test(&pdev->mc_num_vap_attached)) {
+			dp_tx_me_exit(pdev);
+			QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO,
+				  "Disable MCAST_TO_UCAST");
+		}
 	}
 }
 
@@ -189,10 +202,10 @@
 QDF_STATUS
 dp_tx_prepare_send_me(struct dp_vdev *vdev, qdf_nbuf_t nbuf)
 {
-	if (vdev->me_convert) {
-		if (vdev->me_convert(vdev->osif_vdev, nbuf) > 0)
-			return QDF_STATUS_SUCCESS;
-	}
+	if (dp_me_mcast_convert((struct cdp_soc_t *)(vdev->pdev->soc),
+				vdev->vdev_id, vdev->pdev->pdev_id,
+				nbuf) > 0)
+		return QDF_STATUS_SUCCESS;
 
 	return QDF_STATUS_E_FAILURE;
 }
@@ -231,7 +244,8 @@
 
 /**
  * dp_tx_me_send_convert_ucast(): function to convert multicast to unicast
- * @vdev: DP VDEV handle
+ * @soc: Datapath soc handle
+ * @vdev_id: vdev id
  * @nbuf: Multicast nbuf
  * @newmac: Table of the clients to which packets have to be sent
  * @new_mac_cnt: No of clients
@@ -239,11 +253,12 @@
  * return: no of converted packets
  */
 uint16_t
-dp_tx_me_send_convert_ucast(struct cdp_vdev *vdev_handle, qdf_nbuf_t nbuf,
-		uint8_t newmac[][QDF_MAC_ADDR_SIZE], uint8_t new_mac_cnt)
+dp_tx_me_send_convert_ucast(struct cdp_soc_t *soc, uint8_t vdev_id,
+			    qdf_nbuf_t nbuf,
+			    uint8_t newmac[][QDF_MAC_ADDR_SIZE],
+			    uint8_t new_mac_cnt)
 {
-	struct dp_vdev *vdev = (struct dp_vdev *) vdev_handle;
-	struct dp_pdev *pdev = vdev->pdev;
+	struct dp_pdev *pdev;
 	qdf_ether_header_t *eh;
 	uint8_t *data;
 	uint16_t len;
@@ -265,6 +280,31 @@
 	qdf_dma_addr_t paddr_mcbuf = 0;
 	uint8_t empty_entry_mac[QDF_MAC_ADDR_SIZE] = {0};
 	QDF_STATUS status;
+	struct dp_vdev *vdev =
+		dp_get_vdev_from_soc_vdev_id_wifi3((struct dp_soc *)soc,
+						   vdev_id);
+
+	if (!vdev) {
+		qdf_nbuf_free(nbuf);
+		return 1;
+	}
+
+	pdev = vdev->pdev;
+
+	if (!pdev) {
+		qdf_nbuf_free(nbuf);
+		return 1;
+	}
+
+	vdev = dp_get_vdev_from_soc_vdev_id_wifi3((struct dp_soc *)soc,
+						  vdev_id);
+	if (!vdev)
+		return 1;
+
+	pdev = vdev->pdev;
+
+	if (!pdev)
+		return 1;
 
 	qdf_mem_zero(&msdu_info, sizeof(msdu_info));
 
diff --git a/dp/wifi3.0/dp_txrx_me.h b/dp/wifi3.0/dp_txrx_me.h
index 9c7601e..a716bdc 100644
--- a/dp/wifi3.0/dp_txrx_me.h
+++ b/dp/wifi3.0/dp_txrx_me.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -17,14 +17,19 @@
  */
 #ifndef _DP_TXRX_ME_H_
 #define _DP_TXRX_ME_H_
-uint16_t dp_tx_me_send_convert_ucast(struct cdp_vdev *vdev_handle,
-				     qdf_nbuf_t nbuf,
-				     uint8_t newmac[][QDF_MAC_ADDR_SIZE],
-				     uint8_t new_mac_cnt);
-void dp_tx_me_alloc_descriptor(struct cdp_pdev *pdev);
-
-void dp_tx_me_free_descriptor(struct cdp_pdev *pdev);
+uint16_t
+dp_tx_me_send_convert_ucast(struct cdp_soc_t *soc, uint8_t vdev_id,
+			    qdf_nbuf_t nbuf,
+			    uint8_t newmac[][QDF_MAC_ADDR_SIZE],
+			    uint8_t new_mac_cnt);
+void dp_tx_me_alloc_descriptor(struct cdp_soc_t *soc, uint8_t pdev_id);
+void dp_tx_me_free_descriptor(struct cdp_soc_t *soc, uint8_t pdev_id);
 void dp_tx_me_exit(struct dp_pdev *pdev);
 QDF_STATUS
 dp_tx_prepare_send_me(struct dp_vdev *vdev, qdf_nbuf_t nbuf);
+extern int
+dp_me_mcast_convert(struct cdp_soc_t *soc,
+		    uint8_t vdev_id,
+		    uint8_t pdev_id,
+		    qdf_nbuf_t wbuf);
 #endif
diff --git a/dp/wifi3.0/dp_txrx_wds.c b/dp/wifi3.0/dp_txrx_wds.c
index c7bc2f3..8ae9ae2 100644
--- a/dp/wifi3.0/dp_txrx_wds.c
+++ b/dp/wifi3.0/dp_txrx_wds.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -596,7 +596,12 @@
  * @nbuf: skb
  * @tid: traffic priority
  *
- * Return: bool: true if tag is inserted else false
+ * Return: bool: true in case of success else false
+ * Success is considered if:
+ *  i. If frame doesn't come from special peer and do not need multipass processing.
+ *  ii. Successfully processed multipass processing.
+ * Failure is considered if:
+ *  i. If frame needs to be dropped.
  */
 bool dp_rx_multipass_process(struct dp_peer *peer, qdf_nbuf_t nbuf, uint8_t tid)
 {
@@ -604,10 +609,10 @@
 	struct vlan_ethhdr vethhdr;
 
 	if (qdf_unlikely(!peer->vlan_id))
-	       return false;
+	       return true;
 
 	if (qdf_unlikely(qdf_nbuf_headroom(nbuf) < ETHERTYPE_VLAN_LEN))
-		return false;
+		return true;
 
 	/*
 	 * Form the VLAN header and insert in nbuf
@@ -662,28 +667,20 @@
 /**
  * dp_peer_multipass_list_add: add to new multipass list
  * @dp_soc: soc handle
- * @dp_vdev: vdev handle
- * @peer_mac: mac address
+ * @peer: peer handle
  *
  * return: void
  */
-static void dp_peer_multipass_list_add(struct dp_soc *soc, struct dp_vdev *vdev,
-					uint8_t *peer_mac)
+static void dp_peer_multipass_list_add(struct dp_soc *soc, struct dp_peer *peer)
 {
-	struct dp_peer *peer = dp_peer_find_hash_find(soc, peer_mac, 0,
-						      vdev->vdev_id);
-
-	if (!peer) {
-		return;
-	}
-
 	/*
 	 * Ref_cnt is incremented inside dp_peer_find_hash_find().
 	 * Decrement it when element is deleted from the list.
 	 */
-	qdf_spin_lock_bh(&vdev->mpass_peer_mutex);
-	TAILQ_INSERT_HEAD(&vdev->mpass_peer_list, peer, mpass_peer_list_elem);
-	qdf_spin_unlock_bh(&vdev->mpass_peer_mutex);
+	qdf_spin_lock_bh(&peer->vdev->mpass_peer_mutex);
+	TAILQ_INSERT_HEAD(&peer->vdev->mpass_peer_list, peer,
+			  mpass_peer_list_elem);
+	qdf_spin_unlock_bh(&peer->vdev->mpass_peer_mutex);
 }
 
 /**
@@ -695,14 +692,16 @@
  * return: void
  */
 void dp_peer_set_vlan_id(struct cdp_soc_t *cdp_soc,
-		struct cdp_vdev *vdev_handle, uint8_t *peer_mac,
+		uint8_t vdev_id, uint8_t *peer_mac,
 		uint16_t vlan_id)
 {
 	struct dp_soc *soc = (struct dp_soc *)cdp_soc;
-	struct dp_vdev *vdev = (struct dp_vdev *)vdev_handle;
 	struct dp_peer *peer = NULL;
+	struct dp_vdev *vdev =
+		dp_get_vdev_from_soc_vdev_id_wifi3((struct dp_soc *)soc,
+						   vdev_id);
 
-	if (!vdev->multipass_en)
+	if (!vdev || !vdev->multipass_en)
 		return;
 
 	peer = dp_peer_find_hash_find(soc, peer_mac, 0, vdev->vdev_id);
@@ -714,11 +713,12 @@
 
 	peer->vlan_id = vlan_id;
 
+	dp_peer_multipass_list_add(soc, peer);
+
 	/* Ref_cnt is incremented inside dp_peer_find_hash_find().
 	 * Decrement it here.
 	 */
 	dp_peer_unref_delete(peer);
-	dp_peer_multipass_list_add(soc, vdev, peer_mac);
 }
 
 /**
diff --git a/target_if/cfr/src/target_if_cfr_6018.c b/target_if/cfr/src/target_if_cfr_6018.c
index 5d206d6..753df3b 100644
--- a/target_if/cfr/src/target_if_cfr_6018.c
+++ b/target_if/cfr/src/target_if_cfr_6018.c
@@ -113,12 +113,12 @@
 			diff = (lut->dbr_tstamp > lut->txrx_tstamp) ?
 				(lut->dbr_tstamp - lut->txrx_tstamp) :
 				(lut->txrx_tstamp - lut->dbr_tstamp);
-			cfr_info("idx:%d dbrevnt: %d txrxevent: %d "
-				 "dbrppdu:0x%x txrxppdu:0x%x dbr_tstamp: %llu "
-				 "txrx_tstamp: %llu diff: %llu\n",
-				 i, lut->dbr_recv, lut->tx_recv,
-				 lut->dbr_ppdu_id, lut->tx_ppdu_id,
-				 lut->dbr_tstamp, lut->txrx_tstamp, diff);
+			cfr_err("idx:%d dbrevnt: %d txrxevent: %d "
+				"dbrppdu:0x%x txrxppdu:0x%x dbr_tstamp: %llu "
+				"txrx_tstamp: %llu diff: %llu\n",
+				i, lut->dbr_recv, lut->tx_recv,
+				lut->dbr_ppdu_id, lut->tx_ppdu_id,
+				lut->dbr_tstamp, lut->txrx_tstamp, diff);
 		}
 
 	}
@@ -598,25 +598,12 @@
 			 * event since multiple PPDUs are likely to have same
 			 * dma addr, due to ucode aborts
 			 */
-			if (module_id == CORRELATE_TXRX_EV_MODULE_ID) {
-				cfr_debug("Received new tx event for same "
-					  "cookie %u",
-					  cookie);
-				lut->dbr_recv = false;
-				lut->data = NULL;
-				lut->data_len = 0;
-				lut->dbr_ppdu_id = 0;
-				qdf_mem_zero(&lut->dbr_address,
-					     sizeof(lut->dbr_address));
-				pcfr->clear_dbr_event++;
-			} else if (module_id == CORRELATE_DBR_MODULE_ID) {
-				cfr_debug("Received new dbr event for same "
-					  "cookie %u",
-					  cookie);
-				lut->tx_recv = false;
-				lut->tx_ppdu_id = 0;
-				pcfr->clear_txrx_event++;
-			}
+			cfr_debug("Received new dbr event for same "
+				  "cookie %u",
+				  cookie);
+			lut->tx_recv = false;
+			lut->tx_ppdu_id = 0;
+			pcfr->clear_txrx_event++;
 			status = STATUS_HOLD;
 		}
 	} else {
@@ -694,14 +681,13 @@
 		goto done; /* HW registers have not captured FFT bins */
 	}
 
+	pcfr->chan_capture_status[cfr_info->chan_capture_status]++;
 	if (cfr_info->rx_location_info_valid) {
 		pcfr->rx_loc_info_valid_cnt++;
 	} else {
 		goto done;
 	}
 
-	pcfr->chan_capture_status[cfr_info->chan_capture_status]++;
-
 	if (cfr_info->chan_capture_status != CAPTURE_ACTIVE) {
 		wlan_objmgr_pdev_release_ref(pdev, WLAN_CFR_ID);
 		qdf_nbuf_free(nbuf);
@@ -1426,7 +1412,6 @@
 	struct wlan_objmgr_pdev *pdev = NULL;
 	struct look_up_table *lut = NULL;
 	uint64_t diff, cur_tstamp;
-	qdf_dma_addr_t buf_addr = 0, buf_addr_temp = 0;
 
 	OS_GET_TIMER_ARG(pcfr, struct pdev_cfr*);
 
@@ -1467,23 +1452,6 @@
 				pcfr->flush_timeout_dbr_cnt++;
 				release_lut_entry_enh(pdev, lut);
 			}
-		} else if (lut->tx_recv && !lut->dbr_recv) {
-			diff = cur_tstamp - lut->txrx_tstamp;
-			if (diff > LUT_AGE_THRESHOLD) {
-				buf_addr_temp = (lut->tx_address2 & 0x0f);
-				buf_addr = (lut->tx_address1
-					    | ((uint64_t)buf_addr_temp << 32));
-				cfr_err("<%d>DBR event not received for "
-					"%llu ms, release lut entry : "
-					"dma_addr = 0x%pK\n", i, diff,
-					(void *)((uintptr_t)buf_addr));
-				target_if_dbr_buf_release(pdev,
-							  DBR_MODULE_CFR,
-							  buf_addr,
-							  i, 0);
-				pcfr->flush_timeout_txrx_cnt++;
-				release_lut_entry_enh(pdev, lut);
-			}
 		}
 	}
 
@@ -1635,9 +1603,7 @@
 	pcfr->flush_all_dbr_cnt = 0;
 	pcfr->flush_all_txrx_cnt = 0;
 	pcfr->flush_timeout_dbr_cnt = 0;
-	pcfr->flush_timeout_txrx_cnt = 0;
 	pcfr->invalid_dma_length_cnt = 0;
-	pcfr->clear_dbr_event = 0;
 	pcfr->clear_txrx_event = 0;
 	pcfr->bb_captured_channel_cnt = 0;
 	pcfr->bb_captured_timeout_cnt = 0;
diff --git a/umac/cfr/dispatcher/inc/wlan_cfr_utils_api.h b/umac/cfr/dispatcher/inc/wlan_cfr_utils_api.h
index a3e207a..d3fe9a8 100644
--- a/umac/cfr/dispatcher/inc/wlan_cfr_utils_api.h
+++ b/umac/cfr/dispatcher/inc/wlan_cfr_utils_api.h
@@ -507,8 +507,6 @@
 	uint64_t flush_all_txrx_cnt;
 	uint64_t invalid_dma_length_cnt;
 	uint64_t flush_timeout_dbr_cnt;
-	uint64_t flush_timeout_txrx_cnt;
-	uint64_t clear_dbr_event;
 	uint64_t clear_txrx_event;
 #endif
 	struct unassoc_pool_entry unassoc_pool[MAX_CFR_ENABLED_CLIENTS];
diff --git a/umac/cfr/dispatcher/src/wlan_cfr_ucfg_api.c b/umac/cfr/dispatcher/src/wlan_cfr_ucfg_api.c
index 8124318..c112b72 100644
--- a/umac/cfr/dispatcher/src/wlan_cfr_ucfg_api.c
+++ b/umac/cfr/dispatcher/src/wlan_cfr_ucfg_api.c
@@ -671,79 +671,79 @@
 	if (status != QDF_STATUS_SUCCESS)
 		return status;
 
-	cfr_info("CAPTURE MODE:\n");
+	cfr_err("CAPTURE MODE:\n");
 
-	cfr_info("m_directed_ftm is : %s\n",
-		 pcfr->rcc_param.m_directed_ftm ?
-		 "enabled" : "disabled");
-	cfr_info("m_all_ftm_ack is : %s\n",
-		 pcfr->rcc_param.m_all_ftm_ack ?
-		 "enabled" : "disabled");
-	cfr_info("m_ndpa_ndp_directed is: %s\n",
-		 pcfr->rcc_param.m_ndpa_ndp_directed ?
-		 "enabled" : "disabled");
-	cfr_info("m_ndpa_ndp_all is : %s\n",
-		 pcfr->rcc_param.m_ndpa_ndp_all ?
-		 "enabled" : "disabled");
-	cfr_info("m_ta_ra_filter is : %s\n",
-		 pcfr->rcc_param.m_ta_ra_filter ?
-		 "enabled" : "disabled");
-	cfr_info("m_all_packet is : %s\n",
-		 pcfr->rcc_param.m_all_packet ?
-		 "enabled" : "disabled");
+	cfr_err("m_directed_ftm is : %s\n",
+		pcfr->rcc_param.m_directed_ftm ?
+		"enabled" : "disabled");
+	cfr_err("m_all_ftm_ack is : %s\n",
+		pcfr->rcc_param.m_all_ftm_ack ?
+		"enabled" : "disabled");
+	cfr_err("m_ndpa_ndp_directed is: %s\n",
+		pcfr->rcc_param.m_ndpa_ndp_directed ?
+		"enabled" : "disabled");
+	cfr_err("m_ndpa_ndp_all is : %s\n",
+		pcfr->rcc_param.m_ndpa_ndp_all ?
+		"enabled" : "disabled");
+	cfr_err("m_ta_ra_filter is : %s\n",
+		pcfr->rcc_param.m_ta_ra_filter ?
+		"enabled" : "disabled");
+	cfr_err("m_all_packet is : %s\n",
+		pcfr->rcc_param.m_all_packet ?
+		"enabled" : "disabled");
 
-	cfr_info("capture duration : %u usec\n",
-		 pcfr->rcc_param.capture_duration);
-	cfr_info("capture interval : %u usec\n",
-		 pcfr->rcc_param.capture_interval);
-	cfr_info("UL MU User mask lower : %u\n",
-		 pcfr->rcc_param.ul_mu_user_mask_lower);
-	cfr_info("UL MU User mask upper : %u\n",
-		 pcfr->rcc_param.ul_mu_user_mask_upper);
-	cfr_info("Freeze TLV delay count is : %s\n",
-		 pcfr->rcc_param.freeze_tlv_delay_cnt_en ?
-		 "enabled" : "disabled");
-	cfr_info("Freeze TLV delay count threshold : %u\n",
-		 pcfr->rcc_param.freeze_tlv_delay_cnt_thr);
-	cfr_info("Enabled CFG id bitmap : 0x%x\n",
-		 pcfr->rcc_param.filter_group_bitmap);
-	cfr_info(" Modified cfg id bitmap : 0x%x\n",
-		 pcfr->rcc_param.modified_in_curr_session);
+	cfr_err("capture duration : %u usec\n",
+		pcfr->rcc_param.capture_duration);
+	cfr_err("capture interval : %u usec\n",
+		pcfr->rcc_param.capture_interval);
+	cfr_err("UL MU User mask lower : %u\n",
+		pcfr->rcc_param.ul_mu_user_mask_lower);
+	cfr_err("UL MU User mask upper : %u\n",
+		pcfr->rcc_param.ul_mu_user_mask_upper);
+	cfr_err("Freeze TLV delay count is : %s\n",
+		pcfr->rcc_param.freeze_tlv_delay_cnt_en ?
+		"enabled" : "disabled");
+	cfr_err("Freeze TLV delay count threshold : %u\n",
+		pcfr->rcc_param.freeze_tlv_delay_cnt_thr);
+	cfr_err("Enabled CFG id bitmap : 0x%x\n",
+		pcfr->rcc_param.filter_group_bitmap);
+	cfr_err(" Modified cfg id bitmap : 0x%x\n",
+		pcfr->rcc_param.modified_in_curr_session);
 
-	cfr_info("TARA_CONFIG details:\n");
+	cfr_err("TARA_CONFIG details:\n");
 
 	for (grp_id = 0; grp_id < MAX_TA_RA_ENTRIES; grp_id++) {
 		glbl_cfg = &pcfr->global[grp_id];
 
-		cfr_info("Config ID: %d\n", grp_id);
-		cfr_info("Bandwidth :0x%x\n", glbl_cfg->bw);
-		cfr_info("NSS : 0x%x\n", glbl_cfg->nss);
-		cfr_info("valid_ta: %d\n", glbl_cfg->valid_ta);
-		cfr_info("valid_ta_mask: %d\n", glbl_cfg->valid_ta_mask);
-		cfr_info("valid_ra: %d\n", glbl_cfg->valid_ra);
-		cfr_info("valid_ra_mask: %d\n", glbl_cfg->valid_ra_mask);
-		cfr_info("valid_bw_mask: %d\n", glbl_cfg->valid_bw_mask);
-		cfr_info("valid_nss_mask: %d\n", glbl_cfg->valid_nss_mask);
-		cfr_info("valid_mgmt_subtype: %d\n",
-			 glbl_cfg->valid_mgmt_subtype);
-		cfr_info("valid_ctrl_subtype: %d\n",
-			 glbl_cfg->valid_ctrl_subtype);
-		cfr_info("valid_data_subtype: %d\n",
-			 glbl_cfg->valid_data_subtype);
-		cfr_info("Mgmt subtype : 0x%x\n",
-			 glbl_cfg->mgmt_subtype_filter);
-		cfr_info("CTRL subtype : 0x%x\n",
-			 glbl_cfg->ctrl_subtype_filter);
-		cfr_info("Data subtype : 0x%x\n",
-			 glbl_cfg->data_subtype_filter);
-		cfr_info("TX Addr : %s\n",
-			 ether_sprintf(glbl_cfg->tx_addr));
-		cfr_info("TX Addr Mask : %s\n",
-			 ether_sprintf(glbl_cfg->tx_addr_mask));
-		cfr_info("RX Addr : %s\n",
-			 ether_sprintf(glbl_cfg->rx_addr));
-		cfr_info("RX Addr Mask: %s\n",
-			 ether_sprintf(glbl_cfg->rx_addr_mask));
+		cfr_err("Config ID: %d\n", grp_id);
+		cfr_err("Bandwidth :0x%x\n", glbl_cfg->bw);
+		cfr_err("NSS : 0x%x\n", glbl_cfg->nss);
+		cfr_err("valid_ta: %d\n", glbl_cfg->valid_ta);
+		cfr_err("valid_ta_mask: %d\n", glbl_cfg->valid_ta_mask);
+		cfr_err("valid_ra: %d\n", glbl_cfg->valid_ra);
+		cfr_err("valid_ra_mask: %d\n", glbl_cfg->valid_ra_mask);
+		cfr_err("valid_bw_mask: %d\n", glbl_cfg->valid_bw_mask);
+		cfr_err("valid_nss_mask: %d\n", glbl_cfg->valid_nss_mask);
+		cfr_err("valid_mgmt_subtype: %d\n",
+			glbl_cfg->valid_mgmt_subtype);
+		cfr_err("valid_ctrl_subtype: %d\n",
+			glbl_cfg->valid_ctrl_subtype);
+		cfr_err("valid_data_subtype: %d\n",
+			glbl_cfg->valid_data_subtype);
+		cfr_err("Mgmt subtype : 0x%x\n",
+			glbl_cfg->mgmt_subtype_filter);
+		cfr_err("CTRL subtype : 0x%x\n",
+			glbl_cfg->ctrl_subtype_filter);
+		cfr_err("Data subtype : 0x%x\n",
+			glbl_cfg->data_subtype_filter);
+		cfr_err("TX Addr : %s\n",
+			ether_sprintf(glbl_cfg->tx_addr));
+		cfr_err("TX Addr Mask : %s\n",
+			ether_sprintf(glbl_cfg->tx_addr_mask));
+		cfr_err("RX Addr : %s\n",
+			ether_sprintf(glbl_cfg->rx_addr));
+		cfr_err("RX Addr Mask: %s\n",
+			ether_sprintf(glbl_cfg->rx_addr_mask));
 	}
 
 	wlan_objmgr_pdev_release_ref(pdev, WLAN_CFR_ID);
@@ -799,49 +799,45 @@
 	if (status != QDF_STATUS_SUCCESS)
 		return status;
 
-	cfr_info("bb_captured_channel_cnt = %llu\n",
+	cfr_err("bb_captured_channel_cnt = %llu\n",
 		 pcfr->bb_captured_channel_cnt);
-	cfr_info("bb_captured_timeout_cnt = %llu\n",
+	cfr_err("bb_captured_timeout_cnt = %llu\n",
 		 pcfr->bb_captured_timeout_cnt);
-	cfr_info("rx_loc_info_valid_cnt = %llu\n",
+	cfr_err("rx_loc_info_valid_cnt = %llu\n",
 		 pcfr->rx_loc_info_valid_cnt);
-	cfr_info("tx_evt_cnt = %llu\n",
+	cfr_err("tx_evt_cnt = %llu\n",
 		 pcfr->tx_evt_cnt);
-	cfr_info("dbr_evt_cnt = %llu\n",
+	cfr_err("dbr_evt_cnt = %llu\n",
 		 pcfr->dbr_evt_cnt);
-	cfr_info("rx_tlv_evt_cnt = %llu\n",
+	cfr_err("rx_tlv_evt_cnt = %llu\n",
 		 pcfr->rx_tlv_evt_cnt);
-	cfr_info("release_cnt = %llu\n",
+	cfr_err("release_cnt = %llu\n",
 		 pcfr->release_cnt);
-	cfr_info("Error cnt:\n");
-	cfr_info("flush_dbr_cnt = %llu\n",
+	cfr_err("Error cnt:\n");
+	cfr_err("flush_dbr_cnt = %llu\n",
 		 pcfr->flush_dbr_cnt);
-	cfr_info("invalid_dma_length_cnt = %llu\n",
+	cfr_err("invalid_dma_length_cnt = %llu\n",
 		 pcfr->invalid_dma_length_cnt);
-	cfr_info("flush_all_dbr_cnt = %llu\n",
+	cfr_err("flush_all_dbr_cnt = %llu\n",
 		 pcfr->flush_all_dbr_cnt);
-	cfr_info("flush_all_txrx_cnt = %llu\n",
+	cfr_err("flush_all_txrx_cnt = %llu\n",
 		 pcfr->flush_all_txrx_cnt);
-	cfr_info("flush_timeout_dbr_cnt = %llu\n",
+	cfr_err("flush_timeout_dbr_cnt = %llu\n",
 		 pcfr->flush_timeout_dbr_cnt);
-	cfr_info("flush_timeout_txrx_cnt = %llu\n",
-		 pcfr->flush_timeout_txrx_cnt);
-	cfr_info("PPDU id mismatch for same cookie:\n");
-	cfr_info("clear_dbr_event = %llu\n",
-		 pcfr->clear_dbr_event);
-	cfr_info("clear_txrx_event = %llu\n",
+	cfr_err("PPDU id mismatch for same cookie:\n");
+	cfr_err("clear_txrx_event = %llu\n",
 		 pcfr->clear_txrx_event);
 
-	cfr_info("Channel capture status:\n");
+	cfr_err("Channel capture status:\n");
 	for (counter = 0; counter < CAPTURE_MAX; counter++) {
-		cfr_info("%s = %llu\n",
+		cfr_err("%s = %llu\n",
 			 chan_capture_status_to_str(counter),
 			 pcfr->chan_capture_status[counter]);
 	}
 
-	cfr_info("Freeze reason:\n");
+	cfr_err("Freeze reason:\n");
 	for (counter = 0; counter < FREEZE_REASON_MAX; counter++) {
-		cfr_info("%s = %llu\n",
+		cfr_err("%s = %llu\n",
 			 mac_freeze_reason_to_str(counter),
 			 pcfr->bb_captured_reason_cnt[counter]);
 	}
@@ -872,7 +868,7 @@
 		return QDF_STATUS_E_INVAL;
 	}
 
-	cfr_info("LUT table:\n");
+	cfr_err("LUT table:\n");
 	tgt_cfr_dump_lut_enh(pdev);
 	wlan_objmgr_pdev_release_ref(pdev, WLAN_CFR_ID);
 
@@ -887,8 +883,9 @@
 	cfr_info("pdev_id=%d\n", wlan_objmgr_pdev_get_pdev_id(pdev));
 
 	cdp_cfr_filter(wlan_psoc_get_dp_handle(psoc),
-		       wlan_pdev_get_dp_handle(pdev),
-		       enable, filter_val);
+		       wlan_objmgr_pdev_get_pdev_id(pdev),
+		       enable,
+		       filter_val);
 }
 
 static bool cfr_is_filter_enabled(struct cfr_rcc_param *rcc_param)
diff --git a/umac/dfs/core/src/misc/dfs_zero_cac.c b/umac/dfs/core/src/misc/dfs_zero_cac.c
index d9cc679..5671466 100644
--- a/umac/dfs/core/src/misc/dfs_zero_cac.c
+++ b/umac/dfs/core/src/misc/dfs_zero_cac.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved.
  * Copyright (c) 2007-2008 Sam Leffler, Errno Consulting
  * All rights reserved.
  *
@@ -4630,3 +4630,56 @@
 	dfs->dfs_fw_adfs_support_160 = fw_adfs_support_160;
 }
 #endif
+
+void dfs_reinit_precac_lists(struct wlan_dfs *src_dfs,
+			     struct wlan_dfs *dest_dfs,
+			     uint16_t low_5g_freq,
+			     uint16_t high_5g_freq)
+{
+	struct dfs_precac_entry *tmp_precac_entry, *tmp_precac_entry2;
+
+	/* If the destination DFS is not adhering ETSI (or)
+	 * if the source DFS does not have any lists, return (nothing to do).
+	 */
+	if (utils_get_dfsdomain(dest_dfs->dfs_pdev_obj) != DFS_ETSI_DOMAIN ||
+	    TAILQ_EMPTY(&src_dfs->dfs_precac_list))
+		return;
+
+	/* If dest_dfs and src_dfs are same it will cause dead_lock. */
+	if (dest_dfs == src_dfs)
+	       return;
+
+	PRECAC_LIST_LOCK(dest_dfs);
+	if (TAILQ_EMPTY(&dest_dfs->dfs_precac_list))
+		TAILQ_INIT(&dest_dfs->dfs_precac_list);
+	PRECAC_LIST_LOCK(src_dfs);
+	TAILQ_FOREACH(tmp_precac_entry,
+		      &src_dfs->dfs_precac_list,
+		      pe_list) {
+		if (low_5g_freq <= tmp_precac_entry->vht80_ch_freq &&
+		    high_5g_freq >= tmp_precac_entry->vht80_ch_freq) {
+			/* If the destination DFS already have the entries for
+			 * some reason, remove them and update with the active
+			 * entry in the source DFS list.
+			 */
+			TAILQ_FOREACH(tmp_precac_entry2,
+				      &dest_dfs->dfs_precac_list,
+				      pe_list) {
+				if (tmp_precac_entry2->vht80_ch_freq ==
+				    tmp_precac_entry->vht80_ch_freq)
+					TAILQ_REMOVE(&dest_dfs->dfs_precac_list,
+						     tmp_precac_entry2,
+						     pe_list);
+			}
+			TAILQ_REMOVE(&src_dfs->dfs_precac_list,
+				     tmp_precac_entry,
+				     pe_list);
+			tmp_precac_entry->dfs = dest_dfs;
+			TAILQ_INSERT_TAIL(&dest_dfs->dfs_precac_list,
+					  tmp_precac_entry,
+					  pe_list);
+		}
+	}
+	PRECAC_LIST_UNLOCK(src_dfs);
+	PRECAC_LIST_UNLOCK(dest_dfs);
+}
diff --git a/wmi/inc/wmi_unified_ap_api.h b/wmi/inc/wmi_unified_ap_api.h
index b9ef12d..8f91a9f 100644
--- a/wmi/inc/wmi_unified_ap_api.h
+++ b/wmi/inc/wmi_unified_ap_api.h
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2018,2020 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -752,4 +752,18 @@
 		wmi_unified_t wmi_handle,
 		struct wmi_rx_pkt_protocol_routing_info *param);
 #endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG */
+
+/**
+ * wmi_unified_peer_vlan_config_send() - WMI function to send vlan command
+ *
+ * @wmi_hdl: WMI handle
+ * @peer_addr: Peer mac address
+ * @param: struct peer_vlan_config_param *
+ *
+ * Return: QDF_STATUS_SUCCESS if success, else returns proper error code.
+ */
+QDF_STATUS wmi_unified_peer_vlan_config_send(wmi_unified_t wmi_handle,
+		uint8_t peer_addr[QDF_MAC_ADDR_SIZE],
+		struct peer_vlan_config_param *param);
+
 #endif /* _WMI_UNIFIED_AP_API_H_ */
diff --git a/wmi/src/wmi_unified_ap_api.c b/wmi/src/wmi_unified_ap_api.c
index 6fdf4c5..7dc68ea 100644
--- a/wmi/src/wmi_unified_ap_api.c
+++ b/wmi/src/wmi_unified_ap_api.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2018,2020 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -593,3 +593,15 @@
 	return QDF_STATUS_E_FAILURE;
 }
 #endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG */
+
+QDF_STATUS wmi_unified_peer_vlan_config_send(wmi_unified_t wmi_handle,
+				uint8_t peer_addr[QDF_MAC_ADDR_SIZE],
+				struct peer_vlan_config_param *param)
+{
+	if (wmi_handle->ops->send_peer_vlan_config_cmd)
+		return wmi_handle->ops->send_peer_vlan_config_cmd(wmi_handle,
+							   peer_addr,
+							   param);
+
+	return QDF_STATUS_E_FAILURE;
+}
diff --git a/wmi/src/wmi_unified_ap_tlv.c b/wmi/src/wmi_unified_ap_tlv.c
index 6700f1b..9a1397e 100644
--- a/wmi/src/wmi_unified_ap_tlv.c
+++ b/wmi/src/wmi_unified_ap_tlv.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -1131,14 +1131,22 @@
 	wmi_pdev_multiple_vdev_restart_request_cmd_fixed_param *cmd;
 	int i;
 	uint8_t *buf_ptr;
-	uint32_t *vdev_ids;
+	uint32_t *vdev_ids, *phymode;
 	wmi_channel *chan_info;
 	struct mlme_channel_param *tchan_info;
 	uint16_t len = sizeof(*cmd) + WMI_TLV_HDR_SIZE;
 
+	if (!param->num_vdevs) {
+		WMI_LOGE("vdev's not found for MVR cmd");
+		qdf_status = QDF_STATUS_E_FAULT;
+		goto end;
+	}
 	len += sizeof(wmi_channel);
-	if (param->num_vdevs)
+	if (param->num_vdevs) {
+		len += sizeof(uint32_t) * param->num_vdevs + WMI_TLV_HDR_SIZE;
+		/* for phymode */
 		len += sizeof(uint32_t) * param->num_vdevs;
+	}
 
 	buf = wmi_buf_alloc(wmi_handle, len);
 	if (!buf) {
@@ -1224,6 +1232,23 @@
 		tchan_info->maxregpower, tchan_info->reg_class_id,
 		tchan_info->maxregpower);
 
+	buf_ptr += sizeof(*chan_info);
+	WMITLV_SET_HDR(buf_ptr,
+		       WMITLV_TAG_ARRAY_UINT32,
+		       sizeof(uint32_t) * param->num_vdevs);
+	phymode = (uint32_t *)(buf_ptr + WMI_TLV_HDR_SIZE);
+	for (i = 0; i < param->num_vdevs; i++)
+		WMI_MULTIPLE_VDEV_RESTART_FLAG_SET_PHYMODE(
+				phymode[i], param->mvr_param[i].phymode);
+
+	/* Target expects flag for phymode processing */
+	WMI_MULTIPLE_VDEV_RESTART_FLAG_SET_PHYMODE_PRESENT(cmd->flags, 1);
+	/*
+	 * Target expects to be informed that MVR response is
+	 * expected by host corresponding to this request.
+	 */
+	WMI_MULTIPLE_VDEV_RESTART_FLAG_SET_MVRR_EVENT_SUPPORT(cmd->flags, 1);
+
 	wmi_mtrace(WMI_PDEV_MULTIPLE_VDEV_RESTART_REQUEST_CMDID, NO_SESSION, 0);
 	qdf_status = wmi_unified_cmd_send(wmi_handle, buf, len,
 				WMI_PDEV_MULTIPLE_VDEV_RESTART_REQUEST_CMDID);
@@ -1702,6 +1727,93 @@
 }
 #endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG */
 
+/**
+ * send_peer_vlan_config_cmd_tlv() - Send PEER vlan hw acceleration cmd to fw
+ * @wmi: wmi handle
+ * @peer_addr: peer mac addr
+ * @param: struct peer_vlan_config_param *
+ *
+ * Return: QDF_STATUS_SUCCESS for success or error code
+ */
+static QDF_STATUS send_peer_vlan_config_cmd_tlv(wmi_unified_t wmi,
+					uint8_t peer_addr[QDF_MAC_ADDR_SIZE],
+					struct peer_vlan_config_param *param)
+{
+	wmi_peer_config_vlan_cmd_fixed_param *cmd;
+	wmi_buf_t buf;
+	uint32_t len = sizeof(*cmd);
+
+	buf = wmi_buf_alloc(wmi, len);
+	if (!buf)
+		return QDF_STATUS_E_NOMEM;
+
+	cmd = (wmi_peer_config_vlan_cmd_fixed_param *)wmi_buf_data(buf);
+	WMITLV_SET_HDR(&cmd->tlv_header,
+		       WMITLV_TAG_STRUC_wmi_peer_config_vlan_cmd_fixed_param,
+		       WMITLV_GET_STRUCT_TLVLEN
+			       (wmi_peer_config_vlan_cmd_fixed_param));
+	WMI_CHAR_ARRAY_TO_MAC_ADDR(peer_addr, &cmd->peer_macaddr);
+
+	/* vdev id */
+	cmd->vdev_id = param->vdev_id;
+
+	/* Tx command - Check if cmd is Tx then configure Tx cmd */
+	if (param->tx_cmd) {
+		WMI_VLAN_TX_SET(cmd->peer_vlan_config_mask, param->tx_cmd);
+
+		/* Setting insert_or_strip bit for Tx */
+		WMI_TX_INSERT_OR_STRIP_SET(cmd->peer_vlan_config_mask,
+					   param->tx_strip_insert);
+
+		if (param->tx_strip_insert_inner && param->tx_strip_insert) {
+		/* Setting the strip_insert_vlan_inner bit fo Tx */
+			WMI_TX_STRIP_INSERT_VLAN_INNER_SET(cmd->peer_vlan_config_mask,
+				param->tx_strip_insert_inner);
+		/* If Insert inner tag bit is set, then fill inner_tci */
+			WMI_TX_INSERT_VLAN_INNER_TCI_SET(cmd->insert_vlan_tci,
+						param->insert_vlan_inner_tci);
+		}
+
+		if (param->tx_strip_insert_outer && param->tx_strip_insert) {
+			/* Setting the strip_insert_vlan_outer bit fo Tx */
+			WMI_TX_STRIP_INSERT_VLAN_OUTER_SET(cmd->peer_vlan_config_mask,
+					param->tx_strip_insert_outer);
+			/* If Insert outer tag bit is set, then fill outer_tci */
+			WMI_TX_INSERT_VLAN_OUTER_TCI_SET(cmd->insert_vlan_tci,
+						param->insert_vlan_outer_tci);
+		}
+	}
+
+	/* Rx command - Check if cmd is Rx then configure Rx cmd */
+	if (param->rx_cmd) {
+		WMI_VLAN_RX_SET(cmd->peer_vlan_config_mask, param->rx_cmd);
+
+		/* Setting the strip_vlan_c_tag_decap bit in RX */
+		WMI_RX_STRIP_VLAN_C_TAG_SET(cmd->peer_vlan_config_mask,
+				param->rx_strip_c_tag);
+
+		/* Setting the strip_vlan_s_tag_decap bit in RX */
+		WMI_RX_STRIP_VLAN_S_TAG_SET(cmd->peer_vlan_config_mask,
+					    param->rx_strip_s_tag);
+
+		/* Setting the insert_vlan_c_tag_decap bit in RX */
+		WMI_RX_INSERT_VLAN_C_TAG_SET(cmd->peer_vlan_config_mask,
+					     param->rx_insert_c_tag);
+
+		/* Setting the insert_vlan_s_tag_decap bit in RX */
+		WMI_RX_INSERT_VLAN_S_TAG_SET(cmd->peer_vlan_config_mask,
+					     param->rx_insert_s_tag);
+	}
+
+	if (wmi_unified_cmd_send(wmi, buf, len, WMI_PEER_CONFIG_VLAN_CMDID)) {
+		WMI_LOGE("%s: Failed to send peer hw vlan acceleration command", __func__);
+		wmi_buf_free(buf);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	return QDF_STATUS_SUCCESS;
+}
+
 #ifdef WLAN_SUPPORT_FILS
 /**
  * send_vdev_fils_enable_cmd_tlv() - enable/Disable FD Frame command to fw
@@ -2401,6 +2513,48 @@
 	return QDF_STATUS_SUCCESS;
 }
 
+static QDF_STATUS extract_multi_vdev_restart_resp_event_tlv(
+		wmi_unified_t wmi_hdl, void *evt_buf,
+		struct multi_vdev_restart_resp *param)
+{
+	WMI_PDEV_MULTIPLE_VDEV_RESTART_RESP_EVENTID_param_tlvs *param_buf;
+	wmi_pdev_multiple_vdev_restart_resp_event_fixed_param *ev;
+
+	param_buf =
+	(WMI_PDEV_MULTIPLE_VDEV_RESTART_RESP_EVENTID_param_tlvs *)evt_buf;
+	if (!param_buf) {
+		WMI_LOGE("Invalid buf multi_vdev restart response");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	ev = (wmi_pdev_multiple_vdev_restart_resp_event_fixed_param *)
+							param_buf->fixed_param;
+	if (!ev) {
+		WMI_LOGE("Invalid ev multi_vdev restart response");
+		return QDF_STATUS_E_INVAL;
+	}
+
+	param->pdev_id = ev->pdev_id;
+	param->status = ev->status;
+
+	if (!param_buf->num_vdev_ids_bitmap)
+		return QDF_STATUS_E_FAILURE;
+
+	if (param_buf->num_vdev_ids_bitmap > sizeof(param->vdev_id_bmap)) {
+		WMI_LOGE("vdevId bitmap overflow size:%d",
+			 param_buf->num_vdev_ids_bitmap);
+		return QDF_STATUS_E_FAILURE;
+	}
+
+	qdf_mem_copy(param->vdev_id_bmap, param_buf->vdev_ids_bitmap,
+		     param_buf->num_vdev_ids_bitmap);
+
+	WMI_LOGD("vdev_id_bmap :0x%x%x", param->vdev_id_bmap[1],
+		 param->vdev_id_bmap[0]);
+
+	return QDF_STATUS_SUCCESS;
+}
+
 void wmi_ap_attach_tlv(wmi_unified_t wmi_handle)
 {
 	struct wmi_ops *ops = wmi_handle->ops;
@@ -2469,4 +2623,7 @@
 	ops->set_rx_pkt_type_routing_tag_cmd =
 					set_rx_pkt_type_routing_tag_update_tlv;
 #endif /* WLAN_SUPPORT_RX_PROTOCOL_TYPE_TAG */
+	ops->send_peer_vlan_config_cmd = send_peer_vlan_config_cmd_tlv;
+	ops->extract_multi_vdev_restart_resp_event =
+				extract_multi_vdev_restart_resp_event_tlv;
 }
diff --git a/wmi/src/wmi_unified_non_tlv.c b/wmi/src/wmi_unified_non_tlv.c
index 2c9bf31..fdb12f1 100644
--- a/wmi/src/wmi_unified_non_tlv.c
+++ b/wmi/src/wmi_unified_non_tlv.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -20,7 +20,6 @@
 #include "wmi_unified_priv.h"
 #include "target_type.h"
 #include <qdf_module.h>
-
 #if defined(WMI_NON_TLV_SUPPORT) || defined(WMI_TLV_AND_NON_TLV_SUPPORT)
 #include "wmi.h"
 #include "wmi_unified.h"
@@ -1182,6 +1181,22 @@
 }
 
 /**
+ * send_peer_vlan_config_cmd_non_tlv() - Send PEER vlan hw accel cmdd to fw
+ * @wmi: wmi handle
+ * @peer_addr: peer mac addr
+ * @param: struct peer_vlan_config_param *
+ *
+ * It is not supported for legacy.
+ * Return: QDF_STATUS_E_NOSUPPORT
+ */
+static QDF_STATUS send_peer_vlan_config_cmd_non_tlv(wmi_unified_t wmi,
+					uint8_t peer_addr[QDF_MAC_ADDR_SIZE],
+					struct peer_vlan_config_param *param)
+{
+	return QDF_STATUS_E_NOSUPPORT;
+}
+
+/**
  * send_peer_add_wds_entry_cmd_non_tlv() - send peer add command to fw
  * @wmi_handle: wmi handle
  * @param: pointer holding peer details
@@ -7030,22 +7045,100 @@
 }
 
 /**
- * extract_host_mem_req_non_tlv() - Extract host memory request event
+ * extract_num_mem_reqs_non_tlv() - Extract number of memory entries requested
  * @wmi_handle: wmi handle
- * @param evt_buf: pointer to event buffer
- * @param num_entries: pointer to hold number of entries requested
+ * @evt_buf: pointer to event buffer
  *
  * Return: Number of entries requested
  */
-static host_mem_req *extract_host_mem_req_non_tlv(wmi_unified_t wmi_handle,
-		void *evt_buf, uint8_t *num_entries)
+static uint32_t extract_num_mem_reqs_non_tlv(wmi_unified_t wmi_handle,
+					     void *evt_buf)
 {
 	wmi_service_ready_event *ev;
 
 	ev = (wmi_service_ready_event *) evt_buf;
 
-	*num_entries = ev->num_mem_reqs;
-	return (host_mem_req *)ev->mem_reqs;
+	return ev->num_mem_reqs;
+}
+
+/**
+ * extract_host_mem_req_non_tlv() - Extract host memory required from
+ *                                  service ready event
+ * @wmi_handle: wmi handle
+ * @evt_buf: pointer to event buffer
+ * @mem_reqs: pointer to host memory request structure
+ * @num_active_peers: number of active peers for peer cache
+ * @num_peers: number of peers
+ * @fw_prio: FW priority
+ * @idx: index for memory request
+ *
+ * Return: Host memory request parameters requested by target
+ */
+static QDF_STATUS extract_host_mem_req_non_tlv(wmi_unified_t wmi_handle,
+		void *evt_buf, host_mem_req *mem_reqs,
+		uint32_t num_active_peers, uint32_t num_peers,
+		enum wmi_fw_mem_prio fw_prio, uint16_t idx)
+{
+	wmi_service_ready_event *ev;
+
+	ev = (wmi_service_ready_event *) evt_buf;
+
+	mem_reqs->req_id = (uint32_t)ev->mem_reqs[idx].req_id;
+	mem_reqs->unit_size = (uint32_t)ev->mem_reqs[idx].unit_size;
+	mem_reqs->num_unit_info =
+		(uint32_t)ev->mem_reqs[idx].num_unit_info;
+	mem_reqs->num_units = (uint32_t)ev->mem_reqs[idx].num_units;
+	mem_reqs->tgt_num_units = 0;
+
+	if (((fw_prio == WMI_FW_MEM_HIGH_PRIORITY) &&
+	     (mem_reqs->num_unit_info &
+	      REQ_TO_HOST_FOR_CONT_MEMORY)) ||
+	    ((fw_prio == WMI_FW_MEM_LOW_PRIORITY) &&
+	     (!(mem_reqs->num_unit_info &
+	      REQ_TO_HOST_FOR_CONT_MEMORY)))) {
+		/* First allocate the memory that requires contiguous memory */
+		mem_reqs->tgt_num_units = mem_reqs->num_units;
+		if (mem_reqs->num_unit_info) {
+			if (mem_reqs->num_unit_info &
+					NUM_UNITS_IS_NUM_PEERS) {
+				/*
+				 * number of units allocated is equal to number
+				 * of peers, 1 extra for self peer on target.
+				 * this needs to be fixed, host and target can
+				 * get out of sync
+				 */
+				mem_reqs->tgt_num_units =
+					num_peers + 1;
+			}
+			if (mem_reqs->num_unit_info &
+					NUM_UNITS_IS_NUM_ACTIVE_PEERS) {
+				/*
+				 * Requesting allocation of memory using
+				 * num_active_peers in qcache. if qcache is
+				 * disabled in host, then it should allocate
+				 * memory for num_peers instead of
+				 * num_active_peers.
+				 */
+				if (num_active_peers)
+					mem_reqs->tgt_num_units =
+						num_active_peers + 1;
+				else
+					mem_reqs->tgt_num_units =
+						num_peers + 1;
+			}
+		}
+
+		WMI_LOGI("idx %d req %d  num_units %d num_unit_info %d"
+				"unit size %d actual units %d",
+				idx, mem_reqs->req_id,
+				mem_reqs->num_units,
+				mem_reqs->num_unit_info,
+				mem_reqs->unit_size,
+				mem_reqs->tgt_num_units);
+
+	}
+
+	return QDF_STATUS_SUCCESS;
 }
 
 /**
@@ -9857,10 +9950,41 @@
 		WMI_LOGE("Failed to send WMI_PDEV_MULTIPLE_VDEV_RESTART_REQUEST_CMDID");
 		wmi_buf_free(buf);
 	}
+
 	return ret;
+}
 
+/*
+ * extract_multi_vdev_restart_resp_event_non_tlv() -
+ * extract multiple vdev restart response event
+ * @wmi_handle: wmi handle
+ * @evt_buf: pointer to event buffer
+ * @param: Pointer to hold vdev_id of multiple vdev restart response
+ *
+ * Return: QDF_STATUS_SUCCESS for success or QDF_STATUS_E_FAILURE on error
+ */
+static QDF_STATUS extract_multi_vdev_restart_resp_event_non_tlv(
+		wmi_unified_t wmi_hdl, void *evt_buf,
+		struct multi_vdev_restart_resp *param)
+{
+	wmi_vdev_multi_vdev_restart_response_event *ev;
 
+	ev = (wmi_vdev_multi_vdev_restart_response_event *)evt_buf;
+	if (!ev) {
+		WMI_LOGE("Invalid multi_vdev restart response");
+		return QDF_STATUS_E_FAILURE;
+	}
 
+	/* For legacy platforms, pdev_id is set to 0 by default */
+	param->pdev_id = 0;
+	param->status = ev->status;
+	qdf_mem_copy(param->vdev_id_bmap, &ev->requestor_id,
+		     sizeof(uint32_t));
+
+	WMI_LOGD("vdev_id_bmap :0x%x%x", param->vdev_id_bmap[1],
+		 param->vdev_id_bmap[0]);
+
+	return QDF_STATUS_SUCCESS;
 }
 
 /**
@@ -9954,6 +10078,7 @@
 	.send_peer_param_cmd = send_peer_param_cmd_non_tlv,
 	.send_vdev_up_cmd = send_vdev_up_cmd_non_tlv,
 	.send_peer_create_cmd = send_peer_create_cmd_non_tlv,
+	.send_peer_vlan_config_cmd = send_peer_vlan_config_cmd_non_tlv,
 	.send_peer_delete_cmd = send_peer_delete_cmd_non_tlv,
 	.send_peer_delete_all_cmd = send_peer_delete_all_cmd_non_tlv,
 	.send_peer_ft_roam_cmd = send_peer_ft_roam_cmd_non_tlv,
@@ -10103,6 +10228,7 @@
 	.extract_fw_version = extract_fw_version_non_tlv,
 	.extract_fw_abi_version = extract_fw_abi_version_non_tlv,
 	.extract_hal_reg_cap = extract_hal_reg_cap_non_tlv,
+	.extract_num_mem_reqs = extract_num_mem_reqs_non_tlv,
 	.extract_host_mem_req = extract_host_mem_req_non_tlv,
 	.save_service_bitmap = save_service_bitmap_non_tlv,
 	.is_service_enabled = is_service_enabled_non_tlv,
@@ -10214,6 +10340,8 @@
 	.send_vdev_tidmap_prec_cmd = send_vdev_tidmap_prec_cmd_non_tlv,
 	.send_multiple_vdev_restart_req_cmd =
 			send_multiple_vdev_restart_req_cmd_non_tlv,
+	.extract_multi_vdev_restart_resp_event =
+		extract_multi_vdev_restart_resp_event_non_tlv,
 };
 
 /**
@@ -10532,6 +10660,8 @@
 					WMI_PDEV_CTL_FAILSAFE_CHECK_EVENTID;
 	event_ids[wmi_peer_delete_all_response_event_id] =
 					WMI_VDEV_DELETE_ALL_PEER_RESP_EVENTID;
+	event_ids[wmi_pdev_multi_vdev_restart_response_event_id] =
+				WMI_PDEV_MULTIPLE_VDEV_RESTART_RESP_EVENTID;
 }
 #endif