Merge "qca-wifi: filter by mac check"
diff --git a/dp/wifi3.0/dp_tx_capture.c b/dp/wifi3.0/dp_tx_capture.c
index f11b71a..27b8c1a 100644
--- a/dp/wifi3.0/dp_tx_capture.c
+++ b/dp/wifi3.0/dp_tx_capture.c
@@ -3893,6 +3893,7 @@
 	struct dp_ast_entry *ast_entry;
 	uint32_t peer_id;
 	struct dp_peer *peer;
+	struct dp_vdev *vdev = NULL;
 
 	if (rx_user_status->ast_index >=
 	    wlan_cfg_get_max_ast_idx(soc->wlan_cfg_ctx)) {
@@ -3923,6 +3924,21 @@
 		return QDF_STATUS_E_FAILURE;
 	}
 
+	if (pdev->tx_capture_enabled == CDP_TX_ENH_CAPTURE_ENABLE_ALL_PEERS) {
+		int8_t match = 0;
+
+		TAILQ_FOREACH(vdev, &pdev->vdev_list, vdev_list_elem) {
+			if (!qdf_mem_cmp(vdev->mac_addr.raw,
+					 ppdu_info->rx_info.mac_addr1,
+					 QDF_MAC_ADDR_SIZE)) {
+				match = 1;
+				break;
+			}
+		}
+		if (!match)
+			return QDF_STATUS_E_FAILURE;
+	}
+
 	set_mpdu_info(&tx_capture_info,
 		      &ppdu_info->rx_status, rx_user_status);
 	tx_capture_info.mpdu_info.mcs = rx_user_status->mcs;
@@ -4101,6 +4117,11 @@
 
 	rx_status = &ppdu_info->rx_status;
 
+	if (ppdu_info->sw_frame_group_id ==
+	    HAL_MPDU_SW_FRAME_GROUP_CTRL_RTS) {
+		return dp_send_cts_frame_to_stack(soc, pdev, ppdu_info);
+	}
+
 	if (!rx_status->rxpcu_filter_pass)
 		return QDF_STATUS_SUCCESS;
 
@@ -4115,10 +4136,6 @@
 		return QDF_STATUS_SUCCESS;
 	}
 
-	if (ppdu_info->sw_frame_group_id ==
-	    HAL_MPDU_SW_FRAME_GROUP_CTRL_RTS)
-		return dp_send_cts_frame_to_stack(soc, pdev, ppdu_info);
-
 	if (ppdu_info->sw_frame_group_id == HAL_MPDU_SW_FRAME_GROUP_CTRL_BAR)
 		return QDF_STATUS_SUCCESS;