All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/15] wifi: iwlwifi: updates - 2024-01-29
@ 2024-01-29 19:21 Miri Korenblit
  2024-01-29 19:21 ` [PATCH 01/15] wifi: iwlwifi: fix EWRD table validity check Miri Korenblit
                   ` (14 more replies)
  0 siblings, 15 replies; 17+ messages in thread
From: Miri Korenblit @ 2024-01-29 19:21 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless

Hi,

This patch set includes iwlwifi patches intended for v6.9. It contains a
few features, bugfixes and cleanups.

Thanks,
Miri

Ayala Beker (1):
  wifi: iwlwifi: mvm: add support for TID to link mapping neg request

Colin Ian King (1):
  wifi: iwlwifi: Fix spelling mistake "SESION" -> "SESSION"

Daniel Gabay (1):
  wifi: iwlwifi: mvm: log dropped packets due to MIC error

Emmanuel Grumbach (1):
  wifi: iwlwifi: mvm: fix the TLC command after ADD_STA

Ilan Peer (2):
  wifi: iwlwifi: mvm: Fix FTM initiator flags
  wifi: iwlwifi: mvm: Add support for removing responder TKs

Johannes Berg (7):
  wifi: iwlwifi: mvm: d3: fix IPN byte order
  wifi: iwlwifi: mvm: don't set trigger frame padding in AP mode
  wifi: iwlwifi: always have 'uats_enabled'
  wifi: iwlwifi: remove Gl A-step remnants
  wifi: iwlwifi: mvm: use FW rate for non-data only on new devices
  wifi: iwlwifi: mvm: support SPP A-MSDUs
  wifi: iwlwifi: mvm: refactor duplicate chanctx condition

Miri Korenblit (1):
  wifi: iwlwifi: fix EWRD table validity check

Mukesh Sisodiya (1):
  wifi: iwlwifi: pcie: Add new PCI device id for new hardware

 drivers/net/wireless/intel/iwlwifi/cfg/bz.c   |  4 ---
 drivers/net/wireless/intel/iwlwifi/fw/acpi.c  |  2 +-
 .../net/wireless/intel/iwlwifi/fw/api/sta.h   |  4 ++-
 drivers/net/wireless/intel/iwlwifi/fw/file.h  |  3 ++
 .../net/wireless/intel/iwlwifi/fw/runtime.h   |  2 +-
 .../wireless/intel/iwlwifi/iwl-nvm-parse.c    |  1 -
 drivers/net/wireless/intel/iwlwifi/mvm/d3.c   |  8 ++++-
 .../intel/iwlwifi/mvm/ftm-initiator.c         |  9 ++---
 .../intel/iwlwifi/mvm/ftm-responder.c         |  7 +++-
 .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 34 ++++++++++++-------
 .../net/wireless/intel/iwlwifi/mvm/mld-key.c  | 18 ++++++++++
 .../wireless/intel/iwlwifi/mvm/mld-mac80211.c | 19 +++++++++++
 drivers/net/wireless/intel/iwlwifi/mvm/mvm.h  | 17 ++++++++++
 drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c |  5 ++-
 drivers/net/wireless/intel/iwlwifi/mvm/sta.c  | 18 ++++------
 drivers/net/wireless/intel/iwlwifi/mvm/sta.h  |  3 +-
 .../wireless/intel/iwlwifi/mvm/time-event.c   |  2 +-
 drivers/net/wireless/intel/iwlwifi/mvm/tx.c   | 33 +++++++++++++++---
 drivers/net/wireless/intel/iwlwifi/pcie/drv.c |  1 +
 19 files changed, 146 insertions(+), 44 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH 01/15] wifi: iwlwifi: fix EWRD table validity check
  2024-01-29 19:21 [PATCH 00/15] wifi: iwlwifi: updates - 2024-01-29 Miri Korenblit
@ 2024-01-29 19:21 ` Miri Korenblit
  2024-01-29 19:21 ` [PATCH 02/15] wifi: iwlwifi: mvm: add support for TID to link mapping neg request Miri Korenblit
                   ` (13 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Miri Korenblit @ 2024-01-29 19:21 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Gregory Greenman

EWRD ACPI table contains up to 3 additional sar profiles.
According to the BIOS spec, the table contains a n_profile
variable indicating how many additional profiles exist in the
table.
Currently we check that n_profiles is not <= 0.
But according to the BIOS spec, 0 is a valid value,
and it can't be < 0 anyway because we receive that from ACPI as
an unsigned integer.

Fixes: 39c1a9728f93 ("iwlwifi: refactor the SAR tables from mvm to acpi")
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
index dd68d382d7de..9be91e6a9882 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
@@ -767,7 +767,7 @@ int iwl_sar_get_ewrd_table(struct iwl_fw_runtime *fwrt)
 	 * from index 1, so the maximum value allowed here is
 	 * ACPI_SAR_PROFILES_NUM - 1.
 	 */
-	if (n_profiles <= 0 || n_profiles >= ACPI_SAR_PROFILE_NUM) {
+	if (n_profiles >= ACPI_SAR_PROFILE_NUM) {
 		ret = -EINVAL;
 		goto out_free;
 	}
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 02/15] wifi: iwlwifi: mvm: add support for TID to link mapping neg request
  2024-01-29 19:21 [PATCH 00/15] wifi: iwlwifi: updates - 2024-01-29 Miri Korenblit
  2024-01-29 19:21 ` [PATCH 01/15] wifi: iwlwifi: fix EWRD table validity check Miri Korenblit
@ 2024-01-29 19:21 ` Miri Korenblit
  2024-01-29 19:21 ` [PATCH 03/15] wifi: iwlwifi: mvm: d3: fix IPN byte order Miri Korenblit
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Miri Korenblit @ 2024-01-29 19:21 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Ayala Beker, Johannes Berg, Gregory Greenman

From: Ayala Beker <ayala.beker@intel.com>

Add support for handling TID to link mapping negotiation
request and decide whether to accept it or not.
Accept the request if all TIDs are mapped to the same link set,
otherwise reject it.

Signed-off-by: Ayala Beker <ayala.beker@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 .../net/wireless/intel/iwlwifi/mvm/mac80211.c |  5 +++++
 .../wireless/intel/iwlwifi/mvm/mld-mac80211.c | 19 +++++++++++++++++++
 2 files changed, 24 insertions(+)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index c82af4ac27ec..d19e478f382b 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -263,6 +263,9 @@ static const u8 tm_if_types_ext_capa_sta[] = {
 					__bf_shf(IEEE80211_EML_CAP_EMLSR_PADDING_DELAY) | \
 				 IEEE80211_EML_CAP_EMLSR_TRANSITION_DELAY_64US << \
 					__bf_shf(IEEE80211_EML_CAP_EMLSR_TRANSITION_DELAY))
