瀏覽代碼

qcacld-3.0: Drop TX MGMT Frame if no ROC

In case if supplicant issues probe request without ROC,
Host should drop it for STA mode.

Change-Id: I290f441f6ddc41dd8d7434ad7d4fd1b4fcc0c22e
CRs-Fixed: 3296264
abhinav kumar 2 年之前
父節點
當前提交
83d3138157
共有 1 個文件被更改,包括 22 次插入0 次删除
  1. 22 0
      components/p2p/core/src/wlan_p2p_off_chan_tx.c

+ 22 - 0
components/p2p/core/src/wlan_p2p_off_chan_tx.c

@@ -36,6 +36,7 @@
 #include "wlan_osif_request_manager.h"
 #include <wlan_mlme_main.h>
 #include "wlan_mlme_api.h"
+#include <wlan_cm_api.h>
 
 /**
  * p2p_psoc_get_tx_ops() - get p2p tx ops
@@ -3139,7 +3140,10 @@ QDF_STATUS p2p_process_mgmt_tx(struct tx_action_context *tx_ctx)
 	struct p2p_soc_priv_obj *p2p_soc_obj;
 	struct p2p_roc_context *curr_roc_ctx;
 	uint8_t *mac_to;
+	enum QDF_OPMODE mode;
+	struct wlan_objmgr_vdev *vdev;
 	QDF_STATUS status;
+	bool is_vdev_connected = false;
 
 	status = p2p_tx_context_check_valid(tx_ctx);
 	if (status != QDF_STATUS_SUCCESS) {
@@ -3191,9 +3195,27 @@ QDF_STATUS p2p_process_mgmt_tx(struct tx_action_context *tx_ctx)
 		tx_ctx->no_ack = 1;
 	}
 
+	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(
+			p2p_soc_obj->soc, tx_ctx->vdev_id, WLAN_P2P_ID);
+	if (!vdev) {
+		p2p_err("null vdev object");
+		goto fail;
+	}
+
+	mode = wlan_vdev_mlme_get_opmode(vdev);
+	if (mode == QDF_STA_MODE)
+		is_vdev_connected = wlan_cm_is_vdev_connected(vdev);
+
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_P2P_ID);
+
 	if (!tx_ctx->off_chan || !tx_ctx->chan_freq) {
 		if (!tx_ctx->chan_freq)
 			p2p_check_and_update_channel(tx_ctx);
+		if (!tx_ctx->chan_freq && mode == QDF_STA_MODE &&
+		    !is_vdev_connected) {
+			p2p_debug("chan freq is zero, drop tx mgmt frame");
+			goto fail;
+		}
 		status = p2p_execute_tx_action_frame(tx_ctx);
 		if (status != QDF_STATUS_SUCCESS) {
 			p2p_err("execute tx fail");