Sfoglia il codice sorgente

qcacld-3.0: Support to prevent data and mgmt response Tx

BSS max idle testbed test requires to prevent the data and
manamenet response frame Tx with user configuration.
Add support to prevent data Tx and drop Rx mgmt frames so that
response frames is not sent.

Change-Id: I01f08fd8f30dc4b1b80801434918b976abb09e3c
CRs-Fixed: 2817703
Kiran Kumar Lokere 4 anni fa
parent
commit
5d87920a01

+ 10 - 0
core/hdd/src/wlan_hdd_cfg80211.c

@@ -7084,6 +7084,8 @@ wlan_hdd_wifi_test_config_policy[
 			.type = NLA_U8},
 		[QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_PMF_PROTECTION] = {
 			.type = NLA_U8},
+		[QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_DISABLE_DATA_MGMT_RSP_TX]
+			= {.type = NLA_U8},
 		[QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_DISASSOC_TX] = {
 			.type = NLA_FLAG},
 		[QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_FT_REASSOCREQ_RSNXE_USED] = {
@@ -10341,6 +10343,14 @@ __wlan_hdd_cfg80211_set_wifi_test_config(struct wiphy *wiphy,
 						       cfg_val);
 	}
 
+	cmd_id = QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_DISABLE_DATA_MGMT_RSP_TX;
+	if (tb[cmd_id]) {
+		cfg_val = nla_get_u8(tb[cmd_id]);
+		hdd_debug("disable Tx cfg: val %d", cfg_val);
+		sme_set_cfg_disable_tx(hdd_ctx->mac_handle, adapter->vdev_id,
+				       cfg_val);
+	}
+
 	cmd_id = QCA_WLAN_VENDOR_ATTR_WIFI_TEST_CONFIG_PMF_PROTECTION;
 	if (tb[cmd_id]) {
 		cfg_val = nla_get_u8(tb[cmd_id]);

+ 1 - 0
core/mac/inc/ani_global.h

@@ -806,6 +806,7 @@ struct mac_context {
 	bool he_om_ctrl_cfg_tx_nsts_set;
 	uint8_t he_om_ctrl_cfg_tx_nsts;
 	bool he_om_ctrl_ul_mu_data_dis;
+	uint8_t usr_cfg_disable_rsp_tx;
 	uint8_t is_usr_cfg_pmf_wep;
 	uint8_t usr_cfg_ru_242_tone_tx;
 #ifdef WLAN_FEATURE_11AX

+ 5 - 0
core/mac/src/pe/lim/lim_api.c

@@ -1204,6 +1204,11 @@ static QDF_STATUS pe_handle_mgmt_frame(struct wlan_objmgr_psoc *psoc,
 		return QDF_STATUS_E_FAILURE;
 	}
 
+	if (mac->usr_cfg_disable_rsp_tx) {
+		pe_debug("Drop Rx pkt with user config");
+		qdf_nbuf_free(buf);
+		return QDF_STATUS_SUCCESS;
+	}
 	pVosPkt = qdf_mem_malloc_atomic(sizeof(*pVosPkt));
 	if (!pVosPkt) {
 		qdf_nbuf_free(buf);

+ 10 - 0
core/sme/inc/sme_api.h

@@ -3622,6 +3622,16 @@ void sme_set_amsdu(mac_handle_t mac_handle, bool enable);
  */
 void sme_set_pmf_wep_cfg(mac_handle_t mac_handle, uint8_t pmf_wep_cfg);
 
+/**
+ * sme_set_cfg_disable_tx() - set user cfg to disable data and mgmt tx
+ * @mac_handle: Opaque handle to the global MAC context
+ * @vdev_id: vdev id
+ * @val: configuration value
+ *
+ * Return: None
+ */
+void sme_set_cfg_disable_tx(mac_handle_t mac_handle, uint8_t vdev_id,
+			    uint8_t val);
 #ifdef WLAN_FEATURE_11AX
 void sme_set_he_testbed_def(mac_handle_t mac_handle, uint8_t vdev_id);
 void sme_reset_he_caps(mac_handle_t mac_handle, uint8_t vdev_id);

+ 35 - 0
core/sme/src/common/sme_api.c

@@ -14830,6 +14830,38 @@ void sme_set_pmf_wep_cfg(mac_handle_t mac_handle, uint8_t pmf_wep)
 	mac_ctx->is_usr_cfg_pmf_wep = pmf_wep;
 }
 
+void sme_set_cfg_disable_tx(mac_handle_t mac_handle, uint8_t vdev_id,
+			    uint8_t val)
+{
+	struct mac_context *mac = MAC_CONTEXT(mac_handle);
+	int ret_val;
+
+	sme_debug("Block Tx %d", val);
+	if (val) {
+		if (mac->sme.tx_queue_cb) {
+			sme_debug("Blocking the Tx queue");
+			mac->sme.tx_queue_cb(mac->hdd_handle, vdev_id,
+					WLAN_STOP_ALL_NETIF_QUEUE,
+					WLAN_CONTROL_PATH);
+		}
+	} else {
+		if (mac->sme.tx_queue_cb) {
+			sme_debug("Enable the Tx queue");
+			mac->sme.tx_queue_cb(mac->hdd_handle, vdev_id,
+					WLAN_START_ALL_NETIF_QUEUE,
+					WLAN_CONTROL_PATH);
+		}
+	}
+
+	ret_val = wma_cli_set_command(vdev_id,
+			WMI_VDEV_PARAM_PROHIBIT_DATA_MGMT,
+			val, VDEV_CMD);
+	if (ret_val)
+		sme_err("Failed to set firmware, errno %d", ret_val);
+
+	mac->usr_cfg_disable_rsp_tx = val;
+}
+
 void sme_set_amsdu(mac_handle_t mac_handle, bool enable)
 {
 	struct mac_context *mac_ctx = MAC_CONTEXT(mac_handle);
@@ -14966,6 +14998,9 @@ void sme_reset_he_caps(mac_handle_t mac_handle, uint8_t vdev_id)
 		sme_err("Failed to set enable bcast probe resp in FW, %d",
 			status);
 	mac_ctx->is_usr_cfg_pmf_wep = PMF_CORRECT_KEY;
+
+	if (mac_ctx->usr_cfg_disable_rsp_tx)
+		sme_set_cfg_disable_tx(mac_handle, vdev_id, 0);
 }
 #endif