linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/11] wifi: iwlwifi: updates - 2024-02-06
@ 2024-02-06 16:02 Miri Korenblit
  2024-02-06 16:02 ` [PATCH 01/11] wifi: iwlwifi: mvm: fix a crash when we run out of stations Miri Korenblit
                   ` (10 more replies)
  0 siblings, 11 replies; 14+ messages in thread
From: Miri Korenblit @ 2024-02-06 16:02 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,

Emmanuel Grumbach (3):
  wifi: iwlwifi: mvm: fix a crash when we run out of stations
  wifi: iwlwifi: mvm: don't set the MFP flag for the GTK
  wifi: iwlwifi: mvm: don't send the smart fifo command if not needed

Johannes Berg (6):
  wifi: iwlwifi: fw: allow vmalloc for PNVM image
  wifi: iwlwifi: mvm: don't set replay counters to 0xff
  wifi: iwlwifi: mvm: remove flags for enable/disable beacon filter
  wifi: iwlwifi: mvm: show skb_mac_gso_segment() failure reason
  wifi: iwlwifi: mvm: move BA notif messages before action
  wifi: iwlwifi: queue: improve warning for no skb in reclaim

Mukesh Sisodiya (1):
  wifi: iwlwifi: pcie: Add new PCI device id and CNVI

Shaul Triebitz (1):
  wifi: iwlwifi: iwlmvm: handle unprotected deauth/sidassoc in d3

 drivers/net/wireless/intel/iwlwifi/cfg/sc.c   | 38 +++++++++++++++++--
 drivers/net/wireless/intel/iwlwifi/fw/file.h  |  5 ++-
 drivers/net/wireless/intel/iwlwifi/fw/pnvm.c  | 10 ++---
 .../net/wireless/intel/iwlwifi/iwl-config.h   |  8 +++-
 drivers/net/wireless/intel/iwlwifi/mvm/d3.c   | 10 +++--
 .../wireless/intel/iwlwifi/mvm/debugfs-vif.c  |  6 +--
 .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 21 +++++-----
 .../net/wireless/intel/iwlwifi/mvm/mld-key.c  | 18 +++++----
 .../wireless/intel/iwlwifi/mvm/mld-mac80211.c |  2 +-
 drivers/net/wireless/intel/iwlwifi/mvm/mvm.h  |  6 +--
 .../net/wireless/intel/iwlwifi/mvm/power.c    | 29 ++++++--------
 drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c |  4 ++
 drivers/net/wireless/intel/iwlwifi/mvm/sf.c   |  5 ++-
 drivers/net/wireless/intel/iwlwifi/mvm/tx.c   | 30 +++++++++------
 drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 15 +++++++-
 drivers/net/wireless/intel/iwlwifi/queue/tx.c |  9 +++--
 16 files changed, 143 insertions(+), 73 deletions(-)

-- 
2.34.1


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

* [PATCH 01/11] wifi: iwlwifi: mvm: fix a crash when we run out of stations
  2024-02-06 16:02 [PATCH 00/11] wifi: iwlwifi: updates - 2024-02-06 Miri Korenblit
@ 2024-02-06 16:02 ` Miri Korenblit
  2024-02-06 16:02 ` [PATCH 02/11] wifi: iwlwifi: fw: allow vmalloc for PNVM image Miri Korenblit
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Miri Korenblit @ 2024-02-06 16:02 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Emmanuel Grumbach

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

A DoS tool that injects loads of authentication frames made our AP
crash. The iwl_mvm_is_dup() function couldn't find the per-queue
dup_data which was not allocated.

The root cause for that is that we ran out of stations in the firmware
and we didn't really add the station to the firmware, yet we didn't
return an error to mac80211.
Mac80211 was thinking that we have the station and because of that,
sta_info::uploaded was set to 1. This allowed
ieee80211_find_sta_by_ifaddr() to return a valid station object, but
that ieee80211_sta didn't have any iwl_mvm_sta object initialized and
that caused the crash mentioned earlier when we got Rx on that station.

Fixes: 57974a55d995 ("wifi: iwlwifi: mvm: refactor iwl_mvm_mac_sta_state_common()")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 3 +++
 drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c     | 4 ++++
 2 files changed, 7 insertions(+)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index 9c8eea883212..4fe50036bfde 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -3697,6 +3697,9 @@ iwl_mvm_sta_state_notexist_to_none(struct iwl_mvm *mvm,
 					   NL80211_TDLS_SETUP);
 	}
 
+	if (ret)
+		return ret;
+
 	for_each_sta_active_link(vif, sta, link_sta, i)
 		link_sta->agg.max_rc_amsdu_len = 1;
 
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
index b7639e429889..1484eaedf452 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c
@@ -512,6 +512,10 @@ static bool iwl_mvm_is_dup(struct ieee80211_sta *sta, int queue,
 		return false;
 
 	mvm_sta = iwl_mvm_sta_from_mac80211(sta);
+
+	if (WARN_ON_ONCE(!mvm_sta->dup_data))
+		return false;
+
 	dup_data = &mvm_sta->dup_data[queue];
 
 	/*
-- 
2.34.1


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

* [PATCH 02/11] wifi: iwlwifi: fw: allow vmalloc for PNVM image
  2024-02-06 16:02 [PATCH 00/11] wifi: iwlwifi: updates - 2024-02-06 Miri Korenblit
  2024-02-06 16:02 ` [PATCH 01/11] wifi: iwlwifi: mvm: fix a crash when we run out of stations Miri Korenblit
@ 2024-02-06 16:02 ` Miri Korenblit
  2024-02-06 16:02 ` [PATCH 03/11] wifi: iwlwifi: mvm: don't set the MFP flag for the GTK Miri Korenblit
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Miri Korenblit @ 2024-02-06 16:02 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Johannes Berg

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

This image can be pretty big (I've seen order-7 allocations!),
and we later have to copy it to DMA memory (in newer FW even
there it won't need to be contiguous), so we can easily deal
with it being in vmalloc. Use kvmemdup()/kvfree() for it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/fw/pnvm.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c b/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c
index 053174f00e49..1195e708caa9 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
 /*
- * Copyright(c) 2020-2023 Intel Corporation
+ * Copyright(c) 2020-2024 Intel Corporation
  */
 
 #include "iwl-drv.h"
@@ -252,7 +252,7 @@ static int iwl_pnvm_get_from_fs(struct iwl_trans *trans, u8 **data, size_t *len)
 	}
 
 	new_len = pnvm->size;
-	*data = kmemdup(pnvm->data, pnvm->size, GFP_KERNEL);
+	*data = kvmemdup(pnvm->data, pnvm->size, GFP_KERNEL);
 	release_firmware(pnvm);
 
 	if (!*data)
@@ -275,8 +275,8 @@ static u8 *iwl_get_pnvm_image(struct iwl_trans *trans_p, size_t *len)
 			if (*len >= sizeof(*package)) {
 				/* we need only the data */
 				*len -= sizeof(*package);
-				image = kmemdup(package->data,
-						*len, GFP_KERNEL);
+				image = kvmemdup(package->data,
+						 *len, GFP_KERNEL);
 			}
 			/*
 			 * free package regardless of whether kmemdup
@@ -333,7 +333,7 @@ static void iwl_pnvm_load_pnvm_to_trans(struct iwl_trans *trans,
 set:
 	iwl_trans_set_pnvm(trans, capa);
 free:
-	kfree(data);
+	kvfree(data);
 	kfree(pnvm_data);
 }
 
-- 
2.34.1


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

* [PATCH 03/11] wifi: iwlwifi: mvm: don't set the MFP flag for the GTK
  2024-02-06 16:02 [PATCH 00/11] wifi: iwlwifi: updates - 2024-02-06 Miri Korenblit
  2024-02-06 16:02 ` [PATCH 01/11] wifi: iwlwifi: mvm: fix a crash when we run out of stations Miri Korenblit
  2024-02-06 16:02 ` [PATCH 02/11] wifi: iwlwifi: fw: allow vmalloc for PNVM image Miri Korenblit
@ 2024-02-06 16:02 ` Miri Korenblit
  2024-02-06 16:02 ` [PATCH 04/11] wifi: iwlwifi: mvm: don't send the smart fifo command if not needed Miri Korenblit
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Miri Korenblit @ 2024-02-06 16:02 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Emmanuel Grumbach

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

The firmware doesn't need the MFP flag for the GTK, it can even make the
firmware crash. in case the AP is configured with: group cipher TKIP and
MFPC. We would send the GTK with cipher = TKIP and MFP which is of course
not possible.

Fixes: 5c75a208c244 ("wifi: iwlwifi: mvm: support new key API")
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 .../net/wireless/intel/iwlwifi/mvm/mld-key.c   | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c
index bbd37a95d4c8..8a38fc4b0b0f 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-key.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
 /*
- * Copyright (C) 2022 - 2023 Intel Corporation
+ * Copyright (C) 2022 - 2024 Intel Corporation
  */
 #include <linux/kernel.h>
 #include <net/mac80211.h>
@@ -62,11 +62,13 @@ u32 iwl_mvm_get_sec_flags(struct iwl_mvm *mvm,
 			  struct ieee80211_key_conf *keyconf)
 {
 	struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
+	bool pairwise = keyconf->flags & IEEE80211_KEY_FLAG_PAIRWISE;
+	bool igtk = keyconf->keyidx == 4 || keyconf->keyidx == 5;
 	u32 flags = 0;
 
 	lockdep_assert_held(&mvm->mutex);
 
-	if (!(keyconf->flags & IEEE80211_KEY_FLAG_PAIRWISE))
+	if (!pairwise)
 		flags |= IWL_SEC_KEY_FLAG_MCAST_KEY;
 
 	switch (keyconf->cipher) {
@@ -96,12 +98,14 @@ u32 iwl_mvm_get_sec_flags(struct iwl_mvm *mvm,
 	if (!sta && vif->type == NL80211_IFTYPE_STATION)
 		sta = mvmvif->ap_sta;
 
-	/* Set the MFP flag also for an AP interface where the key is an IGTK
-	 * key as in such a case the station would always be NULL
+	/*
+	 * If we are installing an iGTK (in AP or STA mode), we need to tell
+	 * the firmware this key will en/decrypt MGMT frames.
+	 * Same goes if we are installing a pairwise key for an MFP station.
+	 * In case we're installing a groupwise key (which is not an iGTK),
+	 * then, we will not use this key for MGMT frames.
 	 */
-	if ((!IS_ERR_OR_NULL(sta) && sta->mfp) ||
-	    (vif->type == NL80211_IFTYPE_AP &&
-	     (keyconf->keyidx == 4 || keyconf->keyidx == 5)))
+	if ((!IS_ERR_OR_NULL(sta) && sta->mfp && pairwise) || igtk)
 		flags |= IWL_SEC_KEY_FLAG_MFP;
 
 	if (keyconf->flags & IEEE80211_KEY_FLAG_SPP_AMSDU)
-- 
2.34.1


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

* [PATCH 04/11] wifi: iwlwifi: mvm: don't send the smart fifo command if not needed
  2024-02-06 16:02 [PATCH 00/11] wifi: iwlwifi: updates - 2024-02-06 Miri Korenblit
                   ` (2 preceding siblings ...)
  2024-02-06 16:02 ` [PATCH 03/11] wifi: iwlwifi: mvm: don't set the MFP flag for the GTK Miri Korenblit
@ 2024-02-06 16:02 ` Miri Korenblit
  2024-02-06 16:02 ` [PATCH 05/11] wifi: iwlwifi: pcie: Add new PCI device id and CNVI Miri Korenblit
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Miri Korenblit @ 2024-02-06 16:02 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Emmanuel Grumbach

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

Newer firmware versions no longer needs this command. Don't send it if
the firmware advertises it does not need it.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/fw/file.h | 5 ++++-
 drivers/net/wireless/intel/iwlwifi/mvm/sf.c  | 5 ++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/fw/file.h b/drivers/net/wireless/intel/iwlwifi/fw/file.h
index b7ef0882dbad..08d9aeaedd99 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/file.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/file.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
 /*
- * Copyright (C) 2008-2014, 2018-2023 Intel Corporation
+ * Copyright (C) 2008-2014, 2018-2024 Intel Corporation
  * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
  * Copyright (C) 2016-2017 Intel Deutschland GmbH
  */
@@ -247,6 +247,8 @@ typedef unsigned int __bitwise iwl_ucode_tlv_api_t;
  *	logic.
  * @IWL_UCODE_TLV_API_INT_DBG_BUF_CLEAR: Firmware supports clearing the debug
  *	internal buffer
+ * @IWL_UCODE_TLV_API_SMART_FIFO_OFFLOAD: Firmware doesn't need the host to
+ *	configure the smart fifo
  *
  * @NUM_IWL_UCODE_TLV_API: number of bits used
  */
@@ -287,6 +289,7 @@ enum iwl_ucode_tlv_api {
 	/* API Set 2 */
 	IWL_UCODE_TLV_API_NO_HOST_DISABLE_TX	= (__force iwl_ucode_tlv_api_t)66,
 	IWL_UCODE_TLV_API_INT_DBG_BUF_CLEAR     = (__force iwl_ucode_tlv_api_t)67,
+	IWL_UCODE_TLV_API_SMART_FIFO_OFFLOAD    = (__force iwl_ucode_tlv_api_t)68,
 
 	NUM_IWL_UCODE_TLV_API
 /*
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/sf.c b/drivers/net/wireless/intel/iwlwifi/mvm/sf.c
index 30d4233595e8..16285ae7cae9 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/sf.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/sf.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
 /*
- * Copyright (C) 2013-2014, 2018-2019, 2022-2023 Intel Corporation
+ * Copyright (C) 2013-2014, 2018-2019, 2022-2024 Intel Corporation
  * Copyright (C) 2013-2014 Intel Mobile Communications GmbH
  */
 #include "mvm.h"
@@ -232,6 +232,9 @@ int iwl_mvm_sf_update(struct iwl_mvm *mvm, struct ieee80211_vif *changed_vif,
 	};
 	struct ieee80211_sta *sta = NULL;
 
+	if (fw_has_api(&mvm->fw->ucode_capa,
+		       IWL_UCODE_TLV_API_SMART_FIFO_OFFLOAD))
+		return 0;
 	/*
 	 * Ignore the call if we are in HW Restart flow, or if the handled
 	 * vif is a p2p device.
-- 
2.34.1


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

* [PATCH 05/11] wifi: iwlwifi: pcie: Add new PCI device id and CNVI
  2024-02-06 16:02 [PATCH 00/11] wifi: iwlwifi: updates - 2024-02-06 Miri Korenblit
                   ` (3 preceding siblings ...)
  2024-02-06 16:02 ` [PATCH 04/11] wifi: iwlwifi: mvm: don't send the smart fifo command if not needed Miri Korenblit
@ 2024-02-06 16:02 ` Miri Korenblit
  2024-02-06 16:02 ` [PATCH 06/11] wifi: iwlwifi: mvm: don't set replay counters to 0xff Miri Korenblit
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Miri Korenblit @ 2024-02-06 16:02 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Mukesh Sisodiya

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

Add the support for a new PCIE device-id 0x272E and a new CNVI
type.

Signed-off-by: Mukesh Sisodiya <mukesh.sisodiya@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/cfg/sc.c   | 38 +++++++++++++++++--
 .../net/wireless/intel/iwlwifi/iwl-config.h   |  8 +++-
 drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 15 +++++++-
 3 files changed, 55 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/cfg/sc.c b/drivers/net/wireless/intel/iwlwifi/cfg/sc.c
index e0679093ed8e..be98a174a311 100644
--- a/drivers/net/wireless/intel/iwlwifi/cfg/sc.c
+++ b/drivers/net/wireless/intel/iwlwifi/cfg/sc.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/module.h>
 #include <linux/stringify.h>
@@ -33,6 +33,10 @@
 #define IWL_SC_A_GF_A_FW_PRE		"iwlwifi-sc-a0-gf-a0"
 #define IWL_SC_A_GF4_A_FW_PRE		"iwlwifi-sc-a0-gf4-a0"
 #define IWL_SC_A_WH_A_FW_PRE		"iwlwifi-sc-a0-wh-a0"
+#define IWL_SC2_A_FM_C_FW_PRE		"iwlwifi-sc2-a0-fm-c0"
+#define IWL_SC2_A_WH_A_FW_PRE		"iwlwifi-sc2-a0-wh-a0"
+#define IWL_SC2F_A_FM_C_FW_PRE		"iwlwifi-sc2f-a0-fm-c0"
+#define IWL_SC2F_A_WH_A_FW_PRE		"iwlwifi-sc2f-a0-wh-a0"
 
 #define IWL_SC_A_FM_B_FW_MODULE_FIRMWARE(api) \
 	IWL_SC_A_FM_B_FW_PRE "-" __stringify(api) ".ucode"
@@ -48,6 +52,14 @@
 	IWL_SC_A_GF4_A_FW_PRE "-" __stringify(api) ".ucode"
 #define IWL_SC_A_WH_A_FW_MODULE_FIRMWARE(api) \
 	IWL_SC_A_WH_A_FW_PRE "-" __stringify(api) ".ucode"
+#define IWL_SC2_A_FM_C_FW_MODULE_FIRMWARE(api) \
+	IWL_SC2_A_FM_C_FW_PRE "-" __stringify(api) ".ucode"
+#define IWL_SC2_A_WH_A_FW_MODULE_FIRMWARE(api) \
+	IWL_SC2_A_WH_A_FW_PRE "-" __stringify(api) ".ucode"
+#define IWL_SC2F_A_FM_C_FW_MODULE_FIRMWARE(api) \
+	IWL_SC2F_A_FM_C_FW_PRE "-" __stringify(api) ".ucode"
+#define IWL_SC2F_A_WH_A_FW_MODULE_FIRMWARE(api) \
+	IWL_SC2F_A_WH_A_FW_PRE "-" __stringify(api) ".ucode"
 
 static const struct iwl_base_params iwl_sc_base_params = {
 	.eeprom_size = OTP_LOW_IMAGE_SIZE_32K,
@@ -124,6 +136,9 @@ static const struct iwl_base_params iwl_sc_base_params = {
 
 #define IWL_DEVICE_SC							\
 	IWL_DEVICE_BZ_COMMON,						\
+	.uhb_supported = true,						\
+	.features = IWL_TX_CSUM_NETIF_FLAGS | NETIF_F_RXCSUM,		\
+	.num_rbds = IWL_NUM_RBDS_SC_EHT,				\
 	.ht_params = &iwl_22000_ht_params
 
 /*
@@ -149,10 +164,21 @@ const char iwl_sc_name[] = "Intel(R) TBD Sc device";
 
 const struct iwl_cfg iwl_cfg_sc = {
 	.fw_name_mac = "sc",
-	.uhb_supported = true,
 	IWL_DEVICE_SC,
-	.features = IWL_TX_CSUM_NETIF_FLAGS | NETIF_F_RXCSUM,
-	.num_rbds = IWL_NUM_RBDS_SC_EHT,
+};
+
+const char iwl_sc2_name[] = "Intel(R) TBD Sc2 device";
+
+const struct iwl_cfg iwl_cfg_sc2 = {
+	.fw_name_mac = "sc2",
+	IWL_DEVICE_SC,
+};
+
+const char iwl_sc2f_name[] = "Intel(R) TBD Sc2f device";
+
+const struct iwl_cfg iwl_cfg_sc2f = {
+	.fw_name_mac = "sc2f",
+	IWL_DEVICE_SC,
 };
 
 MODULE_FIRMWARE(IWL_SC_A_FM_B_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX));
@@ -162,3 +188,7 @@ MODULE_FIRMWARE(IWL_SC_A_HR_B_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX));
 MODULE_FIRMWARE(IWL_SC_A_GF_A_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX));
 MODULE_FIRMWARE(IWL_SC_A_GF4_A_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX));
 MODULE_FIRMWARE(IWL_SC_A_WH_A_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX));
+MODULE_FIRMWARE(IWL_SC2_A_FM_C_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX));
+MODULE_FIRMWARE(IWL_SC2_A_WH_A_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX));
+MODULE_FIRMWARE(IWL_SC2F_A_FM_C_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX));
+MODULE_FIRMWARE(IWL_SC2F_A_WH_A_FW_MODULE_FIRMWARE(IWL_SC_UCODE_API_MAX));
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-config.h b/drivers/net/wireless/intel/iwlwifi/iwl-config.h
index 97e73443316a..6aa4f7f9c708 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-config.h
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-config.h
@@ -2,7 +2,7 @@
 /*
  * Copyright (C) 2005-2014, 2018-2021 Intel Corporation
  * Copyright (C) 2016-2017 Intel Deutschland GmbH
- * Copyright (C) 2018-2023 Intel Corporation
+ * Copyright (C) 2018-2024 Intel Corporation
  */
 #ifndef __IWL_CONFIG_H__
 #define __IWL_CONFIG_H__
@@ -419,6 +419,8 @@ struct iwl_cfg {
 #define IWL_CFG_MAC_TYPE_BZ		0x46
 #define IWL_CFG_MAC_TYPE_GL		0x47
 #define IWL_CFG_MAC_TYPE_SC		0x48
+#define IWL_CFG_MAC_TYPE_SC2		0x49
+#define IWL_CFG_MAC_TYPE_SC2F		0x4A
 
 #define IWL_CFG_RF_TYPE_TH		0x105
 #define IWL_CFG_RF_TYPE_TH1		0x108
@@ -541,6 +543,8 @@ extern const char iwl_ax411_name[];
 extern const char iwl_bz_name[];
 extern const char iwl_mtp_name[];
 extern const char iwl_sc_name[];
+extern const char iwl_sc2_name[];
+extern const char iwl_sc2f_name[];
 #if IS_ENABLED(CONFIG_IWLDVM)
 extern const struct iwl_cfg iwl5300_agn_cfg;
 extern const struct iwl_cfg iwl5100_agn_cfg;
@@ -646,6 +650,8 @@ extern const struct iwl_cfg iwl_cfg_bz;
 extern const struct iwl_cfg iwl_cfg_gl;
 
 extern const struct iwl_cfg iwl_cfg_sc;
+extern const struct iwl_cfg iwl_cfg_sc2;
+extern const struct iwl_cfg iwl_cfg_sc2f;
 #endif /* CONFIG_IWLMVM */
 
 #endif /* __IWL_CONFIG_H__ */
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
index 1ed67b76b516..4a657036b9d6 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
 /*
- * Copyright (C) 2005-2014, 2018-2023 Intel Corporation
+ * Copyright (C) 2005-2014, 2018-2024 Intel Corporation
  * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
  * Copyright (C) 2016-2017 Intel Deutschland GmbH
  */
@@ -509,6 +509,9 @@ static const struct pci_device_id iwl_hw_card_ids[] = {
 
 /* Sc devices */
 	{IWL_PCI_DEVICE(0xE440, PCI_ANY_ID, iwl_sc_trans_cfg)},
+	{IWL_PCI_DEVICE(0xE340, PCI_ANY_ID, iwl_sc_trans_cfg)},
+	{IWL_PCI_DEVICE(0xD340, PCI_ANY_ID, iwl_sc_trans_cfg)},
+	{IWL_PCI_DEVICE(0x6E70, PCI_ANY_ID, iwl_sc_trans_cfg)},
 #endif /* CONFIG_IWLMVM */
 
 	{0}
@@ -1121,6 +1124,16 @@ VISIBLE_IF_IWLWIFI_KUNIT const struct iwl_dev_info iwl_dev_info_table[] = {
 		      IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_ANY,
 		      IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_ANY,
 		      iwl_cfg_sc, iwl_sc_name),
+	_IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY,
+		      IWL_CFG_MAC_TYPE_SC2, IWL_CFG_ANY,
+		      IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_ANY,
+		      IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_ANY,
+		      iwl_cfg_sc2, iwl_sc2_name),
+	_IWL_DEV_INFO(IWL_CFG_ANY, IWL_CFG_ANY,
+		      IWL_CFG_MAC_TYPE_SC2F, IWL_CFG_ANY,
+		      IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_ANY,
+		      IWL_CFG_ANY, IWL_CFG_ANY, IWL_CFG_ANY,
+		      iwl_cfg_sc2f, iwl_sc2f_name),
 #endif /* CONFIG_IWLMVM */
 };
 EXPORT_SYMBOL_IF_IWLWIFI_KUNIT(iwl_dev_info_table);
-- 
2.34.1


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

* [PATCH 06/11] wifi: iwlwifi: mvm: don't set replay counters to 0xff
  2024-02-06 16:02 [PATCH 00/11] wifi: iwlwifi: updates - 2024-02-06 Miri Korenblit
                   ` (4 preceding siblings ...)
  2024-02-06 16:02 ` [PATCH 05/11] wifi: iwlwifi: pcie: Add new PCI device id and CNVI Miri Korenblit
@ 2024-02-06 16:02 ` Miri Korenblit
  2024-02-06 16:02 ` [PATCH 07/11] wifi: iwlwifi: mvm: remove flags for enable/disable beacon filter Miri Korenblit
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Miri Korenblit @ 2024-02-06 16:02 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Johannes Berg

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

The firmware (later) actually uses the values even for keys
that are invalid as far as the host is concerned, later in
rekeying, and then only sets the low 48 bits since the PNs
are only 48 bits over the air. It does, however, compare the
full 64 bits later, obviously causing problems.

Remove the memset and use kzalloc instead to avoid any old
heap data leaking to the firmware. We already init all the
other fields in the struct anyway. This leaves the data set
to zero for any unused fields, so the firmware can look at
them safely even if they're not used right now.

Fixes: 79e561f0f05a ("iwlwifi: mvm: d3: implement RSC command version 5")
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/d3.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
index 5bc08c1d207a..e1c77276557d 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
@@ -461,12 +461,10 @@ static int iwl_mvm_wowlan_config_rsc_tsc(struct iwl_mvm *mvm,
 		struct wowlan_key_rsc_v5_data data = {};
 		int i;
 
-		data.rsc = kmalloc(sizeof(*data.rsc), GFP_KERNEL);
+		data.rsc = kzalloc(sizeof(*data.rsc), GFP_KERNEL);
 		if (!data.rsc)
 			return -ENOMEM;
 
-		memset(data.rsc, 0xff, sizeof(*data.rsc));
-
 		for (i = 0; i < ARRAY_SIZE(data.rsc->mcast_key_id_map); i++)
 			data.rsc->mcast_key_id_map[i] =
 				IWL_MCAST_KEY_MAP_INVALID;
-- 
2.34.1


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

* [PATCH 07/11] wifi: iwlwifi: mvm: remove flags for enable/disable beacon filter
  2024-02-06 16:02 [PATCH 00/11] wifi: iwlwifi: updates - 2024-02-06 Miri Korenblit
                   ` (5 preceding siblings ...)
  2024-02-06 16:02 ` [PATCH 06/11] wifi: iwlwifi: mvm: don't set replay counters to 0xff Miri Korenblit
@ 2024-02-06 16:02 ` Miri Korenblit
  2024-02-06 16:02 ` [PATCH 08/11] wifi: iwlwifi: mvm: show skb_mac_gso_segment() failure reason Miri Korenblit
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Miri Korenblit @ 2024-02-06 16:02 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Johannes Berg

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

The flags argument to enable/disable beacon filtering functions
is unused and always zero, so just remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 .../wireless/intel/iwlwifi/mvm/debugfs-vif.c  |  6 ++--
 .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 18 ++++++------
 .../wireless/intel/iwlwifi/mvm/mld-mac80211.c |  2 +-
 drivers/net/wireless/intel/iwlwifi/mvm/mvm.h  |  6 ++--
 .../net/wireless/intel/iwlwifi/mvm/power.c    | 29 ++++++++-----------
 5 files changed, 27 insertions(+), 34 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c
index 2b96cf9eac72..aa3c9c2cbd7f 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/debugfs-vif.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
 /*
- * Copyright (C) 2012-2014, 2018-2023 Intel Corporation
+ * Copyright (C) 2012-2014, 2018-2024 Intel Corporation
  * Copyright (C) 2013-2015 Intel Mobile Communications GmbH
  * Copyright (C) 2016-2017 Intel Deutschland GmbH
  */
@@ -381,9 +381,9 @@ static ssize_t iwl_dbgfs_bf_params_write(struct ieee80211_vif *vif, char *buf,
 	mutex_lock(&mvm->mutex);
 	iwl_dbgfs_update_bf(vif, param, value);
 	if (param == MVM_DEBUGFS_BF_ENABLE_BEACON_FILTER && !value)
-		ret = iwl_mvm_disable_beacon_filter(mvm, vif, 0);
+		ret = iwl_mvm_disable_beacon_filter(mvm, vif);
 	else
-		ret = iwl_mvm_enable_beacon_filter(mvm, vif, 0);
+		ret = iwl_mvm_enable_beacon_filter(mvm, vif);
 	mutex_unlock(&mvm->mutex);
 
 	return ret ?: count;
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index 4fe50036bfde..a051e0c955d5 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -1448,7 +1448,7 @@ int iwl_mvm_post_channel_switch(struct ieee80211_hw *hw,
 
 		if (!fw_has_capa(&mvm->fw->ucode_capa,
 				 IWL_UCODE_TLV_CAPA_CHANNEL_SWITCH_CMD)) {
-			ret = iwl_mvm_enable_beacon_filter(mvm, vif, 0);
+			ret = iwl_mvm_enable_beacon_filter(mvm, vif);
 			if (ret)
 				goto out_unlock;
 
@@ -1632,7 +1632,7 @@ static int iwl_mvm_mac_add_interface(struct ieee80211_hw *hw,
 		goto out_remove_mac;
 
 	/* beacon filtering */
-	ret = iwl_mvm_disable_beacon_filter(mvm, vif, 0);
+	ret = iwl_mvm_disable_beacon_filter(mvm, vif);
 	if (ret)
 		goto out_remove_mac;
 
@@ -2575,7 +2575,7 @@ iwl_mvm_bss_info_changed_station_common(struct iwl_mvm *mvm,
 		iwl_mvm_stop_session_protection(mvm, vif);
 
 		iwl_mvm_sf_update(mvm, vif, false);
-		WARN_ON(iwl_mvm_enable_beacon_filter(mvm, vif, 0));
+		WARN_ON(iwl_mvm_enable_beacon_filter(mvm, vif));
 	}
 
 	if (changes & (BSS_CHANGED_PS | BSS_CHANGED_P2P_PS | BSS_CHANGED_QOS |
@@ -2596,7 +2596,7 @@ iwl_mvm_bss_info_changed_station_common(struct iwl_mvm *mvm,
 			/* FIXME: need to update per link when FW API will
 			 * support it
 			 */
-			ret = iwl_mvm_enable_beacon_filter(mvm, vif, 0);
+			ret = iwl_mvm_enable_beacon_filter(mvm, vif);
 			if (ret)
 				IWL_ERR(mvm,
 					"failed to update CQM thresholds\n");
@@ -3800,7 +3800,7 @@ iwl_mvm_sta_state_assoc_to_authorized(struct iwl_mvm *mvm,
 					   NL80211_TDLS_ENABLE_LINK);
 	} else {
 		/* enable beacon filtering */
-		WARN_ON(iwl_mvm_enable_beacon_filter(mvm, vif, 0));
+		WARN_ON(iwl_mvm_enable_beacon_filter(mvm, vif));
 
 		mvmvif->authorized = 1;
 
@@ -3858,7 +3858,7 @@ iwl_mvm_sta_state_authorized_to_assoc(struct iwl_mvm *mvm,
 		mvmvif->authorized = 0;
 
 		/* disable beacon filtering */
-		iwl_mvm_disable_beacon_filter(mvm, vif, 0);
+		iwl_mvm_disable_beacon_filter(mvm, vif);
 	}
 
 	return 0;
@@ -5302,8 +5302,8 @@ static int __iwl_mvm_mac_testmode_cmd(struct iwl_mvm *mvm,
 			return -EINVAL;
 
 		if (nla_get_u32(tb[IWL_MVM_TM_ATTR_BEACON_FILTER_STATE]))
-			return iwl_mvm_enable_beacon_filter(mvm, vif, 0);
-		return iwl_mvm_disable_beacon_filter(mvm, vif, 0);
+			return iwl_mvm_enable_beacon_filter(mvm, vif);
+		return iwl_mvm_disable_beacon_filter(mvm, vif);
 	}
 
 	return -EOPNOTSUPP;
@@ -5387,7 +5387,7 @@ static int iwl_mvm_old_pre_chan_sw_sta(struct iwl_mvm *mvm,
 		iwl_mvm_csa_client_absent(mvm, vif);
 
 	if (mvmvif->bf_data.bf_enabled) {
-		int ret = iwl_mvm_disable_beacon_filter(mvm, vif, 0);
+		int ret = iwl_mvm_disable_beacon_filter(mvm, vif);
 
 		if (ret)
 			return ret;
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
index ff7d9a7d607e..f818cf46b09c 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c
@@ -47,7 +47,7 @@ static int iwl_mvm_mld_mac_add_interface(struct ieee80211_hw *hw,
 		goto out_unlock;
 
 	/* beacon filtering */
-	ret = iwl_mvm_disable_beacon_filter(mvm, vif, 0);
+	ret = iwl_mvm_disable_beacon_filter(mvm, vif);
 	if (ret)
 		goto out_remove_mac;
 
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index 76f50b3bf893..2dd45f39b77f 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -2143,11 +2143,9 @@ iwl_mvm_beacon_filter_debugfs_parameters(struct ieee80211_vif *vif,
 {}
 #endif
 int iwl_mvm_enable_beacon_filter(struct iwl_mvm *mvm,
-				 struct ieee80211_vif *vif,
-				 u32 flags);
+				 struct ieee80211_vif *vif);
 int iwl_mvm_disable_beacon_filter(struct iwl_mvm *mvm,
-				  struct ieee80211_vif *vif,
-				  u32 flags);
+				  struct ieee80211_vif *vif);
 /* SMPS */
 void iwl_mvm_update_smps(struct iwl_mvm *mvm, struct ieee80211_vif *vif,
 				enum iwl_mvm_smps_type_request req_type,
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/power.c b/drivers/net/wireless/intel/iwlwifi/mvm/power.c
index 1b9b06e0443f..41e68aa6bec8 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/power.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/power.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
 /*
- * Copyright (C) 2012-2014, 2018-2019, 2021-2023 Intel Corporation
+ * Copyright (C) 2012-2014, 2018-2019, 2021-2024 Intel Corporation
  * Copyright (C) 2013-2014 Intel Mobile Communications GmbH
  * Copyright (C) 2015-2017 Intel Deutschland GmbH
  */
@@ -20,8 +20,7 @@
 
 static
 int iwl_mvm_beacon_filter_send_cmd(struct iwl_mvm *mvm,
-				   struct iwl_beacon_filter_cmd *cmd,
-				   u32 flags)
+				   struct iwl_beacon_filter_cmd *cmd)
 {
 	u16 len;
 
@@ -62,7 +61,7 @@ int iwl_mvm_beacon_filter_send_cmd(struct iwl_mvm *mvm,
 		len = offsetof(struct iwl_beacon_filter_cmd,
 			       bf_threshold_absolute_low);
 
-	return iwl_mvm_send_cmd_pdu(mvm, REPLY_BEACON_FILTERING_CMD, flags,
+	return iwl_mvm_send_cmd_pdu(mvm, REPLY_BEACON_FILTERING_CMD, 0,
 				    len, cmd);
 }
 
@@ -813,8 +812,7 @@ iwl_mvm_beacon_filter_debugfs_parameters(struct ieee80211_vif *vif,
 
 static int _iwl_mvm_enable_beacon_filter(struct iwl_mvm *mvm,
 					 struct ieee80211_vif *vif,
-					 struct iwl_beacon_filter_cmd *cmd,
-					 u32 cmd_flags)
+					 struct iwl_beacon_filter_cmd *cmd)
 {
 	struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
 	int ret;
@@ -825,7 +823,7 @@ static int _iwl_mvm_enable_beacon_filter(struct iwl_mvm *mvm,
 
 	iwl_mvm_beacon_filter_set_cqm_params(mvm, vif, cmd);
 	iwl_mvm_beacon_filter_debugfs_parameters(vif, cmd);
-	ret = iwl_mvm_beacon_filter_send_cmd(mvm, cmd, cmd_flags);
+	ret = iwl_mvm_beacon_filter_send_cmd(mvm, cmd);
 
 	if (!ret)
 		mvmvif->bf_data.bf_enabled = true;
@@ -834,20 +832,18 @@ static int _iwl_mvm_enable_beacon_filter(struct iwl_mvm *mvm,
 }
 
 int iwl_mvm_enable_beacon_filter(struct iwl_mvm *mvm,
-				 struct ieee80211_vif *vif,
-				 u32 flags)
+				 struct ieee80211_vif *vif)
 {
 	struct iwl_beacon_filter_cmd cmd = {
 		IWL_BF_CMD_CONFIG_DEFAULTS,
 		.bf_enable_beacon_filter = cpu_to_le32(1),
 	};
 
-	return _iwl_mvm_enable_beacon_filter(mvm, vif, &cmd, flags);
+	return _iwl_mvm_enable_beacon_filter(mvm, vif, &cmd);
 }
 
 static int _iwl_mvm_disable_beacon_filter(struct iwl_mvm *mvm,
-					  struct ieee80211_vif *vif,
-					  u32 flags)
+					  struct ieee80211_vif *vif)
 {
 	struct iwl_beacon_filter_cmd cmd = {};
 	struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
@@ -856,7 +852,7 @@ static int _iwl_mvm_disable_beacon_filter(struct iwl_mvm *mvm,
 	if (vif->type != NL80211_IFTYPE_STATION || vif->p2p)
 		return 0;
 
-	ret = iwl_mvm_beacon_filter_send_cmd(mvm, &cmd, flags);
+	ret = iwl_mvm_beacon_filter_send_cmd(mvm, &cmd);
 
 	if (!ret)
 		mvmvif->bf_data.bf_enabled = false;
@@ -865,10 +861,9 @@ static int _iwl_mvm_disable_beacon_filter(struct iwl_mvm *mvm,
 }
 
 int iwl_mvm_disable_beacon_filter(struct iwl_mvm *mvm,
-				  struct ieee80211_vif *vif,
-				  u32 flags)
+				  struct ieee80211_vif *vif)
 {
-	return _iwl_mvm_disable_beacon_filter(mvm, vif, flags);
+	return _iwl_mvm_disable_beacon_filter(mvm, vif);
 }
 
 static int iwl_mvm_power_set_ps(struct iwl_mvm *mvm)
@@ -919,7 +914,7 @@ static int iwl_mvm_power_set_ba(struct iwl_mvm *mvm,
 				       !vif->cfg.ps ||
 				       iwl_mvm_vif_low_latency(mvmvif));
 
-	return _iwl_mvm_enable_beacon_filter(mvm, vif, &cmd, 0);
+	return _iwl_mvm_enable_beacon_filter(mvm, vif, &cmd);
 }
 
 int iwl_mvm_power_update_ps(struct iwl_mvm *mvm)
-- 
2.34.1


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

* [PATCH 08/11] wifi: iwlwifi: mvm: show skb_mac_gso_segment() failure reason
  2024-02-06 16:02 [PATCH 00/11] wifi: iwlwifi: updates - 2024-02-06 Miri Korenblit
                   ` (6 preceding siblings ...)
  2024-02-06 16:02 ` [PATCH 07/11] wifi: iwlwifi: mvm: remove flags for enable/disable beacon filter Miri Korenblit
@ 2024-02-06 16:02 ` Miri Korenblit
  2024-02-06 16:02 ` [PATCH 09/11] wifi: iwlwifi: iwlmvm: handle unprotected deauth/disassoc in d3 Miri Korenblit
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 14+ messages in thread
From: Miri Korenblit @ 2024-02-06 16:02 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Johannes Berg

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

If this warning triggers we don't really know why, print out
the return value so we can see it.

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 | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
index c5fafaaee521..3c887a8eebc0 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
@@ -951,9 +951,15 @@ iwl_mvm_tx_tso_segment(struct sk_buff *skb, unsigned int num_subframes,
 	next = skb_gso_segment(skb, netdev_flags);
 	skb_shinfo(skb)->gso_size = mss;
 	skb_shinfo(skb)->gso_type = ipv4 ? SKB_GSO_TCPV4 : SKB_GSO_TCPV6;
-	if (WARN_ON_ONCE(IS_ERR(next)))
-		return -EINVAL;
-	else if (next)
+
+	if (IS_ERR(next) && PTR_ERR(next) == -ENOMEM)
+		return -ENOMEM;
+
+	if (WARN_ONCE(IS_ERR(next),
+		      "skb_gso_segment error: %d\n", (int)PTR_ERR(next)))
+		return PTR_ERR(next);
+
+	if (next)
 		consume_skb(skb);
 
 	skb_list_walk_safe(next, tmp, next) {
-- 
2.34.1


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

* [PATCH 09/11] wifi: iwlwifi: iwlmvm: handle unprotected deauth/disassoc in d3
  2024-02-06 16:02 [PATCH 00/11] wifi: iwlwifi: updates - 2024-02-06 Miri Korenblit
                   ` (7 preceding siblings ...)
  2024-02-06 16:02 ` [PATCH 08/11] wifi: iwlwifi: mvm: show skb_mac_gso_segment() failure reason Miri Korenblit
@ 2024-02-06 16:02 ` Miri Korenblit
  2024-02-07  3:39   ` kernel test robot
  2024-02-07  6:27   ` kernel test robot
  2024-02-06 16:02 ` [PATCH 10/11] wifi: iwlwifi: mvm: move BA notif messages before action Miri Korenblit
  2024-02-06 16:02 ` [PATCH 11/11] wifi: iwlwifi: queue: improve warning for no skb in reclaim Miri Korenblit
  10 siblings, 2 replies; 14+ messages in thread
From: Miri Korenblit @ 2024-02-06 16:02 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Shaul Triebitz

From: Shaul Triebitz <shaul.triebitz@intel.com>

In MFP, do not disconnect if an unprotected deauth
or disassoc was received during D3.
For that, need to configure wowlan with MFP (IS_11W_ASSOC).

Now, in case of an unprotected deauth/disassoc, the wakeup
reason returned by the firmware will be:
IWL_WAKEUP_BY_11W_UNPROTECTED_DEAUTH_OR_DISASSOC
(and not IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_DEAUTH
which will cause a disconnection).
Also, report this reason to cfg80211.

In another patch, the driver will send an SA query.

Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
index e1c77276557d..26c01d740d0d 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
@@ -925,6 +925,9 @@ iwl_mvm_get_wowlan_config(struct iwl_mvm *mvm,
 	wowlan_config_cmd->flags = ENABLE_L3_FILTERING |
 		ENABLE_NBNS_FILTERING | ENABLE_DHCP_FILTERING;
 
+	if (ap_sta->mfp)
+		wowlan_config_cmd->flags |= IS_11W_ASSOC;
+
 	if (iwl_fw_lookup_cmd_ver(mvm->fw, WOWLAN_CONFIGURATION, 0) < 6) {
 		/* Query the last used seqno and set it */
 		int ret = iwl_mvm_get_last_nonqos_seq(mvm, vif);
@@ -1511,6 +1514,9 @@ static void iwl_mvm_report_wakeup_reasons(struct iwl_mvm *mvm,
 	if (reasons & IWL_WOWLAN_WAKEUP_BY_REM_WAKE_WAKEUP_PACKET)
 		wakeup.tcp_match = true;
 
+	if (reasons & IWL_WAKEUP_BY_11W_UNPROTECTED_DEAUTH_OR_DISASSOC)
+		wakeup.unprot_deauth_disassoc = true;
+
 	if (status->wake_packet) {
 		int pktsize = status->wake_packet_bufsize;
 		int pktlen = status->wake_packet_length;
-- 
2.34.1


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

* [PATCH 10/11] wifi: iwlwifi: mvm: move BA notif messages before action
  2024-02-06 16:02 [PATCH 00/11] wifi: iwlwifi: updates - 2024-02-06 Miri Korenblit
                   ` (8 preceding siblings ...)
  2024-02-06 16:02 ` [PATCH 09/11] wifi: iwlwifi: iwlmvm: handle unprotected deauth/disassoc in d3 Miri Korenblit
@ 2024-02-06 16:02 ` Miri Korenblit
  2024-02-06 16:02 ` [PATCH 11/11] wifi: iwlwifi: queue: improve warning for no skb in reclaim Miri Korenblit
  10 siblings, 0 replies; 14+ messages in thread
From: Miri Korenblit @ 2024-02-06 16:02 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Johannes Berg

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

This is always a bit confusing, the code first does all the
reclaim (with its own debug messages), and _then_ prints it
got a BA notification from firmware. Turn that around.

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 | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
index 3c887a8eebc0..dc3808e3c62e 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/tx.c
@@ -2211,6 +2211,12 @@ void iwl_mvm_rx_ba_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb)
 				 tfd_cnt, pkt_len))
 			return;
 
+		IWL_DEBUG_TX_REPLY(mvm,
+				   "BA_NOTIFICATION Received from sta_id = %d, flags %x, sent:%d, acked:%d\n",
+				   sta_id, le32_to_cpu(ba_res->flags),
+				   le16_to_cpu(ba_res->txed),
+				   le16_to_cpu(ba_res->done));
+
 		rcu_read_lock();
 
 		mvmsta = iwl_mvm_sta_from_staid_rcu(mvm, sta_id);
@@ -2246,12 +2252,6 @@ void iwl_mvm_rx_ba_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb)
 			iwl_mvm_tx_airtime(mvm, mvmsta,
 					   le32_to_cpu(ba_res->wireless_time));
 		rcu_read_unlock();
-
-		IWL_DEBUG_TX_REPLY(mvm,
-				   "BA_NOTIFICATION Received from sta_id = %d, flags %x, sent:%d, acked:%d\n",
-				   sta_id, le32_to_cpu(ba_res->flags),
-				   le16_to_cpu(ba_res->txed),
-				   le16_to_cpu(ba_res->done));
 		return;
 	}
 
@@ -2283,9 +2283,6 @@ void iwl_mvm_rx_ba_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb)
 
 	rcu_read_unlock();
 
-	iwl_mvm_tx_reclaim(mvm, sta_id, tid, txq, index, &ba_info,
-			   tid_data->rate_n_flags, false);
-
 	IWL_DEBUG_TX_REPLY(mvm,
 			   "BA_NOTIFICATION Received from %pM, sta_id = %d\n",
 			   ba_notif->sta_addr, ba_notif->sta_id);
@@ -2298,6 +2295,9 @@ void iwl_mvm_rx_ba_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb)
 
 	IWL_DEBUG_TX_REPLY(mvm, "reduced txp from ba notif %d\n",
 			   ba_notif->reduced_txp);
+
+	iwl_mvm_tx_reclaim(mvm, sta_id, tid, txq, index, &ba_info,
+			   tid_data->rate_n_flags, false);
 }
 
 /*
-- 
2.34.1


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

* [PATCH 11/11] wifi: iwlwifi: queue: improve warning for no skb in reclaim
  2024-02-06 16:02 [PATCH 00/11] wifi: iwlwifi: updates - 2024-02-06 Miri Korenblit
                   ` (9 preceding siblings ...)
  2024-02-06 16:02 ` [PATCH 10/11] wifi: iwlwifi: mvm: move BA notif messages before action Miri Korenblit
@ 2024-02-06 16:02 ` Miri Korenblit
  10 siblings, 0 replies; 14+ messages in thread
From: Miri Korenblit @ 2024-02-06 16:02 UTC (permalink / raw)
  To: johannes; +Cc: linux-wireless, Johannes Berg

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

We've seen this warning trigger, and while the reason is
probably obvious, I haven't been able to see it yet. Add
more information to the warning message to help identify
the cause. Also print out both index and SSN for all the
messages.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 drivers/net/wireless/intel/iwlwifi/queue/tx.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/intel/iwlwifi/queue/tx.c b/drivers/net/wireless/intel/iwlwifi/queue/tx.c
index ba0419bc1765..d3bde2d010b7 100644
--- a/drivers/net/wireless/intel/iwlwifi/queue/tx.c
+++ b/drivers/net/wireless/intel/iwlwifi/queue/tx.c
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
 /*
- * Copyright (C) 2020-2023 Intel Corporation
+ * Copyright (C) 2020-2024 Intel Corporation
  */
 #include <net/tso.h>
 #include <linux/tcp.h>
@@ -1602,8 +1602,8 @@ void iwl_txq_reclaim(struct iwl_trans *trans, int txq_id, int ssn,
 	if (read_ptr == tfd_num)
 		goto out;
 
-	IWL_DEBUG_TX_REPLY(trans, "[Q %d] %d -> %d (%d)\n",
-			   txq_id, txq->read_ptr, tfd_num, ssn);
+	IWL_DEBUG_TX_REPLY(trans, "[Q %d] %d (%d) -> %d (%d)\n",
+			   txq_id, read_ptr, txq->read_ptr, tfd_num, ssn);
 
 	/*Since we free until index _not_ inclusive, the one before index is
 	 * the last we will free. This one must be used */
@@ -1631,7 +1631,8 @@ void iwl_txq_reclaim(struct iwl_trans *trans, int txq_id, int ssn,
 	     read_ptr = iwl_txq_get_cmd_index(txq, txq->read_ptr)) {
 		struct sk_buff *skb = txq->entries[read_ptr].skb;
 
-		if (WARN_ON_ONCE(!skb))
+		if (WARN_ONCE(!skb, "no SKB at %d (%d) on queue %d\n",
+			      read_ptr, txq->read_ptr, txq_id))
 			continue;
 
 		iwl_txq_free_tso_page(trans, skb);
-- 
2.34.1


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

* Re: [PATCH 09/11] wifi: iwlwifi: iwlmvm: handle unprotected deauth/disassoc in d3
  2024-02-06 16:02 ` [PATCH 09/11] wifi: iwlwifi: iwlmvm: handle unprotected deauth/disassoc in d3 Miri Korenblit
@ 2024-02-07  3:39   ` kernel test robot
  2024-02-07  6:27   ` kernel test robot
  1 sibling, 0 replies; 14+ messages in thread
From: kernel test robot @ 2024-02-07  3:39 UTC (permalink / raw)
  To: Miri Korenblit, johannes; +Cc: oe-kbuild-all, linux-wireless, Shaul Triebitz

Hi Miri,

kernel test robot noticed the following build errors:

[auto build test ERROR on wireless-next/main]
[also build test ERROR on next-20240206]
[cannot apply to wireless/main linus/master v6.8-rc3]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Miri-Korenblit/wifi-iwlwifi-mvm-fix-a-crash-when-we-run-out-of-stations/20240207-000459
base:   https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git main
patch link:    https://lore.kernel.org/r/20240206175739.fde438a22e3f.I3c8497520aaa95a22febff727b0ad08146965d47%40changeid
patch subject: [PATCH 09/11] wifi: iwlwifi: iwlmvm: handle unprotected deauth/disassoc in d3
config: loongarch-defconfig (https://download.01.org/0day-ci/archive/20240207/202402071158.kjPLRHpx-lkp@intel.com/config)
compiler: loongarch64-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240207/202402071158.kjPLRHpx-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202402071158.kjPLRHpx-lkp@intel.com/

All errors (new ones prefixed by >>):

   drivers/net/wireless/intel/iwlwifi/mvm/d3.c: In function 'iwl_mvm_report_wakeup_reasons':
>> drivers/net/wireless/intel/iwlwifi/mvm/d3.c:1518:23: error: 'struct cfg80211_wowlan_wakeup' has no member named 'unprot_deauth_disassoc'
    1518 |                 wakeup.unprot_deauth_disassoc = true;
         |                       ^


vim +1518 drivers/net/wireless/intel/iwlwifi/mvm/d3.c

  1465	
  1466	static void iwl_mvm_report_wakeup_reasons(struct iwl_mvm *mvm,
  1467						  struct ieee80211_vif *vif,
  1468						  struct iwl_wowlan_status_data *status)
  1469	{
  1470		struct sk_buff *pkt = NULL;
  1471		struct cfg80211_wowlan_wakeup wakeup = {
  1472			.pattern_idx = -1,
  1473		};
  1474		struct cfg80211_wowlan_wakeup *wakeup_report = &wakeup;
  1475		u32 reasons = status->wakeup_reasons;
  1476	
  1477		if (reasons == IWL_WOWLAN_WAKEUP_BY_NON_WIRELESS) {
  1478			wakeup_report = NULL;
  1479			goto report;
  1480		}
  1481	
  1482		pm_wakeup_event(mvm->dev, 0);
  1483	
  1484		if (reasons & IWL_WOWLAN_WAKEUP_BY_MAGIC_PACKET)
  1485			wakeup.magic_pkt = true;
  1486	
  1487		if (reasons & IWL_WOWLAN_WAKEUP_BY_PATTERN)
  1488			wakeup.pattern_idx =
  1489				status->pattern_number;
  1490	
  1491		if (reasons & (IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_MISSED_BEACON |
  1492			       IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_DEAUTH |
  1493			       IWL_WOWLAN_WAKEUP_BY_GTK_REKEY_FAILURE))
  1494			wakeup.disconnect = true;
  1495	
  1496		if (reasons & IWL_WOWLAN_WAKEUP_BY_GTK_REKEY_FAILURE)
  1497			wakeup.gtk_rekey_failure = true;
  1498	
  1499		if (reasons & IWL_WOWLAN_WAKEUP_BY_RFKILL_DEASSERTED)
  1500			wakeup.rfkill_release = true;
  1501	
  1502		if (reasons & IWL_WOWLAN_WAKEUP_BY_EAPOL_REQUEST)
  1503			wakeup.eap_identity_req = true;
  1504	
  1505		if (reasons & IWL_WOWLAN_WAKEUP_BY_FOUR_WAY_HANDSHAKE)
  1506			wakeup.four_way_handshake = true;
  1507	
  1508		if (reasons & IWL_WOWLAN_WAKEUP_BY_REM_WAKE_LINK_LOSS)
  1509			wakeup.tcp_connlost = true;
  1510	
  1511		if (reasons & IWL_WOWLAN_WAKEUP_BY_REM_WAKE_SIGNATURE_TABLE)
  1512			wakeup.tcp_nomoretokens = true;
  1513	
  1514		if (reasons & IWL_WOWLAN_WAKEUP_BY_REM_WAKE_WAKEUP_PACKET)
  1515			wakeup.tcp_match = true;
  1516	
  1517		if (reasons & IWL_WAKEUP_BY_11W_UNPROTECTED_DEAUTH_OR_DISASSOC)
> 1518			wakeup.unprot_deauth_disassoc = true;
  1519	
  1520		if (status->wake_packet) {
  1521			int pktsize = status->wake_packet_bufsize;
  1522			int pktlen = status->wake_packet_length;
  1523			const u8 *pktdata = status->wake_packet;
  1524			const struct ieee80211_hdr *hdr = (const void *)pktdata;
  1525			int truncated = pktlen - pktsize;
  1526	
  1527			/* this would be a firmware bug */
  1528			if (WARN_ON_ONCE(truncated < 0))
  1529				truncated = 0;
  1530	
  1531			if (ieee80211_is_data(hdr->frame_control)) {
  1532				int hdrlen = ieee80211_hdrlen(hdr->frame_control);
  1533				int ivlen = 0, icvlen = 4; /* also FCS */
  1534	
  1535				pkt = alloc_skb(pktsize, GFP_KERNEL);
  1536				if (!pkt)
  1537					goto report;
  1538	
  1539				skb_put_data(pkt, pktdata, hdrlen);
  1540				pktdata += hdrlen;
  1541				pktsize -= hdrlen;
  1542	
  1543				if (ieee80211_has_protected(hdr->frame_control)) {
  1544					/*
  1545					 * This is unlocked and using gtk_i(c)vlen,
  1546					 * but since everything is under RTNL still
  1547					 * that's not really a problem - changing
  1548					 * it would be difficult.
  1549					 */
  1550					if (is_multicast_ether_addr(hdr->addr1)) {
  1551						ivlen = mvm->gtk_ivlen;
  1552						icvlen += mvm->gtk_icvlen;
  1553					} else {
  1554						ivlen = mvm->ptk_ivlen;
  1555						icvlen += mvm->ptk_icvlen;
  1556					}
  1557				}
  1558	
  1559				/* if truncated, FCS/ICV is (partially) gone */
  1560				if (truncated >= icvlen) {
  1561					icvlen = 0;
  1562					truncated -= icvlen;
  1563				} else {
  1564					icvlen -= truncated;
  1565					truncated = 0;
  1566				}
  1567	
  1568				pktsize -= ivlen + icvlen;
  1569				pktdata += ivlen;
  1570	
  1571				skb_put_data(pkt, pktdata, pktsize);
  1572	
  1573				if (ieee80211_data_to_8023(pkt, vif->addr, vif->type))
  1574					goto report;
  1575				wakeup.packet = pkt->data;
  1576				wakeup.packet_present_len = pkt->len;
  1577				wakeup.packet_len = pkt->len - truncated;
  1578				wakeup.packet_80211 = false;
  1579			} else {
  1580				int fcslen = 4;
  1581	
  1582				if (truncated >= 4) {
  1583					truncated -= 4;
  1584					fcslen = 0;
  1585				} else {
  1586					fcslen -= truncated;
  1587					truncated = 0;
  1588				}
  1589				pktsize -= fcslen;
  1590				wakeup.packet = status->wake_packet;
  1591				wakeup.packet_present_len = pktsize;
  1592				wakeup.packet_len = pktlen - truncated;
  1593				wakeup.packet_80211 = true;
  1594			}
  1595		}
  1596	
  1597	 report:
  1598		ieee80211_report_wowlan_wakeup(vif, wakeup_report, GFP_KERNEL);
  1599		kfree_skb(pkt);
  1600	}
  1601	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

* Re: [PATCH 09/11] wifi: iwlwifi: iwlmvm: handle unprotected deauth/disassoc in d3
  2024-02-06 16:02 ` [PATCH 09/11] wifi: iwlwifi: iwlmvm: handle unprotected deauth/disassoc in d3 Miri Korenblit
  2024-02-07  3:39   ` kernel test robot
@ 2024-02-07  6:27   ` kernel test robot
  1 sibling, 0 replies; 14+ messages in thread
From: kernel test robot @ 2024-02-07  6:27 UTC (permalink / raw)
  To: Miri Korenblit, johannes
  Cc: llvm, oe-kbuild-all, linux-wireless, Shaul Triebitz

Hi Miri,

kernel test robot noticed the following build errors:

[auto build test ERROR on wireless-next/main]
[also build test ERROR on next-20240206]
[cannot apply to wireless/main linus/master v6.8-rc3]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Miri-Korenblit/wifi-iwlwifi-mvm-fix-a-crash-when-we-run-out-of-stations/20240207-000459
base:   https://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless-next.git main
patch link:    https://lore.kernel.org/r/20240206175739.fde438a22e3f.I3c8497520aaa95a22febff727b0ad08146965d47%40changeid
patch subject: [PATCH 09/11] wifi: iwlwifi: iwlmvm: handle unprotected deauth/disassoc in d3
config: powerpc-randconfig-001-20240207 (https://download.01.org/0day-ci/archive/20240207/202402071449.LObxtopc-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project 7dd790db8b77c4a833c06632e903dc4f13877a64)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240207/202402071449.LObxtopc-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202402071449.LObxtopc-lkp@intel.com/

All errors (new ones prefixed by >>):

>> drivers/net/wireless/intel/iwlwifi/mvm/d3.c:1518:10: error: no member named 'unprot_deauth_disassoc' in 'struct cfg80211_wowlan_wakeup'
    1518 |                 wakeup.unprot_deauth_disassoc = true;
         |                 ~~~~~~ ^
   1 error generated.


vim +1518 drivers/net/wireless/intel/iwlwifi/mvm/d3.c

  1465	
  1466	static void iwl_mvm_report_wakeup_reasons(struct iwl_mvm *mvm,
  1467						  struct ieee80211_vif *vif,
  1468						  struct iwl_wowlan_status_data *status)
  1469	{
  1470		struct sk_buff *pkt = NULL;
  1471		struct cfg80211_wowlan_wakeup wakeup = {
  1472			.pattern_idx = -1,
  1473		};
  1474		struct cfg80211_wowlan_wakeup *wakeup_report = &wakeup;
  1475		u32 reasons = status->wakeup_reasons;
  1476	
  1477		if (reasons == IWL_WOWLAN_WAKEUP_BY_NON_WIRELESS) {
  1478			wakeup_report = NULL;
  1479			goto report;
  1480		}
  1481	
  1482		pm_wakeup_event(mvm->dev, 0);
  1483	
  1484		if (reasons & IWL_WOWLAN_WAKEUP_BY_MAGIC_PACKET)
  1485			wakeup.magic_pkt = true;
  1486	
  1487		if (reasons & IWL_WOWLAN_WAKEUP_BY_PATTERN)
  1488			wakeup.pattern_idx =
  1489				status->pattern_number;
  1490	
  1491		if (reasons & (IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_MISSED_BEACON |
  1492			       IWL_WOWLAN_WAKEUP_BY_DISCONNECTION_ON_DEAUTH |
  1493			       IWL_WOWLAN_WAKEUP_BY_GTK_REKEY_FAILURE))
  1494			wakeup.disconnect = true;
  1495	
  1496		if (reasons & IWL_WOWLAN_WAKEUP_BY_GTK_REKEY_FAILURE)
  1497			wakeup.gtk_rekey_failure = true;
  1498	
  1499		if (reasons & IWL_WOWLAN_WAKEUP_BY_RFKILL_DEASSERTED)
  1500			wakeup.rfkill_release = true;
  1501	
  1502		if (reasons & IWL_WOWLAN_WAKEUP_BY_EAPOL_REQUEST)
  1503			wakeup.eap_identity_req = true;
  1504	
  1505		if (reasons & IWL_WOWLAN_WAKEUP_BY_FOUR_WAY_HANDSHAKE)
  1506			wakeup.four_way_handshake = true;
  1507	
  1508		if (reasons & IWL_WOWLAN_WAKEUP_BY_REM_WAKE_LINK_LOSS)
  1509			wakeup.tcp_connlost = true;
  1510	
  1511		if (reasons & IWL_WOWLAN_WAKEUP_BY_REM_WAKE_SIGNATURE_TABLE)
  1512			wakeup.tcp_nomoretokens = true;
  1513	
  1514		if (reasons & IWL_WOWLAN_WAKEUP_BY_REM_WAKE_WAKEUP_PACKET)
  1515			wakeup.tcp_match = true;
  1516	
  1517		if (reasons & IWL_WAKEUP_BY_11W_UNPROTECTED_DEAUTH_OR_DISASSOC)
> 1518			wakeup.unprot_deauth_disassoc = true;
  1519	
  1520		if (status->wake_packet) {
  1521			int pktsize = status->wake_packet_bufsize;
  1522			int pktlen = status->wake_packet_length;
  1523			const u8 *pktdata = status->wake_packet;
  1524			const struct ieee80211_hdr *hdr = (const void *)pktdata;
  1525			int truncated = pktlen - pktsize;
  1526	
  1527			/* this would be a firmware bug */
  1528			if (WARN_ON_ONCE(truncated < 0))
  1529				truncated = 0;
  1530	
  1531			if (ieee80211_is_data(hdr->frame_control)) {
  1532				int hdrlen = ieee80211_hdrlen(hdr->frame_control);
  1533				int ivlen = 0, icvlen = 4; /* also FCS */
  1534	
  1535				pkt = alloc_skb(pktsize, GFP_KERNEL);
  1536				if (!pkt)
  1537					goto report;
  1538	
  1539				skb_put_data(pkt, pktdata, hdrlen);
  1540				pktdata += hdrlen;
  1541				pktsize -= hdrlen;
  1542	
  1543				if (ieee80211_has_protected(hdr->frame_control)) {
  1544					/*
  1545					 * This is unlocked and using gtk_i(c)vlen,
  1546					 * but since everything is under RTNL still
  1547					 * that's not really a problem - changing
  1548					 * it would be difficult.
  1549					 */
  1550					if (is_multicast_ether_addr(hdr->addr1)) {
  1551						ivlen = mvm->gtk_ivlen;
  1552						icvlen += mvm->gtk_icvlen;
  1553					} else {
  1554						ivlen = mvm->ptk_ivlen;
  1555						icvlen += mvm->ptk_icvlen;
  1556					}
  1557				}
  1558	
  1559				/* if truncated, FCS/ICV is (partially) gone */
  1560				if (truncated >= icvlen) {
  1561					icvlen = 0;
  1562					truncated -= icvlen;
  1563				} else {
  1564					icvlen -= truncated;
  1565					truncated = 0;
  1566				}
  1567	
  1568				pktsize -= ivlen + icvlen;
  1569				pktdata += ivlen;
  1570	
  1571				skb_put_data(pkt, pktdata, pktsize);
  1572	
  1573				if (ieee80211_data_to_8023(pkt, vif->addr, vif->type))
  1574					goto report;
  1575				wakeup.packet = pkt->data;
  1576				wakeup.packet_present_len = pkt->len;
  1577				wakeup.packet_len = pkt->len - truncated;
  1578				wakeup.packet_80211 = false;
  1579			} else {
  1580				int fcslen = 4;
  1581	
  1582				if (truncated >= 4) {
  1583					truncated -= 4;
  1584					fcslen = 0;
  1585				} else {
  1586					fcslen -= truncated;
  1587					truncated = 0;
  1588				}
  1589				pktsize -= fcslen;
  1590				wakeup.packet = status->wake_packet;
  1591				wakeup.packet_present_len = pktsize;
  1592				wakeup.packet_len = pktlen - truncated;
  1593				wakeup.packet_80211 = true;
  1594			}
  1595		}
  1596	
  1597	 report:
  1598		ieee80211_report_wowlan_wakeup(vif, wakeup_report, GFP_KERNEL);
  1599		kfree_skb(pkt);
  1600	}
  1601	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

end of thread, other threads:[~2024-02-07  6:28 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-06 16:02 [PATCH 00/11] wifi: iwlwifi: updates - 2024-02-06 Miri Korenblit
2024-02-06 16:02 ` [PATCH 01/11] wifi: iwlwifi: mvm: fix a crash when we run out of stations Miri Korenblit
2024-02-06 16:02 ` [PATCH 02/11] wifi: iwlwifi: fw: allow vmalloc for PNVM image Miri Korenblit
2024-02-06 16:02 ` [PATCH 03/11] wifi: iwlwifi: mvm: don't set the MFP flag for the GTK Miri Korenblit
2024-02-06 16:02 ` [PATCH 04/11] wifi: iwlwifi: mvm: don't send the smart fifo command if not needed Miri Korenblit
2024-02-06 16:02 ` [PATCH 05/11] wifi: iwlwifi: pcie: Add new PCI device id and CNVI Miri Korenblit
2024-02-06 16:02 ` [PATCH 06/11] wifi: iwlwifi: mvm: don't set replay counters to 0xff Miri Korenblit
2024-02-06 16:02 ` [PATCH 07/11] wifi: iwlwifi: mvm: remove flags for enable/disable beacon filter Miri Korenblit
2024-02-06 16:02 ` [PATCH 08/11] wifi: iwlwifi: mvm: show skb_mac_gso_segment() failure reason Miri Korenblit
2024-02-06 16:02 ` [PATCH 09/11] wifi: iwlwifi: iwlmvm: handle unprotected deauth/disassoc in d3 Miri Korenblit
2024-02-07  3:39   ` kernel test robot
2024-02-07  6:27   ` kernel test robot
2024-02-06 16:02 ` [PATCH 10/11] wifi: iwlwifi: mvm: move BA notif messages before action Miri Korenblit
2024-02-06 16:02 ` [PATCH 11/11] wifi: iwlwifi: queue: improve warning for no skb in reclaim Miri Korenblit

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).