* Re: [PATCH] wifi: brcmfmac: cyw: clean up PMKID and cookie code
From: Bogdan Nicolae @ 2026-07-14 15:13 UTC (permalink / raw)
To: Gokul Sivakumar
Cc: Arend van Spriel, linux-wireless, brcm80211,
brcm80211-dev-list.pdl, linux-kernel, Bogdan Nicolae,
wlan-kernel-dev-list
In-Reply-To: <cnztilpxknxuyofx2pfdqissbhqtopwoygzr73ux2qmyasqebv@iesg7d6rvxsw>
On Tue, Jul 14, 2026 at 8:03 AM Gokul Sivakumar
<gokulkumar.sivakumar@infineon.com> wrote:
>
> On 07/14, Bogdan Nicolae wrote:
> > Hi Arend,
> >
> > The code already sets *cookie=0 in the beginning, which according to
> > my understanding tells the driver it does not require async tracking
> > upstream. This is correct, because the function calls
> > wait_for_completion_timeout, so mgmt tx completes by the time we exit
> > the function and doesn't need to be tracked upstream. However, while
> > we are waiting for mgmt tx to finish, the firmware may generate
> > non-matching completion events captured by notify_mgmt_tx_status.
> > That's why setting a non-zero packed_id (sent to and returned by
> > firmware as part of a completion event) and checking against
> > vif->mgmt_tx_id is important.
>
> Avoid top-posting. Need to use interleaved style.
> https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
>
> > Cheers,
> > Bogdan
> >
> > On Sun, Jul 12, 2026 at 5:30 PM Arend van Spriel
> > <arend.vanspriel@broadcom.com> wrote:
> > >
> > > On 09/07/2026 14:23, Bogdan Nicolae wrote:
> > > > Avoid setting packet_id to cookie, which is always 0. Instead, use an
> > > > increasing atomic counter. Avoids mismatches of completion events later
> > > > in brcmf_notify_mgmt_tx_status, where packet_id != vif->mgmt_tx_id is
> > > > checked.
> > > >
> > > > Also, zero out auth_status on initialization. Otherwise, garbage will
> > > > leak from the stack to the firmware (when bssid is less than 32 bytes
>
> BSSID will always be less than 32, you must have meant to say "ssid" here
> instead of "bssid". Also the auth_req_status struct does not have any "bssid"
> member, it only has an "ssid" struct member. Need to fix in commit message.
Fixed
> > > > and/or when params->pmkid is set). Then, pass the params->pmkid to the
> > > > firmware (without it, the firmware caches a garbage PMKID on successful
> > > > authentication and denies a subsequent association request that includes
> > > > the PMKID).
> > > >
> > > > Signed-off-by: Bogdan Nicolae <bogdan.nicolae@acm.org>
> > >
> > > I always get a bit confused when people use different email addresses to
> > > send and sign-off patches.
> > > > ---
> > > > .../net/wireless/broadcom/brcm80211/brcmfmac/cyw/core.c | 8 ++++++--
> > > > 1 file changed, 6 insertions(+), 2 deletions(-)
> > > >
> > > > diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/core.c
> > > > index ce09d44fa..cca53ff19 100644
> > > > --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/core.c
> > > > +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/core.c
> > > > @@ -23,6 +23,8 @@
> > > > #define MGMT_AUTH_FRAME_DWELL_TIME 4000
> > > > #define MGMT_AUTH_FRAME_WAIT_TIME (MGMT_AUTH_FRAME_DWELL_TIME + 100)
> > > >
> > > > +static atomic_t brcmf_cyw_mgmt_tx_id = ATOMIC_INIT(0);
> > > > +
> > > > static int brcmf_cyw_set_sae_pwd(struct brcmf_if *ifp,
> > > > struct cfg80211_crypto_settings *crypto)
> > > > {
> > > > @@ -155,7 +157,7 @@ int brcmf_cyw_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
> > > >
> > > > memcpy(&mf_params->da[0], &mgmt->da[0], ETH_ALEN);
> > > > memcpy(&mf_params->bssid[0], &mgmt->bssid[0], ETH_ALEN);
> > > > - mf_params->packet_id = cpu_to_le32(*cookie);
> > > > + mf_params->packet_id = cpu_to_le32(atomic_inc_return(&brcmf_cyw_mgmt_tx_id));
> > >
> > > As I understand things the cookie value here is an output parameter. The
> > > driver should assign it:
> > >
> > > + *cookie = atomic_inc_return(&brcmf_cyw_mgmt_tx_id);
> > > mf_params->packet_id = cpu_to_le32(*cookie);
>
> Agree with Arend's suggestion here. It is not correct to leave *cookie = 0 as it
> is and only assign a different packet_id while sending requst to firmware, because
> in that case the driver will not return the real cookie for this TX to cfg80211.
> Driver should assign the generated ID to *cookie and then copy that into packet_id.
Fixed
>
>
> Gokul
>
> > > > memcpy(mf_params->data, &buf[DOT11_MGMT_HDR_LEN],
> > > > le16_to_cpu(mf_params->len));
> > > >
> > > Regards,
> > > Arend
Regards,
Bogdan
^ permalink raw reply
* (no subject)
From: nurofen55 @ 2026-07-14 15:08 UTC (permalink / raw)
To: pkshih; +Cc: linux-wireless
Hi Ping-Ke,
Thank you for the quick and insightful analysis!
Here are the results from your suggestions:
1. Firmware Check:
You were absolutely right. I ran `dmesg | grep -i rtw89` on the 7.1.x kernel, and it confirmed that it is indeed loading the new v2 firmware:
rtw89_8852be 0000:02:00.0: loaded firmware rtw89/rtw8852b_fw-2.bin
Firmware version 0.29.29.18 (9e3d777f)
2. Power Save Test:
I identified my interface as wlp2s0 and completely disabled power saving:
sudo iw dev wlp2s0 set power_save off
Unfortunately, this did not improve the 2.4GHz stability; the intermittent packet loss and high latency spikes still persist under the same conditions.
3. Testing Nearby the AP:
Moving the laptop closer to the router (stronger signal) slightly mitigates the frequency of the drops, but the latency spikes still occur randomly on 2.4GHz, whereas 5GHz remains flawlessly stable.
Since I am on openSUSE Tumbleweed (a rolling release distribution) and use it for my daily hospital workflow, compiling a custom kernel to manually apply patch 63ccdfac8677 is quite problematic for me at the moment.
Given that commit 63ccdfac8677 fixes the exact AMPDU drop logic bug introduced in 7.0, it sounds like the perfect candidate to resolve this. Could you please queue this fix for inclusion into the upstream 7.1.x stable kernel tree? Once it is merged there, the openSUSE maintainers will pull it automatically, and I will gladly test the updated repository kernel to confirm the fix!
Best regards,
Svyatoslav
^ permalink raw reply
* [PATCH] wifi: brcmfmac: cyw: clean up PMKID and cookie code
From: bogdan.nicolae @ 2026-07-14 15:04 UTC (permalink / raw)
To: Arend van Spriel
Cc: linux-wireless, brcm80211, brcm80211-dev-list.pdl, linux-kernel,
Bogdan Nicolae
From: Bogdan Nicolae <bogdan.nicolae@acm.org>
Avoid setting packet_id to cookie, which is always 0. Instead, use an
increasing atomic counter. Avoids mismatches of completion events later
in brcmf_notify_mgmt_tx_status, where packet_id != vif->mgmt_tx_id is
checked.
Also, zero out auth_status on initialization. Otherwise, garbage will
leak from the stack to the firmware (when ssid is less than 32 bytes
and/or when params->pmkid is set). Then, pass the params->pmkid to the
firmware (without it, the firmware caches a garbage PMKID on successful
authentication and denies a subsequent association request that includes
the PMKID).
Signed-off-by: Bogdan Nicolae <bogdan.nicolae@acm.org>
---
.../net/wireless/broadcom/brcm80211/brcmfmac/cyw/core.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/core.c
index ce09d44fa..99f8c5bef 100644
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/core.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/core.c
@@ -23,6 +23,8 @@
#define MGMT_AUTH_FRAME_DWELL_TIME 4000
#define MGMT_AUTH_FRAME_WAIT_TIME (MGMT_AUTH_FRAME_DWELL_TIME + 100)
+static atomic_t brcmf_cyw_mgmt_tx_id = ATOMIC_INIT(0);
+
static int brcmf_cyw_set_sae_pwd(struct brcmf_if *ifp,
struct cfg80211_crypto_settings *crypto)
{
@@ -123,7 +125,7 @@ int brcmf_cyw_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
if (!ieee80211_is_auth(mgmt->frame_control))
return brcmf_cfg80211_mgmt_tx(wiphy, wdev, params, cookie);
- *cookie = 0;
+ *cookie = atomic_inc_return(&brcmf_cyw_mgmt_tx_id);
vif = container_of(wdev, struct brcmf_cfg80211_vif, wdev);
reinit_completion(&vif->mgmt_tx);
@@ -200,7 +202,7 @@ brcmf_cyw_external_auth(struct wiphy *wiphy, struct net_device *dev,
{
struct brcmf_if *ifp;
struct brcmf_pub *drvr;
- struct brcmf_auth_req_status_le auth_status;
+ struct brcmf_auth_req_status_le auth_status = {};
int ret = 0;
brcmf_dbg(TRACE, "Enter\n");
@@ -208,6 +210,8 @@ brcmf_cyw_external_auth(struct wiphy *wiphy, struct net_device *dev,
ifp = netdev_priv(dev);
drvr = ifp->drvr;
if (params->status == WLAN_STATUS_SUCCESS) {
+ if (params->pmkid)
+ memcpy(auth_status.pmkid, params->pmkid, WLAN_PMKID_LEN);
auth_status.flags = cpu_to_le16(BRCMF_EXTAUTH_SUCCESS);
} else {
bphy_err(drvr, "External authentication failed: status=%d\n",
--
2.55.0
^ permalink raw reply related
* [PATCH v2 iwlwifi-next 15/15] wifi: iwlwifi: mld: reset the driver state upon firmware recovery
From: Miri Korenblit @ 2026-07-14 14:02 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Emmanuel Grumbach
In-Reply-To: <20260714140218.2887000-1-miriam.rachel.korenblit@intel.com>
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Just like we did in iwlmvm, we also need to clear the mld state when the
firmware was killed because of the device being powered off during
suspend.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
drivers/net/wireless/intel/iwlwifi/mld/mac80211.c | 3 +--
drivers/net/wireless/intel/iwlwifi/mld/mac80211.h | 2 ++
drivers/net/wireless/intel/iwlwifi/mld/mld.c | 1 +
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/mld/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mld/mac80211.c
index 17286b3341c0..4065d8e4fa8c 100644
--- a/drivers/net/wireless/intel/iwlwifi/mld/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mld/mac80211.c
@@ -543,8 +543,7 @@ iwl_mld_mac80211_tx(struct ieee80211_hw *hw,
iwl_mld_tx_skb(mld, skb, NULL);
}
-static void
-iwl_mld_restart_cleanup(struct iwl_mld *mld)
+void iwl_mld_restart_cleanup(struct iwl_mld *mld)
{
iwl_cleanup_mld(mld);
diff --git a/drivers/net/wireless/intel/iwlwifi/mld/mac80211.h b/drivers/net/wireless/intel/iwlwifi/mld/mac80211.h
index aad04d7b2617..f3302997b28f 100644
--- a/drivers/net/wireless/intel/iwlwifi/mld/mac80211.h
+++ b/drivers/net/wireless/intel/iwlwifi/mld/mac80211.h
@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/*
* Copyright (C) 2024 Intel Corporation
+ * Copyright (C) 2026 Intel Corporation
*/
#ifndef __iwl_mld_mac80211_h__
#define __iwl_mld_mac80211_h__
@@ -9,5 +10,6 @@
int iwl_mld_register_hw(struct iwl_mld *mld);
void iwl_mld_recalc_multicast_filter(struct iwl_mld *mld);
+void iwl_mld_restart_cleanup(struct iwl_mld *mld);
#endif /* __iwl_mld_mac80211_h__ */
diff --git a/drivers/net/wireless/intel/iwlwifi/mld/mld.c b/drivers/net/wireless/intel/iwlwifi/mld/mld.c
index 99506f354bfa..093bdc130704 100644
--- a/drivers/net/wireless/intel/iwlwifi/mld/mld.c
+++ b/drivers/net/wireless/intel/iwlwifi/mld/mld.c
@@ -748,6 +748,7 @@ static void iwl_mld_device_powered_off(struct iwl_op_mode *op_mode)
wiphy_lock(mld->wiphy);
iwl_mld_stop_fw(mld);
+ iwl_mld_restart_cleanup(mld);
mld->fw_status.in_d3 = false;
wiphy_unlock(mld->wiphy);
}
--
2.34.1
^ permalink raw reply related
* [PATCH v2 iwlwifi-next 12/15] wifi: iwlwifi: regulatory: add LARI_CONFIG_CHANGE command v14 support
From: Miri Korenblit @ 2026-07-14 14:02 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Pagadala Yesu Anjaneyulu
In-Reply-To: <20260714140218.2887000-1-miriam.rachel.korenblit@intel.com>
From: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Add support for LARI_CONFIG_CHANGE version 14 and populate
the newly added BIOS-related fields in the command payload.
Extend the version 14 command layout with UHB extension, puncturing and
WBEM metadata fields, update command-size handling for version negotiation,
and wire the new data into the LARI configuration flow. Track WBEM and
puncturing source/revision in fw runtime, set them when loading ACPI or
UEFI tables, and pass the headers to firmware. Update send conditions,
debug traces, and related documentation/comments to match the new format.
Signed-off-by: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 4 +-
.../wireless/intel/iwlwifi/fw/api/nvm-reg.h | 15 ++++-
.../net/wireless/intel/iwlwifi/fw/runtime.h | 13 +++-
drivers/net/wireless/intel/iwlwifi/fw/uefi.c | 20 ++++---
drivers/net/wireless/intel/iwlwifi/fw/uefi.h | 4 +-
drivers/net/wireless/intel/iwlwifi/mld/mcc.c | 2 +-
drivers/net/wireless/intel/iwlwifi/mld/mld.c | 2 +-
drivers/net/wireless/intel/iwlwifi/mld/mld.h | 2 -
.../wireless/intel/iwlwifi/mld/regulatory.c | 60 ++++++++++++++-----
9 files changed, 88 insertions(+), 34 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
index bf0f851a9075..9f2f4a6af1ca 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/*
* Copyright (C) 2017 Intel Deutschland GmbH
- * Copyright (C) 2019-2025 Intel Corporation
+ * Copyright (C) 2019-2026 Intel Corporation
*/
#include <linux/uuid.h>
#include "iwl-drv.h"
@@ -1188,6 +1188,8 @@ int iwl_acpi_get_wbem(struct iwl_fw_runtime *fwrt, u32 *value)
*value = wifi_pkg->package.elements[1].integer.value &
IWL_ACPI_WBEM_REV0_MASK;
+ fwrt->wbem_source = BIOS_SOURCE_ACPI;
+ fwrt->wbem_revision = tbl_rev;
IWL_DEBUG_RADIO(fwrt, "Loaded WBEM config from ACPI\n");
ret = 0;
out_free:
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h b/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h
index 443a9a416325..d8ec9934a9b6 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/*
- * Copyright (C) 2012-2014, 2018-2025 Intel Corporation
+ * Copyright (C) 2012-2014, 2018-2026 Intel Corporation
* Copyright (C) 2013-2015 Intel Mobile Communications GmbH
* Copyright (C) 2016-2017 Intel Deutschland GmbH
*/
@@ -662,6 +662,12 @@ struct iwl_lari_config_change_cmd_v8 {
* get the data from the BIOS.
* @oem_unii9_enable: UNII-9 enablement as read from the BIOS
* @bios_hdr: bios config header
+ * @oem_uhb_allow_extension_bitmap: DSM Function 4 data as an extension of UHB
+ * enabled MCC sets
+ * @bios_wcpe_hdr: puncturing config header
+ * @wcpe_bitmap: bitmap of puncturing enablement per MCC
+ * @bios_wbem_hdr: 320 MHz per-MCC WBEM config header
+ * @reserved: reserved
*/
struct iwl_lari_config_change_cmd {
__le32 config_bitmap;
@@ -679,9 +685,16 @@ struct iwl_lari_config_change_cmd {
__le32 oem_unii9_enable;
/* since version 13 */
struct iwl_bios_config_hdr bios_hdr;
+ /* All the below are since version 14 */
+ __le32 oem_uhb_allow_extension_bitmap;
+ struct iwl_bios_config_hdr bios_wcpe_hdr;
+ __le32 wcpe_bitmap;
+ struct iwl_bios_config_hdr bios_wbem_hdr;
+ __le32 reserved[10];
} __packed;
/* LARI_CHANGE_CONF_CMD_S_VER_12
* LARI_CHANGE_CONF_CMD_S_VER_13
+ * LARI_CHANGE_CONF_CMD_S_VER_14
*/
/* Activate UNII-1 (5.2GHz) for World Wide */
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/runtime.h b/drivers/net/wireless/intel/iwlwifi/fw/runtime.h
index d80ae610e56c..ac01ac0092ee 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/runtime.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/runtime.h
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/*
* Copyright (C) 2017 Intel Deutschland GmbH
- * Copyright (C) 2018-2025 Intel Corporation
+ * Copyright (C) 2018-2026 Intel Corporation
*/
#ifndef __iwl_fw_runtime_h__
#define __iwl_fw_runtime_h__
@@ -144,6 +144,11 @@ struct iwl_txf_iter_data {
* @tpc_enabled: TPC enabled
* @dsm_source: one of &enum bios_source. UEFI, ACPI or NONE
* @dsm_revision: the revision of the DSM table
+ * @wbem_source: one of &enum bios_source for the WBEM table
+ * @wbem_revision: the revision of the WBEM table
+ * @puncturing_source: one of &enum bios_source for the puncturing table
+ * @puncturing_revision: the revision of the puncturing table
+ * @bios_puncturing: per-country puncturing enablement bitmap from BIOS
*/
struct iwl_fw_runtime {
struct iwl_trans *trans;
@@ -226,6 +231,12 @@ struct iwl_fw_runtime {
u32 dsm_funcs_valid;
u32 dsm_values[DSM_FUNC_NUM_FUNCS];
#endif
+
+ enum bios_source wbem_source;
+ u8 wbem_revision;
+ enum bios_source puncturing_source;
+ u8 puncturing_revision;
+ u32 bios_puncturing;
};
void iwl_fw_runtime_init(struct iwl_fw_runtime *fwrt, struct iwl_trans *trans,
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/uefi.c b/drivers/net/wireless/intel/iwlwifi/fw/uefi.c
index 2ef0a7a920ad..1046d4fecb72 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/uefi.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/uefi.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/*
- * Copyright(c) 2021-2025 Intel Corporation
+ * Copyright(c) 2021-2026 Intel Corporation
*/
#include "iwl-drv.h"
@@ -884,6 +884,8 @@ int iwl_uefi_get_wbem(struct iwl_fw_runtime *fwrt, u32 *value)
goto out;
}
*value = data->wbem_320mhz_per_mcc & IWL_UEFI_WBEM_REV0_MASK;
+ fwrt->wbem_source = BIOS_SOURCE_UEFI;
+ fwrt->wbem_revision = data->revision;
IWL_DEBUG_RADIO(fwrt, "Loaded WBEM config from UEFI\n");
out:
kfree(data);
@@ -970,29 +972,29 @@ int iwl_uefi_get_dsm(struct iwl_fw_runtime *fwrt, enum iwl_dsm_funcs func,
int iwl_uefi_get_puncturing(struct iwl_fw_runtime *fwrt)
{
struct uefi_cnv_var_puncturing_data *data;
- /* default value is not enabled if there is any issue in reading
- * uefi variable or revision is not supported
- */
- int puncturing = 0;
+ int ret = 0;
data = iwl_uefi_get_verified_variable(fwrt->trans,
IWL_UEFI_PUNCTURING_NAME,
"UefiCnvWlanPuncturing",
sizeof(*data), NULL);
if (IS_ERR(data))
- return puncturing;
+ return -EINVAL;
if (data->revision != IWL_UEFI_PUNCTURING_REVISION) {
IWL_DEBUG_RADIO(fwrt, "Unsupported UEFI PUNCTURING rev:%d\n",
data->revision);
+ ret = -EINVAL;
} else {
- puncturing = data->puncturing & IWL_UEFI_PUNCTURING_REV0_MASK;
+ fwrt->puncturing_source = BIOS_SOURCE_UEFI;
+ fwrt->puncturing_revision = data->revision;
+ fwrt->bios_puncturing = data->puncturing;
IWL_DEBUG_RADIO(fwrt, "Loaded puncturing bits from UEFI: %d\n",
- puncturing);
+ fwrt->bios_puncturing);
}
kfree(data);
- return puncturing;
+ return ret;
}
IWL_EXPORT_SYMBOL(iwl_uefi_get_puncturing);
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/uefi.h b/drivers/net/wireless/intel/iwlwifi/fw/uefi.h
index 474f06db4d43..386ca3744408 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/uefi.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/uefi.h
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/*
- * Copyright(c) 2021-2025 Intel Corporation
+ * Copyright(c) 2021-2026 Intel Corporation
*/
#ifndef __iwl_fw_uefi__
#define __iwl_fw_uefi__
@@ -275,8 +275,6 @@ enum iwl_uefi_cnv_puncturing_flags {
IWL_UEFI_CNV_PUNCTURING_CANADA_EN_MSK = BIT(1),
};
-#define IWL_UEFI_PUNCTURING_REV0_MASK (IWL_UEFI_CNV_PUNCTURING_USA_EN_MSK | \
- IWL_UEFI_CNV_PUNCTURING_CANADA_EN_MSK)
/**
* struct uefi_cnv_var_puncturing_data - controlling channel
* puncturing for few countries.
diff --git a/drivers/net/wireless/intel/iwlwifi/mld/mcc.c b/drivers/net/wireless/intel/iwlwifi/mld/mcc.c
index 8502129abe49..7649ae794dfd 100644
--- a/drivers/net/wireless/intel/iwlwifi/mld/mcc.c
+++ b/drivers/net/wireless/intel/iwlwifi/mld/mcc.c
@@ -131,7 +131,7 @@ iwl_mld_get_regdomain(struct iwl_mld *mld,
/* FM follows BIOS/MCC policy, WH disallows puncturing only in US/CA. */
if (CSR_HW_RFID_TYPE(mld->trans->info.hw_rf_id) == IWL_CFG_RF_TYPE_FM) {
- if (!iwl_puncturing_is_allowed_in_bios(mld->bios_enable_puncturing,
+ if (!iwl_puncturing_is_allowed_in_bios(mld->fwrt.bios_puncturing,
le16_to_cpu(resp->mcc)))
ieee80211_hw_set(mld->hw, DISALLOW_PUNCTURING);
else
diff --git a/drivers/net/wireless/intel/iwlwifi/mld/mld.c b/drivers/net/wireless/intel/iwlwifi/mld/mld.c
index 5a6c9ab20fd6..99506f354bfa 100644
--- a/drivers/net/wireless/intel/iwlwifi/mld/mld.c
+++ b/drivers/net/wireless/intel/iwlwifi/mld/mld.c
@@ -419,7 +419,7 @@ iwl_op_mode_mld_start(struct iwl_trans *trans, const struct iwl_rf_cfg *cfg,
iwl_mld_get_bios_tables(mld);
iwl_uefi_get_sgom_table(trans, &mld->fwrt);
- mld->bios_enable_puncturing = iwl_uefi_get_puncturing(&mld->fwrt);
+ iwl_uefi_get_puncturing(&mld->fwrt);
iwl_mld_hw_set_regulatory(mld);
diff --git a/drivers/net/wireless/intel/iwlwifi/mld/mld.h b/drivers/net/wireless/intel/iwlwifi/mld/mld.h
index 922aa3dbff54..37f41b504b54 100644
--- a/drivers/net/wireless/intel/iwlwifi/mld/mld.h
+++ b/drivers/net/wireless/intel/iwlwifi/mld/mld.h
@@ -172,7 +172,6 @@
* @debug_max_sleep: maximum sleep time in D3 (for debug purposes)
* @led: the led device
* @mcc_src: the source id of the MCC, comes from the firmware
- * @bios_enable_puncturing: is puncturing enabled by bios
* @fw_id_to_ba: maps a fw (BA) id to a corresponding Block Ack session data.
* @num_rx_ba_sessions: tracks the number of active Rx Block Ack (BA) sessions.
* the driver ensures that new BA sessions are blocked once the maximum
@@ -279,7 +278,6 @@ struct iwl_mld {
struct led_classdev led;
#endif
enum iwl_mcc_source mcc_src;
- bool bios_enable_puncturing;
struct iwl_mld_baid_data __rcu *fw_id_to_ba[IWL_MAX_BAID];
u8 num_rx_ba_sessions;
diff --git a/drivers/net/wireless/intel/iwlwifi/mld/regulatory.c b/drivers/net/wireless/intel/iwlwifi/mld/regulatory.c
index 858635607f5d..4a93ccbef495 100644
--- a/drivers/net/wireless/intel/iwlwifi/mld/regulatory.c
+++ b/drivers/net/wireless/intel/iwlwifi/mld/regulatory.c
@@ -13,6 +13,23 @@
#include "mld.h"
#include "hcmd.h"
+static ssize_t iwl_mld_get_lari_config_cmd_size(u8 cmd_ver)
+{
+ switch (cmd_ver) {
+ case 14:
+ return sizeof(struct iwl_lari_config_change_cmd);
+ case 13:
+ return offsetof(struct iwl_lari_config_change_cmd,
+ oem_uhb_allow_extension_bitmap);
+ case 12:
+ return offsetof(struct iwl_lari_config_change_cmd,
+ oem_11bn_allow_bitmap);
+ default:
+ WARN(true, "unsupported version: %d", cmd_ver);
+ return -EINVAL;
+ }
+}
+
void iwl_mld_get_bios_tables(struct iwl_mld *mld)
{
int ret;
@@ -335,9 +352,13 @@ void iwl_mld_configure_lari(struct iwl_mld *mld)
bool has_raw_dsm_capa = cmd_ver >= 13 ||
fw_has_capa(&fwrt->fw->ucode_capa,
IWL_UCODE_TLV_CAPA_FW_ACCEPTS_RAW_DSM_TABLE);
+ ssize_t cmd_len = iwl_mld_get_lari_config_cmd_size(cmd_ver);
int ret;
u32 value;
+ if (cmd_len < 0)
+ return;
+
ret = iwl_bios_get_dsm(fwrt, DSM_FUNC_11AX_ENABLEMENT, &value);
if (!ret) {
if (!has_raw_dsm_capa)
@@ -379,8 +400,11 @@ void iwl_mld_configure_lari(struct iwl_mld *mld)
}
ret = iwl_bios_get_wbem(fwrt, &value);
- if (!ret)
+ if (!ret) {
cmd.oem_320mhz_allow_bitmap = cpu_to_le32(value);
+ cmd.bios_wbem_hdr.table_source = fwrt->wbem_source;
+ cmd.bios_wbem_hdr.table_revision = fwrt->wbem_revision;
+ }
ret = iwl_bios_get_dsm(fwrt, DSM_FUNC_ENABLE_11BE, &value);
if (!ret)
@@ -394,8 +418,17 @@ void iwl_mld_configure_lari(struct iwl_mld *mld)
if (!ret)
cmd.oem_unii9_enable = cpu_to_le32(value);
+ ret = iwl_bios_get_dsm(fwrt, DSM_FUNC_REGULATORY_CONFIG, &value);
+ if (!ret)
+ cmd.oem_uhb_allow_extension_bitmap = cpu_to_le32(value);
+
+ cmd.bios_wcpe_hdr.table_source = fwrt->puncturing_source;
+ cmd.bios_wcpe_hdr.table_revision = fwrt->puncturing_revision;
+ cmd.wcpe_bitmap = cpu_to_le32(fwrt->bios_puncturing);
+
if (!cmd.config_bitmap &&
!cmd.oem_uhb_allow_bitmap &&
+ !cmd.oem_uhb_allow_extension_bitmap &&
!cmd.oem_11ax_allow_bitmap &&
!cmd.oem_unii4_allow_bitmap &&
!cmd.chan_state_active_bitmap &&
@@ -404,7 +437,8 @@ void iwl_mld_configure_lari(struct iwl_mld *mld)
!cmd.oem_320mhz_allow_bitmap &&
!cmd.oem_11be_allow_bitmap &&
!cmd.oem_11bn_allow_bitmap &&
- !cmd.oem_unii9_enable)
+ !cmd.oem_unii9_enable &&
+ !cmd.wcpe_bitmap)
return;
cmd.bios_hdr.table_source = fwrt->dsm_source;
@@ -422,6 +456,9 @@ void iwl_mld_configure_lari(struct iwl_mld *mld)
"sending LARI_CONFIG_CHANGE, oem_uhb_allow_bitmap=0x%x, force_disable_channels_bitmap=0x%x\n",
le32_to_cpu(cmd.oem_uhb_allow_bitmap),
le32_to_cpu(cmd.force_disable_channels_bitmap));
+ IWL_DEBUG_RADIO(mld,
+ "sending LARI_CONFIG_CHANGE, oem_uhb_allow_extension_bitmap=0x%x\n",
+ le32_to_cpu(cmd.oem_uhb_allow_extension_bitmap));
IWL_DEBUG_RADIO(mld,
"sending LARI_CONFIG_CHANGE, edt_bitmap=0x%x, oem_320mhz_allow_bitmap=0x%x\n",
le32_to_cpu(cmd.edt_bitmap),
@@ -435,20 +472,13 @@ void iwl_mld_configure_lari(struct iwl_mld *mld)
IWL_DEBUG_RADIO(mld,
"sending LARI_CONFIG_CHANGE, oem_unii9_enable=0x%x\n",
le32_to_cpu(cmd.oem_unii9_enable));
+ IWL_DEBUG_RADIO(mld,
+ "sending LARI_CONFIG_CHANGE, wcpe_bitmap=0x%x\n",
+ le32_to_cpu(cmd.wcpe_bitmap));
- if (cmd_ver == 12) {
- int cmd_size = offsetof(typeof(cmd), oem_11bn_allow_bitmap);
-
- ret = iwl_mld_send_cmd_pdu(mld,
- WIDE_ID(REGULATORY_AND_NVM_GROUP,
- LARI_CONFIG_CHANGE),
- &cmd, cmd_size);
- } else {
- ret = iwl_mld_send_cmd_pdu(mld,
- WIDE_ID(REGULATORY_AND_NVM_GROUP,
- LARI_CONFIG_CHANGE),
- &cmd);
- }
+ ret = iwl_mld_send_cmd_pdu(mld,
+ WIDE_ID(REGULATORY_AND_NVM_GROUP,
+ LARI_CONFIG_CHANGE), &cmd, cmd_len);
if (ret)
IWL_DEBUG_RADIO(mld,
"Failed to send LARI_CONFIG_CHANGE (%d)\n",
--
2.34.1
^ permalink raw reply related
* [PATCH v2 iwlwifi-next 14/15] wifi: iwlwifi: mvm: cleanup the driver state after device_powered_off
From: Miri Korenblit @ 2026-07-14 14:02 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Emmanuel Grumbach
In-Reply-To: <20260714140218.2887000-1-miriam.rachel.korenblit@intel.com>
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
If the device was powered off during suspend, we need to reload the
firmware in resume which also means that we need to reconfigure it.
It could be tempting to just set IWL_MVM_STATUS_HW_RESTART_REQUESTED
but that would leave IWL_MVM_STATUS_IN_HW_RESTART set forever since that
recovery is not managed by mac80211.
Just call iwl_mvm_restart_cleanup() from device_powered_off().
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 | 2 +-
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 1 +
drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index 74bd4038fd56..fd2a50563ab5 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -1129,7 +1129,7 @@ static void iwl_mvm_cleanup_iterator(void *data, u8 *mac,
RCU_INIT_POINTER(mvmvif->deflink.probe_resp_data, NULL);
}
-static void iwl_mvm_restart_cleanup(struct iwl_mvm *mvm)
+void iwl_mvm_restart_cleanup(struct iwl_mvm *mvm)
{
iwl_mvm_stop_device(mvm);
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index 979b39314981..d6bed2c08606 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -1660,6 +1660,7 @@ void iwl_mvm_hwrate_to_tx_rate(u32 rate_n_flags,
u8 iwl_mvm_rate_idx_to_fw_idx(const struct iwl_fw *fw, int rate_idx);
u8 iwl_mvm_mac80211_ac_to_ucode_ac(enum ieee80211_ac_numbers ac);
bool iwl_mvm_is_nic_ack_enabled(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
+void iwl_mvm_restart_cleanup(struct iwl_mvm *mvm);
static inline void iwl_mvm_dump_nic_error_log(struct iwl_mvm *mvm)
{
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
index 09150feb330d..6ae9f87d5221 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
@@ -2091,7 +2091,7 @@ static void iwl_op_mode_mvm_device_powered_off(struct iwl_op_mode *op_mode)
mutex_lock(&mvm->mutex);
clear_bit(IWL_MVM_STATUS_IN_D3, &mvm->status);
- iwl_mvm_stop_device(mvm);
+ iwl_mvm_restart_cleanup(mvm);
mvm->fast_resume = false;
mutex_unlock(&mvm->mutex);
}
--
2.34.1
^ permalink raw reply related
* [PATCH v2 iwlwifi-next 13/15] wifi: iwlwifi: mvm: reset the smart fifo state upon FW stop
From: Miri Korenblit @ 2026-07-14 14:02 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Emmanuel Grumbach
In-Reply-To: <20260714140218.2887000-1-miriam.rachel.korenblit@intel.com>
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
The smart fifo is a feature in the firmware configured by the driver.
The driver keeps a state to remember what was the last configuration
sent to the firmware. Obviously, if the firmware stops, we need to
reconfigure the smart fifo. Since we didn't reset that state upon
firmware stop, we thought the firmware is already properly
configured and we didn't send the smart fifo configuration command
as part of the init sequence.
Reset the smart fifo state in iwl_mvm_stop_device() so that we
will properly send the command during the init that will come
later.
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/ops.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
index f43895c2f3c6..09150feb330d 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
@@ -1535,6 +1535,7 @@ void iwl_mvm_stop_device(struct iwl_mvm *mvm)
iwl_fw_cancel_timestamp(&mvm->fwrt);
clear_bit(IWL_MVM_STATUS_FIRMWARE_RUNNING, &mvm->status);
+ mvm->sf_state = SF_UNINIT;
iwl_mvm_pause_tcm(mvm, false);
--
2.34.1
^ permalink raw reply related
* [PATCH v2 iwlwifi-next 10/15] wifi: iwlwifi: pcie: validate txq_id in txq_enable
From: Miri Korenblit @ 2026-07-14 14:02 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Emmanuel Grumbach
In-Reply-To: <20260714140218.2887000-1-miriam.rachel.korenblit@intel.com>
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Avoid indexing txq arrays and queue-used bitmaps with an
invalid queue ID by adding an early bounds check in
iwl_trans_pcie_txq_enable().
Assisted-by: GitHubCopilot:gpt-5.3-codex
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/tx.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/tx.c b/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/tx.c
index fdb3ba4f63c0..dc2fe0c4f68c 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/tx.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/gen1_2/tx.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/*
- * Copyright (C) 2003-2014, 2018-2021, 2023-2025 Intel Corporation
+ * Copyright (C) 2003-2014, 2018-2021, 2023-2026 Intel Corporation
* Copyright (C) 2013-2015 Intel Mobile Communications GmbH
* Copyright (C) 2016-2017 Intel Deutschland GmbH
*/
@@ -1149,10 +1149,17 @@ bool iwl_trans_pcie_txq_enable(struct iwl_trans *trans, int txq_id, u16 ssn,
unsigned int wdg_timeout)
{
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
- struct iwl_txq *txq = trans_pcie->txqs.txq[txq_id];
+ struct iwl_txq *txq;
int fifo = -1;
bool scd_bug = false;
+ if (WARN_ONCE(txq_id < 0 ||
+ txq_id >= trans->mac_cfg->base->num_of_queues,
+ "queue %d out of range", txq_id))
+ return false;
+
+ txq = trans_pcie->txqs.txq[txq_id];
+
if (test_and_set_bit(txq_id, trans_pcie->txqs.queue_used))
WARN_ONCE(1, "queue %d already used - expect issues", txq_id);
--
2.34.1
^ permalink raw reply related
* [PATCH v2 iwlwifi-next 11/15] wifi: iwlwifi: ignore raw-DSM TLV for LARI cmd version 13 and above
From: Miri Korenblit @ 2026-07-14 14:02 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Pagadala Yesu Anjaneyulu, Avinash Bhatt
In-Reply-To: <20260714140218.2887000-1-miriam.rachel.korenblit@intel.com>
From: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
LARI_CONFIG_CHANGE command version 13 and above accepts raw DSM
values by default in firmware, so FW_ACCEPTS_RAW_DSM_TABLE should
not gate DSM bitmap handling for these versions.
Set has_raw_dsm_capa based on command version (version 13 and above
is true) with TLV fallback for older command versions. Also update TLV
kernel-doc to mark this capability obsolete for LARI command
version 13 and above.
Signed-off-by: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Reviewed-by: Avinash Bhatt <avinash.bhatt@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
drivers/net/wireless/intel/iwlwifi/fw/file.h | 5 +++--
.../net/wireless/intel/iwlwifi/mld/regulatory.c | 16 +++++++++++-----
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/file.h b/drivers/net/wireless/intel/iwlwifi/fw/file.h
index a26ed82a8106..664ac25754e9 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/file.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/file.h
@@ -448,8 +448,9 @@ typedef unsigned int __bitwise iwl_ucode_tlv_capa_t;
* @IWL_UCODE_TLV_CAPA_EXT_FSEQ_IMAGE_SUPPORT: external FSEQ image support
* @IWL_UCODE_TLV_CAPA_RESET_DURING_ASSERT: FW reset handshake is needed
* during assert handling even if the dump isn't split
- * @IWL_UCODE_TLV_CAPA_FW_ACCEPTS_RAW_DSM_TABLE: Firmware has capability of
- * handling raw DSM table data.
+ * @IWL_UCODE_TLV_CAPA_FW_ACCEPTS_RAW_DSM_TABLE: Firmware can handle raw DSM
+ * table data. For LARI_CONFIG_CHANGE command version 13 and above, this
+ * capability is obsolete since raw DSM values are accepted by default.
* @IWL_UCODE_TLV_CAPA_NAN_SYNC_SUPPORT: Supports NAN synchronization
*
* @NUM_IWL_UCODE_TLV_CAPA: number of bits used
diff --git a/drivers/net/wireless/intel/iwlwifi/mld/regulatory.c b/drivers/net/wireless/intel/iwlwifi/mld/regulatory.c
index 659243ada86c..858635607f5d 100644
--- a/drivers/net/wireless/intel/iwlwifi/mld/regulatory.c
+++ b/drivers/net/wireless/intel/iwlwifi/mld/regulatory.c
@@ -325,8 +325,16 @@ void iwl_mld_configure_lari(struct iwl_mld *mld)
struct iwl_lari_config_change_cmd cmd = {
.config_bitmap = iwl_mld_get_lari_config_bitmap(fwrt),
};
- bool has_raw_dsm_capa = fw_has_capa(&fwrt->fw->ucode_capa,
- IWL_UCODE_TLV_CAPA_FW_ACCEPTS_RAW_DSM_TABLE);
+ u8 cmd_ver = iwl_fw_lookup_cmd_ver(mld->fw,
+ WIDE_ID(REGULATORY_AND_NVM_GROUP,
+ LARI_CONFIG_CHANGE), 12);
+ /*
+ * For LARI_CONFIG_CHANGE command version 13 and above, firmware accepts
+ * raw DSM values by default and this TLV is no longer needed.
+ */
+ bool has_raw_dsm_capa = cmd_ver >= 13 ||
+ fw_has_capa(&fwrt->fw->ucode_capa,
+ IWL_UCODE_TLV_CAPA_FW_ACCEPTS_RAW_DSM_TABLE);
int ret;
u32 value;
@@ -428,9 +436,7 @@ void iwl_mld_configure_lari(struct iwl_mld *mld)
"sending LARI_CONFIG_CHANGE, oem_unii9_enable=0x%x\n",
le32_to_cpu(cmd.oem_unii9_enable));
- if (iwl_fw_lookup_cmd_ver(mld->fw,
- WIDE_ID(REGULATORY_AND_NVM_GROUP,
- LARI_CONFIG_CHANGE), 12) == 12) {
+ if (cmd_ver == 12) {
int cmd_size = offsetof(typeof(cmd), oem_11bn_allow_bitmap);
ret = iwl_mld_send_cmd_pdu(mld,
--
2.34.1
^ permalink raw reply related
* [PATCH v2 iwlwifi-next 09/15] wifi: iwlwifi: mld: validate D3_END notif size
From: Miri Korenblit @ 2026-07-14 14:02 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Emmanuel Grumbach
In-Reply-To: <20260714140218.2887000-1-miriam.rachel.korenblit@intel.com>
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Check D3_END_NOTIFICATION payload length before reading notif->flags.
On short payloads, mark notif handling as failed.
Avoid out-of-bounds reads from malformed notifications.
Assisted-by: GitHubCopilot:gpt-5.3-codex
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
drivers/net/wireless/intel/iwlwifi/mld/d3.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/mld/d3.c b/drivers/net/wireless/intel/iwlwifi/mld/d3.c
index 458a668ba916..b5fed6090340 100644
--- a/drivers/net/wireless/intel/iwlwifi/mld/d3.c
+++ b/drivers/net/wireless/intel/iwlwifi/mld/d3.c
@@ -1449,8 +1449,16 @@ static bool iwl_mld_handle_d3_notif(struct iwl_notif_wait_data *notif_wait,
}
case WIDE_ID(PROT_OFFLOAD_GROUP, D3_END_NOTIFICATION): {
struct iwl_d3_end_notif *notif = (void *)pkt->data;
+ u32 len = iwl_rx_packet_payload_len(pkt);
+
+ if (IWL_FW_CHECK(mld, len < sizeof(*notif),
+ "Invalid D3_END notification (expected=%zu got=%u)\n",
+ sizeof(*notif), len)) {
+ resume_data->notif_handling_err = true;
+ } else {
+ resume_data->d3_end_flags = le32_to_cpu(notif->flags);
+ }
- resume_data->d3_end_flags = le32_to_cpu(notif->flags);
resume_data->notifs_received |= IWL_D3_NOTIF_D3_END_NOTIF;
break;
}
--
2.34.1
^ permalink raw reply related
* [PATCH v2 iwlwifi-next 08/15] wifi: iwlwifi: mld: cancel wiphy work before freeing wiphy
From: Miri Korenblit @ 2026-07-14 14:02 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Johannes Berg
In-Reply-To: <20260714140218.2887000-1-miriam.rachel.korenblit@intel.com>
When we fail to load the fw during op-mode start, we purge the list
of the async handlers but we don't cancel the work.
Same when we stop the op-mode.
Before freeing wiphy, we need to cancel/flush any pending wiphy work,
otherwise the work will fire with a freed memory.
cfg80211 will do it anyway, but it will warn.
Cancel the work in those cases.
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
drivers/net/wireless/intel/iwlwifi/mld/mld.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/wireless/intel/iwlwifi/mld/mld.c b/drivers/net/wireless/intel/iwlwifi/mld/mld.c
index 78c78cf891cd..5a6c9ab20fd6 100644
--- a/drivers/net/wireless/intel/iwlwifi/mld/mld.c
+++ b/drivers/net/wireless/intel/iwlwifi/mld/mld.c
@@ -446,6 +446,8 @@ iwl_op_mode_mld_start(struct iwl_trans *trans, const struct iwl_rf_cfg *cfg,
}
if (ret) {
+ /* wiphy memory is about to be freed, we should cancel any pending work */
+ wiphy_work_cancel(mld->wiphy, &mld->async_handlers_wk);
wiphy_unlock(mld->wiphy);
rtnl_unlock();
goto err;
@@ -511,6 +513,7 @@ iwl_op_mode_mld_stop(struct iwl_op_mode *op_mode)
iwl_mld_thermal_exit(mld);
wiphy_lock(mld->wiphy);
+ wiphy_work_cancel(mld->wiphy, &mld->async_handlers_wk);
iwl_mld_low_latency_stop(mld);
iwl_mld_deinit_time_sync(mld);
wiphy_unlock(mld->wiphy);
--
2.34.1
^ permalink raw reply related
* [PATCH v2 iwlwifi-next 07/15] wifi: iwlwifi: mvm: validate monitor notif link_id
From: Miri Korenblit @ 2026-07-14 14:02 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Emmanuel Grumbach
In-Reply-To: <20260714140218.2887000-1-miriam.rachel.korenblit@intel.com>
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
MONITOR_NOTIF link_id is firmware-provided. Validate link_id range
with IWL_FW_CHECK before vif lookup. Payload length is already
checked by RX_HANDLER.
Use iwl_mvm_rcu_dereference_vif_id which does all we need which allows
us to drop iwl_mvm_get_vif_by_macid.
Assisted-by: GitHubCopilot:gpt-5.3-codex
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/mvm.h | 1 -
drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 4 +--
.../net/wireless/intel/iwlwifi/mvm/utils.c | 30 -------------------
3 files changed, 2 insertions(+), 33 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index 4420005ef69e..979b39314981 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -2405,7 +2405,6 @@ void iwl_mvm_sync_rx_queues_internal(struct iwl_mvm *mvm,
bool sync,
const void *data, u32 size);
struct ieee80211_vif *iwl_mvm_get_bss_vif(struct iwl_mvm *mvm);
-struct ieee80211_vif *iwl_mvm_get_vif_by_macid(struct iwl_mvm *mvm, u32 macid);
bool iwl_mvm_is_vif_assoc(struct iwl_mvm *mvm);
#define MVM_TCM_PERIOD_MSEC 500
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
index 2297392db955..f43895c2f3c6 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
@@ -155,8 +155,8 @@ static void iwl_mvm_rx_monitor_notif(struct iwl_mvm *mvm,
if (notif->type != cpu_to_le32(IWL_DP_MON_NOTIF_TYPE_EXT_CCA))
return;
- /* FIXME: should fetch the link and not the vif */
- vif = iwl_mvm_get_vif_by_macid(mvm, notif->link_id);
+ /* mac_id = link_id since we don't support MLO */
+ vif = iwl_mvm_rcu_dereference_vif_id(mvm, notif->link_id, false);
if (!vif || vif->type != NL80211_IFTYPE_STATION)
return;
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
index 7eae10982869..2fd4a9961145 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
@@ -689,36 +689,6 @@ struct ieee80211_vif *iwl_mvm_get_bss_vif(struct iwl_mvm *mvm)
return bss_iter_data.vif;
}
-struct iwl_bss_find_iter_data {
- struct ieee80211_vif *vif;
- u32 macid;
-};
-
-static void iwl_mvm_bss_find_iface_iterator(void *_data, u8 *mac,
- struct ieee80211_vif *vif)
-{
- struct iwl_bss_find_iter_data *data = _data;
- struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(vif);
-
- if (mvmvif->id == data->macid)
- data->vif = vif;
-}
-
-struct ieee80211_vif *iwl_mvm_get_vif_by_macid(struct iwl_mvm *mvm, u32 macid)
-{
- struct iwl_bss_find_iter_data data = {
- .macid = macid,
- };
-
- lockdep_assert_held(&mvm->mutex);
-
- ieee80211_iterate_active_interfaces_atomic(
- mvm->hw, IEEE80211_IFACE_ITER_NORMAL,
- iwl_mvm_bss_find_iface_iterator, &data);
-
- return data.vif;
-}
-
struct iwl_sta_iter_data {
bool assoc;
};
--
2.34.1
^ permalink raw reply related
* [PATCH v2 iwlwifi-next 06/15] wifi: iwlwifi: mld: treat valid BAID without STA as a FW error
From: Miri Korenblit @ 2026-07-14 14:02 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Emmanuel Grumbach
In-Reply-To: <20260714140218.2887000-1-miriam.rachel.korenblit@intel.com>
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Somehow, the firmware sometimes seems to have a valid BAID even if the
ieee80211_sta was not found. This happens in sniffer mode.
Treat those as a firmware error.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
drivers/net/wireless/intel/iwlwifi/mld/agg.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/mld/agg.c b/drivers/net/wireless/intel/iwlwifi/mld/agg.c
index e3627ad0321c..1aa30d2e8133 100644
--- a/drivers/net/wireless/intel/iwlwifi/mld/agg.c
+++ b/drivers/net/wireless/intel/iwlwifi/mld/agg.c
@@ -200,11 +200,11 @@ iwl_mld_reorder(struct iwl_mld *mld, struct napi_struct *napi,
struct iwl_mld_baid_data *baid_data;
struct iwl_mld_reorder_buffer *buffer;
struct iwl_mld_reorder_buf_entry *entries;
- struct iwl_mld_sta *mld_sta = iwl_mld_sta_from_mac80211(sta);
struct iwl_mld_link_sta *mld_link_sta;
u32 reorder = le32_to_cpu(desc->reorder_data);
bool amsdu, last_subframe, is_old_sn, is_dup;
u8 tid = ieee80211_get_tid(hdr);
+ struct iwl_mld_sta *mld_sta;
u8 baid;
u16 nssn, sn;
u32 sta_mask = 0;
@@ -223,10 +223,13 @@ iwl_mld_reorder(struct iwl_mld *mld, struct napi_struct *napi,
return IWL_MLD_PASS_SKB;
/* no sta yet */
- if (WARN_ONCE(!sta,
- "Got valid BAID without a valid station assigned\n"))
+ if (IWL_FW_CHECK(mld, !sta,
+ "Got valid BAID without a valid station assigned - %d\n",
+ baid))
return IWL_MLD_PASS_SKB;
+ mld_sta = iwl_mld_sta_from_mac80211(sta);
+
/* not a data packet */
if (!ieee80211_is_data_qos(hdr->frame_control) ||
is_multicast_ether_addr(hdr->addr1))
--
2.34.1
^ permalink raw reply related
* [PATCH v2 iwlwifi-next 05/15] wifi: iwlwifi: mvm: fix the FCS truncation logic in d3
From: Miri Korenblit @ 2026-07-14 14:02 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Emmanuel Grumbach
In-Reply-To: <20260714140218.2887000-1-miriam.rachel.korenblit@intel.com>
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Fix a harmless mistake in the wake packet management code in the d3
wakeup flow. If the FCS is truncated, we want to detect it, but we
cleared the icvlen before updating the truncated variable that holds the
number of bytes having been truncated.
Fix that.
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/d3.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
index 9a74f60c9185..d7ceb385ae0b 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/d3.c
@@ -1539,8 +1539,8 @@ static void iwl_mvm_report_wakeup_reasons(struct iwl_mvm *mvm,
/* if truncated, FCS/ICV is (partially) gone */
if (truncated >= icvlen) {
- icvlen = 0;
truncated -= icvlen;
+ icvlen = 0;
} else {
icvlen -= truncated;
truncated = 0;
--
2.34.1
^ permalink raw reply related
* [PATCH v2 iwlwifi-next 04/15] wifi: iwlwifi: support TTL platform device ID
From: Miri Korenblit @ 2026-07-14 14:02 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Johannes Berg
In-Reply-To: <20260714140218.2887000-1-miriam.rachel.korenblit@intel.com>
Add support for a new device ID that we will have on TTL (sc2).
Reviewed-by: Johannes Berg <johannes.berg@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 7a7b10152e5a..a3e6c9e09a3b 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/drv.c
@@ -548,6 +548,7 @@ VISIBLE_IF_IWLWIFI_KUNIT const struct pci_device_id iwl_hw_card_ids[] = {
{IWL_PCI_DEVICE(0xD340, PCI_ANY_ID, iwl_sc_mac_cfg)},
{IWL_PCI_DEVICE(0x6E70, PCI_ANY_ID, iwl_sc_mac_cfg)},
{IWL_PCI_DEVICE(0xD240, PCI_ANY_ID, iwl_sc_mac_cfg)},
+ {IWL_PCI_DEVICE(0x9327, PCI_ANY_ID, iwl_sc_mac_cfg)},
#endif /* CONFIG_IWLMVM || CONFIG_IWLMLD */
{0}
--
2.34.1
^ permalink raw reply related
* [PATCH v2 iwlwifi-next 03/15] wifi: iwlwifi: claim UHR DBE capability for UHR devices
From: Miri Korenblit @ 2026-07-14 14:02 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Johannes Berg
In-Reply-To: <20260714140218.2887000-1-miriam.rachel.korenblit@intel.com>
From: Johannes Berg <johannes.berg@intel.com>
When an Intel device supports UHR it also supports DBE
(dynamic bandwidth extension) since that's handled in
mac80211. Claim support for it for client mode.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c | 3 ++-
1 file changed, 2 insertions(+), 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 d47b4ae2f486..761424812609 100644
--- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
@@ -699,7 +699,8 @@ static const struct ieee80211_sband_iftype_data iwl_iftype_cap[] = {
.mac.mac_cap = {
[0] = IEEE80211_UHR_MAC_CAP0_NPCA_SUPP |
IEEE80211_UHR_MAC_CAP0_DPS_SUPP,
- [1] = IEEE80211_UHR_MAC_CAP1_DUO_SUPP,
+ [1] = IEEE80211_UHR_MAC_CAP1_DUO_SUPP |
+ IEEE80211_UHR_MAC_CAP1_DBE_SUPP,
},
},
},
--
2.34.1
^ permalink raw reply related
* [PATCH v2 iwlwifi-next 02/15] wifi: iwlwifi: mvm: remove iwl_mvm_recalc_tcm()
From: Miri Korenblit @ 2026-07-14 14:02 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless
In-Reply-To: <20260714140218.2887000-1-miriam.rachel.korenblit@intel.com>
From: Johannes Berg <johannes@sipsolutions.net>
This function is only called in the worker, so it doesn't
need to exist at all, simply move the code there.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 1 -
drivers/net/wireless/intel/iwlwifi/mvm/utils.c | 16 +++++-----------
2 files changed, 5 insertions(+), 12 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index 1b56a2695bde..4420005ef69e 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -2412,7 +2412,6 @@ bool iwl_mvm_is_vif_assoc(struct iwl_mvm *mvm);
#define MVM_TCM_PERIOD (HZ * MVM_TCM_PERIOD_MSEC / 1000)
#define MVM_LL_PERIOD (10 * HZ)
void iwl_mvm_tcm_work(struct work_struct *work);
-void iwl_mvm_recalc_tcm(struct iwl_mvm *mvm);
void iwl_mvm_pause_tcm(struct iwl_mvm *mvm, bool with_cancel);
void iwl_mvm_resume_tcm(struct iwl_mvm *mvm);
void iwl_mvm_tcm_add_vif(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
index 849342c96ae7..7eae10982869 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
@@ -1055,7 +1055,7 @@ static unsigned long iwl_mvm_calc_tcm_stats(struct iwl_mvm *mvm,
/*
* If the current load isn't low we need to force re-evaluation
* in the TCM period, so that we can return to low load if there
- * was no traffic at all (and thus iwl_mvm_recalc_tcm didn't get
+ * was no traffic at all (and thus iwl_mvm_tcm_work() didn't get
* triggered by traffic).
*/
if (load != IWL_MVM_TRAFFIC_LOW)
@@ -1081,8 +1081,11 @@ static unsigned long iwl_mvm_calc_tcm_stats(struct iwl_mvm *mvm,
return 0;
}
-void iwl_mvm_recalc_tcm(struct iwl_mvm *mvm)
+void iwl_mvm_tcm_work(struct work_struct *work)
{
+ struct delayed_work *delayed_work = to_delayed_work(work);
+ struct iwl_mvm *mvm = container_of(delayed_work, struct iwl_mvm,
+ tcm.work);
unsigned long ts = jiffies;
bool handle_uapsd =
time_after(ts, mvm->tcm.uapsd_nonagg_ts +
@@ -1119,15 +1122,6 @@ void iwl_mvm_recalc_tcm(struct iwl_mvm *mvm)
iwl_mvm_tcm_results(mvm);
}
-void iwl_mvm_tcm_work(struct work_struct *work)
-{
- struct delayed_work *delayed_work = to_delayed_work(work);
- struct iwl_mvm *mvm = container_of(delayed_work, struct iwl_mvm,
- tcm.work);
-
- iwl_mvm_recalc_tcm(mvm);
-}
-
void iwl_mvm_pause_tcm(struct iwl_mvm *mvm, bool with_cancel)
{
spin_lock_bh(&mvm->tcm.lock);
--
2.34.1
^ permalink raw reply related
* [PATCH v2 iwlwifi-next 01/15] wifi: iwlwifi: add a compile time check for too long hcmds
From: Miri Korenblit @ 2026-07-14 14:02 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Johannes Berg
In-Reply-To: <20260714140218.2887000-1-miriam.rachel.korenblit@intel.com>
A host command that is bigger than the allowed payload length should be
sent with the NOCOPY flag. If it is sent without, we will get a warning.
We do know at compile time what is the maximum size of a hcmd payload that
the transport supports, so in order to catch bugs early,
add a compile time check to iwl_*_send_cmd_pdu to catch that.
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
drivers/net/wireless/intel/iwlwifi/mld/hcmd.h | 9 +++++++--
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 20 ++++++++++++++-----
.../net/wireless/intel/iwlwifi/mvm/utils.c | 8 ++++----
3 files changed, 26 insertions(+), 11 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/mld/hcmd.h b/drivers/net/wireless/intel/iwlwifi/mld/hcmd.h
index 64a8d4248324..19e1c9e509cf 100644
--- a/drivers/net/wireless/intel/iwlwifi/mld/hcmd.h
+++ b/drivers/net/wireless/intel/iwlwifi/mld/hcmd.h
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/*
- * Copyright (C) 2024-2025 Intel Corporation
+ * Copyright (C) 2024-2026 Intel Corporation
*/
#ifndef __iwl_mld_hcmd_h__
#define __iwl_mld_hcmd_h__
@@ -42,7 +42,12 @@ __iwl_mld_send_cmd_with_flags_pdu(struct iwl_mld *mld, u32 id,
#define _iwl_mld_send_cmd_with_flags_pdu(mld, id, flags, data, len, \
ignored...) \
- __iwl_mld_send_cmd_with_flags_pdu(mld, id, flags, data, len)
+ ({ \
+ BUILD_BUG_ON(__builtin_constant_p(len) && \
+ (u16)(len) > IWL_MAX_CMD_PAYLOAD_SIZE); \
+ __iwl_mld_send_cmd_with_flags_pdu(mld, id, flags, \
+ data, len); \
+ })
#define iwl_mld_send_cmd_with_flags_pdu(mld, id, flags, data, len...) \
_iwl_mld_send_cmd_with_flags_pdu(mld, id, flags, data, ##len, \
sizeof(*(data)))
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index 683cac56822c..1b56a2695bde 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -1675,14 +1675,24 @@ u32 iwl_mvm_get_systime(struct iwl_mvm *mvm);
/* Tx / Host Commands */
int iwl_mvm_send_cmd(struct iwl_mvm *mvm,
struct iwl_host_cmd *cmd);
-int iwl_mvm_send_cmd_pdu(struct iwl_mvm *mvm, u32 id,
- u32 flags, u16 len, const void *data);
+int _iwl_mvm_send_cmd_pdu(struct iwl_mvm *mvm, u32 id,
+ u32 flags, u16 len, const void *data);
+#define iwl_mvm_send_cmd_pdu(mvm, id, flags, len, data) ({ \
+ BUILD_BUG_ON(__builtin_constant_p(len) && \
+ (u16)(len) > IWL_MAX_CMD_PAYLOAD_SIZE); \
+ _iwl_mvm_send_cmd_pdu(mvm, id, flags, len, data); \
+})
int iwl_mvm_send_cmd_status(struct iwl_mvm *mvm,
struct iwl_host_cmd *cmd,
u32 *status);
-int iwl_mvm_send_cmd_pdu_status(struct iwl_mvm *mvm, u32 id,
- u16 len, const void *data,
- u32 *status);
+int _iwl_mvm_send_cmd_pdu_status(struct iwl_mvm *mvm, u32 id,
+ u16 len, const void *data,
+ u32 *status);
+#define iwl_mvm_send_cmd_pdu_status(mvm, id, len, data, status) ({ \
+ BUILD_BUG_ON(__builtin_constant_p(len) && \
+ (u16)(len) > IWL_MAX_CMD_PAYLOAD_SIZE); \
+ _iwl_mvm_send_cmd_pdu_status(mvm, id, len, data, status); \
+})
int iwl_mvm_tx_skb_sta(struct iwl_mvm *mvm, struct sk_buff *skb,
struct ieee80211_sta *sta);
int iwl_mvm_tx_skb_non_sta(struct iwl_mvm *mvm, struct sk_buff *skb);
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
index 2e12f93ad32b..849342c96ae7 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c
@@ -73,8 +73,8 @@ int iwl_mvm_send_cmd(struct iwl_mvm *mvm, struct iwl_host_cmd *cmd)
return ret;
}
-int iwl_mvm_send_cmd_pdu(struct iwl_mvm *mvm, u32 id,
- u32 flags, u16 len, const void *data)
+int _iwl_mvm_send_cmd_pdu(struct iwl_mvm *mvm, u32 id,
+ u32 flags, u16 len, const void *data)
{
struct iwl_host_cmd cmd = {
.id = id,
@@ -137,8 +137,8 @@ int iwl_mvm_send_cmd_status(struct iwl_mvm *mvm, struct iwl_host_cmd *cmd,
/*
* We assume that the caller set the status to the sucess value
*/
-int iwl_mvm_send_cmd_pdu_status(struct iwl_mvm *mvm, u32 id, u16 len,
- const void *data, u32 *status)
+int _iwl_mvm_send_cmd_pdu_status(struct iwl_mvm *mvm, u32 id, u16 len,
+ const void *data, u32 *status)
{
struct iwl_host_cmd cmd = {
.id = id,
--
2.34.1
^ permalink raw reply related
* [PATCH v2 iwlwifi-next 00/15] wifi: iwlwifi: updates - 07-14-2026
From: Miri Korenblit @ 2026-07-14 14:02 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless
Hi,
Usual fixed, cleanups and features from our internal tree.
Emmanuel Grumbach (8):
wifi: iwlwifi: mvm: fix the FCS truncation logic in d3
wifi: iwlwifi: mld: treat valid BAID without STA as a FW error
wifi: iwlwifi: mvm: validate monitor notif link_id
wifi: iwlwifi: mld: validate D3_END notif size
wifi: iwlwifi: pcie: validate txq_id in txq_enable
wifi: iwlwifi: mvm: reset the smart fifo state upon FW stop
wifi: iwlwifi: mvm: cleanup the driver state after device_powered_off
wifi: iwlwifi: mld: reset the driver state upon firmware recovery
Johannes Berg (2):
wifi: iwlwifi: mvm: remove iwl_mvm_recalc_tcm()
wifi: iwlwifi: claim UHR DBE capability for UHR devices
Miri Korenblit (3):
wifi: iwlwifi: add a compile time check for too long hcmds
wifi: iwlwifi: support TTL platform device ID
wifi: iwlwifi: mld: cancel wiphy work before freeing wiphy
Pagadala Yesu Anjaneyulu (2):
wifi: iwlwifi: ignore raw-DSM TLV for LARI cmd version 13 and above
wifi: iwlwifi: regulatory: add LARI_CONFIG_CHANGE command v14 support
drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 4 +-
.../wireless/intel/iwlwifi/fw/api/nvm-reg.h | 15 +++-
drivers/net/wireless/intel/iwlwifi/fw/file.h | 5 +-
.../net/wireless/intel/iwlwifi/fw/runtime.h | 13 +++-
drivers/net/wireless/intel/iwlwifi/fw/uefi.c | 20 ++---
drivers/net/wireless/intel/iwlwifi/fw/uefi.h | 4 +-
.../wireless/intel/iwlwifi/iwl-nvm-parse.c | 3 +-
drivers/net/wireless/intel/iwlwifi/mld/agg.c | 9 ++-
drivers/net/wireless/intel/iwlwifi/mld/d3.c | 10 ++-
drivers/net/wireless/intel/iwlwifi/mld/hcmd.h | 9 ++-
.../net/wireless/intel/iwlwifi/mld/mac80211.c | 3 +-
.../net/wireless/intel/iwlwifi/mld/mac80211.h | 2 +
drivers/net/wireless/intel/iwlwifi/mld/mcc.c | 2 +-
drivers/net/wireless/intel/iwlwifi/mld/mld.c | 6 +-
drivers/net/wireless/intel/iwlwifi/mld/mld.h | 2 -
.../wireless/intel/iwlwifi/mld/regulatory.c | 74 ++++++++++++++-----
drivers/net/wireless/intel/iwlwifi/mvm/d3.c | 2 +-
.../net/wireless/intel/iwlwifi/mvm/mac80211.c | 2 +-
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 23 ++++--
drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 7 +-
.../net/wireless/intel/iwlwifi/mvm/utils.c | 54 +++-----------
drivers/net/wireless/intel/iwlwifi/pcie/drv.c | 1 +
.../wireless/intel/iwlwifi/pcie/gen1_2/tx.c | 11 ++-
23 files changed, 173 insertions(+), 108 deletions(-)
---
v2: send again after next branch to contain the fix:
wifi: iwlwifi: mvm: avoid oversized UATS command copy
without it we will get the compilation error added in:
wifi: iwlwifi: add a compile time check for too long hcmds
--
2.34.1
^ permalink raw reply
* Re: [PATCH] wifi: brcmfmac: cyw: clean up PMKID and cookie code
From: Gokul Sivakumar @ 2026-07-14 13:03 UTC (permalink / raw)
To: Bogdan Nicolae
Cc: Arend van Spriel, linux-wireless, brcm80211,
brcm80211-dev-list.pdl, linux-kernel, Bogdan Nicolae,
wlan-kernel-dev-list
In-Reply-To: <CA+ORkNTNytDi56RJbWHoFXLR2mSAgosz4UxHPgEvCBojmaFOdw@mail.gmail.com>
On 07/14, Bogdan Nicolae wrote:
> Hi Arend,
>
> The code already sets *cookie=0 in the beginning, which according to
> my understanding tells the driver it does not require async tracking
> upstream. This is correct, because the function calls
> wait_for_completion_timeout, so mgmt tx completes by the time we exit
> the function and doesn't need to be tracked upstream. However, while
> we are waiting for mgmt tx to finish, the firmware may generate
> non-matching completion events captured by notify_mgmt_tx_status.
> That's why setting a non-zero packed_id (sent to and returned by
> firmware as part of a completion event) and checking against
> vif->mgmt_tx_id is important.
Avoid top-posting. Need to use interleaved style.
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
> Cheers,
> Bogdan
>
> On Sun, Jul 12, 2026 at 5:30 PM Arend van Spriel
> <arend.vanspriel@broadcom.com> wrote:
> >
> > On 09/07/2026 14:23, Bogdan Nicolae wrote:
> > > Avoid setting packet_id to cookie, which is always 0. Instead, use an
> > > increasing atomic counter. Avoids mismatches of completion events later
> > > in brcmf_notify_mgmt_tx_status, where packet_id != vif->mgmt_tx_id is
> > > checked.
> > >
> > > Also, zero out auth_status on initialization. Otherwise, garbage will
> > > leak from the stack to the firmware (when bssid is less than 32 bytes
BSSID will always be less than 32, you must have meant to say "ssid" here
instead of "bssid". Also the auth_req_status struct does not have any "bssid"
member, it only has an "ssid" struct member. Need to fix in commit message.
> > > and/or when params->pmkid is set). Then, pass the params->pmkid to the
> > > firmware (without it, the firmware caches a garbage PMKID on successful
> > > authentication and denies a subsequent association request that includes
> > > the PMKID).
> > >
> > > Signed-off-by: Bogdan Nicolae <bogdan.nicolae@acm.org>
> >
> > I always get a bit confused when people use different email addresses to
> > send and sign-off patches.
> > > ---
> > > .../net/wireless/broadcom/brcm80211/brcmfmac/cyw/core.c | 8 ++++++--
> > > 1 file changed, 6 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/core.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/core.c
> > > index ce09d44fa..cca53ff19 100644
> > > --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/core.c
> > > +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cyw/core.c
> > > @@ -23,6 +23,8 @@
> > > #define MGMT_AUTH_FRAME_DWELL_TIME 4000
> > > #define MGMT_AUTH_FRAME_WAIT_TIME (MGMT_AUTH_FRAME_DWELL_TIME + 100)
> > >
> > > +static atomic_t brcmf_cyw_mgmt_tx_id = ATOMIC_INIT(0);
> > > +
> > > static int brcmf_cyw_set_sae_pwd(struct brcmf_if *ifp,
> > > struct cfg80211_crypto_settings *crypto)
> > > {
> > > @@ -155,7 +157,7 @@ int brcmf_cyw_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
> > >
> > > memcpy(&mf_params->da[0], &mgmt->da[0], ETH_ALEN);
> > > memcpy(&mf_params->bssid[0], &mgmt->bssid[0], ETH_ALEN);
> > > - mf_params->packet_id = cpu_to_le32(*cookie);
> > > + mf_params->packet_id = cpu_to_le32(atomic_inc_return(&brcmf_cyw_mgmt_tx_id));
> >
> > As I understand things the cookie value here is an output parameter. The
> > driver should assign it:
> >
> > + *cookie = atomic_inc_return(&brcmf_cyw_mgmt_tx_id);
> > mf_params->packet_id = cpu_to_le32(*cookie);
Agree with Arend's suggestion here. It is not correct to leave *cookie = 0 as it
is and only assign a different packet_id while sending requst to firmware, because
in that case the driver will not return the real cookie for this TX to cfg80211.
Driver should assign the generated ID to *cookie and then copy that into packet_id.
Gokul
> > > memcpy(mf_params->data, &buf[DOT11_MGMT_HDR_LEN],
> > > le16_to_cpu(mf_params->len));
> > >
> > Regards,
> > Arend
>
^ permalink raw reply
* Re: [PATCH rtw-next 08/16] wifi: rtw89: add IO offload support via firmware
From: Bitterblue Smith @ 2026-07-14 11:36 UTC (permalink / raw)
To: Ping-Ke Shih, linux-wireless@vger.kernel.org
Cc: Leo.Li, Gary Chang, Eric Huang, Johnson Tsai, Bernie Huang,
Isaiah, Zong-Zhe Yang, Mh_chen
In-Reply-To: <6fa6264e9a86488abfd971a32bfcf44a@realtek.com>
On 14/07/2026 10:53, Ping-Ke Shih wrote:
> Bitterblue Smith <rtl8821cerfe2@gmail.com> wrote:
>> On 20/04/2026 06:40, Ping-Ke Shih wrote:
>>> +static void rtw89_fw_cmd_ofld_udelay(struct rtw89_dev *rtwdev, u32 us)
>>> +{
>>> + struct rtw89_fw_cmd_ofld_arg cmd = {
>>> + .src = RTW89_FW_CMD_OFLD_SRC_OTHER,
>>> + .type = RTW89_FW_CMD_OFLD_DELAY,
>>> + .value = us,
>>> + };
>>> + int ret;
>>> +
>>> + ret = rtw89_fw_cmd_ofld_enqueue(rtwdev, &cmd);
>>> + if (ret)
>>> + udelay(us);
>>> +}
>>> +
>>> +static void rtw89_fw_cmd_ofld_mdelay(struct rtw89_dev *rtwdev, u32 ms)
>>> +{
>>> + struct rtw89_fw_cmd_ofld_arg cmd = {
>>> + .src = RTW89_FW_CMD_OFLD_SRC_OTHER,
>>> + .type = RTW89_FW_CMD_OFLD_DELAY,
>>> + .value = ms * 1000,
>>> + };
>>> + int ret;
>>> +
>>> + ret = rtw89_fw_cmd_ofld_enqueue(rtwdev, &cmd);
>>> + if (ret)
>>> + mdelay(ms);
>>> +}
>> This can fail to compile with some kernel configurations because
>> RTW89_FW_CMD_OFLD_SRC_OTHER (4) doesn't fit in the mask
>> RTW89_H2C_CMD_OFLD_W0_SRC (GENMASK(0, 1)):
>
> Thanks for the report.
>
> I sent a patch [1] with first github link. If this the link isn't good to you,
> please let me know. I can change it.
>
> [1] https://lore.kernel.org/linux-wireless/20260714074811.30124-1-pkshih@realtek.com/T/#u
>
>
>
>
It looks good to me, thank you.
^ permalink raw reply
* [PATCH iwlwifi-next 15/15] wifi: iwlwifi: mld: reset the driver state upon firmware recovery
From: Miri Korenblit @ 2026-07-14 11:32 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Emmanuel Grumbach
In-Reply-To: <20260714143119.a549b9499e3e.Id1a95bbbf92b5862862becaf57419bb9fe1385e5@changeid>
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Just like we did in iwlmvm, we also need to clear the mld state when the
firmware was killed because of the device being powered off during
suspend.
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
drivers/net/wireless/intel/iwlwifi/mld/mac80211.c | 3 +--
drivers/net/wireless/intel/iwlwifi/mld/mac80211.h | 2 ++
drivers/net/wireless/intel/iwlwifi/mld/mld.c | 1 +
3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/mld/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mld/mac80211.c
index 17286b3341c0..4065d8e4fa8c 100644
--- a/drivers/net/wireless/intel/iwlwifi/mld/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mld/mac80211.c
@@ -543,8 +543,7 @@ iwl_mld_mac80211_tx(struct ieee80211_hw *hw,
iwl_mld_tx_skb(mld, skb, NULL);
}
-static void
-iwl_mld_restart_cleanup(struct iwl_mld *mld)
+void iwl_mld_restart_cleanup(struct iwl_mld *mld)
{
iwl_cleanup_mld(mld);
diff --git a/drivers/net/wireless/intel/iwlwifi/mld/mac80211.h b/drivers/net/wireless/intel/iwlwifi/mld/mac80211.h
index aad04d7b2617..f3302997b28f 100644
--- a/drivers/net/wireless/intel/iwlwifi/mld/mac80211.h
+++ b/drivers/net/wireless/intel/iwlwifi/mld/mac80211.h
@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/*
* Copyright (C) 2024 Intel Corporation
+ * Copyright (C) 2026 Intel Corporation
*/
#ifndef __iwl_mld_mac80211_h__
#define __iwl_mld_mac80211_h__
@@ -9,5 +10,6 @@
int iwl_mld_register_hw(struct iwl_mld *mld);
void iwl_mld_recalc_multicast_filter(struct iwl_mld *mld);
+void iwl_mld_restart_cleanup(struct iwl_mld *mld);
#endif /* __iwl_mld_mac80211_h__ */
diff --git a/drivers/net/wireless/intel/iwlwifi/mld/mld.c b/drivers/net/wireless/intel/iwlwifi/mld/mld.c
index 99506f354bfa..093bdc130704 100644
--- a/drivers/net/wireless/intel/iwlwifi/mld/mld.c
+++ b/drivers/net/wireless/intel/iwlwifi/mld/mld.c
@@ -748,6 +748,7 @@ static void iwl_mld_device_powered_off(struct iwl_op_mode *op_mode)
wiphy_lock(mld->wiphy);
iwl_mld_stop_fw(mld);
+ iwl_mld_restart_cleanup(mld);
mld->fw_status.in_d3 = false;
wiphy_unlock(mld->wiphy);
}
--
2.34.1
^ permalink raw reply related
* [PATCH iwlwifi-next 14/15] wifi: iwlwifi: mvm: cleanup the driver state after device_powered_off
From: Miri Korenblit @ 2026-07-14 11:32 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Emmanuel Grumbach
In-Reply-To: <20260714143119.a549b9499e3e.Id1a95bbbf92b5862862becaf57419bb9fe1385e5@changeid>
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
If the device was powered off during suspend, we need to reload the
firmware in resume which also means that we need to reconfigure it.
It could be tempting to just set IWL_MVM_STATUS_HW_RESTART_REQUESTED
but that would leave IWL_MVM_STATUS_IN_HW_RESTART set forever since that
recovery is not managed by mac80211.
Just call iwl_mvm_restart_cleanup() from device_powered_off().
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 | 2 +-
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 1 +
drivers/net/wireless/intel/iwlwifi/mvm/ops.c | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
index 74bd4038fd56..fd2a50563ab5 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
@@ -1129,7 +1129,7 @@ static void iwl_mvm_cleanup_iterator(void *data, u8 *mac,
RCU_INIT_POINTER(mvmvif->deflink.probe_resp_data, NULL);
}
-static void iwl_mvm_restart_cleanup(struct iwl_mvm *mvm)
+void iwl_mvm_restart_cleanup(struct iwl_mvm *mvm)
{
iwl_mvm_stop_device(mvm);
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
index 979b39314981..d6bed2c08606 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h
@@ -1660,6 +1660,7 @@ void iwl_mvm_hwrate_to_tx_rate(u32 rate_n_flags,
u8 iwl_mvm_rate_idx_to_fw_idx(const struct iwl_fw *fw, int rate_idx);
u8 iwl_mvm_mac80211_ac_to_ucode_ac(enum ieee80211_ac_numbers ac);
bool iwl_mvm_is_nic_ack_enabled(struct iwl_mvm *mvm, struct ieee80211_vif *vif);
+void iwl_mvm_restart_cleanup(struct iwl_mvm *mvm);
static inline void iwl_mvm_dump_nic_error_log(struct iwl_mvm *mvm)
{
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
index 09150feb330d..6ae9f87d5221 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
@@ -2091,7 +2091,7 @@ static void iwl_op_mode_mvm_device_powered_off(struct iwl_op_mode *op_mode)
mutex_lock(&mvm->mutex);
clear_bit(IWL_MVM_STATUS_IN_D3, &mvm->status);
- iwl_mvm_stop_device(mvm);
+ iwl_mvm_restart_cleanup(mvm);
mvm->fast_resume = false;
mutex_unlock(&mvm->mutex);
}
--
2.34.1
^ permalink raw reply related
* [PATCH iwlwifi-next 13/15] wifi: iwlwifi: mvm: reset the smart fifo state upon FW stop
From: Miri Korenblit @ 2026-07-14 11:32 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Emmanuel Grumbach
In-Reply-To: <20260714143119.a549b9499e3e.Id1a95bbbf92b5862862becaf57419bb9fe1385e5@changeid>
From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
The smart fifo is a feature in the firmware configured by the driver.
The driver keeps a state to remember what was the last configuration
sent to the firmware. Obviously, if the firmware stops, we need to
reconfigure the smart fifo. Since we didn't reset that state upon
firmware stop, we thought the firmware is already properly
configured and we didn't send the smart fifo configuration command
as part of the init sequence.
Reset the smart fifo state in iwl_mvm_stop_device() so that we
will properly send the command during the init that will come
later.
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/ops.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
index f43895c2f3c6..09150feb330d 100644
--- a/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
+++ b/drivers/net/wireless/intel/iwlwifi/mvm/ops.c
@@ -1535,6 +1535,7 @@ void iwl_mvm_stop_device(struct iwl_mvm *mvm)
iwl_fw_cancel_timestamp(&mvm->fwrt);
clear_bit(IWL_MVM_STATUS_FIRMWARE_RUNNING, &mvm->status);
+ mvm->sf_state = SF_UNINIT;
iwl_mvm_pause_tcm(mvm, false);
--
2.34.1
^ permalink raw reply related
* [PATCH iwlwifi-next 12/15] wifi: iwlwifi: regulatory: add LARI_CONFIG_CHANGE command v14 support
From: Miri Korenblit @ 2026-07-14 11:32 UTC (permalink / raw)
To: johannes; +Cc: linux-wireless, Pagadala Yesu Anjaneyulu
In-Reply-To: <20260714143119.a549b9499e3e.Id1a95bbbf92b5862862becaf57419bb9fe1385e5@changeid>
From: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Add support for LARI_CONFIG_CHANGE version 14 and populate
the newly added BIOS-related fields in the command payload.
Extend the version 14 command layout with UHB extension, puncturing and
WBEM metadata fields, update command-size handling for version negotiation,
and wire the new data into the LARI configuration flow. Track WBEM and
puncturing source/revision in fw runtime, set them when loading ACPI or
UEFI tables, and pass the headers to firmware. Update send conditions,
debug traces, and related documentation/comments to match the new format.
Signed-off-by: Pagadala Yesu Anjaneyulu <pagadala.yesu.anjaneyulu@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
drivers/net/wireless/intel/iwlwifi/fw/acpi.c | 4 +-
.../wireless/intel/iwlwifi/fw/api/nvm-reg.h | 15 ++++-
.../net/wireless/intel/iwlwifi/fw/runtime.h | 13 +++-
drivers/net/wireless/intel/iwlwifi/fw/uefi.c | 20 ++++---
drivers/net/wireless/intel/iwlwifi/fw/uefi.h | 4 +-
drivers/net/wireless/intel/iwlwifi/mld/mcc.c | 2 +-
drivers/net/wireless/intel/iwlwifi/mld/mld.c | 2 +-
drivers/net/wireless/intel/iwlwifi/mld/mld.h | 2 -
.../wireless/intel/iwlwifi/mld/regulatory.c | 60 ++++++++++++++-----
9 files changed, 88 insertions(+), 34 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
index bf0f851a9075..9f2f4a6af1ca 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/acpi.c
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/*
* Copyright (C) 2017 Intel Deutschland GmbH
- * Copyright (C) 2019-2025 Intel Corporation
+ * Copyright (C) 2019-2026 Intel Corporation
*/
#include <linux/uuid.h>
#include "iwl-drv.h"
@@ -1188,6 +1188,8 @@ int iwl_acpi_get_wbem(struct iwl_fw_runtime *fwrt, u32 *value)
*value = wifi_pkg->package.elements[1].integer.value &
IWL_ACPI_WBEM_REV0_MASK;
+ fwrt->wbem_source = BIOS_SOURCE_ACPI;
+ fwrt->wbem_revision = tbl_rev;
IWL_DEBUG_RADIO(fwrt, "Loaded WBEM config from ACPI\n");
ret = 0;
out_free:
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h b/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h
index 443a9a416325..d8ec9934a9b6 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/api/nvm-reg.h
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/*
- * Copyright (C) 2012-2014, 2018-2025 Intel Corporation
+ * Copyright (C) 2012-2014, 2018-2026 Intel Corporation
* Copyright (C) 2013-2015 Intel Mobile Communications GmbH
* Copyright (C) 2016-2017 Intel Deutschland GmbH
*/
@@ -662,6 +662,12 @@ struct iwl_lari_config_change_cmd_v8 {
* get the data from the BIOS.
* @oem_unii9_enable: UNII-9 enablement as read from the BIOS
* @bios_hdr: bios config header
+ * @oem_uhb_allow_extension_bitmap: DSM Function 4 data as an extension of UHB
+ * enabled MCC sets
+ * @bios_wcpe_hdr: puncturing config header
+ * @wcpe_bitmap: bitmap of puncturing enablement per MCC
+ * @bios_wbem_hdr: 320 MHz per-MCC WBEM config header
+ * @reserved: reserved
*/
struct iwl_lari_config_change_cmd {
__le32 config_bitmap;
@@ -679,9 +685,16 @@ struct iwl_lari_config_change_cmd {
__le32 oem_unii9_enable;
/* since version 13 */
struct iwl_bios_config_hdr bios_hdr;
+ /* All the below are since version 14 */
+ __le32 oem_uhb_allow_extension_bitmap;
+ struct iwl_bios_config_hdr bios_wcpe_hdr;
+ __le32 wcpe_bitmap;
+ struct iwl_bios_config_hdr bios_wbem_hdr;
+ __le32 reserved[10];
} __packed;
/* LARI_CHANGE_CONF_CMD_S_VER_12
* LARI_CHANGE_CONF_CMD_S_VER_13
+ * LARI_CHANGE_CONF_CMD_S_VER_14
*/
/* Activate UNII-1 (5.2GHz) for World Wide */
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/runtime.h b/drivers/net/wireless/intel/iwlwifi/fw/runtime.h
index d80ae610e56c..ac01ac0092ee 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/runtime.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/runtime.h
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/*
* Copyright (C) 2017 Intel Deutschland GmbH
- * Copyright (C) 2018-2025 Intel Corporation
+ * Copyright (C) 2018-2026 Intel Corporation
*/
#ifndef __iwl_fw_runtime_h__
#define __iwl_fw_runtime_h__
@@ -144,6 +144,11 @@ struct iwl_txf_iter_data {
* @tpc_enabled: TPC enabled
* @dsm_source: one of &enum bios_source. UEFI, ACPI or NONE
* @dsm_revision: the revision of the DSM table
+ * @wbem_source: one of &enum bios_source for the WBEM table
+ * @wbem_revision: the revision of the WBEM table
+ * @puncturing_source: one of &enum bios_source for the puncturing table
+ * @puncturing_revision: the revision of the puncturing table
+ * @bios_puncturing: per-country puncturing enablement bitmap from BIOS
*/
struct iwl_fw_runtime {
struct iwl_trans *trans;
@@ -226,6 +231,12 @@ struct iwl_fw_runtime {
u32 dsm_funcs_valid;
u32 dsm_values[DSM_FUNC_NUM_FUNCS];
#endif
+
+ enum bios_source wbem_source;
+ u8 wbem_revision;
+ enum bios_source puncturing_source;
+ u8 puncturing_revision;
+ u32 bios_puncturing;
};
void iwl_fw_runtime_init(struct iwl_fw_runtime *fwrt, struct iwl_trans *trans,
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/uefi.c b/drivers/net/wireless/intel/iwlwifi/fw/uefi.c
index 2ef0a7a920ad..1046d4fecb72 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/uefi.c
+++ b/drivers/net/wireless/intel/iwlwifi/fw/uefi.c
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
/*
- * Copyright(c) 2021-2025 Intel Corporation
+ * Copyright(c) 2021-2026 Intel Corporation
*/
#include "iwl-drv.h"
@@ -884,6 +884,8 @@ int iwl_uefi_get_wbem(struct iwl_fw_runtime *fwrt, u32 *value)
goto out;
}
*value = data->wbem_320mhz_per_mcc & IWL_UEFI_WBEM_REV0_MASK;
+ fwrt->wbem_source = BIOS_SOURCE_UEFI;
+ fwrt->wbem_revision = data->revision;
IWL_DEBUG_RADIO(fwrt, "Loaded WBEM config from UEFI\n");
out:
kfree(data);
@@ -970,29 +972,29 @@ int iwl_uefi_get_dsm(struct iwl_fw_runtime *fwrt, enum iwl_dsm_funcs func,
int iwl_uefi_get_puncturing(struct iwl_fw_runtime *fwrt)
{
struct uefi_cnv_var_puncturing_data *data;
- /* default value is not enabled if there is any issue in reading
- * uefi variable or revision is not supported
- */
- int puncturing = 0;
+ int ret = 0;
data = iwl_uefi_get_verified_variable(fwrt->trans,
IWL_UEFI_PUNCTURING_NAME,
"UefiCnvWlanPuncturing",
sizeof(*data), NULL);
if (IS_ERR(data))
- return puncturing;
+ return -EINVAL;
if (data->revision != IWL_UEFI_PUNCTURING_REVISION) {
IWL_DEBUG_RADIO(fwrt, "Unsupported UEFI PUNCTURING rev:%d\n",
data->revision);
+ ret = -EINVAL;
} else {
- puncturing = data->puncturing & IWL_UEFI_PUNCTURING_REV0_MASK;
+ fwrt->puncturing_source = BIOS_SOURCE_UEFI;
+ fwrt->puncturing_revision = data->revision;
+ fwrt->bios_puncturing = data->puncturing;
IWL_DEBUG_RADIO(fwrt, "Loaded puncturing bits from UEFI: %d\n",
- puncturing);
+ fwrt->bios_puncturing);
}
kfree(data);
- return puncturing;
+ return ret;
}
IWL_EXPORT_SYMBOL(iwl_uefi_get_puncturing);
diff --git a/drivers/net/wireless/intel/iwlwifi/fw/uefi.h b/drivers/net/wireless/intel/iwlwifi/fw/uefi.h
index 474f06db4d43..386ca3744408 100644
--- a/drivers/net/wireless/intel/iwlwifi/fw/uefi.h
+++ b/drivers/net/wireless/intel/iwlwifi/fw/uefi.h
@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
/*
- * Copyright(c) 2021-2025 Intel Corporation
+ * Copyright(c) 2021-2026 Intel Corporation
*/
#ifndef __iwl_fw_uefi__
#define __iwl_fw_uefi__
@@ -275,8 +275,6 @@ enum iwl_uefi_cnv_puncturing_flags {
IWL_UEFI_CNV_PUNCTURING_CANADA_EN_MSK = BIT(1),
};
-#define IWL_UEFI_PUNCTURING_REV0_MASK (IWL_UEFI_CNV_PUNCTURING_USA_EN_MSK | \
- IWL_UEFI_CNV_PUNCTURING_CANADA_EN_MSK)
/**
* struct uefi_cnv_var_puncturing_data - controlling channel
* puncturing for few countries.
diff --git a/drivers/net/wireless/intel/iwlwifi/mld/mcc.c b/drivers/net/wireless/intel/iwlwifi/mld/mcc.c
index 8502129abe49..7649ae794dfd 100644
--- a/drivers/net/wireless/intel/iwlwifi/mld/mcc.c
+++ b/drivers/net/wireless/intel/iwlwifi/mld/mcc.c
@@ -131,7 +131,7 @@ iwl_mld_get_regdomain(struct iwl_mld *mld,
/* FM follows BIOS/MCC policy, WH disallows puncturing only in US/CA. */
if (CSR_HW_RFID_TYPE(mld->trans->info.hw_rf_id) == IWL_CFG_RF_TYPE_FM) {
- if (!iwl_puncturing_is_allowed_in_bios(mld->bios_enable_puncturing,
+ if (!iwl_puncturing_is_allowed_in_bios(mld->fwrt.bios_puncturing,
le16_to_cpu(resp->mcc)))
ieee80211_hw_set(mld->hw, DISALLOW_PUNCTURING);
else
diff --git a/drivers/net/wireless/intel/iwlwifi/mld/mld.c b/drivers/net/wireless/intel/iwlwifi/mld/mld.c
index 5a6c9ab20fd6..99506f354bfa 100644
--- a/drivers/net/wireless/intel/iwlwifi/mld/mld.c
+++ b/drivers/net/wireless/intel/iwlwifi/mld/mld.c
@@ -419,7 +419,7 @@ iwl_op_mode_mld_start(struct iwl_trans *trans, const struct iwl_rf_cfg *cfg,
iwl_mld_get_bios_tables(mld);
iwl_uefi_get_sgom_table(trans, &mld->fwrt);
- mld->bios_enable_puncturing = iwl_uefi_get_puncturing(&mld->fwrt);
+ iwl_uefi_get_puncturing(&mld->fwrt);
iwl_mld_hw_set_regulatory(mld);
diff --git a/drivers/net/wireless/intel/iwlwifi/mld/mld.h b/drivers/net/wireless/intel/iwlwifi/mld/mld.h
index 922aa3dbff54..37f41b504b54 100644
--- a/drivers/net/wireless/intel/iwlwifi/mld/mld.h
+++ b/drivers/net/wireless/intel/iwlwifi/mld/mld.h
@@ -172,7 +172,6 @@
* @debug_max_sleep: maximum sleep time in D3 (for debug purposes)
* @led: the led device
* @mcc_src: the source id of the MCC, comes from the firmware
- * @bios_enable_puncturing: is puncturing enabled by bios
* @fw_id_to_ba: maps a fw (BA) id to a corresponding Block Ack session data.
* @num_rx_ba_sessions: tracks the number of active Rx Block Ack (BA) sessions.
* the driver ensures that new BA sessions are blocked once the maximum
@@ -279,7 +278,6 @@ struct iwl_mld {
struct led_classdev led;
#endif
enum iwl_mcc_source mcc_src;
- bool bios_enable_puncturing;
struct iwl_mld_baid_data __rcu *fw_id_to_ba[IWL_MAX_BAID];
u8 num_rx_ba_sessions;
diff --git a/drivers/net/wireless/intel/iwlwifi/mld/regulatory.c b/drivers/net/wireless/intel/iwlwifi/mld/regulatory.c
index 858635607f5d..4a93ccbef495 100644
--- a/drivers/net/wireless/intel/iwlwifi/mld/regulatory.c
+++ b/drivers/net/wireless/intel/iwlwifi/mld/regulatory.c
@@ -13,6 +13,23 @@
#include "mld.h"
#include "hcmd.h"
+static ssize_t iwl_mld_get_lari_config_cmd_size(u8 cmd_ver)
+{
+ switch (cmd_ver) {
+ case 14:
+ return sizeof(struct iwl_lari_config_change_cmd);
+ case 13:
+ return offsetof(struct iwl_lari_config_change_cmd,
+ oem_uhb_allow_extension_bitmap);
+ case 12:
+ return offsetof(struct iwl_lari_config_change_cmd,
+ oem_11bn_allow_bitmap);
+ default:
+ WARN(true, "unsupported version: %d", cmd_ver);
+ return -EINVAL;
+ }
+}
+
void iwl_mld_get_bios_tables(struct iwl_mld *mld)
{
int ret;
@@ -335,9 +352,13 @@ void iwl_mld_configure_lari(struct iwl_mld *mld)
bool has_raw_dsm_capa = cmd_ver >= 13 ||
fw_has_capa(&fwrt->fw->ucode_capa,
IWL_UCODE_TLV_CAPA_FW_ACCEPTS_RAW_DSM_TABLE);
+ ssize_t cmd_len = iwl_mld_get_lari_config_cmd_size(cmd_ver);
int ret;
u32 value;
+ if (cmd_len < 0)
+ return;
+
ret = iwl_bios_get_dsm(fwrt, DSM_FUNC_11AX_ENABLEMENT, &value);
if (!ret) {
if (!has_raw_dsm_capa)
@@ -379,8 +400,11 @@ void iwl_mld_configure_lari(struct iwl_mld *mld)
}
ret = iwl_bios_get_wbem(fwrt, &value);
- if (!ret)
+ if (!ret) {
cmd.oem_320mhz_allow_bitmap = cpu_to_le32(value);
+ cmd.bios_wbem_hdr.table_source = fwrt->wbem_source;
+ cmd.bios_wbem_hdr.table_revision = fwrt->wbem_revision;
+ }
ret = iwl_bios_get_dsm(fwrt, DSM_FUNC_ENABLE_11BE, &value);
if (!ret)
@@ -394,8 +418,17 @@ void iwl_mld_configure_lari(struct iwl_mld *mld)
if (!ret)
cmd.oem_unii9_enable = cpu_to_le32(value);
+ ret = iwl_bios_get_dsm(fwrt, DSM_FUNC_REGULATORY_CONFIG, &value);
+ if (!ret)
+ cmd.oem_uhb_allow_extension_bitmap = cpu_to_le32(value);
+
+ cmd.bios_wcpe_hdr.table_source = fwrt->puncturing_source;
+ cmd.bios_wcpe_hdr.table_revision = fwrt->puncturing_revision;
+ cmd.wcpe_bitmap = cpu_to_le32(fwrt->bios_puncturing);
+
if (!cmd.config_bitmap &&
!cmd.oem_uhb_allow_bitmap &&
+ !cmd.oem_uhb_allow_extension_bitmap &&
!cmd.oem_11ax_allow_bitmap &&
!cmd.oem_unii4_allow_bitmap &&
!cmd.chan_state_active_bitmap &&
@@ -404,7 +437,8 @@ void iwl_mld_configure_lari(struct iwl_mld *mld)
!cmd.oem_320mhz_allow_bitmap &&
!cmd.oem_11be_allow_bitmap &&
!cmd.oem_11bn_allow_bitmap &&
- !cmd.oem_unii9_enable)
+ !cmd.oem_unii9_enable &&
+ !cmd.wcpe_bitmap)
return;
cmd.bios_hdr.table_source = fwrt->dsm_source;
@@ -422,6 +456,9 @@ void iwl_mld_configure_lari(struct iwl_mld *mld)
"sending LARI_CONFIG_CHANGE, oem_uhb_allow_bitmap=0x%x, force_disable_channels_bitmap=0x%x\n",
le32_to_cpu(cmd.oem_uhb_allow_bitmap),
le32_to_cpu(cmd.force_disable_channels_bitmap));
+ IWL_DEBUG_RADIO(mld,
+ "sending LARI_CONFIG_CHANGE, oem_uhb_allow_extension_bitmap=0x%x\n",
+ le32_to_cpu(cmd.oem_uhb_allow_extension_bitmap));
IWL_DEBUG_RADIO(mld,
"sending LARI_CONFIG_CHANGE, edt_bitmap=0x%x, oem_320mhz_allow_bitmap=0x%x\n",
le32_to_cpu(cmd.edt_bitmap),
@@ -435,20 +472,13 @@ void iwl_mld_configure_lari(struct iwl_mld *mld)
IWL_DEBUG_RADIO(mld,
"sending LARI_CONFIG_CHANGE, oem_unii9_enable=0x%x\n",
le32_to_cpu(cmd.oem_unii9_enable));
+ IWL_DEBUG_RADIO(mld,
+ "sending LARI_CONFIG_CHANGE, wcpe_bitmap=0x%x\n",
+ le32_to_cpu(cmd.wcpe_bitmap));
- if (cmd_ver == 12) {
- int cmd_size = offsetof(typeof(cmd), oem_11bn_allow_bitmap);
-
- ret = iwl_mld_send_cmd_pdu(mld,
- WIDE_ID(REGULATORY_AND_NVM_GROUP,
- LARI_CONFIG_CHANGE),
- &cmd, cmd_size);
- } else {
- ret = iwl_mld_send_cmd_pdu(mld,
- WIDE_ID(REGULATORY_AND_NVM_GROUP,
- LARI_CONFIG_CHANGE),
- &cmd);
- }
+ ret = iwl_mld_send_cmd_pdu(mld,
+ WIDE_ID(REGULATORY_AND_NVM_GROUP,
+ LARI_CONFIG_CHANGE), &cmd, cmd_len);
if (ret)
IWL_DEBUG_RADIO(mld,
"Failed to send LARI_CONFIG_CHANGE (%d)\n",
--
2.34.1
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox