PKG_NAME:=mac80211
-PKG_VERSION:=6.12.6
+PKG_VERSION:=6.12.44
PKG_RELEASE:=2
PKG_LICENSE:=GPL-2.0-only
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/
-PKG_HASH:=28ec39425a1b3270e1422d92a8131a6a3d8919cc13e8ee250c315e55d922ba68
+PKG_HASH:=85a9f92ddba3bf2970a089e7af576c1135217c387205f4481ea9131c0c45c509
PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(if $(BUILD_VARIANT),$(PKG_NAME)-$(BUILD_VARIANT)/)backports-$(PKG_VERSION)
--- a/net/wireless/reg.c
+++ b/net/wireless/reg.c
-@@ -3364,6 +3364,8 @@ void regulatory_hint_country_ie(struct w
+@@ -3367,6 +3367,8 @@ void regulatory_hint_country_ie(struct w
enum environment_cap env = ENVIRON_ANY;
struct regulatory_request *request = NULL, *lr;
/* IE len must be evenly divisible by 2 */
if (country_ie_len & 0x01)
return;
-@@ -3615,6 +3617,7 @@ static bool is_wiphy_all_set_reg_flag(en
+@@ -3618,6 +3620,7 @@ static bool is_wiphy_all_set_reg_flag(en
void regulatory_hint_disconnect(void)
{
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
-@@ -3539,6 +3539,16 @@ int ath10k_core_register(struct ath10k *
+@@ -3577,6 +3577,16 @@ int ath10k_core_register(struct ath10k *
queue_work(ar->workqueue, &ar->register_work);
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -9919,6 +9919,21 @@ static int ath10k_mac_init_rd(struct ath
+@@ -9924,6 +9924,21 @@ static int ath10k_mac_init_rd(struct ath
return 0;
}
int ath10k_mac_register(struct ath10k *ar)
{
static const u32 cipher_suites[] = {
-@@ -10281,6 +10296,12 @@ int ath10k_mac_register(struct ath10k *a
+@@ -10286,6 +10301,12 @@ int ath10k_mac_register(struct ath10k *a
ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER;
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
-@@ -1315,6 +1315,10 @@ struct ath10k {
+@@ -1320,6 +1320,10 @@ struct ath10k {
s32 tx_power_2g_limit;
s32 tx_power_5g_limit;
if (ret)
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -10297,7 +10297,7 @@ int ath10k_mac_register(struct ath10k *a
+@@ -10302,7 +10302,7 @@ int ath10k_mac_register(struct ath10k *a
ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER;
#ifdef CPTCFG_MAC80211_LEDS
#include <linux/property.h>
#include <linux/dmi.h>
#include <linux/ctype.h>
-@@ -3411,6 +3412,8 @@ static int ath10k_core_probe_fw(struct a
+@@ -3449,6 +3450,8 @@ static int ath10k_core_probe_fw(struct a
device_get_mac_address(ar->dev, ar->mac_addr);
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -10089,7 +10089,6 @@ int ath10k_mac_register(struct ath10k *a
+@@ -10094,7 +10094,6 @@ int ath10k_mac_register(struct ath10k *a
ieee80211_hw_set(ar->hw, CHANCTX_STA_CSA);
ieee80211_hw_set(ar->hw, QUEUE_CONTROL);
ieee80211_hw_set(ar->hw, SUPPORTS_TX_FRAG);
+++ /dev/null
-wifi: ath11k: Fix DMA buffer allocation to resolve SWIOTLB issues
-Currently, the driver allocates cacheable DMA buffers for rings like
-HAL_REO_DST and HAL_WBM2SW_RELEASE. The buffers for HAL_WBM2SW_RELEASE
-are large (1024 KiB), exceeding the SWIOTLB slot size of 256 KiB. This
-leads to "swiotlb buffer is full" error messages on systems without an
-IOMMU that use SWIOTLB, causing driver initialization failures. The driver
-calls dma_map_single() with these large buffers obtained from kzalloc(),
-resulting in ring initialization errors on systems without an IOMMU that
-use SWIOTLB.
-
-To address these issues, replace the flawed buffer allocation mechanism
-with the appropriate DMA API. Specifically, use dma_alloc_noncoherent()
-for cacheable DMA buffers, ensuring proper freeing of buffers with
-dma_free_noncoherent().
-
-Error log:
-[ 10.194343] ath11k_pci 0000:04:00.0: swiotlb buffer is full (sz:1048583 bytes), total 32768 (slots), used 2529 (slots)
-[ 10.194406] ath11k_pci 0000:04:00.0: failed to set up tcl_comp ring (0) :-12
-[ 10.194781] ath11k_pci 0000:04:00.0: failed to init DP: -12
-
-Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
-Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3
-
-Reported-by: Tim Harvey <tharvey@gateworks.com>
-Closes: https://lore.kernel.org/all/20241210041133.GA17116@lst.de/
-Signed-off-by: P Praneesh <quic_ppranees@quicinc.com>
-Tested-by: Tim Harvey <tharvey@gateworks.com>
-Link: https://patch.msgid.link/20250119164219.647059-2-quic_ppranees@quicinc.com
-Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
---- a/drivers/net/wireless/ath/ath11k/dp.c
-+++ b/drivers/net/wireless/ath/ath11k/dp.c
-@@ -1,7 +1,7 @@
- // SPDX-License-Identifier: BSD-3-Clause-Clear
- /*
- * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
-- * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
-+ * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
- */
-
- #include <crypto/hash.h>
-@@ -104,14 +104,12 @@ void ath11k_dp_srng_cleanup(struct ath11
- if (!ring->vaddr_unaligned)
- return;
-
-- if (ring->cached) {
-- dma_unmap_single(ab->dev, ring->paddr_unaligned, ring->size,
-- DMA_FROM_DEVICE);
-- kfree(ring->vaddr_unaligned);
-- } else {
-+ if (ring->cached)
-+ dma_free_noncoherent(ab->dev, ring->size, ring->vaddr_unaligned,
-+ ring->paddr_unaligned, DMA_FROM_DEVICE);
-+ else
- dma_free_coherent(ab->dev, ring->size, ring->vaddr_unaligned,
- ring->paddr_unaligned);
-- }
-
- ring->vaddr_unaligned = NULL;
- }
-@@ -249,25 +247,14 @@ int ath11k_dp_srng_setup(struct ath11k_b
- default:
- cached = false;
- }
--
-- if (cached) {
-- ring->vaddr_unaligned = kzalloc(ring->size, GFP_KERNEL);
-- if (!ring->vaddr_unaligned)
-- return -ENOMEM;
--
-- ring->paddr_unaligned = dma_map_single(ab->dev,
-- ring->vaddr_unaligned,
-- ring->size,
-- DMA_FROM_DEVICE);
-- if (dma_mapping_error(ab->dev, ring->paddr_unaligned)) {
-- kfree(ring->vaddr_unaligned);
-- ring->vaddr_unaligned = NULL;
-- return -ENOMEM;
-- }
-- }
- }
-
-- if (!cached)
-+ if (cached)
-+ ring->vaddr_unaligned = dma_alloc_noncoherent(ab->dev, ring->size,
-+ &ring->paddr_unaligned,
-+ DMA_FROM_DEVICE,
-+ GFP_KERNEL);
-+ else
- ring->vaddr_unaligned = dma_alloc_coherent(ab->dev, ring->size,
- &ring->paddr_unaligned,
- GFP_KERNEL);
+++ /dev/null
-wifi: ath11k: Use dma_alloc_noncoherent for rx_tid buffer allocation
-
-Currently, the driver allocates cacheable DMA buffers for the rx_tid
-structure using kzalloc() and dma_map_single(). These buffers are
-long-lived and can persist for the lifetime of the peer, which is not
-advisable. Instead of using kzalloc() and dma_map_single() for allocating
-cacheable DMA buffers, utilize the dma_alloc_noncoherent() helper for the
-allocation of long-lived cacheable DMA buffers, such as the peer's rx_tid.
-Since dma_alloc_noncoherent() returns unaligned physical and virtual
-addresses, align them internally before use within the driver. This
-ensures proper allocation of non-coherent memory through the kernel
-helper.
-
-Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
-Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3
-
-Signed-off-by: P Praneesh <quic_ppranees@quicinc.com>
---- a/drivers/net/wireless/ath/ath11k/dp.h
-+++ b/drivers/net/wireless/ath/ath11k/dp.h
-@@ -1,7 +1,7 @@
- /* SPDX-License-Identifier: BSD-3-Clause-Clear */
- /*
- * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
-- * Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
-+ * Copyright (c) 2021-2023, 2025 Qualcomm Innovation Center, Inc. All rights reserved.
- */
-
- #ifndef ATH11K_DP_H
-@@ -20,7 +20,6 @@ struct ath11k_ext_irq_grp;
-
- struct dp_rx_tid {
- u8 tid;
-- u32 *vaddr;
- dma_addr_t paddr;
- u32 size;
- u32 ba_win_sz;
-@@ -37,6 +36,9 @@ struct dp_rx_tid {
- /* Timer info related to fragments */
- struct timer_list frag_timer;
- struct ath11k_base *ab;
-+ u32 *vaddr_unaligned;
-+ dma_addr_t paddr_unaligned;
-+ u32 unaligned_size;
- };
-
- #define DP_REO_DESC_FREE_THRESHOLD 64
---- a/drivers/net/wireless/ath/ath11k/dp_rx.c
-+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
-@@ -1,7 +1,7 @@
- // SPDX-License-Identifier: BSD-3-Clause-Clear
- /*
- * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
-- * Copyright (c) 2021-2024 Qualcomm Innovation Center, Inc. All rights reserved.
-+ * Copyright (c) 2021-2025 Qualcomm Innovation Center, Inc. All rights reserved.
- */
-
- #include <linux/ieee80211.h>
-@@ -675,11 +675,11 @@ void ath11k_dp_reo_cmd_list_cleanup(stru
- list_for_each_entry_safe(cmd, tmp, &dp->reo_cmd_list, list) {
- list_del(&cmd->list);
- rx_tid = &cmd->data;
-- if (rx_tid->vaddr) {
-- dma_unmap_single(ab->dev, rx_tid->paddr,
-- rx_tid->size, DMA_BIDIRECTIONAL);
-- kfree(rx_tid->vaddr);
-- rx_tid->vaddr = NULL;
-+ if (rx_tid->vaddr_unaligned) {
-+ dma_free_noncoherent(ab->dev, rx_tid->unaligned_size,
-+ rx_tid->vaddr_unaligned,
-+ rx_tid->paddr_unaligned, DMA_BIDIRECTIONAL);
-+ rx_tid->vaddr_unaligned = NULL;
- }
- kfree(cmd);
- }
-@@ -689,11 +689,11 @@ void ath11k_dp_reo_cmd_list_cleanup(stru
- list_del(&cmd_cache->list);
- dp->reo_cmd_cache_flush_count--;
- rx_tid = &cmd_cache->data;
-- if (rx_tid->vaddr) {
-- dma_unmap_single(ab->dev, rx_tid->paddr,
-- rx_tid->size, DMA_BIDIRECTIONAL);
-- kfree(rx_tid->vaddr);
-- rx_tid->vaddr = NULL;
-+ if (rx_tid->vaddr_unaligned) {
-+ dma_free_noncoherent(ab->dev, rx_tid->unaligned_size,
-+ rx_tid->vaddr_unaligned,
-+ rx_tid->paddr_unaligned, DMA_BIDIRECTIONAL);
-+ rx_tid->vaddr_unaligned = NULL;
- }
- kfree(cmd_cache);
- }
-@@ -708,11 +708,11 @@ static void ath11k_dp_reo_cmd_free(struc
- if (status != HAL_REO_CMD_SUCCESS)
- ath11k_warn(dp->ab, "failed to flush rx tid hw desc, tid %d status %d\n",
- rx_tid->tid, status);
-- if (rx_tid->vaddr) {
-- dma_unmap_single(dp->ab->dev, rx_tid->paddr, rx_tid->size,
-- DMA_BIDIRECTIONAL);
-- kfree(rx_tid->vaddr);
-- rx_tid->vaddr = NULL;
-+ if (rx_tid->vaddr_unaligned) {
-+ dma_free_noncoherent(dp->ab->dev, rx_tid->unaligned_size,
-+ rx_tid->vaddr_unaligned,
-+ rx_tid->paddr_unaligned, DMA_BIDIRECTIONAL);
-+ rx_tid->vaddr_unaligned = NULL;
- }
- }
-
-@@ -749,10 +749,10 @@ static void ath11k_dp_reo_cache_flush(st
- if (ret) {
- ath11k_err(ab, "failed to send HAL_REO_CMD_FLUSH_CACHE cmd, tid %d (%d)\n",
- rx_tid->tid, ret);
-- dma_unmap_single(ab->dev, rx_tid->paddr, rx_tid->size,
-- DMA_BIDIRECTIONAL);
-- kfree(rx_tid->vaddr);
-- rx_tid->vaddr = NULL;
-+ dma_free_noncoherent(ab->dev, rx_tid->unaligned_size,
-+ rx_tid->vaddr_unaligned,
-+ rx_tid->paddr_unaligned, DMA_BIDIRECTIONAL);
-+ rx_tid->vaddr_unaligned = NULL;
- }
- }
-
-@@ -802,10 +802,10 @@ static void ath11k_dp_rx_tid_del_func(st
-
- return;
- free_desc:
-- dma_unmap_single(ab->dev, rx_tid->paddr, rx_tid->size,
-- DMA_BIDIRECTIONAL);
-- kfree(rx_tid->vaddr);
-- rx_tid->vaddr = NULL;
-+ dma_free_noncoherent(ab->dev, rx_tid->unaligned_size,
-+ rx_tid->vaddr_unaligned,
-+ rx_tid->paddr_unaligned, DMA_BIDIRECTIONAL);
-+ rx_tid->vaddr_unaligned = NULL;
- }
-
- void ath11k_peer_rx_tid_delete(struct ath11k *ar,
-@@ -831,14 +831,16 @@ void ath11k_peer_rx_tid_delete(struct at
- if (ret != -ESHUTDOWN)
- ath11k_err(ar->ab, "failed to send HAL_REO_CMD_UPDATE_RX_QUEUE cmd, tid %d (%d)\n",
- tid, ret);
-- dma_unmap_single(ar->ab->dev, rx_tid->paddr, rx_tid->size,
-- DMA_BIDIRECTIONAL);
-- kfree(rx_tid->vaddr);
-- rx_tid->vaddr = NULL;
-+ dma_free_noncoherent(ar->ab->dev, rx_tid->unaligned_size,
-+ rx_tid->vaddr_unaligned,
-+ rx_tid->paddr_unaligned, DMA_BIDIRECTIONAL);
-+ rx_tid->vaddr_unaligned = NULL;
- }
-
- rx_tid->paddr = 0;
-+ rx_tid->paddr_unaligned = 0;
- rx_tid->size = 0;
-+ rx_tid->unaligned_size = 0;
- }
-
- static int ath11k_dp_rx_link_desc_return(struct ath11k_base *ab,
-@@ -982,10 +984,9 @@ static void ath11k_dp_rx_tid_mem_free(st
- if (!rx_tid->active)
- goto unlock_exit;
-
-- dma_unmap_single(ab->dev, rx_tid->paddr, rx_tid->size,
-- DMA_BIDIRECTIONAL);
-- kfree(rx_tid->vaddr);
-- rx_tid->vaddr = NULL;
-+ dma_free_noncoherent(ab->dev, rx_tid->unaligned_size, rx_tid->vaddr_unaligned,
-+ rx_tid->paddr_unaligned, DMA_BIDIRECTIONAL);
-+ rx_tid->vaddr_unaligned = NULL;
-
- rx_tid->active = false;
-
-@@ -1000,9 +1001,8 @@ int ath11k_peer_rx_tid_setup(struct ath1
- struct ath11k_base *ab = ar->ab;
- struct ath11k_peer *peer;
- struct dp_rx_tid *rx_tid;
-- u32 hw_desc_sz;
-- u32 *addr_aligned;
-- void *vaddr;
-+ u32 hw_desc_sz, *vaddr;
-+ void *vaddr_unaligned;
- dma_addr_t paddr;
- int ret;
-
-@@ -1050,37 +1050,34 @@ int ath11k_peer_rx_tid_setup(struct ath1
- else
- hw_desc_sz = ath11k_hal_reo_qdesc_size(DP_BA_WIN_SZ_MAX, tid);
-
-- vaddr = kzalloc(hw_desc_sz + HAL_LINK_DESC_ALIGN - 1, GFP_ATOMIC);
-- if (!vaddr) {
-+ rx_tid->unaligned_size = hw_desc_sz + HAL_LINK_DESC_ALIGN - 1;
-+ vaddr_unaligned = dma_alloc_noncoherent(ab->dev, rx_tid->unaligned_size, &paddr,
-+ DMA_BIDIRECTIONAL, GFP_ATOMIC);
-+ if (!vaddr_unaligned) {
- spin_unlock_bh(&ab->base_lock);
- return -ENOMEM;
- }
-
-- addr_aligned = PTR_ALIGN(vaddr, HAL_LINK_DESC_ALIGN);
--
-- ath11k_hal_reo_qdesc_setup(addr_aligned, tid, ba_win_sz,
-- ssn, pn_type);
--
-- paddr = dma_map_single(ab->dev, addr_aligned, hw_desc_sz,
-- DMA_BIDIRECTIONAL);
--
-- ret = dma_mapping_error(ab->dev, paddr);
-- if (ret) {
-- spin_unlock_bh(&ab->base_lock);
-- ath11k_warn(ab, "failed to setup dma map for peer %pM rx tid %d: %d\n",
-- peer_mac, tid, ret);
-- goto err_mem_free;
-- }
--
-- rx_tid->vaddr = vaddr;
-- rx_tid->paddr = paddr;
-+ rx_tid->vaddr_unaligned = vaddr_unaligned;
-+ vaddr = PTR_ALIGN(vaddr_unaligned, HAL_LINK_DESC_ALIGN);
-+ rx_tid->paddr_unaligned = paddr;
-+ rx_tid->paddr = rx_tid->paddr_unaligned + ((unsigned long)vaddr -
-+ (unsigned long)rx_tid->vaddr_unaligned);
-+ ath11k_hal_reo_qdesc_setup(vaddr, tid, ba_win_sz, ssn, pn_type);
- rx_tid->size = hw_desc_sz;
- rx_tid->active = true;
-
-+ /* After dma_alloc_noncoherent, vaddr is being modified for reo qdesc setup.
-+ * Since these changes are not reflected in the device, driver now needs to
-+ * explicitly call dma_sync_single_for_device.
-+ */
-+ dma_sync_single_for_device(ab->dev, rx_tid->paddr,
-+ rx_tid->size,
-+ DMA_TO_DEVICE);
- spin_unlock_bh(&ab->base_lock);
-
-- ret = ath11k_wmi_peer_rx_reorder_queue_setup(ar, vdev_id, peer_mac,
-- paddr, tid, 1, ba_win_sz);
-+ ret = ath11k_wmi_peer_rx_reorder_queue_setup(ar, vdev_id, peer_mac, rx_tid->paddr,
-+ tid, 1, ba_win_sz);
- if (ret) {
- ath11k_warn(ar->ab, "failed to setup rx reorder queue for peer %pM tid %d: %d\n",
- peer_mac, tid, ret);
-@@ -1088,12 +1085,6 @@ int ath11k_peer_rx_tid_setup(struct ath1
- }
-
- return ret;
--
--err_mem_free:
-- kfree(rx_tid->vaddr);
-- rx_tid->vaddr = NULL;
--
-- return ret;
- }
-
- int ath11k_dp_rx_ampdu_start(struct ath11k *ar,
{
.hw_rev = ATH11K_HW_IPQ8074,
.name = "ipq8074 hw2.0",
-@@ -2147,7 +2147,8 @@ static void ath11k_core_reset(struct wor
+@@ -2200,7 +2200,8 @@ static void ath11k_core_reset(struct wor
static int ath11k_init_hw_params(struct ath11k_base *ab)
{
const struct ath11k_hw_params *hw_params = NULL;
for (i = 0; i < ARRAY_SIZE(ath11k_hw_params); i++) {
hw_params = &ath11k_hw_params[i];
-@@ -2163,7 +2164,31 @@ static int ath11k_init_hw_params(struct
+@@ -2216,7 +2217,31 @@ static int ath11k_init_hw_params(struct
ab->hw_params = *hw_params;
};
static __le32 ath12k_wmi_tlv_hdr(u32 cmd, u32 len)
-@@ -2364,7 +2366,10 @@ int ath12k_wmi_send_scan_start_cmd(struc
+@@ -2374,7 +2376,10 @@ int ath12k_wmi_send_scan_start_cmd(struc
cmd->scan_id = cpu_to_le32(arg->scan_id);
cmd->scan_req_id = cpu_to_le32(arg->scan_req_id);
cmd->vdev_id = cpu_to_le32(arg->vdev_id);
cmd->notify_scan_events = cpu_to_le32(arg->notify_scan_events);
ath12k_wmi_copy_scan_event_cntrl_flags(cmd, arg);
-@@ -3084,6 +3089,110 @@ out:
+@@ -3094,6 +3099,110 @@ out:
return ret;
}
int
ath12k_wmi_send_twt_enable_cmd(struct ath12k *ar, u32 pdev_id)
{
-@@ -5669,6 +5778,50 @@ static void ath12k_wmi_op_ep_tx_credits(
+@@ -5714,6 +5823,50 @@ static void ath12k_wmi_op_ep_tx_credits(
wake_up(&ab->wmi_ab.tx_credits_wq);
}
static void ath12k_wmi_htc_tx_complete(struct ath12k_base *ab,
struct sk_buff *skb)
{
-@@ -7270,6 +7423,9 @@ static void ath12k_wmi_op_rx(struct ath1
+@@ -7317,6 +7470,9 @@ static void ath12k_wmi_op_rx(struct ath1
case WMI_GTK_OFFLOAD_STATUS_EVENTID:
ath12k_wmi_gtk_offload_status_event(ab, skb);
break;
struct wmi_delba_send_cmd {
__le32 tlv_header;
__le32 vdev_id;
-@@ -3945,6 +3967,16 @@ struct ath12k_wmi_eht_rate_set_params {
+@@ -3944,6 +3966,16 @@ struct ath12k_wmi_eht_rate_set_params {
+ #define REG_ALPHA2_LEN 2
#define MAX_6G_REG_RULES 5
- #define REG_US_5G_NUM_REG_RULES 4
+struct wmi_set_current_country_arg {
+ u8 alpha2[REG_ALPHA2_LEN];
enum wmi_start_event_param {
WMI_VDEV_START_RESP_EVENT = 0,
WMI_VDEV_RESTART_RESP_EVENT,
-@@ -5547,11 +5579,17 @@ int ath12k_wmi_send_bcn_offload_control_
+@@ -5546,11 +5578,17 @@ int ath12k_wmi_send_bcn_offload_control_
u32 vdev_id, u32 bcn_ctrl_op);
int ath12k_wmi_send_init_country_cmd(struct ath12k *ar,
struct ath12k_wmi_init_country_arg *arg);
struct ath12k_wmi_rx_reorder_queue_remove_arg *arg);
--- a/drivers/net/wireless/ath/ath12k/core.c
+++ b/drivers/net/wireless/ath/ath12k/core.c
-@@ -1014,6 +1014,7 @@ void ath12k_core_halt(struct ath12k *ar)
+@@ -1017,6 +1017,7 @@ void ath12k_core_halt(struct ath12k *ar)
cancel_delayed_work_sync(&ar->scan.timeout);
cancel_work_sync(&ar->regd_update_work);
cancel_work_sync(&ab->rfkill_work);
rcu_assign_pointer(ab->pdevs_active[ar->pdev_idx], NULL);
synchronize_rcu();
-@@ -1021,6 +1022,34 @@ void ath12k_core_halt(struct ath12k *ar)
+@@ -1029,6 +1030,34 @@ void ath12k_core_halt(struct ath12k *ar)
idr_init(&ar->txmgmt_idr);
}
static void ath12k_core_pre_reconfigure_recovery(struct ath12k_base *ab)
{
struct ath12k *ar;
-@@ -1045,8 +1074,10 @@ static void ath12k_core_pre_reconfigure_
+@@ -1053,8 +1082,10 @@ static void ath12k_core_pre_reconfigure_
ar = &ah->radio[j];
ath12k_mac_drain_tx(ar);
complete(&ar->scan.on_channel);
complete(&ar->peer_assoc_done);
complete(&ar->peer_delete_done);
-@@ -1312,6 +1343,7 @@ struct ath12k_base *ath12k_core_alloc(st
+@@ -1320,6 +1351,7 @@ struct ath12k_base *ath12k_core_alloc(st
INIT_WORK(&ab->restart_work, ath12k_core_restart);
INIT_WORK(&ab->reset_work, ath12k_core_reset);
INIT_WORK(&ab->rfkill_work, ath12k_rfkill_work);
init_completion(&ab->htc_suspend);
--- a/drivers/net/wireless/ath/ath12k/core.h
+++ b/drivers/net/wireless/ath/ath12k/core.h
-@@ -199,6 +199,12 @@ enum ath12k_scan_state {
+@@ -200,6 +200,12 @@ enum ath12k_scan_state {
ATH12K_SCAN_ABORTING,
};
enum ath12k_dev_flags {
ATH12K_CAC_RUNNING,
ATH12K_FLAG_CRASH_FLUSH,
-@@ -319,6 +325,8 @@ struct ath12k_vif_iter {
+@@ -320,6 +326,8 @@ struct ath12k_vif_iter {
#define ATH12K_RX_RATE_TABLE_11AX_NUM 576
#define ATH12K_RX_RATE_TABLE_NUM 320
struct ath12k_rx_peer_rate_stats {
u64 ht_mcs_count[HAL_RX_MAX_MCS_HT + 1];
u64 vht_mcs_count[HAL_RX_MAX_MCS_VHT + 1];
-@@ -654,6 +662,13 @@ struct ath12k {
+@@ -655,6 +663,13 @@ struct ath12k {
u32 freq_low;
u32 freq_high;
bool nlo_enabled;
};
-@@ -886,6 +901,8 @@ struct ath12k_base {
+@@ -887,6 +902,8 @@ struct ath12k_base {
/* continuous recovery fail count */
atomic_t fail_cont_count;
unsigned long reset_fail_timeout;
return ret;
}
-@@ -5994,7 +6009,7 @@ static int ath12k_mac_start(struct ath12
+@@ -5998,7 +6013,7 @@ static int ath12k_mac_start(struct ath12
/* TODO: Do we need to enable ANI? */
ar->num_started_vdevs = 0;
ar->num_created_vdevs = 0;
-@@ -6174,6 +6189,9 @@ static void ath12k_mac_stop(struct ath12
+@@ -6178,6 +6193,9 @@ static void ath12k_mac_stop(struct ath12
cancel_delayed_work_sync(&ar->scan.timeout);
cancel_work_sync(&ar->regd_update_work);
cancel_work_sync(&ar->ab->rfkill_work);
spin_lock_bh(&ar->data_lock);
list_for_each_entry_safe(ppdu_stats, tmp, &ar->ppdu_stats_info, list) {
-@@ -6420,6 +6438,117 @@ static void ath12k_mac_op_update_vif_off
+@@ -6424,6 +6442,117 @@ static void ath12k_mac_op_update_vif_off
ath12k_mac_update_vif_offload(arvif);
}
static int ath12k_mac_vdev_create(struct ath12k *ar, struct ieee80211_vif *vif)
{
struct ath12k_hw *ah = ar->ah;
-@@ -6534,6 +6663,7 @@ static int ath12k_mac_vdev_create(struct
+@@ -6538,6 +6667,7 @@ static int ath12k_mac_vdev_create(struct
arvif->vdev_id, ret);
goto err_peer_del;
}
break;
case WMI_VDEV_TYPE_STA:
param_id = WMI_STA_PS_PARAM_RX_WAKE_POLICY;
-@@ -6572,6 +6702,13 @@ static int ath12k_mac_vdev_create(struct
+@@ -6576,6 +6706,13 @@ static int ath12k_mac_vdev_create(struct
arvif->vdev_id, ret);
goto err_peer_del;
}
break;
default:
break;
-@@ -6912,6 +7049,11 @@ static void ath12k_mac_op_remove_interfa
+@@ -6916,6 +7053,11 @@ static void ath12k_mac_op_remove_interfa
ath12k_dbg(ab, ATH12K_DBG_MAC, "mac remove interface (vdev %d)\n",
arvif->vdev_id);
if (arvif->vdev_type == WMI_VDEV_TYPE_AP) {
ret = ath12k_peer_delete(ar, arvif->vdev_id, vif->addr);
if (ret)
-@@ -7752,6 +7894,14 @@ ath12k_mac_op_unassign_vif_chanctx(struc
+@@ -7756,6 +7898,14 @@ ath12k_mac_op_unassign_vif_chanctx(struc
ar->num_started_vdevs == 1 && ar->monitor_vdev_created)
ath12k_mac_monitor_stop(ar);
mutex_unlock(&ar->conf_mutex);
}
-@@ -8290,6 +8440,14 @@ ath12k_mac_op_reconfig_complete(struct i
+@@ -8294,6 +8444,14 @@ ath12k_mac_op_reconfig_complete(struct i
ath12k_warn(ar->ab, "pdev %d successfully recovered\n",
ar->pdev->pdev_id);
if (ab->is_reset) {
recovery_count = atomic_inc_return(&ab->recovery_count);
-@@ -9339,6 +9497,9 @@ static void ath12k_mac_setup(struct ath1
+@@ -9344,6 +9502,9 @@ static void ath12k_mac_setup(struct ath1
INIT_WORK(&ar->wmi_mgmt_tx_work, ath12k_mgmt_over_wmi_tx_work);
skb_queue_head_init(&ar->wmi_mgmt_tx_queue);
#endif
--- a/drivers/net/wireless/ath/ath12k/hw.c
+++ b/drivers/net/wireless/ath/ath12k/hw.c
-@@ -928,6 +928,7 @@ static const struct ath12k_hw_params ath
+@@ -961,6 +961,7 @@ static const struct ath12k_hw_params ath
.iova_mask = 0,
.supports_aspm = false,
},
{
.name = "wcn7850 hw2.0",
-@@ -1008,6 +1009,7 @@ static const struct ath12k_hw_params ath
+@@ -1041,6 +1042,7 @@ static const struct ath12k_hw_params ath
.iova_mask = ATH12K_PCIE_MAX_PAYLOAD_SIZE - 1,
.supports_aspm = true,
},
{
.name = "qcn9274 hw2.0",
-@@ -1084,6 +1086,7 @@ static const struct ath12k_hw_params ath
+@@ -1117,6 +1119,7 @@ static const struct ath12k_hw_params ath
.iova_mask = 0,
.supports_aspm = false,
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
-@@ -882,6 +882,7 @@ static const struct ieee80211_iface_limi
+@@ -884,6 +884,7 @@ static const struct ieee80211_iface_limi
BIT(NL80211_IFTYPE_AP) },
{ .max = 1, .types = BIT(NL80211_IFTYPE_P2P_CLIENT) |
BIT(NL80211_IFTYPE_P2P_GO) },
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
-@@ -963,6 +963,7 @@ static void ath9k_set_hw_capab(struct at
+@@ -965,6 +965,7 @@ static void ath9k_set_hw_capab(struct at
ieee80211_hw_set(hw, HOST_BROADCAST_PS_BUFFERING);
ieee80211_hw_set(hw, SUPPORT_FAST_XMIT);
ieee80211_hw_set(hw, SUPPORTS_CLONED_SKBS);
if (ath9k_ps_enable)
ieee80211_hw_set(hw, SUPPORTS_PS);
-@@ -975,9 +976,6 @@ static void ath9k_set_hw_capab(struct at
+@@ -977,9 +978,6 @@ static void ath9k_set_hw_capab(struct at
IEEE80211_RADIOTAP_MCS_HAVE_STBC;
}
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
-@@ -1178,25 +1178,25 @@ static int __init ath9k_init(void)
+@@ -1180,25 +1180,25 @@ static int __init ath9k_init(void)
{
int error;
hw->max_listen_interval = 1;
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
-@@ -733,6 +733,7 @@ static int ath9k_init_softc(u16 devid, s
+@@ -735,6 +735,7 @@ static int ath9k_init_softc(u16 devid, s
if (!ath9k_is_chanctx_enabled())
sc->cur_chan->hw_queue_base = 0;
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
-@@ -1089,7 +1089,7 @@ int ath9k_init_device(u16 devid, struct
+@@ -1091,7 +1091,7 @@ int ath9k_init_device(u16 devid, struct
#ifdef CPTCFG_MAC80211_LEDS
/* must be initialized before ieee80211_register_hw */
ops->spectral_scan_config = ar9003_hw_spectral_scan_config;
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
-@@ -871,7 +871,8 @@ static void ath9k_init_txpower_limits(st
+@@ -873,7 +873,8 @@ static void ath9k_init_txpower_limits(st
if (ah->caps.hw_caps & ATH9K_HW_CAP_5GHZ)
ath9k_init_band_txpower(sc, NL80211_BAND_5GHZ);
}
static const struct ieee80211_iface_limit if_limits[] = {
-@@ -1049,6 +1050,18 @@ static void ath9k_set_hw_capab(struct at
+@@ -1051,6 +1052,18 @@ static void ath9k_set_hw_capab(struct at
wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CAN_REPLACE_PTK0);
}
int ath9k_init_device(u16 devid, struct ath_softc *sc,
const struct ath_bus_ops *bus_ops)
{
-@@ -1096,6 +1109,8 @@ int ath9k_init_device(u16 devid, struct
+@@ -1098,6 +1111,8 @@ int ath9k_init_device(u16 devid, struct
wiphy_read_of_freq_limits(hw->wiphy);
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
-@@ -696,6 +696,12 @@ static int ath9k_of_init(struct ath_soft
+@@ -698,6 +698,12 @@ static int ath9k_of_init(struct ath_soft
return 0;
}
static int ath9k_init_softc(u16 devid, struct ath_softc *sc,
const struct ath_bus_ops *bus_ops)
{
-@@ -804,6 +810,9 @@ static int ath9k_init_softc(u16 devid, s
+@@ -806,6 +812,9 @@ static int ath9k_init_softc(u16 devid, s
if (ret)
goto err_hw;
BRCMF_DEFAULT_SCAN_CHANNEL_TIME);
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c
-@@ -1317,7 +1317,7 @@ int brcmf_alloc(struct device *dev, stru
+@@ -1322,7 +1322,7 @@ int brcmf_alloc(struct device *dev, stru
return 0;
}
{
struct brcmf_bus *bus_if = dev_get_drvdata(dev);
struct brcmf_pub *drvr = bus_if->drvr;
-@@ -1358,10 +1358,13 @@ int brcmf_attach(struct device *dev)
+@@ -1363,10 +1363,13 @@ int brcmf_attach(struct device *dev)
brcmf_fweh_register(drvr, BRCMF_E_PSM_WATCHDOG,
brcmf_psm_watchdog_notify);
#endif /* BRCMFMAC_SDIO_H */
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
-@@ -1200,7 +1200,7 @@ static void brcmf_usb_probe_phase2(struc
+@@ -1202,7 +1202,7 @@ static void brcmf_usb_probe_phase2(struc
goto error;
/* Attach to the common driver interface */
if (ret)
goto error;
-@@ -1277,7 +1277,7 @@ static int brcmf_usb_probe_cb(struct brc
+@@ -1279,7 +1279,7 @@ static int brcmf_usb_probe_cb(struct brc
ret = brcmf_alloc(devinfo->dev, devinfo->settings);
if (ret)
goto fail;
--- a/drivers/net/wireless/ath/ath10k/snoc.c
+++ b/drivers/net/wireless/ath/ath10k/snoc.c
-@@ -1635,10 +1635,10 @@ static int ath10k_fw_init(struct ath10k
+@@ -1637,10 +1637,10 @@ static int ath10k_fw_init(struct ath10k
ar_snoc->fw.dev = &pdev->dev;
}
return err;
-@@ -1518,7 +1526,9 @@ static int cfg80211_netdev_notifier_call
+@@ -1525,7 +1533,9 @@ static int cfg80211_netdev_notifier_call
SET_NETDEV_DEVTYPE(dev, &wiphy_type);
wdev->netdev = dev;
/* can only change netns with wiphy */
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
-@@ -1574,7 +1574,11 @@ static int brcmf_usb_reset_device(struct
+@@ -1576,7 +1576,11 @@ static int brcmf_usb_reset_device(struct
void brcmf_usb_exit(void)
{
--- a/drivers/net/wireless/virtual/mac80211_hwsim.c
+++ b/drivers/net/wireless/virtual/mac80211_hwsim.c
-@@ -6629,6 +6629,7 @@ static void hwsim_virtio_rx_done(struct
+@@ -6636,6 +6636,7 @@ static void hwsim_virtio_rx_done(struct
static int init_vqs(struct virtio_device *vdev)
{
struct virtqueue_info vqs_info[HWSIM_NUM_VQS] = {
[HWSIM_VQ_TX] = { "tx", hwsim_virtio_tx_done },
[HWSIM_VQ_RX] = { "rx", hwsim_virtio_rx_done },
-@@ -6636,6 +6637,19 @@ static int init_vqs(struct virtio_device
+@@ -6643,6 +6644,19 @@ static int init_vqs(struct virtio_device
return virtio_find_vqs(vdev, HWSIM_NUM_VQS,
hwsim_vqs, vqs_info, NULL);
--- a/drivers/net/wireless/marvell/mwl8k.c
+++ b/drivers/net/wireless/marvell/mwl8k.c
-@@ -5712,6 +5712,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw")
+@@ -5716,6 +5716,7 @@ MODULE_FIRMWARE("mwl8k/fmimage_8366.fw")
MODULE_FIRMWARE(MWL8K_8366_AP_FW(MWL8K_8366_AP_FW_API));
static const struct pci_device_id mwl8k_pci_id_table[] = {
--- a/drivers/net/wireless/marvell/mwl8k.c
+++ b/drivers/net/wireless/marvell/mwl8k.c
-@@ -6298,6 +6298,8 @@ static int mwl8k_probe(struct pci_dev *p
+@@ -6302,6 +6302,8 @@ static int mwl8k_probe(struct pci_dev *p
priv->running_bsses = 0;
return rc;
err_stop_firmware:
-@@ -6331,8 +6333,6 @@ static void mwl8k_remove(struct pci_dev
+@@ -6335,8 +6337,6 @@ static void mwl8k_remove(struct pci_dev
return;
priv = hw->priv;
.query_rx_desc = rtw8821c_query_rx_desc,
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
-@@ -1978,13 +1978,13 @@ static const struct rtw_pwr_seq_cmd tran
+@@ -1980,13 +1980,13 @@ static const struct rtw_pwr_seq_cmd tran
RTW_PWR_CMD_END, 0, 0},
};
trans_act_to_cardemu_8822b,
trans_cardemu_to_carddis_8822b,
NULL
-@@ -2156,7 +2156,7 @@ static const struct rtw_rqpn rqpn_table_
+@@ -2158,7 +2158,7 @@ static const struct rtw_rqpn rqpn_table_
RTW_DMA_MAPPING_EXTRA, RTW_DMA_MAPPING_HIGH},
};
.prio[RTW_DMA_MAPPING_EXTRA] = {
.rsvd = REG_FIFOPAGE_INFO_4, .avail = REG_FIFOPAGE_INFO_4 + 2,
},
-@@ -2172,7 +2172,7 @@ static struct rtw_prioq_addrs prioq_addr
+@@ -2174,7 +2174,7 @@ static struct rtw_prioq_addrs prioq_addr
.wsize = true,
};
.phy_set_param = rtw8822b_phy_set_param,
.read_efuse = rtw8822b_read_efuse,
.query_rx_desc = rtw8822b_query_rx_desc,
-@@ -2521,7 +2521,7 @@ static const struct rtw_reg_domain coex_
+@@ -2523,7 +2523,7 @@ static const struct rtw_reg_domain coex_
{0xc50, MASKBYTE0, RTW_REG_DOMAIN_MAC8},
};
};
--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
-@@ -4874,13 +4874,13 @@ static const struct rtw_pwr_seq_cmd tran
+@@ -4875,13 +4875,13 @@ static const struct rtw_pwr_seq_cmd tran
RTW_PWR_CMD_END, 0, 0},
};
trans_act_to_cardemu_8822c,
trans_cardemu_to_carddis_8822c,
NULL
-@@ -4972,7 +4972,7 @@ static const struct rtw_rqpn rqpn_table_
+@@ -4973,7 +4973,7 @@ static const struct rtw_rqpn rqpn_table_
RTW_DMA_MAPPING_EXTRA, RTW_DMA_MAPPING_HIGH},
};
.prio[RTW_DMA_MAPPING_EXTRA] = {
.rsvd = REG_FIFOPAGE_INFO_4, .avail = REG_FIFOPAGE_INFO_4 + 2,
},
-@@ -4988,7 +4988,7 @@ static struct rtw_prioq_addrs prioq_addr
+@@ -4989,7 +4989,7 @@ static struct rtw_prioq_addrs prioq_addr
.wsize = true,
};
.phy_set_param = rtw8822c_phy_set_param,
.read_efuse = rtw8822c_read_efuse,
.query_rx_desc = rtw8822c_query_rx_desc,
-@@ -5301,7 +5301,7 @@ static const struct rtw_pwr_track_tbl rt
+@@ -5302,7 +5302,7 @@ static const struct rtw_pwr_track_tbl rt
.pwrtrk_2g_ccka_p = rtw8822c_pwrtrk_2g_cck_a_p,
};
bool (*write_rf)(struct rtw_dev *rtwdev, enum rtw_rf_path rf_path,
--- a/drivers/net/wireless/realtek/rtw88/pci.c
+++ b/drivers/net/wireless/realtek/rtw88/pci.c
-@@ -1065,7 +1065,7 @@ static u32 rtw_pci_rx_napi(struct rtw_de
+@@ -1066,7 +1066,7 @@ static u32 rtw_pci_rx_napi(struct rtw_de
dma_sync_single_for_cpu(rtwdev->dev, dma, RTK_PCI_RX_BUF_SIZE,
DMA_FROM_DEVICE);
rx_desc = skb->data;
-}
-
static void
- rtw8822b_set_tx_power_index_by_rate(struct rtw_dev *rtwdev, u8 path, u8 rs)
- {
-@@ -2175,7 +2134,7 @@ static const struct rtw_prioq_addrs prio
+ rtw8822b_set_tx_power_index_by_rate(struct rtw_dev *rtwdev, u8 path,
+ u8 rs, u32 *phy_pwr_idx)
+@@ -2177,7 +2136,7 @@ static const struct rtw_prioq_addrs prio
static const struct rtw_chip_ops rtw8822b_ops = {
.phy_set_param = rtw8822b_phy_set_param,
.read_efuse = rtw8822b_read_efuse,
static void
rtw8822c_set_write_tx_power_ref(struct rtw_dev *rtwdev, u8 *tx_pwr_ref_cck,
u8 *tx_pwr_ref_ofdm)
-@@ -4991,7 +4949,7 @@ static const struct rtw_prioq_addrs prio
+@@ -4992,7 +4950,7 @@ static const struct rtw_prioq_addrs prio
static const struct rtw_chip_ops rtw8822c_ops = {
.phy_set_param = rtw8822c_phy_set_param,
.read_efuse = rtw8822c_read_efuse,
struct rtw_rx_pkt_stat *pkt_stat);
--- a/drivers/net/wireless/realtek/rtw88/sdio.c
+++ b/drivers/net/wireless/realtek/rtw88/sdio.c
-@@ -981,8 +981,7 @@ static void rtw_sdio_rxfifo_recv(struct
+@@ -979,8 +979,7 @@ static void rtw_sdio_rxfifo_recv(struct
while (true) {
rx_desc = skb->data;
--- a/drivers/net/wireless/realtek/rtw88/usb.c
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
-@@ -571,8 +571,8 @@ static void rtw_usb_rx_handler(struct wo
+@@ -625,8 +625,8 @@ static void rtw_usb_rx_handler(struct wo
do {
rx_desc = skb->data;
#define REG_AFE_CTRL_4 0x0078
#define BIT_CK320M_AFE_EN BIT(4)
#define BIT_EN_SYN BIT(15)
-@@ -134,6 +143,11 @@
+@@ -135,6 +144,11 @@
#define REG_PMC_DBG_CTRL1 0xa8
#define BITS_PMC_BT_IQK_STS GENMASK(22, 21)
#define REG_PAD_CTRL2 0x00C4
#define BIT_RSM_EN_V1 BIT(16)
#define BIT_NO_PDN_CHIPOFF_V1 BIT(17)
-@@ -185,6 +199,15 @@
+@@ -186,6 +200,15 @@
#define MAC_TRX_ENABLE (BIT_HCI_TXDMA_EN | BIT_HCI_RXDMA_EN | BIT_TXDMA_EN | \
BIT_RXDMA_EN | BIT_PROTOCOL_EN | BIT_SCHEDULE_EN | \
BIT_MACTXEN | BIT_MACRXEN)
#define BIT_SHIFT_TXDMA_VOQ_MAP 4
#define BIT_MASK_TXDMA_VOQ_MAP 0x3
#define BIT_TXDMA_VOQ_MAP(x) \
-@@ -256,6 +279,8 @@
+@@ -257,6 +280,8 @@
#define REG_HMEBOX1 0x01D4
#define REG_HMEBOX2 0x01D8
#define REG_HMEBOX3 0x01DC
#define REG_HMEBOX0_EX 0x01F0
#define REG_HMEBOX1_EX 0x01F4
#define REG_HMEBOX2_EX 0x01F8
-@@ -298,6 +323,7 @@
+@@ -299,6 +324,7 @@
#define REG_AUTO_LLT 0x0224
#define BIT_AUTO_INIT_LLT BIT(16)
#define REG_RQPN_CTRL_1 0x0228
#define REG_RQPN_CTRL_2 0x022C
#define BIT_LD_RQPN BIT(31)
-@@ -329,6 +355,7 @@
+@@ -330,6 +356,7 @@
#define BIT_DMA_BURST_SIZE_1024 0
#define REG_RXPKTNUM 0x02B0
#define REG_INT_MIG 0x0304
#define REG_HCI_MIX_CFG 0x03FC
-@@ -336,6 +363,7 @@
+@@ -337,6 +364,7 @@
#define REG_BCNQ_INFO 0x0418
#define BIT_MGQ_CPU_EMPTY BIT(24)
#define REG_FWHW_TXQ_CTRL 0x0420
#define BIT_EN_BCNQ_DL BIT(22)
#define BIT_EN_WR_FREE_TAIL BIT(20)
-@@ -362,10 +390,12 @@
+@@ -363,10 +391,12 @@
#define REG_AMPDU_MAX_TIME_V1 0x0455
#define REG_BCNQ1_BDNY_V1 0x0456
#define REG_AMPDU_MAX_TIME 0x0456
#define REG_DATA_SC 0x0483
#define REG_ARFR2_V1 0x048C
#define REG_ARFRH2_V1 0x0490
-@@ -390,6 +420,8 @@
+@@ -391,6 +421,8 @@
#define REG_PRECNT_CTRL 0x04E5
#define BIT_BTCCA_CTRL (BIT(0) | BIT(1))
#define BIT_EN_PRECNT BIT(11)
#define REG_DUMMY_PAGE4_V1 0x04FC
#define REG_EDCA_VO_PARAM 0x0500
-@@ -400,6 +432,7 @@
+@@ -401,6 +433,7 @@
#define BIT_MASK_CWMAX GENMASK(15, 12)
#define BIT_MASK_CWMIN GENMASK(11, 8)
#define BIT_MASK_AIFS GENMASK(7, 0)
#define REG_PIFS 0x0512
#define REG_SIFS 0x0514
#define BIT_SHIFT_SIFS_OFDM_CTX 8
-@@ -526,6 +559,8 @@
+@@ -527,6 +560,8 @@
#define REG_BT_COEX_V2 0x0762
#define BIT_GNT_BT_POLARITY BIT(12)
#define BIT_LTE_COEX_EN BIT(7)
#define REG_BT_COEX_ENH_INTR_CTRL 0x76E
#define BIT_R_GRANTALL_WLMASK BIT(3)
#define BIT_STATIS_BT_EN BIT(2)
-@@ -543,14 +578,43 @@
+@@ -544,14 +579,43 @@
#define REG_FPGA0_RFMOD 0x0800
#define BIT_CCKEN BIT(24)
#define BIT_OFDMEN BIT(25)
#define REG_DIS_DPD 0x0a70
#define DIS_DPD_MASK GENMASK(9, 0)
-@@ -566,13 +630,109 @@
+@@ -567,13 +631,109 @@
#define DIS_DPD_RATEVHT2SS_MCS1 BIT(9)
#define DIS_DPD_RATEALL GENMASK(9, 0)
#define REG_ANAPARSW_MAC_0 0x1010
#define BIT_CF_L_V2 GENMASK(29, 28)
-@@ -709,6 +869,10 @@
+@@ -710,6 +870,10 @@
#define REG_IGN_GNTBT4 0x4160
#define RF_MODE 0x00
#define RF_MODOPT 0x01
#define RF_WLINT 0x01
-@@ -716,7 +880,13 @@
+@@ -717,7 +881,13 @@
#define RF_DTXLOK 0x08
#define RF_CFGCH 0x18
#define BIT_BAND GENMASK(18, 16)
#define RF_LUTWA 0x33
#define RF_LUTWD1 0x3e
#define RF_LUTWD0 0x3f
-@@ -725,10 +895,14 @@
+@@ -726,10 +896,14 @@
#define RF_T_METER 0x42
#define RF_BSPAD 0x54
#define RF_GAINTX 0x56
#define RF_MALSEL 0xbe
--- a/drivers/net/wireless/realtek/rtw88/rtw8821c.h
+++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.h
-@@ -214,19 +214,10 @@ extern const struct rtw_chip_info rtw882
+@@ -215,19 +215,10 @@ extern const struct rtw_chip_info rtw882
#define BIT_FEN_EN BIT(26)
#define REG_INIRTS_RATE_SEL 0x0480
#define REG_HTSTFWT 0x800
#define REG_ADC40 0x8c8
#define REG_CHFIR 0x8f0
#define REG_CDDTXP 0x93c
-@@ -234,14 +225,11 @@ extern const struct rtw_chip_info rtw882
+@@ -235,14 +226,11 @@ extern const struct rtw_chip_info rtw882
#define REG_ACBB0 0x948
#define REG_ACBBRXFIR 0x94c
#define REG_ACGG2TBL 0x958
#define REG_RXDESC 0xa2c
#define REG_ENTXCCK 0xa80
#define BTG_LNA 0xfc84
-@@ -252,12 +240,8 @@ extern const struct rtw_chip_info rtw882
+@@ -253,12 +241,8 @@ extern const struct rtw_chip_info rtw882
#define REG_PWRTH2 0xaa8
#define REG_CSRATIO 0xaaa
#define REG_TXFILTER 0xaac
#define REG_TRSW 0xca0
#define REG_RFESEL0 0xcb0
#define REG_RFESEL8 0xcb4
-@@ -269,14 +253,6 @@ extern const struct rtw_chip_info rtw882
+@@ -270,14 +254,6 @@ extern const struct rtw_chip_info rtw882
#define B_WLA_SWITCH BIT(23)
#define REG_RFEINV 0xcbc
#define REG_AGCTR_B 0xe08
#define REG_ANTWT 0x1904
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.h
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.h
-@@ -151,21 +151,12 @@ _rtw_write32s_mask(struct rtw_dev *rtwde
+@@ -152,21 +152,12 @@ _rtw_write32s_mask(struct rtw_dev *rtwde
#define RTW8822B_EDCCA_MAX 0x7f
#define RTW8822B_EDCCA_SRC_DEF 1
#define REG_HTSTFWT 0x800
#define REG_ADC40 0x8c8
#define REG_EDCCA_DECISION 0x8dc
#define BIT_EDCCA_OPTION BIT(5)
-@@ -176,7 +167,6 @@ _rtw_write32s_mask(struct rtw_dev *rtwde
+@@ -177,7 +168,6 @@ _rtw_write32s_mask(struct rtw_dev *rtwde
#define REG_ACBB0 0x948
#define REG_ACBBRXFIR 0x94c
#define REG_ACGG2TBL 0x958
#define REG_ADCINI 0xa04
#define REG_TXSF2 0xa24
#define REG_TXSF6 0xa28
-@@ -184,14 +174,12 @@ _rtw_write32s_mask(struct rtw_dev *rtwde
+@@ -185,14 +175,12 @@ _rtw_write32s_mask(struct rtw_dev *rtwde
#define REG_ENTXCCK 0xa80
#define REG_AGCTR_A 0xc08
#define REG_TXDFIR 0xc20
--- a/drivers/net/wireless/realtek/rtw88/main.c
+++ b/drivers/net/wireless/realtek/rtw88/main.c
-@@ -1917,6 +1917,9 @@ static int rtw_dump_hw_feature(struct rt
+@@ -1907,6 +1907,9 @@ static int rtw_dump_hw_feature(struct rt
u8 bw;
int i;
.lps_deep_mode_supported = BIT(LPS_DEEP_MODE_LCLK),
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
-@@ -2509,6 +2509,7 @@ const struct rtw_chip_info rtw8822b_hw_s
+@@ -2511,6 +2511,7 @@ const struct rtw_chip_info rtw8822b_hw_s
.page_size = TX_PAGE_SIZE,
.dig_min = 0x1c,
.usb_tx_agg_desc_num = 3,
.lps_deep_mode_supported = BIT(LPS_DEEP_MODE_LCLK),
--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
-@@ -5329,6 +5329,7 @@ const struct rtw_chip_info rtw8822c_hw_s
+@@ -5330,6 +5330,7 @@ const struct rtw_chip_info rtw8822c_hw_s
.page_size = TX_PAGE_SIZE,
.dig_min = 0x20,
.usb_tx_agg_desc_num = 3,
.lps_deep_mode_supported = BIT(LPS_DEEP_MODE_LCLK),
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
-@@ -2510,6 +2510,7 @@ const struct rtw_chip_info rtw8822b_hw_s
+@@ -2512,6 +2512,7 @@ const struct rtw_chip_info rtw8822b_hw_s
.dig_min = 0x1c,
.usb_tx_agg_desc_num = 3,
.hw_feature_report = true,
.lps_deep_mode_supported = BIT(LPS_DEEP_MODE_LCLK),
--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
-@@ -5330,6 +5330,7 @@ const struct rtw_chip_info rtw8822c_hw_s
+@@ -5331,6 +5331,7 @@ const struct rtw_chip_info rtw8822c_hw_s
.dig_min = 0x20,
.usb_tx_agg_desc_num = 3,
.hw_feature_report = true,
static int rtw_mac_power_switch(struct rtw_dev *rtwdev, bool pwr_on)
{
-@@ -994,6 +995,7 @@ int rtw_download_firmware(struct rtw_dev
+@@ -999,6 +1000,7 @@ int rtw_download_firmware(struct rtw_dev
return 0;
}
static u32 get_priority_queues(struct rtw_dev *rtwdev, u32 queues)
{
-@@ -1127,7 +1129,7 @@ static int txdma_queue_mapping(struct rt
+@@ -1132,7 +1134,7 @@ static int txdma_queue_mapping(struct rt
return 0;
}
{
const struct rtw_chip_info *chip = rtwdev->chip;
struct rtw_fifo_conf *fifo = &rtwdev->fifo;
-@@ -1179,6 +1181,7 @@ static int set_trx_fifo_info(struct rtw_
+@@ -1184,6 +1186,7 @@ static int set_trx_fifo_info(struct rtw_
return 0;
}
static int __priority_queue_cfg(struct rtw_dev *rtwdev,
const struct rtw_page_table *pg_tbl,
-@@ -1256,7 +1259,7 @@ static int priority_queue_cfg(struct rtw
+@@ -1261,7 +1264,7 @@ static int priority_queue_cfg(struct rtw
u16 pubq_num;
int ret;
--- a/drivers/net/wireless/realtek/rtw88/mac.h
+++ b/drivers/net/wireless/realtek/rtw88/mac.h
-@@ -30,11 +30,14 @@
+@@ -30,6 +30,8 @@
void rtw_set_channel_mac(struct rtw_dev *rtwdev, u8 channel, u8 bw,
u8 primary_ch_idx);
+ const struct rtw_pwr_seq_cmd * const *cmd_seq);
int rtw_mac_power_on(struct rtw_dev *rtwdev);
void rtw_mac_power_off(struct rtw_dev *rtwdev);
+ void rtw_write_firmware_page(struct rtw_dev *rtwdev, u32 page,
+@@ -37,6 +39,7 @@ void rtw_write_firmware_page(struct rtw_
int rtw_download_firmware(struct rtw_dev *rtwdev, struct rtw_fw_state *fw);
int rtw_mac_init(struct rtw_dev *rtwdev);
void rtw_mac_flush_queues(struct rtw_dev *rtwdev, u32 queues, bool drop);
.query_phy_status = query_phy_status,
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
-@@ -2132,6 +2132,8 @@ static const struct rtw_prioq_addrs prio
+@@ -2134,6 +2134,8 @@ static const struct rtw_prioq_addrs prio
};
static const struct rtw_chip_ops rtw8822b_ops = {
.query_phy_status = query_phy_status,
--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
-@@ -4947,6 +4947,8 @@ static const struct rtw_prioq_addrs prio
+@@ -4948,6 +4948,8 @@ static const struct rtw_prioq_addrs prio
};
static const struct rtw_chip_ops rtw8822c_ops = {
--- a/drivers/net/wireless/realtek/rtw88/pci.c
+++ b/drivers/net/wireless/realtek/rtw88/pci.c
-@@ -824,7 +824,7 @@ static int rtw_pci_tx_write_data(struct
+@@ -825,7 +825,7 @@ static int rtw_pci_tx_write_data(struct
pkt_desc = skb_push(skb, chip->tx_pkt_desc_sz);
memset(pkt_desc, 0, tx_pkt_desc_sz);
pkt_info->qsel = rtw_pci_get_tx_qsel(skb, queue);
.lps_deep_mode_supported = BIT(LPS_DEEP_MODE_LCLK),
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
-@@ -2513,6 +2513,7 @@ const struct rtw_chip_info rtw8822b_hw_s
+@@ -2515,6 +2515,7 @@ const struct rtw_chip_info rtw8822b_hw_s
.usb_tx_agg_desc_num = 3,
.hw_feature_report = true,
.c2h_ra_report_size = 7,
.lps_deep_mode_supported = BIT(LPS_DEEP_MODE_LCLK),
--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
-@@ -5333,6 +5333,7 @@ const struct rtw_chip_info rtw8822c_hw_s
+@@ -5334,6 +5334,7 @@ const struct rtw_chip_info rtw8822c_hw_s
.usb_tx_agg_desc_num = 3,
.hw_feature_report = true,
.c2h_ra_report_size = 7,
.ht_supported = true,
--- a/drivers/net/wireless/realtek/rtw88/sdio.c
+++ b/drivers/net/wireless/realtek/rtw88/sdio.c
-@@ -864,7 +864,7 @@ static void rtw_sdio_tx_skb_prepare(stru
+@@ -862,7 +862,7 @@ static void rtw_sdio_tx_skb_prepare(stru
pkt_info->qsel = rtw_sdio_get_tx_qsel(rtwdev, skb, queue);
void rtw_tx_rsvd_page_pkt_info_update(struct rtw_dev *rtwdev,
--- a/drivers/net/wireless/realtek/rtw88/usb.c
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
-@@ -458,7 +458,7 @@ static int rtw_usb_write_data(struct rtw
+@@ -512,7 +512,7 @@ static int rtw_usb_write_data(struct rtw
skb_put_data(skb, buf, size);
skb_push(skb, chip->tx_pkt_desc_sz);
memset(skb->data, 0, chip->tx_pkt_desc_sz);
rtw_tx_fill_txdesc_checksum(rtwdev, pkt_info, skb->data);
ret = rtw_usb_write_port(rtwdev, qsel, skb,
-@@ -525,7 +525,7 @@ static int rtw_usb_tx_write(struct rtw_d
+@@ -579,7 +579,7 @@ static int rtw_usb_tx_write(struct rtw_d
pkt_desc = skb_push(skb, chip->tx_pkt_desc_sz);
memset(pkt_desc, 0, chip->tx_pkt_desc_sz);
ep = qsel_to_ep(rtwusb, pkt_info->qsel);
if (rtw_fw_feature_ext_check(&rtwdev->fw, FW_FEATURE_EXT_OLD_PAGE_NUM))
--- a/drivers/net/wireless/realtek/rtw88/mac.c
+++ b/drivers/net/wireless/realtek/rtw88/mac.c
-@@ -1138,7 +1138,7 @@ int rtw_set_trx_fifo_info(struct rtw_dev
+@@ -1143,7 +1143,7 @@ int rtw_set_trx_fifo_info(struct rtw_dev
/* config rsvd page num */
fifo->rsvd_drv_pg_num = chip->rsvd_drv_pg_num;
.bfer_mu_max_num = 1,
--- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c
-@@ -2072,12 +2072,6 @@ static const struct rtw_intf_phy_para_ta
+@@ -2074,12 +2074,6 @@ static const struct rtw_intf_phy_para_ta
.n_gen2_para = ARRAY_SIZE(pcie_gen2_param_8822b),
};
static const struct rtw_hw_reg rtw8822b_dig[] = {
[0] = { .addr = 0xc50, .mask = 0x7f },
[1] = { .addr = 0xe50, .mask = 0x7f },
-@@ -2432,7 +2426,7 @@ static const u8 rtw8822b_pwrtrk_2g_cck_a
+@@ -2434,7 +2428,7 @@ static const u8 rtw8822b_pwrtrk_2g_cck_a
10, 11, 11, 12, 12, 13, 13, 14, 14, 15
};
.pwrtrk_5gb_n[RTW_PWR_TRK_5G_1] = rtw8822b_pwrtrk_5gb_n[RTW_PWR_TRK_5G_1],
.pwrtrk_5gb_n[RTW_PWR_TRK_5G_2] = rtw8822b_pwrtrk_5gb_n[RTW_PWR_TRK_5G_2],
.pwrtrk_5gb_n[RTW_PWR_TRK_5G_3] = rtw8822b_pwrtrk_5gb_n[RTW_PWR_TRK_5G_3],
-@@ -2455,6 +2449,12 @@ static const struct rtw_pwr_track_tbl rt
+@@ -2457,6 +2451,12 @@ static const struct rtw_pwr_track_tbl rt
.pwrtrk_2g_ccka_p = rtw8822b_pwrtrk_2g_cck_a_p,
};
static const struct rtw_reg_domain coex_info_hw_regs_8822b[] = {
{0xcb0, MASKDWORD, RTW_REG_DOMAIN_MAC32},
{0xcb4, MASKDWORD, RTW_REG_DOMAIN_MAC32},
-@@ -2535,7 +2535,6 @@ const struct rtw_chip_info rtw8822b_hw_s
+@@ -2537,7 +2537,6 @@ const struct rtw_chip_info rtw8822b_hw_s
.rf_tbl = {&rtw8822b_rf_a_tbl, &rtw8822b_rf_b_tbl},
.rfe_defs = rtw8822b_rfe_defs,
.rfe_defs_size = ARRAY_SIZE(rtw8822b_rfe_defs),
.bfer_mu_max_num = 1,
--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
-@@ -4883,16 +4883,6 @@ static const struct rtw_intf_phy_para_ta
+@@ -4884,16 +4884,6 @@ static const struct rtw_intf_phy_para_ta
.n_gen2_para = ARRAY_SIZE(pcie_gen2_param_8822c),
};
static const struct rtw_hw_reg rtw8822c_dig[] = {
[0] = { .addr = 0x1d70, .mask = 0x7f },
[1] = { .addr = 0x1d70, .mask = 0x7f00 },
-@@ -5238,7 +5228,7 @@ static const u8 rtw8822c_pwrtrk_2g_cck_a
+@@ -5239,7 +5229,7 @@ static const u8 rtw8822c_pwrtrk_2g_cck_a
18, 18, 19, 20, 21, 22, 23, 24, 24, 25
};
.pwrtrk_5gb_n[RTW_PWR_TRK_5G_1] = rtw8822c_pwrtrk_5gb_n[RTW_PWR_TRK_5G_1],
.pwrtrk_5gb_n[RTW_PWR_TRK_5G_2] = rtw8822c_pwrtrk_5gb_n[RTW_PWR_TRK_5G_2],
.pwrtrk_5gb_n[RTW_PWR_TRK_5G_3] = rtw8822c_pwrtrk_5gb_n[RTW_PWR_TRK_5G_3],
-@@ -5261,6 +5251,16 @@ static const struct rtw_pwr_track_tbl rt
+@@ -5262,6 +5252,16 @@ static const struct rtw_pwr_track_tbl rt
.pwrtrk_2g_ccka_p = rtw8822c_pwrtrk_2g_cck_a_p,
};
static const struct rtw_hw_reg_offset rtw8822c_edcca_th[] = {
[EDCCA_TH_L2H_IDX] = {
{.addr = 0x84c, .mask = MASKBYTE2}, .offset = 0x80
-@@ -5360,7 +5360,6 @@ const struct rtw_chip_info rtw8822c_hw_s
+@@ -5361,7 +5361,6 @@ const struct rtw_chip_info rtw8822c_hw_s
.rfe_defs_size = ARRAY_SIZE(rtw8822c_rfe_defs),
.en_dis_dpd = true,
.dpd_ratemask = DIS_DPD_RATEALL,
--- a/drivers/net/wireless/realtek/rtw88/usb.c
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
-@@ -478,6 +478,7 @@ static int rtw_usb_write_data_rsvd_page(
+@@ -532,6 +532,7 @@ static int rtw_usb_write_data_rsvd_page(
pkt_info.tx_pkt_size = size;
pkt_info.qsel = TX_DESC_QSEL_BEACON;
pkt_info.offset = chip->tx_pkt_desc_sz;
--- a/drivers/net/wireless/realtek/rtw88/usb.c
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
-@@ -930,6 +930,32 @@ static void rtw_usb_intf_deinit(struct r
+@@ -985,6 +985,32 @@ static void rtw_usb_intf_deinit(struct r
usb_set_intfdata(intf, NULL);
}
static int rtw_usb_switch_mode_new(struct rtw_dev *rtwdev)
{
enum usb_device_speed cur_speed;
-@@ -983,7 +1009,8 @@ static int rtw_usb_switch_mode(struct rt
+@@ -1038,7 +1064,8 @@ static int rtw_usb_switch_mode(struct rt
{
u8 id = rtwdev->chip->id;
return 0;
if (!rtwdev->efuse.usb_mode_switch) {
-@@ -998,7 +1025,10 @@ static int rtw_usb_switch_mode(struct rt
+@@ -1053,7 +1080,10 @@ static int rtw_usb_switch_mode(struct rt
return 0;
}
--- a/drivers/net/wireless/realtek/rtw88/usb.c
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
-@@ -789,6 +789,32 @@ static void rtw_usb_dynamic_rx_agg_v1(st
+@@ -843,6 +843,32 @@ static void rtw_usb_dynamic_rx_agg_v1(st
rtw_write16(rtwdev, REG_RXDMA_AGG_PG_TH, val16);
}
static void rtw_usb_dynamic_rx_agg(struct rtw_dev *rtwdev, bool enable)
{
switch (rtwdev->chip->id) {
-@@ -797,6 +823,10 @@ static void rtw_usb_dynamic_rx_agg(struc
+@@ -851,6 +877,10 @@ static void rtw_usb_dynamic_rx_agg(struc
case RTW_CHIP_TYPE_8821C:
rtw_usb_dynamic_rx_agg_v1(rtwdev, enable);
break;
+++ /dev/null
-From 927dcd0ab53f39ee00a2d1f204b5aac77e28fcf9 Mon Sep 17 00:00:00 2001
-From: Colin Ian King <colin.i.king@gmail.com>
-Date: Wed, 6 Nov 2024 15:46:42 +0000
-Subject: [PATCH 5/6] wifi: rtlwifi: rtl8821ae: phy: restore removed code to
- fix infinite loop
-
-A previous clean-up fix removed the assignment of v2 inside a while loop
-that turned it into an infinite loop. Fix this by restoring the assignment
-of v2 from array[] so that v2 is updated inside the loop.
-
-Fixes: cda37445718d ("wifi: rtlwifi: rtl8821ae: phy: remove some useless code")
-Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
-Tested-by: Ping-Ke Shih <pkshih@realtek.com>
-Reviewed-by: Su Hui <suhui@nfschina.com>
----
- drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c | 4 +++-
- 1 file changed, 3 insertions(+), 1 deletion(-)
-
---- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
-+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
-@@ -2033,8 +2033,10 @@ static bool _rtl8821ae_phy_config_bb_wit
- if (!_rtl8821ae_check_condition(hw, v1)) {
- i += 2; /* skip the pair of expression*/
- v2 = array[i+1];
-- while (v2 != 0xDEAD)
-+ while (v2 != 0xDEAD) {
- i += 3;
-+ v2 = array[i + 1];
-+ }
- }
- }
- }
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
-@@ -1583,24 +1583,6 @@ int ieee80211_register_hw(struct ieee802
+@@ -1585,24 +1585,6 @@ int ieee80211_register_hw(struct ieee802
ieee80211_check_wbrf_support(local);
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
-@@ -2439,6 +2439,13 @@ static void sta_stats_decode_rate(struct
+@@ -2446,6 +2446,13 @@ static void sta_stats_decode_rate(struct
sband = local->hw.wiphy->bands[band];
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
-@@ -565,6 +565,7 @@ __sta_info_alloc(struct ieee80211_sub_if
+@@ -564,6 +564,7 @@ __sta_info_alloc(struct ieee80211_sub_if
spin_lock_init(&sta->ps_lock);
INIT_WORK(&sta->drv_deliver_wk, sta_deliver_ps_frames);
wiphy_work_init(&sta->ampdu_mlme.work, ieee80211_ba_session_work);
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
-@@ -4081,7 +4081,7 @@ struct ieee80211_txq *ieee80211_next_txq
+@@ -4082,7 +4082,7 @@ struct ieee80211_txq *ieee80211_next_txq
if (deficit < 0)
sta->airtime[txqi->txq.ac].deficit +=
if (deficit < 0 || !aql_check) {
list_move_tail(&txqi->schedule_order,
-@@ -4224,7 +4224,8 @@ bool ieee80211_txq_may_transmit(struct i
+@@ -4227,7 +4227,8 @@ bool ieee80211_txq_may_transmit(struct i
}
sta = container_of(iter->txq.sta, struct sta_info, sta);
if (ieee80211_sta_deficit(sta, ac) < 0)
list_move_tail(&iter->schedule_order, &local->active_txqs[ac]);
}
-@@ -4232,7 +4233,7 @@ bool ieee80211_txq_may_transmit(struct i
+@@ -4235,7 +4236,7 @@ bool ieee80211_txq_may_transmit(struct i
if (sta->airtime[ac].deficit >= 0)
goto out;
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
-@@ -187,6 +187,8 @@ enum ieee80211_channel_flags {
+@@ -190,6 +190,8 @@ enum ieee80211_channel_flags {
* @dfs_state: current state of this channel. Only relevant if radar is required
* on this channel.
* @dfs_state_entered: timestamp (jiffies) when the dfs state was entered.
* @dfs_cac_ms: DFS CAC time in milliseconds, this is valid for DFS channels.
* @psd: power spectral density (in dBm)
*/
-@@ -204,6 +206,7 @@ struct ieee80211_channel {
+@@ -207,6 +209,7 @@ struct ieee80211_channel {
int orig_mag, orig_mpwr;
enum nl80211_dfs_state dfs_state;
unsigned long dfs_state_entered;
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
-@@ -1031,6 +1031,8 @@ void cfg80211_dfs_channels_update_work(s
+@@ -1032,6 +1032,8 @@ void cfg80211_dfs_channels_update_work(s
if (c->dfs_state == NL80211_DFS_UNAVAILABLE) {
time_dfs_update = IEEE80211_DFS_MIN_NOP_TIME_MS;
radar_event = NL80211_RADAR_NOP_FINISHED;
} else {
if (regulatory_pre_cac_allowed(wiphy) ||
cfg80211_any_wiphy_oper_chan(wiphy, c))
-@@ -1038,11 +1040,10 @@ void cfg80211_dfs_channels_update_work(s
+@@ -1039,11 +1041,10 @@ void cfg80211_dfs_channels_update_work(s
time_dfs_update = REG_PRE_CAC_EXPIRY_GRACE_MS;
radar_event = NL80211_RADAR_PRE_CAC_EXPIRED;
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
-@@ -3423,6 +3423,7 @@ enum wiphy_params_flags {
+@@ -3426,6 +3426,7 @@ enum wiphy_params_flags {
/* The per TXQ device queue limit in airtime */
#define IEEE80211_DEFAULT_AQL_TXQ_LIMIT_L 5000
#define IEEE80211_DEFAULT_AQL_TXQ_LIMIT_H 12000
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
-@@ -1351,10 +1351,12 @@ struct ieee80211_local {
+@@ -1360,10 +1360,12 @@ struct ieee80211_local {
spinlock_t handle_wake_tx_queue_lock;
u16 airtime_flags;
spin_lock_init(&local->active_txq_lock[i]);
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
-@@ -2353,13 +2353,28 @@ EXPORT_SYMBOL(ieee80211_sta_recalc_aggre
+@@ -2360,13 +2360,28 @@ EXPORT_SYMBOL(ieee80211_sta_recalc_aggre
void ieee80211_sta_update_pending_airtime(struct ieee80211_local *local,
struct sta_info *sta, u8 ac,
spin_unlock_irqrestore(&local->ack_status_lock, flags);
if (id >= 0) {
-@@ -3982,20 +3982,20 @@ begin:
+@@ -3983,20 +3983,20 @@ begin:
encap_out:
info->control.vif = vif;
}
return skb;
-@@ -4047,6 +4047,7 @@ struct ieee80211_txq *ieee80211_next_txq
+@@ -4048,6 +4048,7 @@ struct ieee80211_txq *ieee80211_next_txq
struct ieee80211_txq *ret = NULL;
struct txq_info *txqi = NULL, *head = NULL;
bool found_eligible_txq = false;
spin_lock_bh(&local->active_txq_lock[ac]);
-@@ -4070,26 +4071,26 @@ struct ieee80211_txq *ieee80211_next_txq
+@@ -4071,26 +4072,26 @@ struct ieee80211_txq *ieee80211_next_txq
if (!head)
head = txqi;
if (txqi->schedule_round == local->schedule_round[ac])
goto out;
-@@ -4154,7 +4155,8 @@ bool ieee80211_txq_airtime_check(struct
+@@ -4157,7 +4158,8 @@ bool ieee80211_txq_airtime_check(struct
return true;
if (!txq->sta)
if (unlikely(txq->tid == IEEE80211_NUM_TIDS))
return true;
-@@ -4203,15 +4205,15 @@ bool ieee80211_txq_may_transmit(struct i
+@@ -4206,15 +4208,15 @@ bool ieee80211_txq_may_transmit(struct i
spin_lock_bh(&local->active_txq_lock[ac]);
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
-@@ -6271,6 +6271,7 @@ enum ieee80211_ap_reg_power {
+@@ -6274,6 +6274,7 @@ enum ieee80211_ap_reg_power {
* entered.
* @links.cac_time_ms: CAC time in ms
* @valid_links: bitmap describing what elements of @links are valid
*/
struct wireless_dev {
struct wiphy *wiphy;
-@@ -6383,6 +6384,8 @@ struct wireless_dev {
+@@ -6386,6 +6387,8 @@ struct wireless_dev {
unsigned int cac_time_ms;
} links[IEEE80211_MLD_MAX_NUM_LINKS];
u16 valid_links;
};
static inline const u8 *wdev_address(struct wireless_dev *wdev)
-@@ -6569,6 +6572,17 @@ bool cfg80211_radio_chandef_valid(const
+@@ -6572,6 +6575,17 @@ bool cfg80211_radio_chandef_valid(const
const struct cfg80211_chan_def *chandef);
/**
__NL80211_ATTR_AFTER_LAST,
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
-@@ -829,6 +829,7 @@ static const struct nla_policy nl80211_p
+@@ -832,6 +832,7 @@ static const struct nla_policy nl80211_p
[NL80211_ATTR_MLO_TTLM_DLINK] = NLA_POLICY_EXACT_LEN(sizeof(u16) * 8),
[NL80211_ATTR_MLO_TTLM_ULINK] = NLA_POLICY_EXACT_LEN(sizeof(u16) * 8),
[NL80211_ATTR_ASSOC_SPP_AMSDU] = { .type = NLA_FLAG },
};
/* policy for the key attributes */
-@@ -3996,7 +3997,8 @@ static int nl80211_send_iface(struct sk_
+@@ -4003,7 +4004,8 @@ static int nl80211_send_iface(struct sk_
nla_put_u32(msg, NL80211_ATTR_GENERATION,
rdev->devlist_generation ^
(cfg80211_rdev_list_generation << 2)) ||
goto nla_put_failure;
if (rdev->ops->get_channel && !wdev->valid_links) {
-@@ -4312,6 +4314,29 @@ static int nl80211_valid_4addr(struct cf
+@@ -4324,6 +4326,29 @@ static int nl80211_valid_4addr(struct cf
return -EOPNOTSUPP;
}
static int nl80211_set_interface(struct sk_buff *skb, struct genl_info *info)
{
struct cfg80211_registered_device *rdev = info->user_ptr[0];
-@@ -4319,6 +4344,8 @@ static int nl80211_set_interface(struct
+@@ -4331,6 +4356,8 @@ static int nl80211_set_interface(struct
int err;
enum nl80211_iftype otype, ntype;
struct net_device *dev = info->user_ptr[1];
bool change = false;
memset(¶ms, 0, sizeof(params));
-@@ -4332,8 +4359,6 @@ static int nl80211_set_interface(struct
+@@ -4344,8 +4371,6 @@ static int nl80211_set_interface(struct
}
if (info->attrs[NL80211_ATTR_MESH_ID]) {
if (ntype != NL80211_IFTYPE_MESH_POINT)
return -EINVAL;
if (otype != NL80211_IFTYPE_MESH_POINT)
-@@ -4364,6 +4389,12 @@ static int nl80211_set_interface(struct
+@@ -4376,6 +4401,12 @@ static int nl80211_set_interface(struct
if (err > 0)
change = true;
if (change)
err = cfg80211_change_iface(rdev, dev, ntype, ¶ms);
else
-@@ -4372,11 +4403,11 @@ static int nl80211_set_interface(struct
+@@ -4384,11 +4415,11 @@ static int nl80211_set_interface(struct
if (!err && params.use_4addr != -1)
dev->ieee80211_ptr->use_4addr = params.use_4addr;
return err;
}
-@@ -4387,6 +4418,7 @@ static int _nl80211_new_interface(struct
+@@ -4399,6 +4430,7 @@ static int _nl80211_new_interface(struct
struct vif_params params;
struct wireless_dev *wdev;
struct sk_buff *msg;
int err;
enum nl80211_iftype type = NL80211_IFTYPE_UNSPECIFIED;
-@@ -4424,6 +4456,10 @@ static int _nl80211_new_interface(struct
+@@ -4436,6 +4468,10 @@ static int _nl80211_new_interface(struct
if (err < 0)
return err;
msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
if (!msg)
return -ENOMEM;
-@@ -4465,6 +4501,9 @@ static int _nl80211_new_interface(struct
+@@ -4477,6 +4513,9 @@ static int _nl80211_new_interface(struct
break;
}
if (nl80211_send_iface(msg, info->snd_portid, info->snd_seq, 0,
rdev, wdev, NL80211_CMD_NEW_INTERFACE) < 0) {
nlmsg_free(msg);
-@@ -9180,6 +9219,9 @@ static bool cfg80211_off_channel_oper_al
+@@ -9192,6 +9231,9 @@ static bool cfg80211_off_channel_oper_al
lockdep_assert_wiphy(wdev->wiphy);
if (!cfg80211_beaconing_iface_active(wdev))
return true;
-@@ -9392,7 +9434,8 @@ static int nl80211_trigger_scan(struct s
+@@ -9404,7 +9446,8 @@ static int nl80211_trigger_scan(struct s
}
/* ignore disabled channels */
continue;
request->channels[i] = chan;
-@@ -9412,7 +9455,8 @@ static int nl80211_trigger_scan(struct s
+@@ -9424,7 +9467,8 @@ static int nl80211_trigger_scan(struct s
chan = &wiphy->bands[band]->channels[j];
request->channels[i] = chan;
--- a/net/wireless/scan.c
+++ b/net/wireless/scan.c
-@@ -956,7 +956,8 @@ static int cfg80211_scan_6ghz(struct cfg
+@@ -953,7 +953,8 @@ static int cfg80211_scan_6ghz(struct cfg
struct ieee80211_channel *chan =
ieee80211_get_channel(&rdev->wiphy, ap->center_freq);
continue;
for (i = 0; i < rdev_req->n_channels; i++) {
-@@ -3519,9 +3520,12 @@ int cfg80211_wext_siwscan(struct net_dev
+@@ -3512,9 +3513,12 @@ int cfg80211_wext_siwscan(struct net_dev
continue;
for (j = 0; j < wiphy->bands[band]->n_channels; j++) {
/* If we have a wireless request structure and the
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
-@@ -2923,3 +2923,32 @@ bool cfg80211_radio_chandef_valid(const
+@@ -2970,3 +2970,32 @@ bool cfg80211_radio_chandef_valid(const
return true;
}
EXPORT_SYMBOL(cfg80211_radio_chandef_valid);
+EXPORT_SYMBOL(cfg80211_wdev_channel_allowed);
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
-@@ -1424,6 +1424,8 @@ void cfg80211_init_wdev(struct wireless_
+@@ -1431,6 +1431,8 @@ void cfg80211_init_wdev(struct wireless_
/* allow mac80211 to determine the timeout */
wdev->ps_timeout = -1;
--- a/net/mac80211/scan.c
+++ b/net/mac80211/scan.c
-@@ -1176,14 +1176,14 @@ int ieee80211_request_ibss_scan(struct i
+@@ -1175,14 +1175,14 @@ int ieee80211_request_ibss_scan(struct i
unsigned int n_channels)
{
struct ieee80211_local *local = sdata->local;
/* fill internal scan request */
if (!channels) {
-@@ -1200,7 +1200,9 @@ int ieee80211_request_ibss_scan(struct i
+@@ -1199,7 +1199,9 @@ int ieee80211_request_ibss_scan(struct i
&local->hw.wiphy->bands[band]->channels[i];
if (tmp_ch->flags & (IEEE80211_CHAN_NO_IR |
continue;
local->int_scan_req->channels[n_ch] = tmp_ch;
-@@ -1209,21 +1211,23 @@ int ieee80211_request_ibss_scan(struct i
+@@ -1208,21 +1210,23 @@ int ieee80211_request_ibss_scan(struct i
}
if (WARN_ON_ONCE(n_ch == 0))
local->int_scan_req->n_channels = n_ch;
}
-@@ -1233,9 +1237,7 @@ int ieee80211_request_ibss_scan(struct i
+@@ -1232,9 +1236,7 @@ int ieee80211_request_ibss_scan(struct i
memcpy(local->int_scan_req->ssids[0].ssid, ssid, IEEE80211_MAX_SSID_LEN);
local->int_scan_req->ssids[0].ssid_len = ssid_len;
new_ctx = ieee80211_new_chanctx(local, chanreq, mode,
false, radio_idx);
else
-@@ -1883,7 +1888,9 @@ int _ieee80211_link_use_channel(struct i
+@@ -1884,7 +1889,9 @@ int _ieee80211_link_use_channel(struct i
/* Note: context is now reserved */
if (ctx)
reserved = true;
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
-@@ -4700,6 +4700,7 @@ struct cfg80211_ops {
+@@ -4703,6 +4703,7 @@ struct cfg80211_ops {
struct ieee80211_channel *chan);
int (*set_monitor_channel)(struct wiphy *wiphy,
struct ieee80211_local *local = wiphy_priv(wiphy);
--- a/net/wireless/chan.c
+++ b/net/wireless/chan.c
-@@ -1673,6 +1673,7 @@ bool cfg80211_reg_check_beaconing(struct
+@@ -1679,6 +1679,7 @@ bool cfg80211_reg_check_beaconing(struct
EXPORT_SYMBOL(cfg80211_reg_check_beaconing);
int cfg80211_set_monitor_channel(struct cfg80211_registered_device *rdev,
struct cfg80211_chan_def *chandef)
{
if (!rdev->ops->set_monitor_channel)
-@@ -1680,7 +1681,7 @@ int cfg80211_set_monitor_channel(struct
+@@ -1686,7 +1687,7 @@ int cfg80211_set_monitor_channel(struct
if (!cfg80211_has_monitors_only(rdev))
return -EBUSY;
int ieee80211_get_ratemask(struct ieee80211_supported_band *sband,
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
-@@ -3562,7 +3562,7 @@ static int __nl80211_set_channel(struct
+@@ -3569,7 +3569,7 @@ static int __nl80211_set_channel(struct
case NL80211_IFTYPE_MESH_POINT:
return cfg80211_set_mesh_channel(rdev, wdev, &chandef);
case NL80211_IFTYPE_MONITOR:
* @IEEE80211_HW_NO_AUTO_VIF: The driver would like for no wlanX to
* be created. It is expected user-space will create vifs as
* desired (and thus have them named as desired).
-@@ -2838,6 +2843,7 @@ enum ieee80211_hw_flags {
+@@ -2843,6 +2848,7 @@ enum ieee80211_hw_flags {
IEEE80211_HW_SUPPORTS_DYNAMIC_PS,
IEEE80211_HW_MFP_CAPABLE,
IEEE80211_HW_WANT_MONITOR_VIF,
}
/* Regardless of eth_mac_addr() return we still want to add the
-@@ -699,9 +704,11 @@ static void ieee80211_do_stop(struct iee
+@@ -705,9 +710,11 @@ static void ieee80211_do_stop(struct iee
ieee80211_recalc_idle(local);
ieee80211_recalc_offload(local);
fallthrough;
default:
if (!going_down)
-@@ -1131,7 +1138,8 @@ int ieee80211_add_virtual_monitor(struct
+@@ -1140,7 +1147,8 @@ int ieee80211_add_virtual_monitor(struct
ASSERT_RTNL();
lockdep_assert_wiphy(local->hw.wiphy);
return 0;
sdata = kzalloc(sizeof(*sdata) + local->hw.vif_data_size, GFP_KERNEL);
-@@ -1193,6 +1201,9 @@ void ieee80211_del_virtual_monitor(struc
+@@ -1202,6 +1210,9 @@ void ieee80211_del_virtual_monitor(struc
{
struct ieee80211_sub_if_data *sdata;
ASSERT_RTNL();
lockdep_assert_wiphy(local->hw.wiphy);
-@@ -1328,7 +1339,8 @@ int ieee80211_do_open(struct wireless_de
+@@ -1345,7 +1356,8 @@ int ieee80211_do_open(struct wireless_de
break;
}
vif = &sdata->vif;
break;
}
-@@ -3952,7 +3953,8 @@ begin:
+@@ -3953,7 +3954,8 @@ begin:
switch (tx.sdata->vif.type) {
case NL80211_IFTYPE_MONITOR:
}
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
-@@ -739,7 +739,8 @@ static void __iterate_interfaces(struct
+@@ -740,7 +740,8 @@ static void __iterate_interfaces(struct
lockdep_is_held(&local->hw.wiphy->mtx)) {
switch (sdata->vif.type) {
case NL80211_IFTYPE_MONITOR:
continue;
break;
case NL80211_IFTYPE_AP_VLAN:
-@@ -1856,8 +1857,10 @@ int ieee80211_reconfig(struct ieee80211_
+@@ -1860,8 +1861,10 @@ int ieee80211_reconfig(struct ieee80211_
}
list_for_each_entry(sdata, &local->interfaces, list) {
ieee80211_sdata_running(sdata)) {
res = drv_add_interface(local, sdata);
if (WARN_ON(res))
-@@ -1870,11 +1873,14 @@ int ieee80211_reconfig(struct ieee80211_
+@@ -1874,11 +1877,14 @@ int ieee80211_reconfig(struct ieee80211_
*/
if (res) {
list_for_each_entry_continue_reverse(sdata, &local->interfaces,
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
-@@ -2272,6 +2272,7 @@ static inline int cfg80211_get_station(s
+@@ -2275,6 +2275,7 @@ static inline int cfg80211_get_station(s
* @MONITOR_FLAG_OTHER_BSS: disable BSSID filtering
* @MONITOR_FLAG_COOK_FRAMES: report frames after processing
* @MONITOR_FLAG_ACTIVE: active monitor, ACKs frames on its MAC address
*/
enum monitor_flags {
MONITOR_FLAG_CHANGED = BIT(__NL80211_MNTR_FLAG_INVALID),
-@@ -2281,6 +2282,7 @@ enum monitor_flags {
+@@ -2284,6 +2285,7 @@ enum monitor_flags {
MONITOR_FLAG_OTHER_BSS = BIT(NL80211_MNTR_FLAG_OTHER_BSS),
MONITOR_FLAG_COOK_FRAMES = BIT(NL80211_MNTR_FLAG_COOK_FRAMES),
MONITOR_FLAG_ACTIVE = BIT(NL80211_MNTR_FLAG_ACTIVE),
/**
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
-@@ -4703,6 +4703,7 @@ enum nl80211_survey_info {
+@@ -4709,6 +4709,7 @@ enum nl80211_survey_info {
* overrides all other flags.
* @NL80211_MNTR_FLAG_ACTIVE: use the configured MAC address
* and ACK incoming unicast packets.
*
* @__NL80211_MNTR_FLAG_AFTER_LAST: internal use
* @NL80211_MNTR_FLAG_MAX: highest possible monitor flag
-@@ -4715,6 +4716,7 @@ enum nl80211_mntr_flags {
+@@ -4721,6 +4722,7 @@ enum nl80211_mntr_flags {
NL80211_MNTR_FLAG_OTHER_BSS,
NL80211_MNTR_FLAG_COOK_FRAMES,
NL80211_MNTR_FLAG_ACTIVE,
__NL80211_MNTR_FLAG_AFTER_LAST,
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
-@@ -4201,6 +4201,7 @@ static const struct nla_policy mntr_flag
+@@ -4208,6 +4208,7 @@ static const struct nla_policy mntr_flag
[NL80211_MNTR_FLAG_OTHER_BSS] = { .type = NLA_FLAG },
[NL80211_MNTR_FLAG_COOK_FRAMES] = { .type = NLA_FLAG },
[NL80211_MNTR_FLAG_ACTIVE] = { .type = NLA_FLAG },
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
-@@ -1373,7 +1373,7 @@ struct ieee80211_local {
+@@ -1382,7 +1382,7 @@ struct ieee80211_local {
spinlock_t queue_stop_reason_lock;
int open_count;
fif_probe_req;
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
-@@ -1094,6 +1094,8 @@ void ieee80211_adjust_monitor_flags(stru
+@@ -1103,6 +1103,8 @@ void ieee80211_adjust_monitor_flags(stru
ADJUST(CONTROL, control);
ADJUST(CONTROL, pspoll);
ADJUST(OTHER_BSS, other_bss);
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
-@@ -5443,6 +5443,8 @@ struct wiphy_radio_freq_range {
+@@ -5446,6 +5446,8 @@ struct wiphy_radio_freq_range {
* @iface_combinations: Valid interface combinations array, should not
* list single interface types.
* @n_iface_combinations: number of entries in @iface_combinations array.
*/
struct wiphy_radio {
const struct wiphy_radio_freq_range *freq_range;
-@@ -5450,6 +5452,8 @@ struct wiphy_radio {
+@@ -5453,6 +5455,8 @@ struct wiphy_radio {
const struct ieee80211_iface_combination *iface_combinations;
int n_iface_combinations;
#define CFG80211_HW_TIMESTAMP_ALL_PEERS 0xffff
--- a/include/uapi/linux/nl80211.h
+++ b/include/uapi/linux/nl80211.h
-@@ -8038,6 +8038,8 @@ enum nl80211_ap_settings_flags {
+@@ -8044,6 +8044,8 @@ enum nl80211_ap_settings_flags {
* @NL80211_WIPHY_RADIO_ATTR_INTERFACE_COMBINATION: Supported interface
* combination for this radio. Attribute may be present multiple times
* and contains attributes defined in &enum nl80211_if_combination_attrs.
*
* @__NL80211_WIPHY_RADIO_ATTR_LAST: Internal
* @NL80211_WIPHY_RADIO_ATTR_MAX: Highest attribute
-@@ -8048,6 +8050,7 @@ enum nl80211_wiphy_radio_attrs {
+@@ -8054,6 +8056,7 @@ enum nl80211_wiphy_radio_attrs {
NL80211_WIPHY_RADIO_ATTR_INDEX,
NL80211_WIPHY_RADIO_ATTR_FREQ_RANGE,
NL80211_WIPHY_RADIO_ATTR_INTERFACE_COMBINATION,
__NL80211_WIPHY_RADIO_ATTR_LAST,
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
-@@ -2431,6 +2431,11 @@ static int nl80211_put_radio(struct wiph
+@@ -2438,6 +2438,11 @@ static int nl80211_put_radio(struct wiph
if (nla_put_u32(msg, NL80211_WIPHY_RADIO_ATTR_INDEX, idx))
goto nla_put_failure;
}
/* Regardless of eth_mac_addr() return we still want to add the
-@@ -1324,6 +1319,8 @@ int ieee80211_do_open(struct wireless_de
+@@ -1336,6 +1331,8 @@ int ieee80211_do_open(struct wireless_de
}
}
+From 4e1916dec9850cd49dd5792200ab649061cbedc1 Mon Sep 17 00:00:00 2001
From: Maharaja Kennadyrajan <maharaja.kennadyrajan@oss.qualcomm.com>
Date: Fri, 18 Jul 2025 11:38:35 +0530
-Subject: [PATCH] wifi: mac80211: Add link iteration macro for link data
- with rcu_dereference
+Subject: [PATCH] wifi: mac80211: Add link iteration macro for link data with
+ rcu_dereference
Currently, the existing macro for_each_link_data() uses sdata_dereference()
which requires the wiphy lock. This lock cannot be used in atomic or RCU
Link: https://patch.msgid.link/20250718060837.59371-3-maharaja.kennadyrajan@oss.qualcomm.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
+ net/mac80211/ieee80211_i.h | 13 +++++++++++++
+ 1 file changed, 13 insertions(+)
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
-@@ -1211,6 +1211,30 @@ struct ieee80211_sub_if_data *vif_to_sda
- if ((_link = wiphy_dereference((local)->hw.wiphy, \
- ___sdata->link[___link_id])))
+@@ -1220,6 +1220,19 @@ struct ieee80211_sub_if_data *vif_to_sda
+ ((__link) = sdata_dereference((__sdata)->link[__link_id], \
+ (__sdata))))
-+#define for_each_link_data(sdata, __link) \
-+ /* outer loop just to define the variable ... */ \
-+ for (struct ieee80211_sub_if_data *__sdata = (sdata); __sdata; \
-+ __sdata = NULL /* always stop */) \
-+ for (int __link_id = 0; \
-+ __link_id < ARRAY_SIZE((__sdata)->link); __link_id++) \
-+ if ((!(__sdata)->vif.valid_links || \
-+ (__sdata)->vif.valid_links & BIT(__link_id)) && \
-+ ((__link) = sdata_dereference((__sdata)->link[__link_id], \
-+ (__sdata))))
-+
+/*
+ * for_each_link_data_rcu should be used under RCU read lock.
+ */
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
-@@ -2159,6 +2159,21 @@ static void ieee80211_csa_switch_work(st
+@@ -2167,6 +2167,21 @@ static void ieee80211_csa_switch_work(st
}
}
ieee80211_sta_reset_beacon_monitor(sdata);
ieee80211_sta_reset_conn_monitor(sdata);
}
-@@ -7863,6 +7878,29 @@ void ieee80211_sta_work(struct ieee80211
+@@ -7892,6 +7907,29 @@ void ieee80211_sta_work(struct ieee80211
}
}
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
-@@ -3831,9 +3831,6 @@ static void ieee80211_mgd_probe_ap_send(
+@@ -3841,9 +3841,6 @@ static void ieee80211_mgd_probe_ap_send(
lockdep_assert_wiphy(sdata->local->hw.wiphy);
/*
* Try sending broadcast probe requests for the last three
* probe requests after the first ones failed since some
-@@ -3879,9 +3876,6 @@ static void ieee80211_mgd_probe_ap(struc
+@@ -3889,9 +3886,6 @@ static void ieee80211_mgd_probe_ap(struc
lockdep_assert_wiphy(sdata->local->hw.wiphy);
if (!ieee80211_sdata_running(sdata))
return;
-@@ -7921,36 +7915,73 @@ static void ieee80211_sta_bcn_mon_timer(
+@@ -7950,36 +7944,73 @@ static void ieee80211_sta_bcn_mon_timer(
&sdata->u.mgd.beacon_connection_loss_work);
}
+++ /dev/null
-From 0d47666f48a084363ee54f389bec2865de4934b8 Mon Sep 17 00:00:00 2001
-From: Benjamin Berg <benjamin@sipsolutions.net>
-Date: Wed, 30 Apr 2025 20:25:38 +0200
-Subject: [PATCH] wifi: mac80211: do not offer a mesh path if forwarding is
- disabled
-
-When processing a PREQ the code would always check whether we have a
-mesh path locally and reply accordingly. However, when forwarding is
-disabled then we should not reply with this information as we will not
-forward data packets down that path.
-
-Move the check for dot11MeshForwarding up in the function and skip the
-mesh path lookup in that case. In the else block, set forward to false
-so that the rest of the function becomes a no-op and the
-dot11MeshForwarding check does not need to be duplicated.
-
-This explains an effect observed in the Freifunk community where mesh
-forwarding is disabled. In that case a mesh with three STAs and only bad
-links in between them, individual STAs would occionally have indirect
-mpath entries. This should not have happened.
-
-Signed-off-by: Benjamin Berg <benjamin@sipsolutions.net>
-Reviewed-by: Rouven Czerwinski <rouven@czerwinskis.de>
----
- net/mac80211/mesh_hwmp.c | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
-
---- a/net/mac80211/mesh_hwmp.c
-+++ b/net/mac80211/mesh_hwmp.c
-@@ -630,7 +630,7 @@ static void hwmp_preq_frame_process(stru
- mesh_path_add_gate(mpath);
- }
- rcu_read_unlock();
-- } else {
-+ } else if (ifmsh->mshcfg.dot11MeshForwarding) {
- rcu_read_lock();
- mpath = mesh_path_lookup(sdata, target_addr);
- if (mpath) {
-@@ -648,6 +648,8 @@ static void hwmp_preq_frame_process(stru
- }
- }
- rcu_read_unlock();
-+ } else {
-+ forward = false;
- }
-
- if (reply) {
-@@ -665,7 +667,7 @@ static void hwmp_preq_frame_process(stru
- }
- }
-
-- if (forward && ifmsh->mshcfg.dot11MeshForwarding) {
-+ if (forward) {
- u32 preq_id;
- u8 hopcount;
-