From: Johannes Berg johannes.berg@intel.com
[ Upstream commit 8d7f08922a8cb621aa5d00bdce6a7afe57af1665 ]
The beacon CCK flag should be set for any CCK rate, not just for 1 Mbps. Fix that.
Signed-off-by: Johannes Berg johannes.berg@intel.com Reviewed-by: Ilan Peer ilan.peer@intel.com Link: https://patch.msgid.link/20250505215513.fe18b7d92d7d.I7bb40a92cea102677b695b... Signed-off-by: Miri Korenblit miriam.rachel.korenblit@intel.com Signed-off-by: Sasha Levin sashal@kernel.org ---
**YES** This commit should be backported to stable kernel trees based on my analysis of both the commit message and code changes: ## Analysis of the Bug Fix **The Bug**: The original code incorrectly sets the beacon CCK flag: ```c if (rate_idx <= IWL_FIRST_CCK_RATE) // WRONG: Only for 1 Mbps rate ``` **The Fix**: Changes the condition to properly include all CCK rates: ```c if (rate_idx <= IWL_LAST_CCK_RATE) // CORRECT: For all CCK rates (1, 2, 5.5, 11 Mbps) ``` ## Why This Should Be Backported ### 1. **Fixes Important Functional Bug** This fixes beacon transmission in Access Point mode for Intel WiFi devices. The beacon CCK flag tells the firmware which modulation type to use when transmitting beacons. Setting it incorrectly could cause: - Beacon transmission failures - Radio configuration errors - Interoperability issues with client devices - Power management problems ### 2. **Small, Contained Change** The fix is minimal and surgical - changing `IWL_FIRST_CCK_RATE` to `IWL_LAST_CCK_RATE` in a single line. This type of targeted fix has minimal risk of introducing regressions. ### 3. **Affects Critical Kernel Subsystem** Wireless networking is a critical subsystem, and beacon transmission is fundamental to WiFi Access Point operation. Incorrect beacon formatting could prevent devices from connecting or maintaining stable connections. ### 4. **Follows Stable Tree Criteria** - **Important bugfix**: ✅ Fixes beacon transmission logic - **Minimal risk**: ✅ One-line change with clear purpose - **No new features**: ✅ Pure bug fix - **No architectural changes**: ✅ Simple condition fix - **Confined to subsystem**: ✅ Only affects iwlwifi driver ### 5. **Matches Successful Backport Patterns** Looking at the similar commits provided: - **Similar Commit #2** (YES): Fixed netif checksum flags - also a small wireless driver fix - **Similar Commit #4** (YES): Fixed beacon protection flags - nearly identical type of beacon-related fix - **Similar Commit #5** (YES): Fixed MAC filter flags - another small flag correction This commit has the same characteristics as those marked for backporting: small driver fixes that correct important functionality without architectural changes. ### 6. **Affects User-Visible Functionality** Users running Intel WiFi devices as Access Points could experience connection issues due to malformed beacons. This is exactly the type of bug that stable trees should address. The fix is straightforward, low-risk, and addresses a functional issue that could impact real-world WiFi operations, making it an excellent candidate for stable backporting.
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c index 6b06732441c35..a699b43d475e1 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause /* - * Copyright (C) 2012-2014, 2018-2024 Intel Corporation + * Copyright (C) 2012-2014, 2018-2025 Intel Corporation * Copyright (C) 2013-2014 Intel Mobile Communications GmbH * Copyright (C) 2015-2017 Intel Deutschland GmbH */ @@ -941,7 +941,7 @@ u16 iwl_mvm_mac_ctxt_get_beacon_flags(const struct iwl_fw *fw, u8 rate_idx) u16 flags = iwl_mvm_mac80211_idx_to_hwrate(fw, rate_idx); bool is_new_rate = iwl_fw_lookup_cmd_ver(fw, BEACON_TEMPLATE_CMD, 0) > 10;
- if (rate_idx <= IWL_FIRST_CCK_RATE) + if (rate_idx <= IWL_LAST_CCK_RATE) flags |= is_new_rate ? IWL_MAC_BEACON_CCK : IWL_MAC_BEACON_CCK_V1;