linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Miri Korenblit <miriam.rachel.korenblit@intel.com>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org,
	Avraham Stern <avraham.stern@intel.com>,
	Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Subject: [PATCH 03/15] wifi: iwlwifi: mvm: add debugfs for forcing unprotected ranging request
Date: Tue, 19 Mar 2024 10:10:15 +0200	[thread overview]
Message-ID: <20240319100755.8523150148ec.I7ab6c547513717e69ec385f72a8f43ea00bd9e0a@changeid> (raw)
In-Reply-To: <20240319081027.3853611-1-miriam.rachel.korenblit@intel.com>

From: Avraham Stern <avraham.stern@intel.com>

Add an option to force sending unprotected ranging request even if the
station is associated to the responder or a PASN keys are configured.
This is used for testing.

Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
---
 .../wireless/intel/iwlwifi/mvm/debugfs-vif.c    |  2 ++
 .../wireless/intel/iwlwifi/mvm/ftm-initiator.c  | 17 ++++++++++++++++-
 drivers/net/wireless/intel/iwlwifi/mvm/mvm.h    |  1 +
 3 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c
index 3d272b3bed4e..5485e8bf613e 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c
@@ -793,6 +793,8 @@ void iwl_mvm_vif_add_debugfs(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
 	MVM_DEBUGFS_ADD_FILE_VIF(rx_phyinfo, mvmvif->dbgfs_dir, 0600);
 	MVM_DEBUGFS_ADD_FILE_VIF(quota_min, mvmvif->dbgfs_dir, 0600);
 	MVM_DEBUGFS_ADD_FILE_VIF(os_device_timediff, mvmvif->dbgfs_dir, 0400);
+	debugfs_create_bool("ftm_unprotected", 0200, mvmvif->dbgfs_dir,
+			    &mvmvif->ftm_unprotected);
 	MVM_DEBUGFS_ADD_FILE_VIF(int_mlo_scan, mvmvif->dbgfs_dir, 0200);
 
 	if (vif->type == NL80211_IFTYPE_STATION && !vif->p2p &&
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
index 4863a3c74640..c9000c878005 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
@@ -1,7 +1,7 @@
 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
 /*
  * Copyright (C) 2015-2017 Intel Deutschland GmbH
- * Copyright (C) 2018-2023 Intel Corporation
+ * Copyright (C) 2018-2024 Intel Corporation
  */
 #include <linux/etherdevice.h>
 #include <linux/math64.h>
@@ -551,6 +551,15 @@ iwl_mvm_ftm_put_target(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 			break;
 		}
 		rcu_read_unlock();
+
+#ifdef CONFIG_IWLWIFI_DEBUGFS
+		if (mvmvif->ftm_unprotected) {
+			target->sta_id = IWL_MVM_INVALID_STA;
+			target->initiator_ap_flags &=
+				~cpu_to_le32(IWL_INITIATOR_AP_FLAGS_PMF);
+		}
+
+#endif
 	} else {
 		target->sta_id = IWL_MVM_INVALID_STA;
 	}
@@ -713,6 +722,12 @@ iwl_mvm_ftm_set_secured_ranging(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 {
 	struct iwl_mvm_ftm_pasn_entry *entry;
 	u32 flags = le32_to_cpu(target->initiator_ap_flags);
+#ifdef CONFIG_IWLWIFI_DEBUGFS
+	struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
+
+	if (mvmvif->ftm_unprotected)
+		return;
+#endif
 
 	if (!(flags & (IWL_INITIATOR_AP_FLAGS_NON_TB |
 		       IWL_INITIATOR_AP_FLAGS_TB)))
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index 3f6fd6fef7cf..8134a5907908 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -437,6 +437,7 @@ struct iwl_mvm_vif {
 	struct iwl_dbgfs_bf dbgfs_bf;
 	struct iwl_mac_power_cmd mac_pwr_cmd;
 	int dbgfs_quota_min;
+	bool ftm_unprotected;
 #endif
 
 	/* FW identified misbehaving AP */
-- 
2.34.1


  parent reply	other threads:[~2024-03-19  8:10 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-19  8:10 [PATCH 00/15] wifi: iwlwifi: updates - 2024-03-19 Miri Korenblit
2024-03-19  8:10 ` [PATCH 01/15] wifi: iwlwifi: mvm: Introduce internal MLO passive scan Miri Korenblit
2024-03-19  8:10 ` [PATCH 02/15] wifi: iwlwifi: mvm: Add debugfs entry for triggering internal MLO scan Miri Korenblit
2024-03-19  8:10 ` Miri Korenblit [this message]
2024-03-19  8:10 ` [PATCH 04/15] wifi: iwlwifi: add a kunit test for PCI table duplicates Miri Korenblit
2024-03-19  8:10 ` [PATCH 05/15] wifi: iwlwifi: mvm: rfi: fix potential response leaks Miri Korenblit
2024-03-19  8:10 ` [PATCH 06/15] wifi: iwlwifi: mvm: support iwl_dev_tx_power_cmd_v8 Miri Korenblit
2024-03-19  8:10 ` [PATCH 07/15] wifi: iwlwifi: mvm: always apply 6 GHz probe limitations Miri Korenblit
2024-03-19  8:10 ` [PATCH 08/15] wifi: iwlwifi: fw: don't always use FW dump trig Miri Korenblit
2024-03-19  8:10 ` [PATCH 09/15] wifi: iwlwifi: fw: add clarifying comments about iwl_fwrt_dump_data Miri Korenblit
2024-03-19  8:10 ` [PATCH 10/15] wifi: iwlwifi: read txq->read_ptr under lock Miri Korenblit
2024-03-19  8:10 ` [PATCH 11/15] wifi: iwlwifi: mvm: don't support puncturing in 5 GHz Miri Korenblit
2024-03-19  8:10 ` [PATCH 12/15] wifi: iwlwifi: remove 6 GHz NVM override Miri Korenblit
2024-03-19  8:10 ` [PATCH 13/15] wifi: iwlwifi: mvm: Do not warn on invalid link on scan complete Miri Korenblit
2024-03-19  8:10 ` [PATCH 14/15] wifi: iwlwifi: enable monitor on passive/inactive channels Miri Korenblit
2024-03-19  8:10 ` [PATCH 15/15] wifi: iwlwifi: mvm: allocate STA links only for active links Miri Korenblit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240319100755.8523150148ec.I7ab6c547513717e69ec385f72a8f43ea00bd9e0a@changeid \
    --to=miriam.rachel.korenblit@intel.com \
    --cc=avraham.stern@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).