+#define IWL_MVM_MLD_CAPA_OPS FIELD_PREP_CONST( \
+			IEEE80211_MLD_CAP_OP_TID_TO_LINK_MAP_NEG_SUPP, \
+			IEEE80211_MLD_CAP_OP_TID_TO_LINK_MAP_NEG_SUPP_SAME)
 
 static const struct wiphy_iftype_ext_capab add_iftypes_ext_capa[] = {
 	{
@@ -272,6 +275,7 @@ static const struct wiphy_iftype_ext_capab add_iftypes_ext_capa[] = {
 		.extended_capabilities_len = sizeof(he_if_types_ext_capa_sta),
 		/* relevant only if EHT is supported */
 		.eml_capabilities = IWL_MVM_EMLSR_CAPA,
+		.mld_capa_and_ops = IWL_MVM_MLD_CAPA_OPS,
 	},
 	{
 		.iftype = NL80211_IFTYPE_STATION,
@@ -280,6 +284,7 @@ static const struct wiphy_iftype_ext_capab add_iftypes_ext_capa[] = {
 		.extended_capabilities_len = sizeof(tm_if_types_ext_capa_sta),
 		/* relevant only if EHT is supported */
 		.eml_capabilities = IWL_MVM_EMLSR_CAPA,
+		.mld_capa_and_ops = IWL_MVM_MLD_CAPA_OPS,
 	},
 };
 
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
index 770e4c4e909a..9653d335d573 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
@@ -1330,6 +1330,24 @@ static bool iwl_mvm_mld_can_activate_links(struct ieee80211_hw *hw,
 	return ret;
 }
 
+static enum ieee80211_neg_ttlm_res
+iwl_mvm_mld_can_neg_ttlm(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
+			 struct ieee80211_neg_ttlm *neg_ttlm)
+{
+	u16 map;
+	u8 i;
+
+	/* Verify all TIDs are mapped to the same links set */
+	map = neg_ttlm->downlink[0];
+	for (i = 0; i < IEEE80211_TTLM_NUM_TIDS; i++) {
+		if (neg_ttlm->downlink[i] != neg_ttlm->uplink[i] ||
+		    neg_ttlm->uplink[i] != map)
+			return NEG_TTLM_RES_REJECT;
+	}
+
+	return NEG_TTLM_RES_ACCEPT;
+}
+
 const struct ieee80211_ops iwl_mvm_mld_hw_ops = {
 	.tx = iwl_mvm_mac_tx,
 	.wake_tx_queue = iwl_mvm_mac_wake_tx_queue,
@@ -1425,4 +1443,5 @@ const struct ieee80211_ops iwl_mvm_mld_hw_ops = {
 	.change_vif_links = iwl_mvm_mld_change_vif_links,
 	.change_sta_links = iwl_mvm_mld_change_sta_links,
 	.can_activate_links = iwl_mvm_mld_can_activate_links,
+	.can_neg_ttlm = iwl_mvm_mld_can_neg_ttlm,
 };
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 03/15] wifi: iwlwifi: mvm: d3: fix IPN byte order
  2024-01-29 19:21 [PATCH 00/15] wifi: iwlwifi: updates - 2024-01-29 Miri Korenblit
  2024-01-29 19:21 ` [PATCH 01/15] wifi: iwlwifi: fix EWRD table validity check Miri Korenblit
  2024-01-29 19:21 ` [PATCH 02/15] wifi: iwlwifi: mvm: add support for TID to link mapping neg request Miri Korenblit
@ 2024-01-29 19:21 ` Miri Korenblit
  2024-01-29 19:21 ` [PATCH 04/15] wifi: iwlwifi: Fix spelling mistake "SESION" -> "SESSION" Miri Korenblit
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Miri Korenblit @ 2024-01-29 19:21 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Johannes Berg, Gregory Greenman

From: Johannes Berg <johannes.berg@intel.com>

The IPN is reported by the firmware in 6 bytes little endian,
but mac80211 expects big endian so it can do memcmp() on it.
We used to store this as a u64 which was filled in the right
way, but never used. When implementing that it's used, we
changed it to just be 6 bytes, but lost the conversion. Add
it back.

Fixes: 04f78e242fff ("wifi: iwlwifi: mvm: Add support for IGTK in D3 resume flow")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
index 61aeb7f6604b..6ab9def2c670 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
@@ -2194,7 +2194,10 @@ static void iwl_mvm_convert_gtk_v3(struct iwl_wowlan_status_data *status,
 static void iwl_mvm_convert_igtk(struct iwl_wowlan_status_data *status,
 				 struct iwl_wowlan_igtk_status *data)
 {
+	int i;
+
 	BUILD_BUG_ON(sizeof(status->igtk.key) < sizeof(data->key));
+	BUILD_BUG_ON(sizeof(status->igtk.ipn) != sizeof(data->ipn));
 
 	if (!data->key_len)
 		return;
@@ -2206,7 +2209,10 @@ static void iwl_mvm_convert_igtk(struct iwl_wowlan_status_data *status,
 		+ WOWLAN_IGTK_MIN_INDEX;
 
 	memcpy(status->igtk.key, data->key, sizeof(data->key));
-	memcpy(status->igtk.ipn, data->ipn, sizeof(data->ipn));
+
+	/* mac80211 expects big endian for memcmp() to work, convert */
+	for (i = 0; i < sizeof(data->ipn); i++)
+		status->igtk.ipn[i] = data->ipn[sizeof(data->ipn) - i - 1];
 }
 
 static void iwl_mvm_convert_bigtk(struct iwl_wowlan_status_data *status,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 04/15] wifi: iwlwifi: Fix spelling mistake "SESION" -> "SESSION"
  2024-01-29 19:21 [PATCH 00/15] wifi: iwlwifi: updates - 2024-01-29 Miri Korenblit
                   ` (2 preceding siblings ...)
  2024-01-29 19:21 ` [PATCH 03/15] wifi: iwlwifi: mvm: d3: fix IPN byte order Miri Korenblit
@ 2024-01-29 19:21 ` Miri Korenblit
  2024-01-29 19:21 ` [PATCH 05/15] wifi: iwlwifi: mvm: don't set trigger frame padding in AP mode Miri Korenblit
                   ` (10 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Miri Korenblit @ 2024-01-29 19:21 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Colin Ian King, Gregory Greenman

From: Colin Ian King <colin.i.king@gmail.com>

There is a spelling mistake in a WARN message. Fix it.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/time-event.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c b/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c
index aceab96bcb97..703ccdd4d967 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/time-event.c
@@ -929,7 +929,7 @@ void iwl_mvm_rx_session_protect_notif(struct iwl_mvm *mvm,
 
 	if (WARN(ver > 2 && mvmvif->time_event_data.link_id >= 0 &&
 		 mvmvif->time_event_data.link_id != notif_link_id,
-		 "SESION_PROTECTION_NOTIF was received for link %u, while the current time event is on link %u\n",
+		 "SESSION_PROTECTION_NOTIF was received for link %u, while the current time event is on link %u\n",
 		 notif_link_id, mvmvif->time_event_data.link_id))
 		goto out_unlock;
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 05/15] wifi: iwlwifi: mvm: don't set trigger frame padding in AP mode
  2024-01-29 19:21 [PATCH 00/15] wifi: iwlwifi: updates - 2024-01-29 Miri Korenblit
                   ` (3 preceding siblings ...)
  2024-01-29 19:21 ` [PATCH 04/15] wifi: iwlwifi: Fix spelling mistake "SESION" -> "SESSION" Miri Korenblit
@ 2024-01-29 19:21 ` Miri Korenblit
  2024-01-29 19:21 ` [PATCH 06/15] wifi: iwlwifi: always have 'uats_enabled' Miri Korenblit
                   ` (9 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Miri Korenblit @ 2024-01-29 19:21 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Johannes Berg, Gregory Greenman

From: Johannes Berg <johannes.berg@intel.com>

This field is reserved in AP mode, don't set any bits in it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
index a7152d65eefa..0b2b0c320cb0 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
@@ -749,7 +749,6 @@ static const struct ieee80211_sband_iftype_data iwl_he_eht_capa[] = {
 				.mac_cap_info[0] =
 					IEEE80211_HE_MAC_CAP0_HTC_HE,
 				.mac_cap_info[1] =
-					IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_16US |
 					IEEE80211_HE_MAC_CAP1_MULTI_TID_AGG_RX_QOS_8,
 				.mac_cap_info[3] =
 					IEEE80211_HE_MAC_CAP3_OMI_CONTROL,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 06/15] wifi: iwlwifi: always have 'uats_enabled'
  2024-01-29 19:21 [PATCH 00/15] wifi: iwlwifi: updates - 2024-01-29 Miri Korenblit
                   ` (4 preceding siblings ...)
  2024-01-29 19:21 ` [PATCH 05/15] wifi: iwlwifi: mvm: don't set trigger frame padding in AP mode Miri Korenblit
@ 2024-01-29 19:21 ` Miri Korenblit
  2024-01-29 19:21 ` [PATCH 07/15] wifi: iwlwifi: mvm: Fix FTM initiator flags Miri Korenblit
                   ` (8 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Miri Korenblit @ 2024-01-29 19:21 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Johannes Berg, Mukesh Sisodiya, Gregory Greenman

From: Johannes Berg <johannes.berg@intel.com>

We check this in code that'd be complicated to put under
ifdef (CONFIG_ACPI), so just always have 'uats_enabled'.

Fixes: 4a9bb5b4d949 ("wifi: iwlwifi: fw: Add support for UATS table in UHB")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/fw/runtime.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/fw/runtime.h b/drivers/net/wireless/intel/iwlwifi/fw/runtime.h
index 1ec2bcdf92b8..048830bb09f2 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/runtime.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/runtime.h
@@ -176,10 +176,10 @@ struct iwl_fw_runtime {
 	struct iwl_sar_offset_mapping_cmd sgom_table;
 	bool sgom_enabled;
 	u8 reduced_power_flags;
-	bool uats_enabled;
 	struct iwl_uats_table_cmd uats_table;
 	u8 uefi_tables_lock_status;
 #endif
+	bool uats_enabled;
 };
 
 void iwl_fw_runtime_init(struct iwl_fw_runtime *fwrt, struct iwl_trans *trans,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 07/15] wifi: iwlwifi: mvm: Fix FTM initiator flags
  2024-01-29 19:21 [PATCH 00/15] wifi: iwlwifi: updates - 2024-01-29 Miri Korenblit
                   ` (5 preceding siblings ...)
  2024-01-29 19:21 ` [PATCH 06/15] wifi: iwlwifi: always have 'uats_enabled' Miri Korenblit
@ 2024-01-29 19:21 ` Miri Korenblit
  2024-01-29 19:21 ` [PATCH 08/15] wifi: iwlwifi: mvm: Add support for removing responder TKs Miri Korenblit
                   ` (7 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Miri Korenblit @ 2024-01-29 19:21 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Ilan Peer, Avraham Stern, Gregory Greenman

From: Ilan Peer <ilan.peer@intel.com>

When secure LTF is used MFP must also be set.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Avraham Stern <avraham.stern@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
index 233ae81884a0..4863a3c74640 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-2022 Intel Corporation
+ * Copyright (C) 2018-2023 Intel Corporation
  */
 #include <linux/etherdevice.h>
 #include <linux/math64.h>
@@ -821,9 +821,10 @@ iwl_mvm_ftm_put_target_v8(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 	 * If secure LTF is turned off, replace the flag with PMF only
 	 */
 	flags = le32_to_cpu(target->initiator_ap_flags);
-	if ((flags & IWL_INITIATOR_AP_FLAGS_SECURED) &&
-	    !IWL_MVM_FTM_INITIATOR_SECURE_LTF) {
-		flags &= ~IWL_INITIATOR_AP_FLAGS_SECURED;
+	if (flags & IWL_INITIATOR_AP_FLAGS_SECURED) {
+		if (!IWL_MVM_FTM_INITIATOR_SECURE_LTF)
+			flags &= ~IWL_INITIATOR_AP_FLAGS_SECURED;
+
 		flags |= IWL_INITIATOR_AP_FLAGS_PMF;
 		target->initiator_ap_flags = cpu_to_le32(flags);
 	}
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 08/15] wifi: iwlwifi: mvm: Add support for removing responder TKs
  2024-01-29 19:21 [PATCH 00/15] wifi: iwlwifi: updates - 2024-01-29 Miri Korenblit
                   ` (6 preceding siblings ...)
  2024-01-29 19:21 ` [PATCH 07/15] wifi: iwlwifi: mvm: Fix FTM initiator flags Miri Korenblit
@ 2024-01-29 19:21 ` Miri Korenblit
  2024-01-29 19:21 ` [PATCH 09/15] wifi: iwlwifi: remove Gl A-step remnants Miri Korenblit
                   ` (6 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Miri Korenblit @ 2024-01-29 19:21 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Ilan Peer, Gregory Greenman

From: Ilan Peer <ilan.peer@intel.com>

When removing a PASN station, the TK must be removed before
the station is removed as otherwise the FW would assert.

To handle this, store the key configuration, and use it to remove
the key when the station is removed.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 .../wireless/intel/iwlwifi/mvm/ftm-responder.c    |  7 ++++++-
 drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c  | 15 +++++++++++++++
 drivers/net/wireless/intel/iwlwifi/mvm/mvm.h      |  4 ++++
 drivers/net/wireless/intel/iwlwifi/mvm/sta.c      | 15 ++++-----------
 drivers/net/wireless/intel/iwlwifi/mvm/sta.h      |  3 ++-
 5 files changed, 31 insertions(+), 13 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c
index 8f10590f9cdd..dc8c9315b834 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ftm-responder.c
@@ -12,6 +12,7 @@ struct iwl_mvm_pasn_sta {
 	struct list_head list;
 	struct iwl_mvm_int_sta int_sta;
 	u8 addr[ETH_ALEN];
+	struct ieee80211_key_conf keyconf;
 };
 
 struct iwl_mvm_pasn_hltk_data {
@@ -303,6 +304,10 @@ static void iwl_mvm_resp_del_pasn_sta(struct iwl_mvm *mvm,
 {
 	list_del(&sta->list);
 
+	if (sta->keyconf.keylen)
+		iwl_mvm_sec_key_del_pasn(mvm, vif, BIT(sta->int_sta.sta_id),
+					 &sta->keyconf);
+
 	if (iwl_mvm_has_mld_api(mvm->fw))
 		iwl_mvm_mld_rm_sta_id(mvm, sta->int_sta.sta_id);
 	else
@@ -357,7 +362,7 @@ int iwl_mvm_ftm_respoder_add_pasn_sta(struct iwl_mvm *mvm,
 			return -ENOBUFS;
 
 		ret = iwl_mvm_add_pasn_sta(mvm, vif, &sta->int_sta, addr,
-					   cipher, tk, tk_len);
+					   cipher, tk, tk_len, &sta->keyconf);
 		if (ret) {
 			kfree(sta);
 			return ret;
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c
index ea3e9e9c6e26..a1ce08a5527c 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c
@@ -335,6 +335,21 @@ static int _iwl_mvm_sec_key_del(struct iwl_mvm *mvm,
 	return ret;
 }
 
+int iwl_mvm_sec_key_del_pasn(struct iwl_mvm *mvm,
+			     struct ieee80211_vif *vif,
+			     u32 sta_mask,
+			     struct ieee80211_key_conf *keyconf)
+{
+	u32 key_flags = iwl_mvm_get_sec_flags(mvm, vif, NULL, keyconf) |
+		IWL_SEC_KEY_FLAG_MFP;
+
+	if (WARN_ON(!sta_mask))
+		return -EINVAL;
+
+	return  __iwl_mvm_sec_key_del(mvm, sta_mask, key_flags, keyconf->keyidx,
+				      0);
+}
+
 int iwl_mvm_sec_key_del(struct iwl_mvm *mvm,
 			struct ieee80211_vif *vif,
 			struct ieee80211_sta *sta,
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index 9a89b91519db..e148ef02ff73 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -2402,6 +2402,10 @@ int iwl_mvm_sec_key_del(struct iwl_mvm *mvm,
 			struct ieee80211_vif *vif,
 			struct ieee80211_sta *sta,
 			struct ieee80211_key_conf *keyconf);
+int iwl_mvm_sec_key_del_pasn(struct iwl_mvm *mvm,
+			     struct ieee80211_vif *vif,
+			     u32 sta_mask,
+			     struct ieee80211_key_conf *keyconf);
 void iwl_mvm_sec_key_remove_ap(struct iwl_mvm *mvm,
 			       struct ieee80211_vif *vif,
 			       struct iwl_mvm_vif_link_info *link,
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
index 2a3ca9785974..d57fcbe4f8ac 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
@@ -4298,12 +4298,12 @@ u16 iwl_mvm_tid_queued(struct iwl_mvm *mvm, struct iwl_mvm_tid_data *tid_data)
 
 int iwl_mvm_add_pasn_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 			 struct iwl_mvm_int_sta *sta, u8 *addr, u32 cipher,
-			 u8 *key, u32 key_len)
+			 u8 *key, u32 key_len,
+			 struct ieee80211_key_conf *keyconf)
 {
 	int ret;
 	u16 queue;
 	struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
-	struct ieee80211_key_conf *keyconf;
 	unsigned int wdg_timeout =
 		iwl_mvm_get_wd_timeout(mvm, vif, false, false);
 	bool mld = iwl_mvm_has_mld_api(mvm->fw);
@@ -4328,12 +4328,6 @@ int iwl_mvm_add_pasn_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 	if (ret)
 		goto out;
 
-	keyconf = kzalloc(sizeof(*keyconf) + key_len, GFP_KERNEL);
-	if (!keyconf) {
-		ret = -ENOBUFS;
-		goto out;
-	}
-
 	keyconf->cipher = cipher;
 	memcpy(keyconf->key, key, key_len);
 	keyconf->keylen = key_len;
@@ -4354,10 +4348,9 @@ int iwl_mvm_add_pasn_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 					   0, NULL, 0, 0, true);
 	}
 
-	kfree(keyconf);
-	return 0;
 out:
-	iwl_mvm_dealloc_int_sta(mvm, sta);
+	if (ret)
+		iwl_mvm_dealloc_int_sta(mvm, sta);
 	return ret;
 }
 
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.h b/drivers/net/wireless/intel/iwlwifi/mvm/sta.h
index b33a0ce096d4..4668f413abd3 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.h
@@ -574,7 +574,8 @@ void iwl_mvm_csa_client_absent(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
 void iwl_mvm_add_new_dqa_stream_wk(struct work_struct *wk);
 int iwl_mvm_add_pasn_sta(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 			 struct iwl_mvm_int_sta *sta, u8 *addr, u32 cipher,
-			 u8 *key, u32 key_len);
+			 u8 *key, u32 key_len,
+			 struct ieee80211_key_conf *key_conf_out);
 void iwl_mvm_cancel_channel_switch(struct iwl_mvm *mvm,
 				   struct ieee80211_vif *vif,
 				   u32 id);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 09/15] wifi: iwlwifi: remove Gl A-step remnants
  2024-01-29 19:21 [PATCH 00/15] wifi: iwlwifi: updates - 2024-01-29 Miri Korenblit
                   ` (7 preceding siblings ...)
  2024-01-29 19:21 ` [PATCH 08/15] wifi: iwlwifi: mvm: Add support for removing responder TKs Miri Korenblit
@ 2024-01-29 19:21 ` Miri Korenblit
  2024-01-29 19:21 ` [PATCH 10/15] wifi: iwlwifi: mvm: use FW rate for non-data only on new devices Miri Korenblit
                   ` (5 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Miri Korenblit @ 2024-01-29 19:21 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Johannes Berg, Gregory Greenman

From: Johannes Berg <johannes.berg@intel.com>

The IWL_DEVICE_GL_A macro is no longer used, and couldn't
be, so remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/cfg/bz.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/cfg/bz.c b/drivers/net/wireless/intel/iwlwifi/cfg/bz.c
index 20799a0fbc07..b0b003a6a46e 100644
--- a/drivers/net/wireless/intel/iwlwifi/cfg/bz.c
+++ b/drivers/net/wireless/intel/iwlwifi/cfg/bz.c
@@ -129,10 +129,6 @@ static const struct iwl_base_params iwl_bz_base_params = {
 	IWL_DEVICE_BZ_COMMON,						\
 	.ht_params = &iwl_22000_ht_params
 
-#define IWL_DEVICE_GL_A							\
-	IWL_DEVICE_BZ_COMMON,						\
-	.ht_params = &iwl_gl_a_ht_params
-
 /*
  * This size was picked according to 8 MSDUs inside 512 A-MSDUs in an
  * A-MPDU, with additional overhead to account for processing time.
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 10/15] wifi: iwlwifi: mvm: use FW rate for non-data only on new devices
  2024-01-29 19:21 [PATCH 00/15] wifi: iwlwifi: updates - 2024-01-29 Miri Korenblit
                   ` (8 preceding siblings ...)
  2024-01-29 19:21 ` [PATCH 09/15] wifi: iwlwifi: remove Gl A-step remnants Miri Korenblit
@ 2024-01-29 19:21 ` Miri Korenblit
  2024-01-29 19:21 ` [PATCH 11/15] wifi: iwlwifi: mvm: fix the TLC command after ADD_STA Miri Korenblit
                   ` (4 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Miri Korenblit @ 2024-01-29 19:21 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

With MLO connections we need to let the firmware pick the rate
as we don't know the link the frame might be transmitted on
(in some cases we do know, but we'd rather always use the FW
and find bugs.) We _did_ end up finding bugs and fixing them,
but older devices likely won't get fixed as we don't have a
need for this there, they cannot support MLO.

Thus, go back to picking a rate on the host for the relevant
frames on older (pre-Bz) devices.

Fixes: 499d02790495 ("wifi: iwlwifi: Use FW rate for non-data frames")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 33 ++++++++++++++++++---
 1 file changed, 29 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
index db986bfc4dc3..79eb6394e5a7 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
@@ -520,6 +520,31 @@ static void iwl_mvm_set_tx_cmd_crypto(struct iwl_mvm *mvm,
 	}
 }
 
+static bool iwl_mvm_use_host_rate(struct iwl_mvm *mvm,
+				  struct iwl_mvm_sta *mvmsta,
+				  struct ieee80211_hdr *hdr,
+				  struct ieee80211_tx_info *info)
+{
+	if (unlikely(!mvmsta))
+		return true;
+
+	if (unlikely(info->control.flags & IEEE80211_TX_CTRL_RATE_INJECT))
+		return true;
+
+	if (likely(ieee80211_is_data(hdr->frame_control) &&
+		   mvmsta->sta_state >= IEEE80211_STA_AUTHORIZED))
+		return false;
+
+	/*
+	 * Not a data frame, use host rate if on an old device that
+	 * can't possibly be doing MLO (firmware may be selecting a
+	 * bad rate), if we might be doing MLO we need to let FW pick
+	 * (since we don't necesarily know the link), but FW rate
+	 * selection was fixed.
+	 */
+	return mvm->trans->trans_cfg->device_family < IWL_DEVICE_FAMILY_BZ;
+}
+
 /*
  * Allocates and sets the Tx cmd the driver data pointers in the skb
  */
@@ -556,12 +581,12 @@ iwl_mvm_set_tx_params(struct iwl_mvm *mvm, struct sk_buff *skb,
 			flags |= IWL_TX_FLAGS_ENCRYPT_DIS;
 
 		/*
-		 * For data and mgmt packets rate info comes from the fw. Only
+		 * For data and mgmt packets rate info comes from the fw (for
+		 * new devices, older FW is somewhat broken for this). Only
 		 * set rate/antenna for injected frames with fixed rate, or
-		 * when no sta is given.
+		 * when no sta is given, or with older firmware.
 		 */
-		if (unlikely(!sta ||
-			     info->control.flags & IEEE80211_TX_CTRL_RATE_INJECT)) {
+		if (unlikely(iwl_mvm_use_host_rate(mvm, mvmsta, hdr, info))) {
 			flags |= IWL_TX_FLAGS_CMD_RATE;
 			rate_n_flags =
 				iwl_mvm_get_tx_rate_n_flags(mvm, info, sta,
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 11/15] wifi: iwlwifi: mvm: fix the TLC command after ADD_STA
  2024-01-29 19:21 [PATCH 00/15] wifi: iwlwifi: updates - 2024-01-29 Miri Korenblit
                   ` (9 preceding siblings ...)
  2024-01-29 19:21 ` [PATCH 10/15] wifi: iwlwifi: mvm: use FW rate for non-data only on new devices Miri Korenblit
@ 2024-01-29 19:21 ` Miri Korenblit
  2024-01-29 19:22 ` [PATCH 12/15] wifi: iwlwifi: pcie: Add the PCI device id for new hardware Miri Korenblit
                   ` (3 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Miri Korenblit @ 2024-01-29 19:21 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Emmanuel Grumbach, Johannes Berg

From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>

ADD_STA resets the link quality data inside the firmware. This is not
supposed to happen and has been fixed for newer devices. For older
devices (AX201 and down), this makes us send frames with rates that are
not in the TLC table.

Fixes: 5a86dcb4a908 ("wifi: iwlwifi: mvm: update station's MFP flag after association")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index d19e478f382b..0ec1156c89c5 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -3804,13 +3804,17 @@ iwl_mvm_sta_state_assoc_to_authorized(struct iwl_mvm *mvm,
 
 	mvm_sta->authorized = true;
 
-	iwl_mvm_rs_rate_init_all_links(mvm, vif, sta);
-
 	/* MFP is set by default before the station is authorized.
 	 * Clear it here in case it's not used.
 	 */
-	if (!sta->mfp)
-		return callbacks->update_sta(mvm, vif, sta);
+	if (!sta->mfp) {
+		int ret = callbacks->update_sta(mvm, vif, sta);
+
+		if (ret)
+			return ret;
+	}
+
+	iwl_mvm_rs_rate_init_all_links(mvm, vif, sta);
 
 	return 0;
 }
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 12/15] wifi: iwlwifi: pcie: Add the PCI device id for new hardware
  2024-01-29 19:21 [PATCH 00/15] wifi: iwlwifi: updates - 2024-01-29 Miri Korenblit
                   ` (10 preceding siblings ...)
  2024-01-29 19:21 ` [PATCH 11/15] wifi: iwlwifi: mvm: fix the TLC command after ADD_STA Miri Korenblit
@ 2024-01-29 19:22 ` Miri Korenblit
  2024-01-29 19:22 ` [PATCH 13/15] wifi: iwlwifi: mvm: support SPP A-MSDUs Miri Korenblit
                   ` (2 subsequent siblings)
  14 siblings, 0 replies; 17+ messages in thread
From: Miri Korenblit @ 2024-01-29 19:22 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Mukesh Sisodiya, Gregory Greenman

From: Mukesh Sisodiya <mukesh.sisodiya@intel.com>

Add the support for a new PCI device id.

Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
index c80b02503b41..bbc8dc390bdc 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
@@ -502,6 +502,7 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
 
 /* Bz devices */
 	{IWL_PCI_DEVICE(0x2727, PCI_ANY_ID, iwl_bz_trans_cfg)},
+	{IWL_PCI_DEVICE(0x272D, PCI_ANY_ID, iwl_bz_trans_cfg)},
 	{IWL_PCI_DEVICE(0x272b, PCI_ANY_ID, iwl_bz_trans_cfg)},
 	{IWL_PCI_DEVICE(0xA840, PCI_ANY_ID, iwl_bz_trans_cfg)},
 	{IWL_PCI_DEVICE(0x7740, PCI_ANY_ID, iwl_bz_trans_cfg)},
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 13/15] wifi: iwlwifi: mvm: support SPP A-MSDUs
  2024-01-29 19:21 [PATCH 00/15] wifi: iwlwifi: updates - 2024-01-29 Miri Korenblit
                   ` (11 preceding siblings ...)
  2024-01-29 19:22 ` [PATCH 12/15] wifi: iwlwifi: pcie: Add the PCI device id for new hardware Miri Korenblit
@ 2024-01-29 19:22 ` Miri Korenblit
  2024-01-29 19:22 ` [PATCH 14/15] wifi: iwlwifi: mvm: log dropped packets due to MIC error Miri Korenblit
  2024-01-29 19:22 ` [PATCH 15/15] wifi: iwlwifi: mvm: refactor duplicate chanctx condition Miri Korenblit
  14 siblings, 0 replies; 17+ messages in thread
From: Miri Korenblit @ 2024-01-29 19:22 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Johannes Berg, Daniel Gabay, Gregory Greenman

From: Johannes Berg <johannes.berg@intel.com>

If the firmware has the necessary support, enable SPP A-MSDUs.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Daniel Gabay <daniel.gabay@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/fw/api/sta.h   | 4 +++-
 drivers/net/wireless/intel/iwlwifi/fw/file.h      | 3 +++
 drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 5 +++++
 drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c  | 3 +++
 drivers/net/wireless/intel/iwlwifi/mvm/sta.c      | 3 +++
 5 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/sta.h b/drivers/net/wireless/intel/iwlwifi/fw/api/sta.h
index d62fed543276..d7f8a276b683 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/api/sta.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/api/sta.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
 /*
- * Copyright (C) 2012-2014, 2018-2021 Intel Corporation
+ * Copyright (C) 2012-2014, 2018-2021, 2023 Intel Corporation
  * Copyright (C) 2013-2014 Intel Mobile Communications GmbH
  * Copyright (C) 2016-2017 Intel Deutschland GmbH
  */
@@ -109,6 +109,7 @@ enum iwl_sta_flags {
  * @STA_KEY_FLG_EN_MSK: mask for encryption algorithmi value
  * @STA_KEY_FLG_WEP_KEY_MAP: wep is either a group key (0 - legacy WEP) or from
  *	station info array (1 - n 1X mode)
+ * @STA_KEY_FLG_AMSDU_SPP: SPP (signaling and payload protected) A-MSDU
  * @STA_KEY_FLG_KEYID_MSK: the index of the key
  * @STA_KEY_FLG_KEYID_POS: key index bit position
  * @STA_KEY_NOT_VALID: key is invalid
@@ -129,6 +130,7 @@ enum iwl_sta_key_flag {
 	STA_KEY_FLG_EN_MSK		= (7 << 0),
 
 	STA_KEY_FLG_WEP_KEY_MAP		= BIT(3),
+	STA_KEY_FLG_AMSDU_SPP		= BIT(7),
 	STA_KEY_FLG_KEYID_POS		 = 8,
 	STA_KEY_FLG_KEYID_MSK		= (3 << STA_KEY_FLG_KEYID_POS),
 	STA_KEY_NOT_VALID		= BIT(11),
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/file.h b/drivers/net/wireless/intel/iwlwifi/fw/file.h
index bfc39bd5bbc6..b216da7d95fc 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/file.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/file.h
@@ -383,6 +383,8 @@ typedef unsigned int __bitwise iwl_ucode_tlv_capa_t;
  *      channels even when these are not enabled.
  * @IWL_UCODE_TLV_CAPA_DUMP_COMPLETE_SUPPORT: Support for indicating dump collection
  *	complete to FW.
+ * @IWL_UCODE_TLV_CAPA_SPP_AMSDU_SUPPORT: Support SPP (signaling and payload
+ *	protected) A-MSDU.
  *
  * @NUM_IWL_UCODE_TLV_CAPA: number of bits used
  */
@@ -468,6 +470,7 @@ enum iwl_ucode_tlv_capa {
 	IWL_UCODE_TLV_CAPA_PSC_CHAN_SUPPORT		= (__force iwl_ucode_tlv_capa_t)98,
 
 	IWL_UCODE_TLV_CAPA_BIGTK_SUPPORT		= (__force iwl_ucode_tlv_capa_t)100,
+	IWL_UCODE_TLV_CAPA_SPP_AMSDU_SUPPORT		= (__force iwl_ucode_tlv_capa_t)103,
 	IWL_UCODE_TLV_CAPA_DRAM_FRAG_SUPPORT		= (__force iwl_ucode_tlv_capa_t)104,
 	IWL_UCODE_TLV_CAPA_DUMP_COMPLETE_SUPPORT	= (__force iwl_ucode_tlv_capa_t)105,
 	IWL_UCODE_TLV_CAPA_SYNCED_TIME			= (__force iwl_ucode_tlv_capa_t)106,
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index 0ec1156c89c5..843544cfcfe9 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -495,6 +495,11 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)
 			IWL_UCODE_TLV_CAPA_TIME_SYNC_BOTH_FTM_TM))
 		hw->wiphy->hw_timestamp_max_peers = 1;
 
+	if (fw_has_capa(&mvm->fw->ucode_capa,
+			IWL_UCODE_TLV_CAPA_SPP_AMSDU_SUPPORT))
+		wiphy_ext_feature_set(hw->wiphy,
+				      NL80211_EXT_FEATURE_SPP_AMSDU_SUPPORT);
+
 	ieee80211_hw_set(hw, SINGLE_SCAN_ON_ALL_BANDS);
 	hw->wiphy->features |=
 		NL80211_FEATURE_SCHED_SCAN_RANDOM_MAC_ADDR |
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c
index a1ce08a5527c..bbd37a95d4c8 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c
@@ -104,6 +104,9 @@ u32 iwl_mvm_get_sec_flags(struct iwl_mvm *mvm,
 	     (keyconf->keyidx == 4 || keyconf->keyidx == 5)))
 		flags |= IWL_SEC_KEY_FLAG_MFP;
 
+	if (keyconf->flags & IEEE80211_KEY_FLAG_SPP_AMSDU)
+		flags |= IWL_SEC_KEY_FLAG_SPP_AMSDU;
+
 	return flags;
 }
 
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
index d57fcbe4f8ac..8ffbb8efda73 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/sta.c
@@ -3559,6 +3559,9 @@ static int iwl_mvm_send_sta_key(struct iwl_mvm *mvm,
 	key_flags = cpu_to_le16(keyidx);
 	key_flags |= cpu_to_le16(STA_KEY_FLG_WEP_KEY_MAP);
 
+	if (key->flags & IEEE80211_KEY_FLAG_SPP_AMSDU)
+		key_flags |= cpu_to_le16(STA_KEY_FLG_AMSDU_SPP);
+
 	switch (key->cipher) {
 	case WLAN_CIPHER_SUITE_TKIP:
 		key_flags |= cpu_to_le16(STA_KEY_FLG_TKIP);
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 14/15] wifi: iwlwifi: mvm: log dropped packets due to MIC error
  2024-01-29 19:21 [PATCH 00/15] wifi: iwlwifi: updates - 2024-01-29 Miri Korenblit
                   ` (12 preceding siblings ...)
  2024-01-29 19:22 ` [PATCH 13/15] wifi: iwlwifi: mvm: support SPP A-MSDUs Miri Korenblit
@ 2024-01-29 19:22 ` Miri Korenblit
  2024-01-29 19:22 ` [PATCH 15/15] wifi: iwlwifi: mvm: refactor duplicate chanctx condition Miri Korenblit
  14 siblings, 0 replies; 17+ messages in thread
From: Miri Korenblit @ 2024-01-29 19:22 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Daniel Gabay, Gregory Greenman

From: Daniel Gabay <daniel.gabay@intel.com>

When we drop frames due to MIC error we want to have something
printed in the logger (this won't be printed by default).

Signed-off-by: Daniel Gabay <daniel.gabay@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
index 451af501c7a1..67062fe40152 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
@@ -401,8 +401,11 @@ static int iwl_mvm_rx_crypto(struct iwl_mvm *mvm, struct ieee80211_sta *sta,
 	case IWL_RX_MPDU_STATUS_SEC_GCM:
 		BUILD_BUG_ON(IEEE80211_CCMP_PN_LEN != IEEE80211_GCMP_PN_LEN);
 		/* alg is CCM: check MIC only */
-		if (!(status & IWL_RX_MPDU_STATUS_MIC_OK))
+		if (!(status & IWL_RX_MPDU_STATUS_MIC_OK)) {
+			IWL_DEBUG_DROP(mvm,
+				       "Dropping packet, bad MIC (CCM/GCM)\n");
 			return -1;
+		}
 
 		stats->flag |= RX_FLAG_DECRYPTED | RX_FLAG_MIC_STRIPPED;
 		*crypt_len = IEEE80211_CCMP_HDR_LEN;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 15/15] wifi: iwlwifi: mvm: refactor duplicate chanctx condition
  2024-01-29 19:21 [PATCH 00/15] wifi: iwlwifi: updates - 2024-01-29 Miri Korenblit
                   ` (13 preceding siblings ...)
  2024-01-29 19:22 ` [PATCH 14/15] wifi: iwlwifi: mvm: log dropped packets due to MIC error Miri Korenblit
@ 2024-01-29 19:22 ` Miri Korenblit
  14 siblings, 0 replies; 17+ messages in thread
From: Miri Korenblit @ 2024-01-29 19:22 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Johannes Berg

From: Johannes Berg <johannes.berg@intel.com>

Refactor the check for using a chanctx's def vs. min_def,
to have the same in both places and reuse it later.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 12 ++++--------
 drivers/net/wireless/intel/iwlwifi/mvm/mvm.h      | 13 +++++++++++++
 2 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index 843544cfcfe9..dbad30e61451 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -4810,8 +4810,8 @@ static void iwl_mvm_ftm_responder_chanctx_iter(void *_data, u8 *mac,
 		data->responder = true;
 }
 
-static bool iwl_mvm_is_ftm_responder_chanctx(struct iwl_mvm *mvm,
-					     struct ieee80211_chanctx_conf *ctx)
+bool iwl_mvm_is_ftm_responder_chanctx(struct iwl_mvm *mvm,
+				      struct ieee80211_chanctx_conf *ctx)
 {
 	struct iwl_mvm_ftm_responder_iter_data data = {
 		.responder = false,
@@ -4830,9 +4830,7 @@ static int __iwl_mvm_add_chanctx(struct iwl_mvm *mvm,
 {
 	u16 *phy_ctxt_id = (u16 *)ctx->drv_priv;
 	struct iwl_mvm_phy_ctxt *phy_ctxt;
-	bool use_def = iwl_mvm_is_ftm_responder_chanctx(mvm, ctx) ||
-		iwl_mvm_enable_fils(mvm, ctx);
-	struct cfg80211_chan_def *def = use_def ? &ctx->def : &ctx->min_def;
+	struct cfg80211_chan_def *def = iwl_mvm_chanctx_def(mvm, ctx);
 	int ret;
 
 	lockdep_assert_held(&mvm->mutex);
@@ -4898,9 +4896,7 @@ void iwl_mvm_change_chanctx(struct ieee80211_hw *hw,
 	struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
 	u16 *phy_ctxt_id = (u16 *)ctx->drv_priv;
 	struct iwl_mvm_phy_ctxt *phy_ctxt = &mvm->phy_ctxts[*phy_ctxt_id];
-	bool use_def = iwl_mvm_is_ftm_responder_chanctx(mvm, ctx) ||
-		iwl_mvm_enable_fils(mvm, ctx);
-	struct cfg80211_chan_def *def = use_def ? &ctx->def : &ctx->min_def;
+	struct cfg80211_chan_def *def = iwl_mvm_chanctx_def(mvm, ctx);
 
 	if (WARN_ONCE((phy_ctxt->ref > 1) &&
 		      (changed & ~(IEEE80211_CHANCTX_CHANGE_WIDTH |
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index e148ef02ff73..d414007c4755 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -2752,4 +2752,17 @@ void iwl_mvm_mld_select_links(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 int iwl_mvm_mld_get_primary_link(struct iwl_mvm *mvm,
 				 struct ieee80211_vif *vif,
 				 unsigned long usable_links);
+
+bool iwl_mvm_is_ftm_responder_chanctx(struct iwl_mvm *mvm,
+				      struct ieee80211_chanctx_conf *ctx);
+
+static inline struct cfg80211_chan_def *
+iwl_mvm_chanctx_def(struct iwl_mvm *mvm, struct ieee80211_chanctx_conf *ctx)
+{
+	bool use_def = iwl_mvm_is_ftm_responder_chanctx(mvm, ctx) ||
+		iwl_mvm_enable_fils(mvm, ctx);
+
+	return use_def ? &ctx->def : &ctx->min_def;
+}
+
 #endif /* __IWL_MVM_H__ */
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 17+ messages in thread

* [PATCH 00/15] wifi: iwlwifi: updates - 2024-01-29
@ 2024-01-29 19:13 Miri Korenblit
  0 siblings, 0 replies; 17+ messages in thread
From: Miri Korenblit @ 2024-01-29 19:13 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless

Hi,

This patch set includes iwlwifi patches intended for v6.9. It contains a
few features, bugfixes and cleanups.

Thanks,
Miri

Ayala Beker (1):
  wifi: iwlwifi: mvm: add support for TID to link mapping neg request

Colin Ian King (1):
  wifi: iwlwifi: Fix spelling mistake "SESION" -> "SESSION"

Daniel Gabay (1):
  wifi: iwlwifi: mvm: log dropped packets due to MIC error

Emmanuel Grumbach (1):
  wifi: iwlwifi: mvm: fix the TLC command after ADD_STA

Ilan Peer (2):
  wifi: iwlwifi: mvm: Fix FTM initiator flags
  wifi: iwlwifi: mvm: Add support for removing responder TKs

Johannes Berg (7):
  wifi: iwlwifi: mvm: d3: fix IPN byte order
  wifi: iwlwifi: mvm: don't set trigger frame padding in AP mode
  wifi: iwlwifi: always have 'uats_enabled'
  wifi: iwlwifi: remove Gl A-step remnants
  wifi: iwlwifi: mvm: use FW rate for non-data only on new devices
  wifi: iwlwifi: mvm: support SPP A-MSDUs
  wifi: iwlwifi: mvm: refactor duplicate chanctx condition

Miri Korenblit (1):
  wifi: iwlwifi: fix EWRD table validity check

Mukesh Sisodiya (1):
  wifi: iwlwifi: pcie: Add new PCI device id for new hardware

 drivers/net/wireless/intel/iwlwifi/cfg/bz.c   |  4 ---
 drivers/net/wireless/intel/iwlwifi/fw/acpi.c  |  2 +-
 .../net/wireless/intel/iwlwifi/fw/api/sta.h   |  4 ++-
 drivers/net/wireless/intel/iwlwifi/fw/file.h  |  3 ++
 .../net/wireless/intel/iwlwifi/fw/runtime.h   |  2 +-
 .../wireless/intel/iwlwifi/iwl-nvm-parse.c    |  1 -
 drivers/net/wireless/intel/iwlwifi/mvm/d3.c   |  8 ++++-
 .../intel/iwlwifi/mvm/ftm-initiator.c         |  9 ++---
 .../intel/iwlwifi/mvm/ftm-responder.c         |  7 +++-
 .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 34 ++++++++++++-------
 .../net/wireless/intel/iwlwifi/mvm/mld-key.c  | 18 ++++++++++
 .../wireless/intel/iwlwifi/mvm/mld-mac80211.c | 19 +++++++++++
 drivers/net/wireless/intel/iwlwifi/mvm/mvm.h  | 17 ++++++++++
 drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c |  5 ++-
 drivers/net/wireless/intel/iwlwifi/mvm/sta.c  | 18 ++++------
 drivers/net/wireless/intel/iwlwifi/mvm/sta.h  |  3 +-
 .../wireless/intel/iwlwifi/mvm/time-event.c   |  2 +-
 drivers/net/wireless/intel/iwlwifi/mvm/tx.c   | 33 +++++++++++++++---
 drivers/net/wireless/intel/iwlwifi/pcie/drv.c |  1 +
 19 files changed, 146 insertions(+), 44 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2024-01-29 19:22 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-29 19:21 [PATCH 00/15] wifi: iwlwifi: updates - 2024-01-29 Miri Korenblit
2024-01-29 19:21 ` [PATCH 01/15] wifi: iwlwifi: fix EWRD table validity check Miri Korenblit
2024-01-29 19:21 ` [PATCH 02/15] wifi: iwlwifi: mvm: add support for TID to link mapping neg request Miri Korenblit
2024-01-29 19:21 ` [PATCH 03/15] wifi: iwlwifi: mvm: d3: fix IPN byte order Miri Korenblit
2024-01-29 19:21 ` [PATCH 04/15] wifi: iwlwifi: Fix spelling mistake "SESION" -> "SESSION" Miri Korenblit
2024-01-29 19:21 ` [PATCH 05/15] wifi: iwlwifi: mvm: don't set trigger frame padding in AP mode Miri Korenblit
2024-01-29 19:21 ` [PATCH 06/15] wifi: iwlwifi: always have 'uats_enabled' Miri Korenblit
2024-01-29 19:21 ` [PATCH 07/15] wifi: iwlwifi: mvm: Fix FTM initiator flags Miri Korenblit
2024-01-29 19:21 ` [PATCH 08/15] wifi: iwlwifi: mvm: Add support for removing responder TKs Miri Korenblit
2024-01-29 19:21 ` [PATCH 09/15] wifi: iwlwifi: remove Gl A-step remnants Miri Korenblit
2024-01-29 19:21 ` [PATCH 10/15] wifi: iwlwifi: mvm: use FW rate for non-data only on new devices Miri Korenblit
2024-01-29 19:21 ` [PATCH 11/15] wifi: iwlwifi: mvm: fix the TLC command after ADD_STA Miri Korenblit
2024-01-29 19:22 ` [PATCH 12/15] wifi: iwlwifi: pcie: Add the PCI device id for new hardware Miri Korenblit
2024-01-29 19:22 ` [PATCH 13/15] wifi: iwlwifi: mvm: support SPP A-MSDUs Miri Korenblit
2024-01-29 19:22 ` [PATCH 14/15] wifi: iwlwifi: mvm: log dropped packets due to MIC error Miri Korenblit
2024-01-29 19:22 ` [PATCH 15/15] wifi: iwlwifi: mvm: refactor duplicate chanctx condition Miri Korenblit
  -- strict thread matches above, loose matches on Subject: below --
2024-01-29 19:13 [PATCH 00/15] wifi: iwlwifi: updates - 2024-01-29 Miri Korenblit

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.