From: Mieczyslaw Nalewaj Date: Sat, 24 May 2025 12:58:18 +0000 (+0200) Subject: mac80211: update to version 6.14.11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=88f4c32060f79e5161a789e85da299cebbde68bf;p=thirdparty%2Fopenwrt.git mac80211: update to version 6.14.11 Update to version 6.14.11 Signed-off-by: Mieczyslaw Nalewaj Signed-off-by: Felix Fietkau --- diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index cd63225b25d..2dcd70f7e1b 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -10,13 +10,13 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 -PKG_VERSION:=6.12.6 -PKG_RELEASE:=2 +PKG_VERSION:=6.14.11 +PKG_RELEASE:=1 PKG_LICENSE:=GPL-2.0-only PKG_LICENSE_FILES:=COPYING PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/ -PKG_HASH:=28ec39425a1b3270e1422d92a8131a6a3d8919cc13e8ee250c315e55d922ba68 +PKG_HASH:=1f6620485f0b33046e87aa2c6ac04ae529e9b5e83e318652d89939b192c6e348 PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(if $(BUILD_VARIANT),$(PKG_NAME)-$(BUILD_VARIANT)/)backports-$(PKG_VERSION) diff --git a/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch b/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch index 5f5ac20ddba..6b1bbefd24b 100644 --- a/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch +++ b/package/kernel/mac80211/patches/ath/402-ath_regd_optional.patch @@ -82,7 +82,7 @@ help --- a/local-symbols +++ b/local-symbols -@@ -96,6 +96,7 @@ ADM8211= +@@ -90,6 +90,7 @@ ADM8211= ATH_COMMON= WLAN_VENDOR_ATH= ATH_DEBUG= diff --git a/package/kernel/mac80211/patches/ath/404-regd_no_assoc_hints.patch b/package/kernel/mac80211/patches/ath/404-regd_no_assoc_hints.patch index 895e2ff8d8d..e9b83b87cc6 100644 --- a/package/kernel/mac80211/patches/ath/404-regd_no_assoc_hints.patch +++ b/package/kernel/mac80211/patches/ath/404-regd_no_assoc_hints.patch @@ -1,6 +1,6 @@ --- a/net/wireless/reg.c +++ b/net/wireless/reg.c -@@ -3364,6 +3364,8 @@ void regulatory_hint_country_ie(struct w +@@ -3365,6 +3365,8 @@ void regulatory_hint_country_ie(struct w enum environment_cap env = ENVIRON_ANY; struct regulatory_request *request = NULL, *lr; @@ -9,7 +9,7 @@ /* 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 +@@ -3614,6 +3616,7 @@ static bool is_wiphy_all_set_reg_flag(en void regulatory_hint_disconnect(void) { diff --git a/package/kernel/mac80211/patches/ath10k/080-ath10k_thermal_config.patch b/package/kernel/mac80211/patches/ath10k/080-ath10k_thermal_config.patch index 10d95d36bf8..0c631f6bb26 100644 --- a/package/kernel/mac80211/patches/ath10k/080-ath10k_thermal_config.patch +++ b/package/kernel/mac80211/patches/ath10k/080-ath10k_thermal_config.patch @@ -37,7 +37,7 @@ void ath10k_thermal_event_temperature(struct ath10k *ar, int temperature); --- a/local-symbols +++ b/local-symbols -@@ -156,6 +156,7 @@ ATH10K_DEBUG= +@@ -150,6 +150,7 @@ ATH10K_DEBUG= ATH10K_DEBUGFS= ATH10K_LEDS= ATH10K_SPECTRAL= diff --git a/package/kernel/mac80211/patches/ath10k/930-ath10k_add_tpt_led_trigger.patch b/package/kernel/mac80211/patches/ath10k/930-ath10k_add_tpt_led_trigger.patch index aa953c00fb2..ec055b20bfb 100644 --- a/package/kernel/mac80211/patches/ath10k/930-ath10k_add_tpt_led_trigger.patch +++ b/package/kernel/mac80211/patches/ath10k/930-ath10k_add_tpt_led_trigger.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -9920,6 +9920,21 @@ static int ath10k_mac_init_rd(struct ath +@@ -9934,6 +9934,21 @@ static int ath10k_mac_init_rd(struct ath return 0; } @@ -22,7 +22,7 @@ int ath10k_mac_register(struct ath10k *ar) { static const u32 cipher_suites[] = { -@@ -10282,6 +10297,12 @@ int ath10k_mac_register(struct ath10k *a +@@ -10296,6 +10311,12 @@ int ath10k_mac_register(struct ath10k *a ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER; diff --git a/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch b/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch index 4f555d704e0..f6247f092c7 100644 --- a/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch +++ b/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch @@ -40,7 +40,7 @@ Signed-off-by: Mathias Kresin if (ret) --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -10298,7 +10298,7 @@ int ath10k_mac_register(struct ath10k *a +@@ -10312,7 +10312,7 @@ int ath10k_mac_register(struct ath10k *a ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER; #ifdef CPTCFG_MAC80211_LEDS diff --git a/package/kernel/mac80211/patches/ath10k/988-ath10k-always-use-mac80211-loss-detection.patch b/package/kernel/mac80211/patches/ath10k/988-ath10k-always-use-mac80211-loss-detection.patch index d14f25104eb..cfcf5a091af 100644 --- a/package/kernel/mac80211/patches/ath10k/988-ath10k-always-use-mac80211-loss-detection.patch +++ b/package/kernel/mac80211/patches/ath10k/988-ath10k-always-use-mac80211-loss-detection.patch @@ -18,7 +18,7 @@ Signed-off-by: David Bauer --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -10090,7 +10090,6 @@ int ath10k_mac_register(struct ath10k *a +@@ -10104,7 +10104,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); diff --git a/package/kernel/mac80211/patches/ath11k/001-wifi-ath11k-Fix-DMA-buffer-allocation-to-resolve-SWIOTLB-issues.patch b/package/kernel/mac80211/patches/ath11k/001-wifi-ath11k-Fix-DMA-buffer-allocation-to-resolve-SWIOTLB-issues.patch deleted file mode 100644 index d5d80a395d7..00000000000 --- a/package/kernel/mac80211/patches/ath11k/001-wifi-ath11k-Fix-DMA-buffer-allocation-to-resolve-SWIOTLB-issues.patch +++ /dev/null @@ -1,91 +0,0 @@ -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 -Closes: https://lore.kernel.org/all/20241210041133.GA17116@lst.de/ -Signed-off-by: P Praneesh -Tested-by: Tim Harvey -Link: https://patch.msgid.link/20250119164219.647059-2-quic_ppranees@quicinc.com -Signed-off-by: Jeff Johnson ---- 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 -@@ -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); diff --git a/package/kernel/mac80211/patches/ath11k/002-wifi-ath11k-use-dma-alloc-noncoherent-for-rx-tid-buffer-allocation.patch b/package/kernel/mac80211/patches/ath11k/002-wifi-ath11k-use-dma-alloc-noncoherent-for-rx-tid-buffer-allocation.patch deleted file mode 100644 index 2257b069107..00000000000 --- a/package/kernel/mac80211/patches/ath11k/002-wifi-ath11k-use-dma-alloc-noncoherent-for-rx-tid-buffer-allocation.patch +++ /dev/null @@ -1,255 +0,0 @@ -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 ---- 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 -@@ -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, diff --git a/package/kernel/mac80211/patches/ath11k/0906-wifi-ath11k-disable-coldboot-for-ipq6018.patch b/package/kernel/mac80211/patches/ath11k/0906-wifi-ath11k-disable-coldboot-for-ipq6018.patch index 325724e68d9..132f5359b09 100644 --- a/package/kernel/mac80211/patches/ath11k/0906-wifi-ath11k-disable-coldboot-for-ipq6018.patch +++ b/package/kernel/mac80211/patches/ath11k/0906-wifi-ath11k-disable-coldboot-for-ipq6018.patch @@ -13,7 +13,7 @@ Signed-off-by: Mantas Pucka --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -170,8 +170,8 @@ static const struct ath11k_hw_params ath +@@ -171,8 +171,8 @@ static const struct ath11k_hw_params ath .supports_shadow_regs = false, .idle_ps = false, .supports_sta_ps = false, diff --git a/package/kernel/mac80211/patches/ath11k/0907-wifi-ath11k-disable-coldboot-calibration-for-ipq5018.patch b/package/kernel/mac80211/patches/ath11k/0907-wifi-ath11k-disable-coldboot-calibration-for-ipq5018.patch index 2c4762e2757..597d6aa4456 100644 --- a/package/kernel/mac80211/patches/ath11k/0907-wifi-ath11k-disable-coldboot-calibration-for-ipq5018.patch +++ b/package/kernel/mac80211/patches/ath11k/0907-wifi-ath11k-disable-coldboot-calibration-for-ipq5018.patch @@ -14,7 +14,7 @@ Signed-off-by: George Moussalem --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -691,8 +691,8 @@ static const struct ath11k_hw_params ath +@@ -698,8 +698,8 @@ static const struct ath11k_hw_params ath .supports_suspend = false, .hal_params = &ath11k_hw_hal_params_ipq8074, .single_pdev_only = false, diff --git a/package/kernel/mac80211/patches/ath11k/201-wifi-ath11k-Support-setting-bdf-addr-and-caldb-addr-.patch b/package/kernel/mac80211/patches/ath11k/201-wifi-ath11k-Support-setting-bdf-addr-and-caldb-addr-.patch index 81aee57546e..40d3b8065c6 100644 --- a/package/kernel/mac80211/patches/ath11k/201-wifi-ath11k-Support-setting-bdf-addr-and-caldb-addr-.patch +++ b/package/kernel/mac80211/patches/ath11k/201-wifi-ath11k-Support-setting-bdf-addr-and-caldb-addr-.patch @@ -10,7 +10,7 @@ Signed-off-by: Ziyang Huang --- a/drivers/net/wireless/ath/ath11k/qmi.c +++ b/drivers/net/wireless/ath/ath11k/qmi.c -@@ -2028,6 +2028,7 @@ static int ath11k_qmi_assign_target_mem_ +@@ -2030,6 +2030,7 @@ static int ath11k_qmi_assign_target_mem_ struct device_node *hremote_node = NULL; struct resource res; u32 host_ddr_sz; @@ -18,7 +18,7 @@ Signed-off-by: Ziyang Huang int i, idx, ret; for (i = 0, idx = 0; i < ab->qmi.mem_seg_count; i++) { -@@ -2067,7 +2068,9 @@ static int ath11k_qmi_assign_target_mem_ +@@ -2069,7 +2070,9 @@ static int ath11k_qmi_assign_target_mem_ idx++; break; case BDF_MEM_REGION_TYPE: @@ -29,7 +29,7 @@ Signed-off-by: Ziyang Huang ab->qmi.target_mem[idx].vaddr = NULL; ab->qmi.target_mem[idx].size = ab->qmi.target_mem[i].size; ab->qmi.target_mem[idx].type = ab->qmi.target_mem[i].type; -@@ -2089,8 +2092,9 @@ static int ath11k_qmi_assign_target_mem_ +@@ -2091,8 +2094,9 @@ static int ath11k_qmi_assign_target_mem_ if (!ab->qmi.target_mem[idx].iaddr) return -EIO; } else { @@ -41,7 +41,7 @@ Signed-off-by: Ziyang Huang } } else { ab->qmi.target_mem[idx].paddr = 0; -@@ -2295,6 +2299,7 @@ static int ath11k_qmi_load_file_target_m +@@ -2297,6 +2301,7 @@ static int ath11k_qmi_load_file_target_m struct qmi_wlanfw_bdf_download_resp_msg_v01 resp; struct qmi_txn txn; const u8 *temp = data; @@ -49,7 +49,7 @@ Signed-off-by: Ziyang Huang void __iomem *bdf_addr = NULL; int ret = 0; u32 remaining = len; -@@ -2306,7 +2311,9 @@ static int ath11k_qmi_load_file_target_m +@@ -2308,7 +2313,9 @@ static int ath11k_qmi_load_file_target_m memset(&resp, 0, sizeof(resp)); if (ab->hw_params.fixed_bdf_addr) { diff --git a/package/kernel/mac80211/patches/ath11k/900-ath11k-control-thermal-support-via-symbol.patch b/package/kernel/mac80211/patches/ath11k/900-ath11k-control-thermal-support-via-symbol.patch index 6a0e4ff77ea..fbc26cd96b3 100644 --- a/package/kernel/mac80211/patches/ath11k/900-ath11k-control-thermal-support-via-symbol.patch +++ b/package/kernel/mac80211/patches/ath11k/900-ath11k-control-thermal-support-via-symbol.patch @@ -56,7 +56,7 @@ Signed-off-by: Robert Marko int ath11k_thermal_set_throttling(struct ath11k *ar, u32 throttle_state); --- a/local-symbols +++ b/local-symbols -@@ -168,6 +168,7 @@ ATH11K_DEBUG= +@@ -162,6 +162,7 @@ ATH11K_DEBUG= ATH11K_DEBUGFS= ATH11K_TRACING= ATH11K_SPECTRAL= diff --git a/package/kernel/mac80211/patches/ath11k/903-ath11k-support-setting-FW-memory-mode-via-DT.patch b/package/kernel/mac80211/patches/ath11k/903-ath11k-support-setting-FW-memory-mode-via-DT.patch index 1250147e2bd..4b1bd698630 100644 --- a/package/kernel/mac80211/patches/ath11k/903-ath11k-support-setting-FW-memory-mode-via-DT.patch +++ b/package/kernel/mac80211/patches/ath11k/903-ath11k-support-setting-FW-memory-mode-via-DT.patch @@ -31,7 +31,7 @@ Signed-off-by: Robert Marko { .hw_rev = ATH11K_HW_IPQ8074, .name = "ipq8074 hw2.0", -@@ -2147,7 +2147,8 @@ static void ath11k_core_reset(struct wor +@@ -2280,7 +2280,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; @@ -41,7 +41,7 @@ Signed-off-by: Robert Marko 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 +@@ -2296,7 +2297,31 @@ static int ath11k_init_hw_params(struct ab->hw_params = *hw_params; diff --git a/package/kernel/mac80211/patches/ath11k/905-ath11k-remove-intersection-support-for-regulatory-ru.patch b/package/kernel/mac80211/patches/ath11k/905-ath11k-remove-intersection-support-for-regulatory-ru.patch index f30e03475f5..59a2165c0cd 100644 --- a/package/kernel/mac80211/patches/ath11k/905-ath11k-remove-intersection-support-for-regulatory-ru.patch +++ b/package/kernel/mac80211/patches/ath11k/905-ath11k-remove-intersection-support-for-regulatory-ru.patch @@ -23,7 +23,7 @@ Signed-off-by: Aditya Kumar Singh --- a/drivers/net/wireless/ath/ath11k/reg.c +++ b/drivers/net/wireless/ath/ath11k/reg.c -@@ -361,134 +361,6 @@ static u32 ath11k_map_fw_phy_flags(u32 p +@@ -353,134 +353,6 @@ static u32 ath11k_map_fw_phy_flags(u32 p return flags; } @@ -158,7 +158,7 @@ Signed-off-by: Aditya Kumar Singh static const char * ath11k_reg_get_regdom_str(enum nl80211_dfs_regions dfs_region) { -@@ -639,11 +511,11 @@ ath11k_reg_ap_pwr_convert(enum ieee80211 +@@ -631,11 +503,11 @@ ath11k_reg_ap_pwr_convert(enum ieee80211 struct ieee80211_regdomain * ath11k_reg_build_regd(struct ath11k_base *ab, @@ -172,7 +172,7 @@ Signed-off-by: Aditya Kumar Singh struct cur_reg_rule *reg_rule, *reg_rule_6ghz; u8 i = 0, j = 0, k = 0; u8 num_rules; -@@ -686,26 +558,26 @@ ath11k_reg_build_regd(struct ath11k_base +@@ -678,26 +550,26 @@ ath11k_reg_build_regd(struct ath11k_base } if (!num_rules) @@ -206,7 +206,7 @@ Signed-off-by: Aditya Kumar Singh reg_info->dfs_region, num_rules); /* Update reg_rules[] below. Firmware is expected to * send these rules in order(2 GHz rules first and then 5 GHz) -@@ -744,7 +616,7 @@ ath11k_reg_build_regd(struct ath11k_base +@@ -736,7 +608,7 @@ ath11k_reg_build_regd(struct ath11k_base flags |= ath11k_map_fw_reg_flags(reg_rule->flags); flags |= ath11k_map_fw_phy_flags(reg_info->phybitmap); @@ -215,7 +215,7 @@ Signed-off-by: Aditya Kumar Singh reg_rule->start_freq, reg_rule->end_freq, max_bw, reg_rule->ant_gain, reg_rule->reg_power, -@@ -759,7 +631,7 @@ ath11k_reg_build_regd(struct ath11k_base +@@ -751,7 +623,7 @@ ath11k_reg_build_regd(struct ath11k_base reg_info->dfs_region == ATH11K_DFS_REG_ETSI && (reg_rule->end_freq > ETSI_WEATHER_RADAR_BAND_LOW && reg_rule->start_freq < ETSI_WEATHER_RADAR_BAND_HIGH)){ @@ -224,7 +224,7 @@ Signed-off-by: Aditya Kumar Singh reg_rule, &i, flags, max_bw); continue; -@@ -770,51 +642,23 @@ ath11k_reg_build_regd(struct ath11k_base +@@ -762,37 +634,20 @@ ath11k_reg_build_regd(struct ath11k_base "\t%d. (%d - %d @ %d) (%d, %d) (%d ms) (FLAGS %d) (%d, %d)\n", i + 1, reg_rule->start_freq, reg_rule->end_freq, max_bw, reg_rule->ant_gain, reg_rule->reg_power, @@ -265,6 +265,10 @@ Signed-off-by: Aditya Kumar Singh return new_regd; } +@@ -844,17 +699,6 @@ void ath11k_regd_update_chan_list_work(s + } + } + -static bool ath11k_reg_is_world_alpha(char *alpha) -{ - if (alpha[0] == '0' && alpha[1] == '0') @@ -279,7 +283,7 @@ Signed-off-by: Aditya Kumar Singh static enum wmi_vdev_type ath11k_reg_get_ar_vdev_type(struct ath11k *ar) { struct ath11k_vif *arvif; -@@ -837,7 +681,6 @@ int ath11k_reg_handle_chan_list(struct a +@@ -877,7 +721,6 @@ int ath11k_reg_handle_chan_list(struct a enum ieee80211_ap_reg_power power_type) { struct ieee80211_regdomain *regd; @@ -287,7 +291,7 @@ Signed-off-by: Aditya Kumar Singh int pdev_idx; struct ath11k *ar; enum wmi_vdev_type vdev_type; -@@ -889,24 +732,14 @@ int ath11k_reg_handle_chan_list(struct a +@@ -929,24 +772,14 @@ int ath11k_reg_handle_chan_list(struct a (char *)reg_info->alpha2, 2)) goto retfail; @@ -317,8 +321,8 @@ Signed-off-by: Aditya Kumar Singh goto fallback; --- a/drivers/net/wireless/ath/ath11k/reg.h +++ b/drivers/net/wireless/ath/ath11k/reg.h -@@ -35,7 +35,7 @@ void ath11k_reg_free(struct ath11k_base - void ath11k_regd_update_work(struct work_struct *work); +@@ -36,7 +36,7 @@ void ath11k_regd_update_work(struct work + void ath11k_regd_update_chan_list_work(struct work_struct *work); struct ieee80211_regdomain * ath11k_reg_build_regd(struct ath11k_base *ab, - struct cur_regulatory_info *reg_info, bool intersect, diff --git a/package/kernel/mac80211/patches/ath11k/920-wifi-ath11k-add-hw-params-for-QCN6122.patch b/package/kernel/mac80211/patches/ath11k/920-wifi-ath11k-add-hw-params-for-QCN6122.patch index e1f725d6b94..a428684cba6 100644 --- a/package/kernel/mac80211/patches/ath11k/920-wifi-ath11k-add-hw-params-for-QCN6122.patch +++ b/package/kernel/mac80211/patches/ath11k/920-wifi-ath11k-add-hw-params-for-QCN6122.patch @@ -25,9 +25,9 @@ Signed-off-by: George Moussalem --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -809,6 +809,67 @@ static struct ath11k_hw_params ath11k_hw - .support_fw_mac_sequence = true, +@@ -905,6 +905,67 @@ static struct ath11k_hw_params ath11k_hw .support_dual_stations = true, + .pdev_suspend = false, }, + { + .hw_rev = ATH11K_HW_QCN6122_HW10, @@ -95,10 +95,10 @@ Signed-off-by: George Moussalem static inline struct ath11k_pdev *ath11k_core_get_single_pdev(struct ath11k_base *ab) --- a/drivers/net/wireless/ath/ath11k/core.h +++ b/drivers/net/wireless/ath/ath11k/core.h -@@ -148,6 +148,7 @@ enum ath11k_hw_rev { - ATH11K_HW_WCN6750_HW10, +@@ -149,6 +149,7 @@ enum ath11k_hw_rev { ATH11K_HW_IPQ5018_HW10, ATH11K_HW_QCA2066_HW21, + ATH11K_HW_QCA6698AQ_HW21, + ATH11K_HW_QCN6122_HW10, }; diff --git a/package/kernel/mac80211/patches/ath11k/921-wifi-ath11k-add-hal-regs-for-QCN6122.patch b/package/kernel/mac80211/patches/ath11k/921-wifi-ath11k-add-hal-regs-for-QCN6122.patch index eae73170b3f..4ecf1d34714 100644 --- a/package/kernel/mac80211/patches/ath11k/921-wifi-ath11k-add-hal-regs-for-QCN6122.patch +++ b/package/kernel/mac80211/patches/ath11k/921-wifi-ath11k-add-hal-regs-for-QCN6122.patch @@ -10,7 +10,7 @@ Signed-off-by: George Moussalem --- --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -822,6 +822,7 @@ static struct ath11k_hw_params ath11k_hw +@@ -918,6 +918,7 @@ static struct ath11k_hw_params ath11k_hw .bdf_addr = 0x4D200000, .hw_ops = &ipq5018_ops, .hal_desc_sz = sizeof(struct hal_rx_desc_qcn9074), @@ -104,7 +104,7 @@ Signed-off-by: George Moussalem .tcl2wbm_rbm_map = ath11k_hw_tcl2wbm_rbm_map_ipq8074, --- a/drivers/net/wireless/ath/ath11k/hw.h +++ b/drivers/net/wireless/ath/ath11k/hw.h -@@ -425,6 +425,7 @@ extern const struct ath11k_hw_regs qcn90 +@@ -426,6 +426,7 @@ extern const struct ath11k_hw_regs qcn90 extern const struct ath11k_hw_regs wcn6855_regs; extern const struct ath11k_hw_regs wcn6750_regs; extern const struct ath11k_hw_regs ipq5018_regs; diff --git a/package/kernel/mac80211/patches/ath11k/922-wifi-ath11k-add-hw-ring-mask-for-QCN6122.patch b/package/kernel/mac80211/patches/ath11k/922-wifi-ath11k-add-hw-ring-mask-for-QCN6122.patch index f93a3bc60ae..b54461f74f2 100644 --- a/package/kernel/mac80211/patches/ath11k/922-wifi-ath11k-add-hw-ring-mask-for-QCN6122.patch +++ b/package/kernel/mac80211/patches/ath11k/922-wifi-ath11k-add-hw-ring-mask-for-QCN6122.patch @@ -8,7 +8,7 @@ Signed-off-by: George Moussalem --- --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -821,6 +821,7 @@ static struct ath11k_hw_params ath11k_hw +@@ -917,6 +917,7 @@ static struct ath11k_hw_params ath11k_hw .max_radios = MAX_RADIOS_5018, .bdf_addr = 0x4D200000, .hw_ops = &ipq5018_ops, @@ -64,7 +64,7 @@ Signed-off-by: George Moussalem /* CE0: host->target HTC control and raw streams */ --- a/drivers/net/wireless/ath/ath11k/hw.h +++ b/drivers/net/wireless/ath/ath11k/hw.h -@@ -289,6 +289,7 @@ extern const struct ath11k_hw_ring_mask +@@ -290,6 +290,7 @@ extern const struct ath11k_hw_ring_mask extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qca6390; extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_qcn9074; extern const struct ath11k_hw_ring_mask ath11k_hw_ring_mask_wcn6750; diff --git a/package/kernel/mac80211/patches/ath11k/923-wifi-ath11k-update-hif_and-pci_ops-for-QCN6122.patch b/package/kernel/mac80211/patches/ath11k/923-wifi-ath11k-update-hif_and-pci_ops-for-QCN6122.patch index 8497c3a8c99..07eaf872798 100644 --- a/package/kernel/mac80211/patches/ath11k/923-wifi-ath11k-update-hif_and-pci_ops-for-QCN6122.patch +++ b/package/kernel/mac80211/patches/ath11k/923-wifi-ath11k-update-hif_and-pci_ops-for-QCN6122.patch @@ -91,7 +91,7 @@ Signed-off-by: George Moussalem #endif /* _HIF_H_ */ --- a/drivers/net/wireless/ath/ath11k/qmi.c +++ b/drivers/net/wireless/ath/ath11k/qmi.c -@@ -2187,6 +2187,8 @@ static int ath11k_qmi_request_device_inf +@@ -2189,6 +2189,8 @@ static int ath11k_qmi_request_device_inf if (!ab->hw_params.ce_remap) ab->mem_ce = ab->mem; diff --git a/package/kernel/mac80211/patches/ath11k/924-wifi-ath11k-add-multipd-support-for-QCN6122.patch b/package/kernel/mac80211/patches/ath11k/924-wifi-ath11k-add-multipd-support-for-QCN6122.patch index 5b0c58dd947..e73b8da3795 100644 --- a/package/kernel/mac80211/patches/ath11k/924-wifi-ath11k-add-multipd-support-for-QCN6122.patch +++ b/package/kernel/mac80211/patches/ath11k/924-wifi-ath11k-add-multipd-support-for-QCN6122.patch @@ -89,7 +89,7 @@ Signed-off-by: George Moussalem /* SMBIOS type containing Board Data File Name Extension */ #define ATH11K_SMBIOS_BDF_EXT_TYPE 0xF8 -@@ -951,6 +954,7 @@ struct ath11k_base { +@@ -952,6 +955,7 @@ struct ath11k_base { struct list_head peers; wait_queue_head_t peer_mapping_wq; u8 mac_addr[ETH_ALEN]; diff --git a/package/kernel/mac80211/patches/ath11k/925-wifi-ath11k-add-QCN6122-device-support.patch b/package/kernel/mac80211/patches/ath11k/925-wifi-ath11k-add-QCN6122-device-support.patch index 58627ce07e0..b8b12ddf235 100644 --- a/package/kernel/mac80211/patches/ath11k/925-wifi-ath11k-add-QCN6122-device-support.patch +++ b/package/kernel/mac80211/patches/ath11k/925-wifi-ath11k-add-QCN6122-device-support.patch @@ -37,9 +37,9 @@ Signed-off-by: George Moussalem --- a/drivers/net/wireless/ath/ath11k/pcic.c +++ b/drivers/net/wireless/ath/ath11k/pcic.c -@@ -126,6 +126,15 @@ static const struct ath11k_msi_config at +@@ -137,6 +137,15 @@ static const struct ath11k_msi_config at }, - .hw_rev = ATH11K_HW_QCA2066_HW21, + .hw_rev = ATH11K_HW_QCA6698AQ_HW21, }, + { + .total_vectors = 13, diff --git a/package/kernel/mac80211/patches/ath11k/931-wifi-ath11k-Support-to-assign-m3-dump-memory.patch b/package/kernel/mac80211/patches/ath11k/931-wifi-ath11k-Support-to-assign-m3-dump-memory.patch index 834a4b57973..3339cfc43c7 100644 --- a/package/kernel/mac80211/patches/ath11k/931-wifi-ath11k-Support-to-assign-m3-dump-memory.patch +++ b/package/kernel/mac80211/patches/ath11k/931-wifi-ath11k-Support-to-assign-m3-dump-memory.patch @@ -10,7 +10,7 @@ Signed-off-by: Ziyang Huang --- a/drivers/net/wireless/ath/ath11k/qmi.c +++ b/drivers/net/wireless/ath/ath11k/qmi.c -@@ -2104,6 +2104,18 @@ static int ath11k_qmi_assign_target_mem_ +@@ -2106,6 +2106,18 @@ static int ath11k_qmi_assign_target_mem_ ab->qmi.target_mem[idx].type = ab->qmi.target_mem[i].type; idx++; break; diff --git a/package/kernel/mac80211/patches/ath11k/932-wifi-ath11k-poll-reo-status-ipq5018.patch b/package/kernel/mac80211/patches/ath11k/932-wifi-ath11k-poll-reo-status-ipq5018.patch index 693cb0e0d48..894346652fd 100644 --- a/package/kernel/mac80211/patches/ath11k/932-wifi-ath11k-poll-reo-status-ipq5018.patch +++ b/package/kernel/mac80211/patches/ath11k/932-wifi-ath11k-poll-reo-status-ipq5018.patch @@ -24,10 +24,10 @@ Signed-off-by: Sriram R --- --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c -@@ -719,6 +719,7 @@ static struct ath11k_hw_params ath11k_hw - .smp2p_wow_exit = false, +@@ -727,6 +727,7 @@ static struct ath11k_hw_params ath11k_hw .support_fw_mac_sequence = false, .support_dual_stations = false, + .pdev_suspend = false, + .reo_status_poll = true, }, { @@ -121,7 +121,7 @@ Signed-off-by: Sriram R struct dp_reo_cache_flush_elem { struct list_head list; struct dp_rx_tid data; -@@ -288,6 +290,10 @@ struct ath11k_dp { +@@ -287,6 +289,10 @@ struct ath11k_dp { spinlock_t reo_cmd_lock; struct ath11k_hp_update_timer reo_cmd_timer; struct ath11k_hp_update_timer tx_ring_timer[DP_TCL_NUM_RING_MAX]; @@ -132,7 +132,7 @@ Signed-off-by: Sriram R }; /* HTT definitions */ -@@ -1691,5 +1697,6 @@ void ath11k_dp_shadow_init_timer(struct +@@ -1690,5 +1696,6 @@ void ath11k_dp_shadow_init_timer(struct struct ath11k_hp_update_timer *update_timer, u32 interval, u32 ring_id); void ath11k_dp_stop_shadow_timers(struct ath11k_base *ab); @@ -154,10 +154,10 @@ Signed-off-by: Sriram R --- a/drivers/net/wireless/ath/ath11k/hw.h +++ b/drivers/net/wireless/ath/ath11k/hw.h -@@ -232,6 +232,7 @@ struct ath11k_hw_params { - bool smp2p_wow_exit; +@@ -233,6 +233,7 @@ struct ath11k_hw_params { bool support_fw_mac_sequence; bool support_dual_stations; + bool pdev_suspend; + bool reo_status_poll; }; diff --git a/package/kernel/mac80211/patches/ath11k/940-ath11k-Revert-clear-the-keys-properly-when-DISABLE_K.patch b/package/kernel/mac80211/patches/ath11k/940-ath11k-Revert-clear-the-keys-properly-when-DISABLE_K.patch index ec2dc222b66..352e68fceca 100644 --- a/package/kernel/mac80211/patches/ath11k/940-ath11k-Revert-clear-the-keys-properly-when-DISABLE_K.patch +++ b/package/kernel/mac80211/patches/ath11k/940-ath11k-Revert-clear-the-keys-properly-when-DISABLE_K.patch @@ -23,7 +23,7 @@ Signed-off-by: Rameshkumar Sundaram --- a/drivers/net/wireless/ath/ath11k/mac.c +++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -4222,7 +4222,9 @@ static int ath11k_install_key(struct ath +@@ -4220,7 +4220,9 @@ static int ath11k_install_key(struct ath return 0; if (cmd == DISABLE_KEY) { diff --git a/package/kernel/mac80211/patches/ath12k/001-wifi-ath12k-add-11d-scan-offload-support-and-handle-country-code-for-WCN7850.patch b/package/kernel/mac80211/patches/ath12k/001-wifi-ath12k-add-11d-scan-offload-support-and-handle-country-code-for-WCN7850.patch index 2afd7f8b0e5..e93a591b0eb 100644 --- a/package/kernel/mac80211/patches/ath12k/001-wifi-ath12k-add-11d-scan-offload-support-and-handle-country-code-for-WCN7850.patch +++ b/package/kernel/mac80211/patches/ath12k/001-wifi-ath12k-add-11d-scan-offload-support-and-handle-country-code-for-WCN7850.patch @@ -121,7 +121,7 @@ Acked-by: Jeff Johnson }; static __le32 ath12k_wmi_tlv_hdr(u32 cmd, u32 len) -@@ -2364,7 +2366,10 @@ int ath12k_wmi_send_scan_start_cmd(struc +@@ -2531,7 +2533,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); @@ -133,7 +133,7 @@ Acked-by: Jeff Johnson 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: +@@ -3253,6 +3258,110 @@ out: return ret; } @@ -244,7 +244,7 @@ Acked-by: Jeff Johnson 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( +@@ -5873,6 +5982,50 @@ static void ath12k_wmi_op_ep_tx_credits( wake_up(&ab->wmi_ab.tx_credits_wq); } @@ -295,9 +295,9 @@ Acked-by: Jeff Johnson 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 - case WMI_GTK_OFFLOAD_STATUS_EVENTID: - ath12k_wmi_gtk_offload_status_event(ab, skb); +@@ -7586,6 +7739,9 @@ static void ath12k_wmi_op_rx(struct ath1 + case WMI_OBSS_COLOR_COLLISION_DETECTION_EVENTID: + /* debug might flood hence silently ignore (no-op) */ break; + case WMI_11D_NEW_COUNTRY_EVENTID: + ath12k_reg_11d_new_cc_event(ab, skb); @@ -307,7 +307,7 @@ Acked-by: Jeff Johnson ath12k_dbg(ab, ATH12K_DBG_WMI, "Unknown eventid: 0x%x\n", id); --- a/drivers/net/wireless/ath/ath12k/wmi.h +++ b/drivers/net/wireless/ath/ath12k/wmi.h -@@ -3860,6 +3860,28 @@ struct wmi_init_country_cmd { +@@ -3990,6 +3990,28 @@ struct wmi_init_country_cmd { } cc_info; } __packed; @@ -336,9 +336,9 @@ Acked-by: Jeff Johnson struct wmi_delba_send_cmd { __le32 tlv_header; __le32 vdev_id; -@@ -3945,6 +3967,16 @@ struct ath12k_wmi_eht_rate_set_params { +@@ -4074,6 +4096,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]; @@ -353,7 +353,7 @@ Acked-by: Jeff Johnson 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_ +@@ -5714,11 +5746,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); @@ -373,7 +373,7 @@ Acked-by: Jeff Johnson 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) +@@ -1251,6 +1251,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); @@ -381,7 +381,7 @@ Acked-by: Jeff Johnson rcu_assign_pointer(ab->pdevs_active[ar->pdev_idx], NULL); synchronize_rcu(); -@@ -1021,6 +1022,34 @@ void ath12k_core_halt(struct ath12k *ar) +@@ -1258,6 +1259,34 @@ void ath12k_core_halt(struct ath12k *ar) idr_init(&ar->txmgmt_idr); } @@ -415,8 +415,8 @@ Acked-by: Jeff Johnson + static void ath12k_core_pre_reconfigure_recovery(struct ath12k_base *ab) { - struct ath12k *ar; -@@ -1045,8 +1074,10 @@ static void ath12k_core_pre_reconfigure_ + struct ath12k_hw_group *ag = ab->ag; +@@ -1283,8 +1312,10 @@ static void ath12k_core_pre_reconfigure_ ar = &ah->radio[j]; ath12k_mac_drain_tx(ar); @@ -428,18 +428,18 @@ Acked-by: Jeff Johnson 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 - INIT_WORK(&ab->restart_work, ath12k_core_restart); +@@ -1953,6 +1984,7 @@ struct ath12k_base *ath12k_core_alloc(st INIT_WORK(&ab->reset_work, ath12k_core_reset); INIT_WORK(&ab->rfkill_work, ath12k_rfkill_work); + INIT_WORK(&ab->dump_work, ath12k_coredump_upload); + INIT_WORK(&ab->update_11d_work, ath12k_update_11d); timer_setup(&ab->rx_replenish_retry, ath12k_ce_rx_replenish_retry, 0); 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 { - ATH12K_SCAN_ABORTING, +@@ -224,6 +224,12 @@ enum ath12k_hw_group_flags { + ATH12K_GROUP_FLAG_UNREGISTER, }; +enum ath12k_11d_state { @@ -449,9 +449,9 @@ Acked-by: Jeff Johnson +}; + enum ath12k_dev_flags { - ATH12K_CAC_RUNNING, + ATH12K_FLAG_CAC_RUNNING, ATH12K_FLAG_CRASH_FLUSH, -@@ -319,6 +325,8 @@ struct ath12k_vif_iter { +@@ -361,6 +367,8 @@ struct ath12k_vif_iter { #define ATH12K_RX_RATE_TABLE_11AX_NUM 576 #define ATH12K_RX_RATE_TABLE_NUM 320 @@ -460,9 +460,9 @@ Acked-by: Jeff Johnson 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 { - u32 freq_low; - u32 freq_high; +@@ -713,6 +721,13 @@ struct ath12k { + + struct wiphy_radio_freq_range freq_range; + /* Protected by wiphy::mtx lock. */ + u32 vdev_id_11d_scan; @@ -472,9 +472,9 @@ Acked-by: Jeff Johnson + bool regdom_set_by_user; + bool nlo_enabled; - }; -@@ -886,6 +901,8 @@ struct ath12k_base { + struct completion mlo_setup_done; +@@ -985,6 +1000,8 @@ struct ath12k_base { /* continuous recovery fail count */ atomic_t fail_cont_count; unsigned long reset_fail_timeout; @@ -485,28 +485,28 @@ Acked-by: Jeff Johnson u32 fw_crash_counter; --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c -@@ -2949,6 +2949,11 @@ static void ath12k_bss_assoc(struct ath1 +@@ -3340,6 +3340,11 @@ static void ath12k_bss_assoc(struct ath1 if (ret) ath12k_warn(ar->ab, "failed to set vdev %i OBSS PD parameters: %d\n", arvif->vdev_id, ret); + + if (test_bit(WMI_TLV_SERVICE_11D_OFFLOAD, ar->ab->wmi_ab.svc_map) && -+ arvif->vdev_type == WMI_VDEV_TYPE_STA && -+ arvif->vdev_subtype == WMI_VDEV_SUBTYPE_NONE) ++ ahvif->vdev_type == WMI_VDEV_TYPE_STA && ++ ahvif->vdev_subtype == WMI_VDEV_SUBTYPE_NONE) + ath12k_mac_11d_scan_stop_all(ar->ab); } static void ath12k_bss_disassoc(struct ath12k *ar, -@@ -3524,7 +3529,7 @@ void __ath12k_mac_scan_finish(struct ath - ar->scan_channel = NULL; - ar->scan.roc_freq = 0; +@@ -4094,7 +4099,7 @@ void __ath12k_mac_scan_finish(struct ath + fallthrough; + case ATH12K_SCAN_STARTING: cancel_delayed_work(&ar->scan.timeout); - complete(&ar->scan.completed); + complete_all(&ar->scan.completed); + wiphy_work_queue(ar->ah->hw->wiphy, &ar->scan.vdev_clean_wk); break; } - } -@@ -3790,7 +3795,12 @@ scan: +@@ -4438,7 +4443,12 @@ static int ath12k_mac_op_hw_scan(struct ret = ath12k_start_scan(ar, arg); if (ret) { @@ -520,19 +520,19 @@ Acked-by: Jeff Johnson spin_lock_bh(&ar->data_lock); ar->scan.state = ATH12K_SCAN_IDLE; spin_unlock_bh(&ar->data_lock); -@@ -3810,6 +3820,11 @@ exit: - - mutex_unlock(&ar->conf_mutex); +@@ -4465,6 +4475,11 @@ exit: + kfree(arg); + } + if (ar->state_11d == ATH12K_11D_PREPARING && -+ arvif->vdev_type == WMI_VDEV_TYPE_STA && -+ arvif->vdev_subtype == WMI_VDEV_SUBTYPE_NONE) ++ ahvif->vdev_type == WMI_VDEV_TYPE_STA && ++ ahvif->vdev_subtype == WMI_VDEV_SUBTYPE_NONE) + ath12k_mac_11d_scan_start(ar, arvif->vdev_id); + return ret; } -@@ -5995,7 +6010,7 @@ static int ath12k_mac_start(struct ath12 +@@ -7383,7 +7398,7 @@ static int ath12k_mac_start(struct ath12 /* TODO: Do we need to enable ANI? */ @@ -541,8 +541,8 @@ Acked-by: Jeff Johnson ar->num_started_vdevs = 0; ar->num_created_vdevs = 0; -@@ -6175,6 +6190,9 @@ static void ath12k_mac_stop(struct ath12 - cancel_delayed_work_sync(&ar->scan.timeout); +@@ -7564,6 +7579,9 @@ static void ath12k_mac_stop(struct ath12 + wiphy_work_cancel(ath12k_ar_to_hw(ar)->wiphy, &ar->scan.vdev_clean_wk); cancel_work_sync(&ar->regd_update_work); cancel_work_sync(&ar->ab->rfkill_work); + cancel_work_sync(&ar->ab->update_11d_work); @@ -551,22 +551,22 @@ Acked-by: Jeff Johnson spin_lock_bh(&ar->data_lock); list_for_each_entry_safe(ppdu_stats, tmp, &ar->ppdu_stats_info, list) { -@@ -6421,6 +6439,117 @@ static void ath12k_mac_op_update_vif_off - ath12k_mac_update_vif_offload(arvif); +@@ -7857,6 +7875,117 @@ static void ath12k_mac_op_update_vif_off + ath12k_mac_update_vif_offload(&ahvif->deflink); } +static bool ath12k_mac_vif_ap_active_any(struct ath12k_base *ab) +{ + struct ath12k *ar; + struct ath12k_pdev *pdev; -+ struct ath12k_vif *arvif; ++ struct ath12k_link_vif *arvif; + int i; + + for (i = 0; i < ab->num_radios; i++) { + pdev = &ab->pdevs[i]; + ar = pdev->ar; + list_for_each_entry(arvif, &ar->arvifs, list) { -+ if (arvif->is_up && arvif->vdev_type == WMI_VDEV_TYPE_AP) ++ if (arvif->is_up && arvif->ahvif->vdev_type == WMI_VDEV_TYPE_AP) + return true; + } + } @@ -666,10 +666,10 @@ Acked-by: Jeff Johnson + } +} + - static int ath12k_mac_vdev_create(struct ath12k *ar, struct ieee80211_vif *vif) + int ath12k_mac_vdev_create(struct ath12k *ar, struct ath12k_link_vif *arvif) { struct ath12k_hw *ah = ar->ah; -@@ -6535,6 +6664,7 @@ static int ath12k_mac_vdev_create(struct +@@ -7991,6 +8120,7 @@ int ath12k_mac_vdev_create(struct ath12k arvif->vdev_id, ret); goto err_peer_del; } @@ -677,48 +677,48 @@ Acked-by: Jeff Johnson break; case WMI_VDEV_TYPE_STA: param_id = WMI_STA_PS_PARAM_RX_WAKE_POLICY; -@@ -6573,6 +6703,13 @@ static int ath12k_mac_vdev_create(struct +@@ -8029,6 +8159,13 @@ int ath12k_mac_vdev_create(struct ath12k arvif->vdev_id, ret); goto err_peer_del; } + + if (test_bit(WMI_TLV_SERVICE_11D_OFFLOAD, ab->wmi_ab.svc_map) && -+ arvif->vdev_type == WMI_VDEV_TYPE_STA && -+ arvif->vdev_subtype == WMI_VDEV_SUBTYPE_NONE) { ++ ahvif->vdev_type == WMI_VDEV_TYPE_STA && ++ ahvif->vdev_subtype == WMI_VDEV_SUBTYPE_NONE) { + reinit_completion(&ar->completed_11d_scan); + ar->state_11d = ATH12K_11D_PREPARING; + } break; default: break; -@@ -6913,6 +7050,11 @@ static void ath12k_mac_op_remove_interfa - ath12k_dbg(ab, ATH12K_DBG_MAC, "mac remove interface (vdev %d)\n", - arvif->vdev_id); +@@ -8821,6 +8958,11 @@ ath12k_mac_vdev_start_restart(struct ath + return ret; + } + if (test_bit(WMI_TLV_SERVICE_11D_OFFLOAD, ab->wmi_ab.svc_map) && -+ arvif->vdev_type == WMI_VDEV_TYPE_STA && -+ arvif->vdev_subtype == WMI_VDEV_SUBTYPE_NONE) ++ ahvif->vdev_type == WMI_VDEV_TYPE_STA && ++ ahvif->vdev_subtype == WMI_VDEV_SUBTYPE_NONE) + ath12k_mac_11d_scan_stop(ar); + - if (arvif->vdev_type == WMI_VDEV_TYPE_AP) { - ret = ath12k_peer_delete(ar, arvif->vdev_id, vif->addr); - if (ret) -@@ -7753,6 +7895,14 @@ ath12k_mac_op_unassign_vif_chanctx(struc + if (ahvif->vdev_type == WMI_VDEV_TYPE_AP) { + arg.ssid = ahvif->u.ap.ssid; + arg.ssid_len = ahvif->u.ap.ssid_len; +@@ -9395,6 +9537,14 @@ ath12k_mac_op_unassign_vif_chanctx(struc ar->num_started_vdevs == 1 && ar->monitor_vdev_created) ath12k_mac_monitor_stop(ar); + if (test_bit(WMI_TLV_SERVICE_11D_OFFLOAD, ab->wmi_ab.svc_map) && -+ arvif->vdev_type == WMI_VDEV_TYPE_STA && -+ arvif->vdev_subtype == WMI_VDEV_SUBTYPE_NONE && ++ ahvif->vdev_type == WMI_VDEV_TYPE_STA && ++ ahvif->vdev_subtype == WMI_VDEV_SUBTYPE_NONE && + ar->state_11d != ATH12K_11D_PREPARING) { + reinit_completion(&ar->completed_11d_scan); + ar->state_11d = ATH12K_11D_PREPARING; + } + - mutex_unlock(&ar->conf_mutex); + ath12k_mac_remove_link_interface(hw, arvif); + ath12k_mac_unassign_link_vif(arvif); } - -@@ -8291,6 +8441,14 @@ ath12k_mac_op_reconfig_complete(struct i +@@ -9958,6 +10108,14 @@ ath12k_mac_op_reconfig_complete(struct i ath12k_warn(ar->ab, "pdev %d successfully recovered\n", ar->pdev->pdev_id); @@ -733,19 +733,19 @@ Acked-by: Jeff Johnson if (ab->is_reset) { recovery_count = atomic_inc_return(&ab->recovery_count); -@@ -9340,6 +9498,9 @@ static void ath12k_mac_setup(struct ath1 +@@ -11173,6 +11331,9 @@ static void ath12k_mac_setup(struct ath1 - INIT_WORK(&ar->wmi_mgmt_tx_work, ath12k_mgmt_over_wmi_tx_work); + wiphy_work_init(&ar->wmi_mgmt_tx_work, ath12k_mgmt_over_wmi_tx_work); skb_queue_head_init(&ar->wmi_mgmt_tx_queue); + + ar->vdev_id_11d_scan = ATH12K_11D_INVALID_VDEV_ID; + init_completion(&ar->completed_11d_scan); } - int ath12k_mac_register(struct ath12k_base *ab) + static int __ath12k_mac_mlo_setup(struct ath12k *ar) --- a/drivers/net/wireless/ath/ath12k/mac.h +++ b/drivers/net/wireless/ath/ath12k/mac.h -@@ -51,6 +51,13 @@ enum ath12k_supported_bw { +@@ -66,6 +66,13 @@ struct ath12k_mac_get_any_chanctx_conf_a extern const struct htt_rx_ring_tlv_filter ath12k_mac_mon_status_filter_default; @@ -756,9 +756,9 @@ Acked-by: Jeff Johnson +void ath12k_mac_11d_scan_stop(struct ath12k *ar); +void ath12k_mac_11d_scan_stop_all(struct ath12k_base *ab); + - void ath12k_mac_destroy(struct ath12k_base *ab); - void ath12k_mac_unregister(struct ath12k_base *ab); - int ath12k_mac_register(struct ath12k_base *ab); + void ath12k_mac_destroy(struct ath12k_hw_group *ag); + void ath12k_mac_unregister(struct ath12k_hw_group *ag); + int ath12k_mac_register(struct ath12k_hw_group *ag); --- a/drivers/net/wireless/ath/ath12k/reg.c +++ b/drivers/net/wireless/ath/ath12k/reg.c @@ -48,6 +48,7 @@ ath12k_reg_notifier(struct wiphy *wiphy, diff --git a/package/kernel/mac80211/patches/ath12k/002-wifi-ath12k-Fetch-regdb.bin-file-from-board-2.bin.patch b/package/kernel/mac80211/patches/ath12k/002-wifi-ath12k-Fetch-regdb.bin-file-from-board-2.bin.patch deleted file mode 100644 index 67d62f92575..00000000000 --- a/package/kernel/mac80211/patches/ath12k/002-wifi-ath12k-Fetch-regdb.bin-file-from-board-2.bin.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 24f587572acf7509127dbdfcbf1b681ef84eeba0 Mon Sep 17 00:00:00 2001 -From: Aaradhana Sahu -Date: Thu, 16 Jan 2025 08:58:35 +0530 -Subject: [PATCH] wifi: ath12k: Fetch regdb.bin file from board-2.bin - -Currently, ath12k_core_fetch_regdb() finds regdb.bin file through -board id's but in board-2.bin file regdb.bin file is present with -default board id because of which regdb.bin is not fetched. - -Add support to fetch regdb.bin file from board-2.bin through -default board id. - -Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1 - -Signed-off-by: Aaradhana Sahu -Reviewed-by: Aditya Kumar Singh -Link: https://patch.msgid.link/20250116032835.118397-1-quic_aarasahu@quicinc.com -Signed-off-by: Jeff Johnson ---- - drivers/net/wireless/ath/ath12k/core.c | 12 +++++++----- - 1 file changed, 7 insertions(+), 5 deletions(-) - ---- a/drivers/net/wireless/ath/ath12k/core.c -+++ b/drivers/net/wireless/ath/ath12k/core.c -@@ -161,7 +161,7 @@ EXPORT_SYMBOL(ath12k_core_resume); - - static int __ath12k_core_create_board_name(struct ath12k_base *ab, char *name, - size_t name_len, bool with_variant, -- bool bus_type_mode) -+ bool bus_type_mode, bool with_default) - { - /* strlen(',variant=') + strlen(ab->qmi.target.bdf_ext) */ - char variant[9 + ATH12K_QMI_BDF_EXT_STR_LENGTH] = { 0 }; -@@ -192,7 +192,9 @@ static int __ath12k_core_create_board_na - "bus=%s,qmi-chip-id=%d,qmi-board-id=%d%s", - ath12k_bus_str(ab->hif.bus), - ab->qmi.target.chip_id, -- ab->qmi.target.board_id, variant); -+ with_default ? -+ ATH12K_BOARD_ID_DEFAULT : ab->qmi.target.board_id, -+ variant); - break; - } - -@@ -204,19 +206,19 @@ static int __ath12k_core_create_board_na - static int ath12k_core_create_board_name(struct ath12k_base *ab, char *name, - size_t name_len) - { -- return __ath12k_core_create_board_name(ab, name, name_len, true, false); -+ return __ath12k_core_create_board_name(ab, name, name_len, true, false, false); - } - - static int ath12k_core_create_fallback_board_name(struct ath12k_base *ab, char *name, - size_t name_len) - { -- return __ath12k_core_create_board_name(ab, name, name_len, false, false); -+ return __ath12k_core_create_board_name(ab, name, name_len, false, false, true); - } - - static int ath12k_core_create_bus_type_board_name(struct ath12k_base *ab, char *name, - size_t name_len) - { -- return __ath12k_core_create_board_name(ab, name, name_len, false, true); -+ return __ath12k_core_create_board_name(ab, name, name_len, false, true, true); - } - - const struct firmware *ath12k_core_firmware_request(struct ath12k_base *ab, diff --git a/package/kernel/mac80211/patches/ath12k/003-1-v6.16-wifi-ath12k-Pass-correct-values-of-center-freq1-and-.patch b/package/kernel/mac80211/patches/ath12k/003-1-v6.16-wifi-ath12k-Pass-correct-values-of-center-freq1-and-.patch new file mode 100644 index 00000000000..78dea13a490 --- /dev/null +++ b/package/kernel/mac80211/patches/ath12k/003-1-v6.16-wifi-ath12k-Pass-correct-values-of-center-freq1-and-.patch @@ -0,0 +1,53 @@ +From b1b01e46a3db5ad44d1e4691ba37c1e0832cd5cf Mon Sep 17 00:00:00 2001 +From: Suraj P Kizhakkethil +Date: Tue, 4 Mar 2025 15:23:14 +0530 +Subject: [PATCH 1/2] wifi: ath12k: Pass correct values of center freq1 and + center freq2 for 160 MHz + +Currently, for 160 MHz bandwidth, center frequency1 and +center frequency2 are not passed correctly to the firmware. +Set center frequency1 as the center frequency +of the primary 80 MHz channel segment and center frequency2 as +the center frequency of the 160 MHz channel and pass the values +to the firmware. + +Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1 + +Signed-off-by: Suraj P Kizhakkethil +Reviewed-by: Aditya Kumar Singh +Link: https://patch.msgid.link/20250304095315.3050325-2-quic_surapk@quicinc.com +Signed-off-by: Jeff Johnson +--- + drivers/net/wireless/ath/ath12k/wmi.c | 16 +++++++++++++--- + 1 file changed, 13 insertions(+), 3 deletions(-) + +--- a/drivers/net/wireless/ath/ath12k/wmi.c ++++ b/drivers/net/wireless/ath/ath12k/wmi.c +@@ -1000,14 +1000,24 @@ int ath12k_wmi_vdev_down(struct ath12k * + static void ath12k_wmi_put_wmi_channel(struct ath12k_wmi_channel_params *chan, + struct wmi_vdev_start_req_arg *arg) + { ++ u32 center_freq1 = arg->band_center_freq1; ++ + memset(chan, 0, sizeof(*chan)); + + chan->mhz = cpu_to_le32(arg->freq); +- chan->band_center_freq1 = cpu_to_le32(arg->band_center_freq1); +- if (arg->mode == MODE_11AC_VHT80_80) ++ chan->band_center_freq1 = cpu_to_le32(center_freq1); ++ if (arg->mode == MODE_11BE_EHT160) { ++ if (arg->freq > center_freq1) ++ chan->band_center_freq1 = cpu_to_le32(center_freq1 + 40); ++ else ++ chan->band_center_freq1 = cpu_to_le32(center_freq1 - 40); ++ ++ chan->band_center_freq2 = cpu_to_le32(center_freq1); ++ } else if (arg->mode == MODE_11BE_EHT80_80) { + chan->band_center_freq2 = cpu_to_le32(arg->band_center_freq2); +- else ++ } else { + chan->band_center_freq2 = 0; ++ } + + chan->info |= le32_encode_bits(arg->mode, WMI_CHAN_INFO_MODE); + if (arg->passive) diff --git a/package/kernel/mac80211/patches/ath12k/003-2-v6.16-wifi-ath12k-Pass-correct-values-of-center-freq1-and-.patch b/package/kernel/mac80211/patches/ath12k/003-2-v6.16-wifi-ath12k-Pass-correct-values-of-center-freq1-and-.patch new file mode 100644 index 00000000000..3f7f05e9acc --- /dev/null +++ b/package/kernel/mac80211/patches/ath12k/003-2-v6.16-wifi-ath12k-Pass-correct-values-of-center-freq1-and-.patch @@ -0,0 +1,43 @@ +From 5e44b181bec8e2fe3826033360fc1a42bb432191 Mon Sep 17 00:00:00 2001 +From: Sriram R +Date: Tue, 4 Mar 2025 15:23:15 +0530 +Subject: [PATCH 2/2] wifi: ath12k: Pass correct values of center freq1 and + center freq2 for 320 MHz + +Currently, for 320 MHz bandwidth, center frequency1 and +center frequency2 are not passed correctly to the firmware. +Set center frequency1 as the center frequency of the +primary 160 MHz channel segment and center frequency2 as the center +frequency of the 320 MHz channel and pass the values +to the firmware. + +Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1 + +Signed-off-by: Sriram R +Signed-off-by: Suraj P Kizhakkethil +Reviewed-by: Aditya Kumar Singh +Link: https://patch.msgid.link/20250304095315.3050325-3-quic_surapk@quicinc.com +Signed-off-by: Jeff Johnson +--- + drivers/net/wireless/ath/ath12k/wmi.c | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +--- a/drivers/net/wireless/ath/ath12k/wmi.c ++++ b/drivers/net/wireless/ath/ath12k/wmi.c +@@ -1006,7 +1006,15 @@ static void ath12k_wmi_put_wmi_channel(s + + chan->mhz = cpu_to_le32(arg->freq); + chan->band_center_freq1 = cpu_to_le32(center_freq1); +- if (arg->mode == MODE_11BE_EHT160) { ++ if (arg->mode == MODE_11BE_EHT320) { ++ if (arg->freq > center_freq1) ++ chan->band_center_freq1 = cpu_to_le32(center_freq1 + 80); ++ else ++ chan->band_center_freq1 = cpu_to_le32(center_freq1 - 80); ++ ++ chan->band_center_freq2 = cpu_to_le32(center_freq1); ++ ++ } else if (arg->mode == MODE_11BE_EHT160) { + if (arg->freq > center_freq1) + chan->band_center_freq1 = cpu_to_le32(center_freq1 + 40); + else diff --git a/package/kernel/mac80211/patches/ath12k/003-wifi-ath12k-fix-handling-of-6-GHz-rules.patch b/package/kernel/mac80211/patches/ath12k/003-wifi-ath12k-fix-handling-of-6-GHz-rules.patch deleted file mode 100644 index 8df49d38d31..00000000000 --- a/package/kernel/mac80211/patches/ath12k/003-wifi-ath12k-fix-handling-of-6-GHz-rules.patch +++ /dev/null @@ -1,140 +0,0 @@ -From 64a1ba4072b34af1b76bf15fca5c2075b8cc4d64 Mon Sep 17 00:00:00 2001 -From: Aditya Kumar Singh -Date: Thu, 23 Jan 2025 21:51:38 +0530 -Subject: [PATCH] wifi: ath12k: fix handling of 6 GHz rules - -In the US country code, to avoid including 6 GHz rules in the 5 GHz rules -list, the number of 5 GHz rules is set to a default constant value of 4 -(REG_US_5G_NUM_REG_RULES). However, if there are more than 4 valid 5 GHz -rules, the current logic will bypass the legitimate 6 GHz rules. - -For example, if there are 5 valid 5 GHz rules and 1 valid 6 GHz rule, the -current logic will only consider 4 of the 5 GHz rules, treating the last -valid rule as a 6 GHz rule. Consequently, the actual 6 GHz rule is never -processed, leading to the eventual disabling of 6 GHz channels. - -To fix this issue, instead of hardcoding the value to 4, use a helper -function to determine the number of 6 GHz rules present in the 5 GHz rules -list and ignore only those rules. - -Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1 - -Cc: stable@vger.kernel.org -Fixes: d889913205cf ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices") -Signed-off-by: Aditya Kumar Singh -Link: https://patch.msgid.link/20250123-fix_6ghz_rules_handling-v1-1-d734bfa58ff4@oss.qualcomm.com -Signed-off-by: Jeff Johnson ---- - drivers/net/wireless/ath/ath12k/wmi.c | 61 ++++++++++++++++++++++++++--------- - drivers/net/wireless/ath/ath12k/wmi.h | 1 - - 2 files changed, 45 insertions(+), 17 deletions(-) - ---- a/drivers/net/wireless/ath/ath12k/wmi.c -+++ b/drivers/net/wireless/ath/ath12k/wmi.c -@@ -4790,6 +4790,22 @@ static struct ath12k_reg_rule - return reg_rule_ptr; - } - -+static u8 ath12k_wmi_ignore_num_extra_rules(struct ath12k_wmi_reg_rule_ext_params *rule, -+ u32 num_reg_rules) -+{ -+ u8 num_invalid_5ghz_rules = 0; -+ u32 count, start_freq; -+ -+ for (count = 0; count < num_reg_rules; count++) { -+ start_freq = le32_get_bits(rule[count].freq_info, REG_RULE_START_FREQ); -+ -+ if (start_freq >= ATH12K_MIN_6G_FREQ) -+ num_invalid_5ghz_rules++; -+ } -+ -+ return num_invalid_5ghz_rules; -+} -+ - static int ath12k_pull_reg_chan_list_ext_update_ev(struct ath12k_base *ab, - struct sk_buff *skb, - struct ath12k_reg_info *reg_info) -@@ -4800,6 +4816,7 @@ static int ath12k_pull_reg_chan_list_ext - u32 num_2g_reg_rules, num_5g_reg_rules; - u32 num_6g_reg_rules_ap[WMI_REG_CURRENT_MAX_AP_TYPE]; - u32 num_6g_reg_rules_cl[WMI_REG_CURRENT_MAX_AP_TYPE][WMI_REG_MAX_CLIENT_TYPE]; -+ u8 num_invalid_5ghz_ext_rules; - u32 total_reg_rules = 0; - int ret, i, j; - -@@ -4893,20 +4910,6 @@ static int ath12k_pull_reg_chan_list_ext - - memcpy(reg_info->alpha2, &ev->alpha2, REG_ALPHA2_LEN); - -- /* FIXME: Currently FW includes 6G reg rule also in 5G rule -- * list for country US. -- * Having same 6G reg rule in 5G and 6G rules list causes -- * intersect check to be true, and same rules will be shown -- * multiple times in iw cmd. So added hack below to avoid -- * parsing 6G rule from 5G reg rule list, and this can be -- * removed later, after FW updates to remove 6G reg rule -- * from 5G rules list. -- */ -- if (memcmp(reg_info->alpha2, "US", 2) == 0) { -- reg_info->num_5g_reg_rules = REG_US_5G_NUM_REG_RULES; -- num_5g_reg_rules = reg_info->num_5g_reg_rules; -- } -- - reg_info->dfs_region = le32_to_cpu(ev->dfs_region); - reg_info->phybitmap = le32_to_cpu(ev->phybitmap); - reg_info->num_phy = le32_to_cpu(ev->num_phy); -@@ -5009,8 +5012,29 @@ static int ath12k_pull_reg_chan_list_ext - } - } - -+ ext_wmi_reg_rule += num_2g_reg_rules; -+ -+ /* Firmware might include 6 GHz reg rule in 5 GHz rule list -+ * for few countries along with separate 6 GHz rule. -+ * Having same 6 GHz reg rule in 5 GHz and 6 GHz rules list -+ * causes intersect check to be true, and same rules will be -+ * shown multiple times in iw cmd. -+ * Hence, avoid parsing 6 GHz rule from 5 GHz reg rule list -+ */ -+ num_invalid_5ghz_ext_rules = ath12k_wmi_ignore_num_extra_rules(ext_wmi_reg_rule, -+ num_5g_reg_rules); -+ -+ if (num_invalid_5ghz_ext_rules) { -+ ath12k_dbg(ab, ATH12K_DBG_WMI, -+ "CC: %s 5 GHz reg rules number %d from fw, %d number of invalid 5 GHz rules", -+ reg_info->alpha2, reg_info->num_5g_reg_rules, -+ num_invalid_5ghz_ext_rules); -+ -+ num_5g_reg_rules = num_5g_reg_rules - num_invalid_5ghz_ext_rules; -+ reg_info->num_5g_reg_rules = num_5g_reg_rules; -+ } -+ - if (num_5g_reg_rules) { -- ext_wmi_reg_rule += num_2g_reg_rules; - reg_info->reg_rules_5g_ptr = - create_ext_reg_rules_from_wmi(num_5g_reg_rules, - ext_wmi_reg_rule); -@@ -5022,7 +5046,12 @@ static int ath12k_pull_reg_chan_list_ext - } - } - -- ext_wmi_reg_rule += num_5g_reg_rules; -+ /* We have adjusted the number of 5 GHz reg rules above. But still those -+ * many rules needs to be adjusted in ext_wmi_reg_rule. -+ * -+ * NOTE: num_invalid_5ghz_ext_rules will be 0 for rest other cases. -+ */ -+ ext_wmi_reg_rule += (num_5g_reg_rules + num_invalid_5ghz_ext_rules); - - for (i = 0; i < WMI_REG_CURRENT_MAX_AP_TYPE; i++) { - reg_info->reg_rules_6g_ap_ptr[i] = ---- a/drivers/net/wireless/ath/ath12k/wmi.h -+++ b/drivers/net/wireless/ath/ath12k/wmi.h -@@ -3965,7 +3965,6 @@ struct ath12k_wmi_eht_rate_set_params { - #define MAX_REG_RULES 10 - #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]; diff --git a/package/kernel/mac80211/patches/ath12k/100-ath12k-prevent-ltssm-startup-crash.patch b/package/kernel/mac80211/patches/ath12k/100-ath12k-prevent-ltssm-startup-crash.patch index cd85a0f6aa2..2209878b3c1 100644 --- a/package/kernel/mac80211/patches/ath12k/100-ath12k-prevent-ltssm-startup-crash.patch +++ b/package/kernel/mac80211/patches/ath12k/100-ath12k-prevent-ltssm-startup-crash.patch @@ -5,7 +5,7 @@ But have issues on BPI-Rx boards. --- a/drivers/net/wireless/ath/ath12k/pci.c +++ b/drivers/net/wireless/ath/ath12k/pci.c -@@ -277,6 +277,9 @@ static void ath12k_pci_enable_ltssm(stru +@@ -279,6 +279,9 @@ static void ath12k_pci_enable_ltssm(stru u32 val; int i; diff --git a/package/kernel/mac80211/patches/ath12k/102-wifi-ath12k-limit-WMI_SCAN_CHAN_LIST_CMDID-arg.patch b/package/kernel/mac80211/patches/ath12k/102-wifi-ath12k-limit-WMI_SCAN_CHAN_LIST_CMDID-arg.patch index 5b1628023fc..398f4d44512 100644 --- a/package/kernel/mac80211/patches/ath12k/102-wifi-ath12k-limit-WMI_SCAN_CHAN_LIST_CMDID-arg.patch +++ b/package/kernel/mac80211/patches/ath12k/102-wifi-ath12k-limit-WMI_SCAN_CHAN_LIST_CMDID-arg.patch @@ -130,7 +130,7 @@ Best regards, --- a/drivers/net/wireless/ath/ath12k/wmi.c +++ b/drivers/net/wireless/ath/ath12k/wmi.c -@@ -2558,6 +2558,9 @@ int ath12k_wmi_send_scan_chan_list_cmd(s +@@ -2743,6 +2743,9 @@ int ath12k_wmi_send_scan_chan_list_cmd(s max_chan_limit = (wmi->wmi_ab->max_msg_len[ar->pdev_idx] - len) / sizeof(*chan_info); @@ -142,7 +142,7 @@ Best regards, arg->nallchans -= num_send_chans; --- a/drivers/net/wireless/ath/ath12k/wmi.h +++ b/drivers/net/wireless/ath/ath12k/wmi.h -@@ -3743,6 +3743,8 @@ struct wmi_stop_scan_cmd { +@@ -3873,6 +3873,8 @@ struct wmi_stop_scan_cmd { __le32 pdev_id; } __packed; diff --git a/package/kernel/mac80211/patches/ath12k/103-wifi-ath12k-fix-5GHz-operation-on-wideband-QCN.patch b/package/kernel/mac80211/patches/ath12k/103-wifi-ath12k-fix-5GHz-operation-on-wideband-QCN.patch index 3b8b6226d1b..a8aa752db32 100644 --- a/package/kernel/mac80211/patches/ath12k/103-wifi-ath12k-fix-5GHz-operation-on-wideband-QCN.patch +++ b/package/kernel/mac80211/patches/ath12k/103-wifi-ath12k-fix-5GHz-operation-on-wideband-QCN.patch @@ -124,7 +124,7 @@ Best regards, --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c -@@ -5186,9 +5186,7 @@ static void ath12k_mac_setup_ht_vht_cap( +@@ -6432,9 +6432,7 @@ static void ath12k_mac_setup_ht_vht_cap( rate_cap_rx_chainmask); } diff --git a/package/kernel/mac80211/patches/ath12k/104-1-wifi-ath12k-push-HE-MU-MIMO-params-to-hardware.patch b/package/kernel/mac80211/patches/ath12k/104-1-wifi-ath12k-push-HE-MU-MIMO-params-to-hardware.patch index dcf633e1017..0ab44b54a51 100644 --- a/package/kernel/mac80211/patches/ath12k/104-1-wifi-ath12k-push-HE-MU-MIMO-params-to-hardware.patch +++ b/package/kernel/mac80211/patches/ath12k/104-1-wifi-ath12k-push-HE-MU-MIMO-params-to-hardware.patch @@ -1,68 +1,68 @@ -From patchwork Wed Sep 18 21:20:48 2024 +From patchwork Wed May 21 22:45:31 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pradeep Kumar Chitrapu -X-Patchwork-Id: 13807212 +X-Patchwork-Id: 14096118 X-Patchwork-Delegate: quic_jjohnson@quicinc.com -Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com - [205.220.168.131]) +Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com + [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) - by smtp.subspace.kernel.org (Postfix) with ESMTPS id A06681CA6B9 - for ; Wed, 18 Sep 2024 21:21:13 +0000 (UTC) + by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8D9B523506D + for ; Wed, 21 May 2025 22:45:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; - arc=none smtp.client-ip=205.220.168.131 + arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; - t=1726694475; cv=none; - b=HjUnHV2ZbMRZne/OD71kC1p0zBs+1+LVanM+3YbUfCnjvvtSry2r0Dj0HBjHnId1ltZw0ebTJaEZDcXBybkc2yiiGRlcH5s4feXisp9WApElGptz2Qn1SEtO3VDLKyE5m56eJftK/dpin6HPZGOk3hMBHkxoo966Jp4vlC9e2rY= + t=1747867559; cv=none; + b=QXLrpE5trQYq3qZVPuAYdZ8IfmZi7XatjLyxn+9IZXmAWvPsCpT2EOrmLKoTKXH1gxwInwHzxiiwzDveDdYBFh2FGnxhAgdJlTBf1yChfW7+YndhKTtca3rP8z+Zt8QK48/n7gpmFEWkKGmxkG1DKIkCHgAZjD///ttubaAe2gc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; - s=arc-20240116; t=1726694475; c=relaxed/simple; - bh=lJX5iM2Ahf/ROaeR2Kk4suhcbwA47aOSPqyQsesg4A0=; + s=arc-20240116; t=1747867559; c=relaxed/simple; + bh=wlnSlGktw4cBYqpNPJwSPfG4fkld5ABcJ0NmmjY/jLg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; - b=RYEWdi9+UZKYtzHKfAF5xdIOkpdgQjBK8hE1SX/f0rJDxozjZe1jDY28C+kzN4uhSwcBSwr7pZjMLL8LELNITE6fIk/zDY5UAO/jdeUPBnTrmrckzZOwaCFIQ1nt6ssDZDfpJADBjCIuMXB7HNChH3qSMlmYTV9QTDxpBK0fQxM= + b=A4dIxT87Fh9Y97+jvDIVTPlA5cnixK5ZcCAl5lklS0dCWBpo0QkFFiYyRUSKso7kYaT6KFazofkMt8A2z/fDgN8gVZgqEkaXDFSRjqNWCtoplSK7qYryl88snzbQvzD52CbWKkX8yu2Qmd98HFrl2kg69o1e4wzXVcNc+fehea8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com - header.b=EtpV59A6; arc=none smtp.client-ip=205.220.168.131 + header.b=gwsO0461; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com - header.b="EtpV59A6" -Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) + header.b="gwsO0461" +Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id - 48IL3WbX003099; - Wed, 18 Sep 2024 21:21:07 GMT + 54LIZCMW000836; + Wed, 21 May 2025 22:45:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= - 3ukRiLVgAcc9GoJxAaFrgsHYImZ/9ZPgSlMf75Ew/1Y=; b=EtpV59A6K8yD5o5B - 8JSYPL7TI2tnIQciUmyLNJig3DWGn3AZbFqPjgTYUgoQLHjsNWd+WRAKx13tQhSW - peq0OW9986uI1TFVpaw0pwVXoBiStEI5MH/7ThiA5nIAI4hYBI6+iiwL7qWpboSL - UrG9sWI35wsgcjedTtrzR2QfpeTAvlnReoac/49o5GAysu1oGDN79VAAP7tDZbO2 - trx/XdQmW/8iqtRR3Idhjcod6B6ovXKkmAZUHzhp4zRupTUsKOU84X3aTYZQLN/B - 46HuFZSlOJEB/63Co7I2K8YfQT3FikP2mkrIsDwH78Y2OekhXJWFe7dU4SsX6nh6 - sIXVxA== -Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com + jJ/9931jjDg+8neUbH09oigyzQwINmgJKgsYw6rWwPU=; b=gwsO0461NDm4hzMy + /aP5LNjbfqB08SmlMEzcZ/MRNS7Ffjdvz9gsUyJR4DOilx71C5MvB0ZBvxEJF6pg + qcU4QPZtOzyixWx+3vL6eh4Sdt/RN5AD/6U6TJEZCPwdJNLMD5uB2OQjP87NG9Wj + 2aEs+kb//lRXz6Gy5d7CCDW3+1KSDzgIg/cYJecPjWsMKbyCxTeFTIkkdonetQyz + PSzkIDi3IBnca94koYTQyFTVvpUVHpC3QAq+jM9+xQJOItRbDHZjdPjLG6q1ML4W + zYHODhd8LupxL323rnWJQxtYu5Ver7g2LgPW3npNz/JEdF2Hq9b8G0w5U8qVJVHr + 2nNuUA== +Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) - by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41n4gd387e-1 + by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 46rwf6vbsd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); - Wed, 18 Sep 2024 21:21:07 +0000 (GMT) + Wed, 21 May 2025 22:45:53 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) - by NALASPPMTA04.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id - 48ILL6rr020545 + by NALASPPMTA05.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id + 54LMjqLl023280 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); - Wed, 18 Sep 2024 21:21:06 GMT -Received: from ath12k-linux1.qualcomm.com (10.80.80.8) by + Wed, 21 May 2025 22:45:52 GMT +Received: from ath12k-linux2.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id - 15.2.1544.9; Wed, 18 Sep 2024 14:21:06 -0700 + 15.2.1544.9; Wed, 21 May 2025 15:45:51 -0700 From: Pradeep Kumar Chitrapu To: CC: , @@ -71,12 +71,13 @@ CC: , Muna Sinada , "Jeff Johnson" -Subject: [PATCH V8 1/9] wifi: ath12k: push HE MU-MIMO params to hardware -Date: Wed, 18 Sep 2024 14:20:48 -0700 -Message-ID: <20240918212056.4137076-2-quic_pradeepc@quicinc.com> -X-Mailer: git-send-email 2.34.1 -In-Reply-To: <20240918212056.4137076-1-quic_pradeepc@quicinc.com> -References: <20240918212056.4137076-1-quic_pradeepc@quicinc.com> +Subject: [PATCH ath-next V14 1/9] wifi: ath12k: push HE MU-MIMO params to + hardware +Date: Wed, 21 May 2025 15:45:31 -0700 +Message-ID: <20250521224539.355985-2-quic_pradeepc@quicinc.com> +X-Mailer: git-send-email 2.43.0 +In-Reply-To: <20250521224539.355985-1-quic_pradeepc@quicinc.com> +References: <20250521224539.355985-1-quic_pradeepc@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: @@ -88,17 +89,28 @@ X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 -X-Proofpoint-ORIG-GUID: QTgqLsl2p5OGLwWEQsGrsmA8q68U11H8 -X-Proofpoint-GUID: QTgqLsl2p5OGLwWEQsGrsmA8q68U11H8 +X-Proofpoint-GUID: Zzf2Q5y4JzSN5f1E_vlCnvLRODG4zasa +X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTIxMDIyNiBTYWx0ZWRfXyLZVeJQcQf0U + B/O6/0+L+1nXg6SAFSC1bdc8B/eF8RxRnvbbX+YkF3RG14/UHGCF654g8ZXTq8oTCDzm3x5wmAk + i8wAlv0otog8iYaicRd5q/x9Vynwlo0e67/iHhH1K0rxsp5yagZ6L3XLS82iLDPuXzHP7ylgo+I + D0c1CMcLo4bGNe421uQk2jqRij3j1iAoI0gGSwcQqHRucJQSYetF+SSp/oDox9Dn2TqOagngt4V + UxzAxO13SoH2X7RyWe5NxhfbEjOUmHjfodyJhBfIYh4s5SCx8IDUn6jSorAnl5mh1ZmAfISyZCC + UqoQ2LDdmGl1HT3d4xvb7/ah09ru4wukKEcvP+HDrow6Xn/WsfgmRy6xdRv5vdNODiEv64XOGHa + TxrJA2l36xRwX82xvkyUzyQ1sIeXwbvD0Wn//AQSmFVE0uMJHnCwRE1OYRGf9Dd2p/mfZfFh +X-Authority-Analysis: v=2.4 cv=fZOty1QF c=1 sm=1 tr=0 ts=682e57a1 cx=c_pps + a=ouPCqIW2jiPt+lZRy3xVPw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 + a=GEpy-HfZoHoA:10 a=dt9VzEwgFbYA:10 a=COk6AnOGAAAA:8 a=-_O-Wy8N5QNPZvNXkjkA:9 + a=TjNXssC_j7lpFel5tvFf:22 +X-Proofpoint-ORIG-GUID: Zzf2Q5y4JzSN5f1E_vlCnvLRODG4zasa X-Proofpoint-Virus-Version: vendor=baseguard - engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 - definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 + engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 + definitions=2025-05-21_07,2025-05-20_03,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 - malwarescore=0 suspectscore=0 - bulkscore=0 clxscore=1015 spamscore=0 adultscore=0 lowpriorityscore=0 - mlxlogscore=999 impostorscore=0 mlxscore=0 priorityscore=1501 phishscore=0 - classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000 - definitions=main-2409180140 + clxscore=1015 mlxscore=0 adultscore=0 spamscore=0 bulkscore=0 suspectscore=0 + malwarescore=0 priorityscore=1501 impostorscore=0 mlxlogscore=999 + lowpriorityscore=0 phishscore=0 classifier=spam authscore=0 authtc=n/a + authcc= route=outbound adjust=0 reason=mlx scancount=1 + engine=8.19.0-2505160000 definitions=main-2505210226 Currently, only the HE IE in management frames is updated with respect to MU-MIMO configurations, but this change is not @@ -112,42 +124,50 @@ Signed-off-by: Muna Sinada Signed-off-by: Pradeep Kumar Chitrapu Acked-by: Jeff Johnson --- - drivers/net/wireless/ath/ath12k/mac.c | 215 +++++++++++++++++--------- + drivers/net/wireless/ath/ath12k/mac.c | 228 +++++++++++++++++--------- drivers/net/wireless/ath/ath12k/mac.h | 15 ++ drivers/net/wireless/ath/ath12k/wmi.h | 28 +--- - 3 files changed, 156 insertions(+), 102 deletions(-) + 3 files changed, 169 insertions(+), 102 deletions(-) --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c -@@ -2851,6 +2851,108 @@ static int ath12k_setup_peer_smps(struct +@@ -3215,6 +3215,125 @@ static int ath12k_setup_peer_smps(struct ath12k_smps_map[smps]); } -+static int ath12k_mac_set_he_txbf_conf(struct ath12k_vif *arvif) ++static int ath12k_mac_set_he_txbf_conf(struct ath12k_link_vif *arvif) +{ ++ struct ath12k_vif *ahvif = arvif->ahvif; + struct ath12k *ar = arvif->ar; + u32 param = WMI_VDEV_PARAM_SET_HEMU_MODE; + u32 value = 0; + int ret; ++ struct ieee80211_bss_conf *link_conf; + -+ if (!arvif->vif->bss_conf.he_support) ++ link_conf = ath12k_mac_get_link_bss_conf(arvif); ++ if (!link_conf) { ++ ath12k_warn(ar->ab, "unable to access bss link conf in txbf conf\n"); ++ return -EINVAL; ++ } ++ ++ if (!link_conf->he_support) + return 0; + -+ if (arvif->vif->bss_conf.he_su_beamformer) { ++ if (link_conf->he_su_beamformer) { + value |= u32_encode_bits(HE_SU_BFER_ENABLE, HE_MODE_SU_TX_BFER); -+ if (arvif->vif->bss_conf.he_mu_beamformer && -+ arvif->vdev_type == WMI_VDEV_TYPE_AP) ++ if (link_conf->he_mu_beamformer && ++ ahvif->vdev_type == WMI_VDEV_TYPE_AP) + value |= u32_encode_bits(HE_MU_BFER_ENABLE, HE_MODE_MU_TX_BFER); + } + -+ if (arvif->vif->type != NL80211_IFTYPE_MESH_POINT) { ++ if (ahvif->vif->type != NL80211_IFTYPE_MESH_POINT) { + value |= u32_encode_bits(HE_DL_MUOFDMA_ENABLE, HE_MODE_DL_OFDMA) | + u32_encode_bits(HE_UL_MUOFDMA_ENABLE, HE_MODE_UL_OFDMA); + -+ if (arvif->vif->bss_conf.he_full_ul_mumimo) ++ if (link_conf->he_full_ul_mumimo) + value |= u32_encode_bits(HE_UL_MUMIMO_ENABLE, HE_MODE_UL_MUMIMO); + -+ if (arvif->vif->bss_conf.he_su_beamformee) ++ if (link_conf->he_su_beamformee) + value |= u32_encode_bits(HE_SU_BFEE_ENABLE, HE_MODE_SU_TX_BFEE); + } + @@ -174,21 +194,30 @@ Acked-by: Jeff Johnson +} + +static int ath12k_mac_vif_recalc_sta_he_txbf(struct ath12k *ar, -+ struct ieee80211_vif *vif, ++ struct ath12k_link_vif *arvif, + struct ieee80211_sta_he_cap *he_cap, + int *hemode) +{ ++ struct ieee80211_vif *vif = arvif->ahvif->vif; + struct ieee80211_he_cap_elem he_cap_elem = {}; + struct ieee80211_sta_he_cap *cap_band; + struct cfg80211_chan_def def; ++ u8 link_id = arvif->link_id; ++ struct ieee80211_bss_conf *link_conf; + -+ if (!vif->bss_conf.he_support) ++ link_conf = ath12k_mac_get_link_bss_conf(arvif); ++ if (!link_conf) { ++ ath12k_warn(ar->ab, "unable to access bss link conf in recalc txbf conf\n"); ++ return -EINVAL; ++ } ++ ++ if (!link_conf->he_support) + return 0; + + if (vif->type != NL80211_IFTYPE_STATION) + return -EINVAL; + -+ if (WARN_ON(ath12k_mac_vif_chan(vif, &def))) ++ if (WARN_ON(ath12k_mac_vif_link_chan(vif, link_id, &def))) + return -EINVAL; + + if (def.chan->band == NL80211_BAND_2GHZ) @@ -226,29 +255,22 @@ Acked-by: Jeff Johnson +} + static void ath12k_bss_assoc(struct ath12k *ar, - struct ath12k_vif *arvif, + struct ath12k_link_vif *arvif, struct ieee80211_bss_conf *bss_conf) -@@ -2858,9 +2960,11 @@ static void ath12k_bss_assoc(struct ath1 - struct ieee80211_vif *vif = arvif->vif; - struct ath12k_wmi_vdev_up_params params = {}; - struct ath12k_wmi_peer_assoc_arg peer_arg; -+ struct ieee80211_sta_he_cap he_cap; - struct ieee80211_sta *ap_sta; +@@ -3229,6 +3348,7 @@ static void ath12k_bss_assoc(struct ath1 + struct ath12k_sta *ahsta; struct ath12k_peer *peer; bool is_auth = false; + u32 hemode = 0; int ret; - lockdep_assert_held(&ar->conf_mutex); -@@ -2880,8 +2984,29 @@ static void ath12k_bss_assoc(struct ath1 + lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy); +@@ -3272,8 +3392,26 @@ static void ath12k_bss_assoc(struct ath1 - ath12k_peer_assoc_prepare(ar, vif, ap_sta, &peer_arg, false); + ath12k_peer_assoc_prepare(ar, arvif, arsta, peer_arg, false); -+ /* he_cap here is updated at assoc success for sta mode only */ -+ he_cap = ap_sta->deflink.he_cap; -+ -+ /* ap_sta->deflink.he_cap must be protected by rcu_read_lock */ -+ ret = ath12k_mac_vif_recalc_sta_he_txbf(ar, vif, &he_cap, &hemode); ++ /* link_sta->he_cap must be protected by rcu_read_lock */ ++ ret = ath12k_mac_vif_recalc_sta_he_txbf(ar, arvif, &link_sta->he_cap, &hemode); + if (ret) { + ath12k_warn(ar->ab, "failed to recalc he txbf for vdev %i on bss %pM: %d\n", + arvif->vdev_id, bss_conf->bssid, ret); @@ -267,10 +289,10 @@ Acked-by: Jeff Johnson + return; + } + - ret = ath12k_wmi_send_peer_assoc_cmd(ar, &peer_arg); + ret = ath12k_wmi_send_peer_assoc_cmd(ar, peer_arg); if (ret) { ath12k_warn(ar->ab, "failed to run peer assoc for %pM vdev %i: %d\n", -@@ -3220,6 +3345,13 @@ static void ath12k_mac_bss_info_changed( +@@ -3677,6 +3815,13 @@ static void ath12k_mac_bss_info_changed( ether_addr_copy(arvif->bssid, info->bssid); if (changed & BSS_CHANGED_BEACON_ENABLED) { @@ -283,8 +305,8 @@ Acked-by: Jeff Johnson + } ath12k_control_beaconing(arvif, info); - if (arvif->is_up && vif->bss_conf.he_support && -@@ -5352,11 +5484,14 @@ static void ath12k_mac_copy_he_cap(struc + if (arvif->is_up && info->he_support && +@@ -6598,11 +6743,14 @@ static void ath12k_mac_copy_he_cap(struc he_cap_elem->mac_cap_info[1] &= IEEE80211_HE_MAC_CAP1_TF_MAC_PAD_DUR_MASK; @@ -302,7 +324,7 @@ Acked-by: Jeff Johnson he_cap_elem->phy_cap_info[5] |= num_tx_chains - 1; switch (iftype) { -@@ -6318,71 +6453,6 @@ static int ath12k_mac_setup_vdev_create_ +@@ -7734,72 +7882,6 @@ static int ath12k_mac_setup_vdev_create_ return 0; } @@ -341,14 +363,15 @@ Acked-by: Jeff Johnson -} - -static int ath12k_set_he_mu_sounding_mode(struct ath12k *ar, -- struct ath12k_vif *arvif) +- struct ath12k_link_vif *arvif) -{ - u32 param_id, param_value; - struct ath12k_base *ab = ar->ab; +- struct ath12k_vif *ahvif = arvif->ahvif; - int ret; - - param_id = WMI_VDEV_PARAM_SET_HEMU_MODE; -- param_value = ath12k_mac_prepare_he_mode(ar->pdev, arvif->vif->type); +- param_value = ath12k_mac_prepare_he_mode(ar->pdev, ahvif->vif->type); - ret = ath12k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, - param_id, param_value); - if (ret) { @@ -371,22 +394,14 @@ Acked-by: Jeff Johnson - return ret; -} - - static void ath12k_mac_update_vif_offload(struct ath12k_vif *arvif) + static void ath12k_mac_update_vif_offload(struct ath12k_link_vif *arvif) { - struct ieee80211_vif *vif = arvif->vif; -@@ -7340,7 +7410,6 @@ ath12k_mac_vdev_start_restart(struct ath - struct ath12k_base *ab = ar->ab; - struct wmi_vdev_start_req_arg arg = {}; - const struct cfg80211_chan_def *chandef = &ctx->def; -- int he_support = arvif->vif->bss_conf.he_support; - int ret; - - lockdep_assert_held(&ar->conf_mutex); -@@ -7396,14 +7465,6 @@ ath12k_mac_vdev_start_restart(struct ath + struct ath12k_vif *ahvif = arvif->ahvif; +@@ -8978,14 +9060,6 @@ ath12k_mac_vdev_start_restart(struct ath spin_unlock_bh(&ab->base_lock); /* TODO: Notify if secondary 80Mhz also needs radar detection */ -- if (he_support) { +- if (link_conf->he_support) { - ret = ath12k_set_he_mu_sounding_mode(ar, arvif); - if (ret) { - ath12k_warn(ar->ab, "failed to set he mode vdev %i\n", @@ -399,9 +414,9 @@ Acked-by: Jeff Johnson arg.passive |= !!(chandef->chan->flags & IEEE80211_CHAN_NO_IR); --- a/drivers/net/wireless/ath/ath12k/mac.h +++ b/drivers/net/wireless/ath/ath12k/mac.h -@@ -41,6 +41,21 @@ struct ath12k_generic_iter { - #define ATH12K_TX_POWER_MAX_VAL 70 - #define ATH12K_TX_POWER_MIN_VAL 0 +@@ -51,6 +51,21 @@ struct ath12k_generic_iter { + #define ATH12K_DEFAULT_SCAN_LINK IEEE80211_MLD_MAX_NUM_LINKS + #define ATH12K_NUM_MAX_LINKS (IEEE80211_MLD_MAX_NUM_LINKS + 1) +#define HECAP_PHY_SUBFMR_GET(hecap_phy) \ + u8_get_bits(hecap_phy[3], IEEE80211_HE_PHY_CAP3_SU_BEAMFORMER) @@ -423,7 +438,7 @@ Acked-by: Jeff Johnson ATH12K_BW_40 = 1, --- a/drivers/net/wireless/ath/ath12k/wmi.h +++ b/drivers/net/wireless/ath/ath12k/wmi.h -@@ -2995,31 +2995,6 @@ struct ath12k_wmi_rx_reorder_queue_remov +@@ -3079,31 +3079,6 @@ struct ath12k_wmi_rx_reorder_queue_remov #define WMI_VDEV_PARAM_TXBF_SU_TX_BFER BIT(2) #define WMI_VDEV_PARAM_TXBF_MU_TX_BFER BIT(3) @@ -455,7 +470,7 @@ Acked-by: Jeff Johnson #define HE_MODE_SU_TX_BFEE BIT(0) #define HE_MODE_SU_TX_BFER BIT(1) #define HE_MODE_MU_TX_BFEE BIT(2) -@@ -3031,8 +3006,11 @@ struct ath12k_wmi_rx_reorder_queue_remov +@@ -3115,8 +3090,11 @@ struct ath12k_wmi_rx_reorder_queue_remov #define HE_DL_MUOFDMA_ENABLE 1 #define HE_UL_MUOFDMA_ENABLE 1 #define HE_DL_MUMIMO_ENABLE 1 diff --git a/package/kernel/mac80211/patches/ath12k/104-2-wifi-ath12k-push-EHT-MU-MIMO-params-to-hardware.patch b/package/kernel/mac80211/patches/ath12k/104-2-wifi-ath12k-push-EHT-MU-MIMO-params-to-hardware.patch index 65ef65fa7fb..d733b5be23f 100644 --- a/package/kernel/mac80211/patches/ath12k/104-2-wifi-ath12k-push-EHT-MU-MIMO-params-to-hardware.patch +++ b/package/kernel/mac80211/patches/ath12k/104-2-wifi-ath12k-push-EHT-MU-MIMO-params-to-hardware.patch @@ -1,68 +1,68 @@ -From patchwork Wed Sep 18 21:20:49 2024 +From patchwork Wed May 21 22:45:32 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pradeep Kumar Chitrapu -X-Patchwork-Id: 13807210 +X-Patchwork-Id: 14096119 X-Patchwork-Delegate: quic_jjohnson@quicinc.com -Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com - [205.220.168.131]) +Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com + [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) - by smtp.subspace.kernel.org (Postfix) with ESMTPS id B81C317967F - for ; Wed, 18 Sep 2024 21:21:12 +0000 (UTC) + by smtp.subspace.kernel.org (Postfix) with ESMTPS id 697B71A23AA + for ; Wed, 21 May 2025 22:45:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; - arc=none smtp.client-ip=205.220.168.131 + arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; - t=1726694474; cv=none; - b=SYN3tI9xaTiXuxK7CUAD6gXBOqoyS1qZxAGNOXDt4yS1Q6oU0YiwQonIkVrnux7/DC3bCm2JScN5vIxVzkGOkFztaIHlZMM/TRsp6GzSIbZdasVpxySumoe965kRna+5fYAmf4i3wJupfj9p6509u7j6kXzz1ZxlSStR4wLObcE= + t=1747867560; cv=none; + b=XceXZ7CY2+FEzM9RuC10/cGW+vmyB2cX8QWJ3ckav7jiY5NYBQe1XW2asWcHaAEmOwdUh2iRT6imeiQLYue78g4UAcBErvihTGqlYL0m+10CQMNHmQZurUQkLPeFS0WAwlA+HBgcdp+Z71PhXs/ttQD6dF/8mlPaeGqxlTUoEcM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; - s=arc-20240116; t=1726694474; c=relaxed/simple; - bh=yQPaApb7knqLxhkxSrizMfAanw18TDUbxBPbfnhzlV0=; + s=arc-20240116; t=1747867560; c=relaxed/simple; + bh=mXjCwVOeMuqCjiNDATjkwHPrwNjm6Uv3d5yO5+bqbfk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; - b=W+Rk8/tiKUvP6A8WYQFxi97//4Yj4m/rYPXAg0YP+6K+GXDcFK2VD+yEzmymA/fsenli+7ZEJ1zH6XgzLe4+1QFctCYGnq1LPoD01a4AIF8VqJGVdgs6e1ZwCKv8AOLkZUb09QkmM8Ur4R1xFhc4oVqhlvm3NMc24NERWmxzGjI= + b=SeDDAI+0lqXCMqhleIhxgpdPq9QuWaPI9jj0JOqYiwOIVtAsNqQv7KQ+AMvXDQTsIe0LfA2l23stlXB7sLNpKHTM9JhPsLkafU7mvBaiwTxaJR5tEi4zGQZhsrKSn/awYszamnM81hQS3r9bBgS4oe8AeFV2/lDXYPXNHCGv0+w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com - header.b=XJxqlj7h; arc=none smtp.client-ip=205.220.168.131 + header.b=DwzHO5rL; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com - header.b="XJxqlj7h" -Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) + header.b="DwzHO5rL" +Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id - 48IHKWuA006417; - Wed, 18 Sep 2024 21:21:08 GMT + 54LJflLg012749; + Wed, 21 May 2025 22:45:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= - hcoreX5pgczyblwh1gpL6Ax4OV0yrVpAaKX7psGXczI=; b=XJxqlj7hhoW4GYMB - +B9r7ajbqV+ZxP+/1uDt5veOBY8aQgsorBoEbZFKm+ccV0u5SQJ/fFSomLg8QYpE - iojXUyYsGJMsXSPW+OdC0DQ2JrhDEHWFQa/6c3C0sdBE5IGgTa8YiAmYAx/A1ti1 - ruMNSyT8H/xEKkR953axz1DOGJZfp9dCtOM5Xw6nrqpeUEYBShgvQ+1LLXqrH8U4 - qUlYW2vKFKJgZUe97nwRrwOiunhTD4M2ARe6xHqZ7bL+2bW27sRTSI69vGrcEdKM - Ied7A8KmlUAN5BBsOj5MeKAaoy0+h4iY/9W3JgDfOu+LwjuAaKzgPNrttmPehdhJ - Q8q0JQ== + tiHJ0bp145D1K0TKBussv+a5p9S+5sP37NuNrmk03fg=; b=DwzHO5rLl1Vp87qm + lpxifM2nR9pLT0mgMqz/HRb/yTHCnS9oGDXzc24mnve2I/O9X/YT8q8qN+wjBlLB + 4W7snIItVpffzrSmAJupTNtzj8qbmIYeti1zUlDdVoesUaICbdiDvSeCWPUtfeaz + tNKDOmBUTvCb+1qxxciQZhuRobmmkuRgcg8VkgCFP+OyG5o1OrUESYu3QeZ62Hle + ODt78jw+qe8cE9e2TxGEZhy++loik0tbF8D9P3cX5L+CdB+i4TyWnFxwvNgJciIx + RptE1lyB75UdrnAqETq0km4svwyidUuum/x0hqd6TvlDod3b7FD4tjbE7EP5iQ5V + Dw2tXA== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) - by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41n4kjk65k-1 + by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 46rwf9carr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); - Wed, 18 Sep 2024 21:21:07 +0000 (GMT) + Wed, 21 May 2025 22:45:53 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id - 48ILL7IZ032342 + 54LMjqtS008810 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); - Wed, 18 Sep 2024 21:21:07 GMT -Received: from ath12k-linux1.qualcomm.com (10.80.80.8) by + Wed, 21 May 2025 22:45:52 GMT +Received: from ath12k-linux2.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id - 15.2.1544.9; Wed, 18 Sep 2024 14:21:06 -0700 + 15.2.1544.9; Wed, 21 May 2025 15:45:52 -0700 From: Pradeep Kumar Chitrapu To: CC: , @@ -71,12 +71,13 @@ CC: , Muna Sinada , "Jeff Johnson" -Subject: [PATCH V8 2/9] wifi: ath12k: push EHT MU-MIMO params to hardware -Date: Wed, 18 Sep 2024 14:20:49 -0700 -Message-ID: <20240918212056.4137076-3-quic_pradeepc@quicinc.com> -X-Mailer: git-send-email 2.34.1 -In-Reply-To: <20240918212056.4137076-1-quic_pradeepc@quicinc.com> -References: <20240918212056.4137076-1-quic_pradeepc@quicinc.com> +Subject: [PATCH ath-next V14 2/9] wifi: ath12k: push EHT MU-MIMO params to + hardware +Date: Wed, 21 May 2025 15:45:32 -0700 +Message-ID: <20250521224539.355985-3-quic_pradeepc@quicinc.com> +X-Mailer: git-send-email 2.43.0 +In-Reply-To: <20250521224539.355985-1-quic_pradeepc@quicinc.com> +References: <20250521224539.355985-1-quic_pradeepc@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: @@ -88,17 +89,28 @@ X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 -X-Proofpoint-GUID: DiIEaDHD4453WG2b31qitb3_i0JkAM4u -X-Proofpoint-ORIG-GUID: DiIEaDHD4453WG2b31qitb3_i0JkAM4u +X-Proofpoint-ORIG-GUID: _eaDrXLa14UhDtRJT-hk8Y6z1fwFI6QB +X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTIxMDIyNSBTYWx0ZWRfX7QgTyyXEHZM8 + OnUvphQD/4J77Z8iHm4hJQIe6duMI5HbpiWELH5aRxqU7pFuvCjmltcmWPjwls9DzTkJnDGHMjo + FuBarQpMaZO8eQsx97aM8WpE0dpJHROE1ZRZ3SV8VEoTHHG712fvPw+oUWaZo6WccaEbxH9x9+W + n76tkFOOopbjRgOBmCokHCrfZmCMKcT4FLUFoiIDn0Fv8b/WKaut3Z+1hrEwcOuXCJv4X1QIOcx + 6NCnxNr8y1O1cwqXg3pBhHB+BpcLiEat6TlD9bH/5oUZHFce4W1jkZYs2J5VJnzLDeQxq8xBhP0 + Qal3bpuUPyWAMKZKH/uAEXwEZ5ZMghUioGuc78EBMJhSXa2VsT3lhmJtc/CaHDqNKFrp01I/KAh + 7UcIN/PKb8qOKrHE8/8cpuHgoBgB24X84Qo5rORKfnW4s7FbS0xkcs2ZV2TI0AIGz4eEZAOY +X-Authority-Analysis: v=2.4 cv=GawXnRXL c=1 sm=1 tr=0 ts=682e57a1 cx=c_pps + a=ouPCqIW2jiPt+lZRy3xVPw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 + a=GEpy-HfZoHoA:10 a=dt9VzEwgFbYA:10 a=COk6AnOGAAAA:8 a=uoU_VXRAPQDrZd00miQA:9 + a=TjNXssC_j7lpFel5tvFf:22 +X-Proofpoint-GUID: _eaDrXLa14UhDtRJT-hk8Y6z1fwFI6QB X-Proofpoint-Virus-Version: vendor=baseguard - engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 - definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 + engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 + definitions=2025-05-21_07,2025-05-20_03,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 - bulkscore=0 adultscore=0 - suspectscore=0 mlxscore=0 clxscore=1015 lowpriorityscore=0 malwarescore=0 - phishscore=0 impostorscore=0 mlxlogscore=999 priorityscore=1501 - spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 - engine=8.19.0-2408220000 definitions=main-2409180140 + mlxscore=0 mlxlogscore=999 lowpriorityscore=0 impostorscore=0 + priorityscore=1501 clxscore=1015 malwarescore=0 phishscore=0 bulkscore=0 + spamscore=0 suspectscore=0 adultscore=0 classifier=spam authscore=0 + authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 + engine=8.19.0-2505160000 definitions=main-2505210225 Currently, only the EHT IE in management frames is updated with respect to MU-MIMO configurations, but this change is not @@ -113,30 +125,38 @@ Signed-off-by: Muna Sinada Signed-off-by: Pradeep Kumar Chitrapu Acked-by: Jeff Johnson --- - drivers/net/wireless/ath/ath12k/mac.c | 50 +++++++++++++++++++++++++++ - drivers/net/wireless/ath/ath12k/wmi.h | 21 +++++++++++ - 2 files changed, 71 insertions(+) + drivers/net/wireless/ath/ath12k/mac.c | 58 +++++++++++++++++++++++++++ + drivers/net/wireless/ath/ath12k/wmi.h | 21 ++++++++++ + 2 files changed, 79 insertions(+) --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c -@@ -2953,6 +2953,50 @@ static int ath12k_mac_vif_recalc_sta_he_ +@@ -3334,6 +3334,58 @@ static int ath12k_mac_vif_recalc_sta_he_ return 0; } -+static int ath12k_mac_set_eht_txbf_conf(struct ath12k_vif *arvif) ++static int ath12k_mac_set_eht_txbf_conf(struct ath12k_link_vif *arvif) +{ -+ u32 param = WMI_VDEV_PARAM_SET_EHT_MU_MODE; ++ struct ath12k_vif *ahvif = arvif->ahvif; + struct ath12k *ar = arvif->ar; ++ u32 param = WMI_VDEV_PARAM_SET_EHT_MU_MODE; + u32 value = 0; + int ret; ++ struct ieee80211_bss_conf *link_conf; ++ ++ link_conf = ath12k_mac_get_link_bss_conf(arvif); ++ if (!link_conf) { ++ ath12k_warn(ar->ab, "unable to access bss link conf in eht txbf conf\n"); ++ return -ENOENT; ++ } + -+ if (!arvif->vif->bss_conf.eht_support) ++ if (!link_conf->eht_support) + return 0; + -+ if (arvif->vif->bss_conf.eht_su_beamformer) { ++ if (link_conf->eht_su_beamformer) { + value |= u32_encode_bits(EHT_SU_BFER_ENABLE, EHT_MODE_SU_TX_BFER); -+ if (arvif->vif->bss_conf.eht_mu_beamformer && -+ arvif->vdev_type == WMI_VDEV_TYPE_AP) ++ if (link_conf->eht_mu_beamformer && ++ ahvif->vdev_type == WMI_VDEV_TYPE_AP) + value |= u32_encode_bits(EHT_MU_BFER_ENABLE, + EHT_MODE_MU_TX_BFER) | + u32_encode_bits(EHT_DL_MUOFDMA_ENABLE, @@ -145,14 +165,14 @@ Acked-by: Jeff Johnson + EHT_MODE_UL_OFDMA_MUMIMO); + } + -+ if (arvif->vif->type != NL80211_IFTYPE_MESH_POINT) { ++ if (ahvif->vif->type != NL80211_IFTYPE_MESH_POINT) { + value |= u32_encode_bits(EHT_DL_MUOFDMA_ENABLE, EHT_MODE_DL_OFDMA) | + u32_encode_bits(EHT_UL_MUOFDMA_ENABLE, EHT_MODE_UL_OFDMA); + -+ if (arvif->vif->bss_conf.eht_80mhz_full_bw_ul_mumimo) ++ if (link_conf->eht_80mhz_full_bw_ul_mumimo) + value |= u32_encode_bits(EHT_UL_MUMIMO_ENABLE, EHT_MODE_MUMIMO); + -+ if (arvif->vif->bss_conf.eht_su_beamformee) ++ if (link_conf->eht_su_beamformee) + value |= u32_encode_bits(EHT_SU_BFEE_ENABLE, + EHT_MODE_SU_TX_BFEE); + } @@ -168,9 +188,9 @@ Acked-by: Jeff Johnson +} + static void ath12k_bss_assoc(struct ath12k *ar, - struct ath12k_vif *arvif, + struct ath12k_link_vif *arvif, struct ieee80211_bss_conf *bss_conf) -@@ -3351,6 +3395,12 @@ static void ath12k_mac_bss_info_changed( +@@ -3821,6 +3873,12 @@ static void ath12k_mac_bss_info_changed( ath12k_warn(ar->ab, "failed to set HE TXBF config for vdev: %d\n", arvif->vdev_id); @@ -185,7 +205,7 @@ Acked-by: Jeff Johnson --- a/drivers/net/wireless/ath/ath12k/wmi.h +++ b/drivers/net/wireless/ath/ath12k/wmi.h -@@ -1139,6 +1139,7 @@ enum wmi_tlv_vdev_param { +@@ -1152,6 +1152,7 @@ enum wmi_tlv_vdev_param { WMI_VDEV_PARAM_BSS_COLOR, WMI_VDEV_PARAM_SET_HEMU_MODE, WMI_VDEV_PARAM_HEOPS_0_31 = 0x8003, @@ -193,7 +213,7 @@ Acked-by: Jeff Johnson }; enum wmi_tlv_peer_flags { -@@ -3012,6 +3013,26 @@ struct ath12k_wmi_rx_reorder_queue_remov +@@ -3096,6 +3097,26 @@ struct ath12k_wmi_rx_reorder_queue_remov #define HE_MU_BFER_ENABLE 1 #define HE_SU_BFER_ENABLE 1 diff --git a/package/kernel/mac80211/patches/ath12k/104-3-wifi-ath12k-move-HE-MCS-mapper-to-a-separate-function.patch b/package/kernel/mac80211/patches/ath12k/104-3-wifi-ath12k-move-HE-MCS-mapper-to-a-separate-function.patch index 1d6c9cc7dbd..ee0f20fe174 100644 --- a/package/kernel/mac80211/patches/ath12k/104-3-wifi-ath12k-move-HE-MCS-mapper-to-a-separate-function.patch +++ b/package/kernel/mac80211/patches/ath12k/104-3-wifi-ath12k-move-HE-MCS-mapper-to-a-separate-function.patch @@ -1,68 +1,68 @@ -From patchwork Wed Sep 18 21:20:50 2024 +From patchwork Wed May 21 22:45:33 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pradeep Kumar Chitrapu -X-Patchwork-Id: 13807213 +X-Patchwork-Id: 14096126 X-Patchwork-Delegate: quic_jjohnson@quicinc.com -Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com - [205.220.180.131]) +Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com + [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) - by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B2B11CB312 - for ; Wed, 18 Sep 2024 21:21:14 +0000 (UTC) + by smtp.subspace.kernel.org (Postfix) with ESMTPS id A4E00239570 + for ; Wed, 21 May 2025 22:46:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; - arc=none smtp.client-ip=205.220.180.131 + arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; - t=1726694475; cv=none; - b=uo8JC/iAnxSCZyXzNFarViwWJNwY+JldG9aDgn6LOK7yCxMusODCN3rw4mSCs0sLxHrfxFouDKWpiKeM7hGb/fzQzU2eh6bHNvzhjOqaTjAsJo7sVGj4L2QK1UPb2ZxMke35L51ztNTVhAc7IS17sn6blDZnU+1+RGRKXskHc78= + t=1747867563; cv=none; + b=m0NU8tyG2d1pHiYNjTYhCTeGXC0pFtHNZTKxb+dc5AEzzUCa75lxPxtYFZApv1QHaLqo3lGkZ+ADhqhj/V82GA+bUeetm3hSsnyGgjbayU3IzqeO09+VPkt9sx9hdrTMlVGEI4c5881Zho41rlVW65O/SlmqRi4J/ajQzA4tiGQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; - s=arc-20240116; t=1726694475; c=relaxed/simple; - bh=nhEu2OadboIpWVwShgMmYabjiVuEo2mUKJhJlcUzvgI=; + s=arc-20240116; t=1747867563; c=relaxed/simple; + bh=0bTV82dMwisd7nmbtolnSKswG/aTjqN0YxpAx66Oqv8=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; - b=iPc43CIgA4O9RfgxO3cfBBvDShW3nh4Q/MVoL1JTtx8u/9t1CeFY7KstjtKiPdJ6vxx0yhZwXcwCRFfbZdfRduyybDRKPmgqN/VogzkwizBSFWBL41H02pCvee2mV3poTyZz9CnCJ5L7An5k7ARI3Eo6EwsgaAYIncO/tU2Jsao= + b=jOkezej/N9fmvOtPNCGPpnPNtoQ+pAG4k1zAiw3xnL1iikk7VcJlbXDCrGUithxMZE2513zz/fsfDjXx0AMi4YT1ISljvGCw9B0dGQ5ECiFfoGLc+12nnsvqjiXI5zla6C1iX7bgtJjv/OYWzoY0TR5jI28CZWC/Pa9fT/X0duw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com - header.b=iXyzdRBT; arc=none smtp.client-ip=205.220.180.131 + header.b=UqUMYAcW; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com - header.b="iXyzdRBT" -Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) + header.b="UqUMYAcW" +Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id - 48I90GrT001584; - Wed, 18 Sep 2024 21:21:09 GMT + 54LIDlKw013406; + Wed, 21 May 2025 22:45:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= - aj0umwCwR0cGrc/Vc7qz7QRYcnU4amMo6KwLL9RZRaA=; b=iXyzdRBTMie5qv2n - KocnG3cRtZjxDUMbNTj+in3o4zrIU5RFumLb3ZmgpbCZD9jcmxkc9fcTdtwxUz8e - LTodO1mKSkqtOufy45keXIYYJN3lxfFsZtA5bcmG+QCJZJmPaTpMaf9L9Us9e+JZ - Ngjh4JNR3UIXn5+UvNGrRNEWeAlCrwf9Z5bWl1mQmwmkVVuH3nMu1IyPidF3tzRk - AdQTPkPtpnoGlYwEWL/noPAYTf4OuZrqPCAj31iBfZvq2RjAdWtPx/ayYEQsNKCu - xoBLKjb8hppxfGqn06TpV73nTxvhEDwnwBTwfgrr+xVeKvwz6Mrh8aoYBdUeFUAh - OiuxDA== -Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com + tYXOeicncMlFjsw5kmnB5kxC/Nrj/HibF1jgO4m8lhM=; b=UqUMYAcWWQ07Z79h + GESSroshxr6zIUBw3jr/ESGDCO554RYWZZh9PXJxjTRM3ceCrNHNpCAT+mqXXiWy + eb+l7G0W+s1l/MStBq7B43CSdKxljZtlkC/JsHk6DQjBacQzVB8qAiq3ShbR/vn7 + ud3kzjHtYsfLvIpi+8wLTkE1in8E/CUFZ4bea866xldnrcOVEa7EuxKwKXj3sLhE + 8n3IsPUIYGLKnEFkmWFZTXTqlEOV9lVYdTxeDAUBxII8PQIKu+dlB/UWffTFTSOd + aQDPK5N6y8x29E2fugyy2XBSEFskz50Jb60+kJhHFGTgl5cQw+NfymuC9SQJBWaE + HFZu+w== +Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) - by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41n4hf38cn-1 + by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 46rwh5cfg1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); - Wed, 18 Sep 2024 21:21:08 +0000 (GMT) + Wed, 21 May 2025 22:45:53 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) - by NALASPPMTA03.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id - 48ILL7e8005093 + by NALASPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id + 54LMjqn9020293 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); - Wed, 18 Sep 2024 21:21:07 GMT -Received: from ath12k-linux1.qualcomm.com (10.80.80.8) by + Wed, 21 May 2025 22:45:52 GMT +Received: from ath12k-linux2.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id - 15.2.1544.9; Wed, 18 Sep 2024 14:21:07 -0700 + 15.2.1544.9; Wed, 21 May 2025 15:45:52 -0700 From: Pradeep Kumar Chitrapu To: CC: , @@ -71,13 +71,13 @@ CC: , Muna Sinada , "Jeff Johnson" -Subject: [PATCH V8 3/9] wifi: ath12k: move HE MCS mapper to a separate - function -Date: Wed, 18 Sep 2024 14:20:50 -0700 -Message-ID: <20240918212056.4137076-4-quic_pradeepc@quicinc.com> -X-Mailer: git-send-email 2.34.1 -In-Reply-To: <20240918212056.4137076-1-quic_pradeepc@quicinc.com> -References: <20240918212056.4137076-1-quic_pradeepc@quicinc.com> +Subject: [PATCH ath-next V14 3/9] wifi: ath12k: move HE MCS mapper to a + separate function +Date: Wed, 21 May 2025 15:45:33 -0700 +Message-ID: <20250521224539.355985-4-quic_pradeepc@quicinc.com> +X-Mailer: git-send-email 2.43.0 +In-Reply-To: <20250521224539.355985-1-quic_pradeepc@quicinc.com> +References: <20250521224539.355985-1-quic_pradeepc@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: @@ -89,17 +89,28 @@ X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 -X-Proofpoint-ORIG-GUID: zHmCiFNBcWNOH7v_I9cuj0l6gmfKvBVa -X-Proofpoint-GUID: zHmCiFNBcWNOH7v_I9cuj0l6gmfKvBVa +X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTIxMDIyNiBTYWx0ZWRfX0c42ymLt+PTP + 1OuRw1LMafhFmBy7Y+zhs50WttVxoryUfqamicOcfcFB1N0ReYFgzeQ7geC/w54E8E6mzQDYeie + WWkPGvuIyvtCjzhBcBwz1A7W/LdsI7Od6+VlXyCuAp4pbCASB7kqVnI7Neak6mvdIQIW5khVLX7 + r/364Kop8/BPQzOVUZf5snfx4TBCgWauiHZQBTJupIn1Tf8+NctUXB8H3QNfu8zJTLVrBA3rtt1 + +yjeNOHom4U/t0u5Vzxu+8XctXsWHoYytfluXbsRo7WNut0MwPSY8GCm7RQ2wDQp0CzdactGb6t + KCMvNcpkDRjEtOdkNtf2BeVHF1yJKxuibe6qssobLjTadJRkC33xnz5E+hzF6sEZlg7JWok01h4 + OxWFUldQYnF/eQjZYTQcgLyH91h9gWkvz0YJWKGCrg0PlxqeIFS/SQvVNs7qMnsX0qrXb7NV +X-Authority-Analysis: v=2.4 cv=XeWJzJ55 c=1 sm=1 tr=0 ts=682e57a1 cx=c_pps + a=ouPCqIW2jiPt+lZRy3xVPw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 + a=GEpy-HfZoHoA:10 a=dt9VzEwgFbYA:10 a=COk6AnOGAAAA:8 a=4Pgy4kl5F6fn7-PMLAkA:9 + a=TjNXssC_j7lpFel5tvFf:22 +X-Proofpoint-GUID: CVZHk1FyIP3eCYHbVaXVp1fjSAGIjnVJ +X-Proofpoint-ORIG-GUID: CVZHk1FyIP3eCYHbVaXVp1fjSAGIjnVJ X-Proofpoint-Virus-Version: vendor=baseguard - engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 - definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 + engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 + definitions=2025-05-21_07,2025-05-20_03,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 - priorityscore=1501 mlxscore=0 - suspectscore=0 bulkscore=0 lowpriorityscore=0 spamscore=0 clxscore=1015 - mlxlogscore=999 adultscore=0 malwarescore=0 phishscore=0 impostorscore=0 - classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000 - definitions=main-2409180140 + phishscore=0 clxscore=1015 mlxlogscore=999 mlxscore=0 bulkscore=0 spamscore=0 + suspectscore=0 impostorscore=0 adultscore=0 malwarescore=0 lowpriorityscore=0 + priorityscore=1501 classifier=spam authscore=0 authtc=n/a authcc= + route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505160000 + definitions=main-2505210226 Refactor the HE MCS mapper functionality in ath12k_mac_copy_he_cap() into a new function. @@ -119,7 +130,7 @@ Acked-by: Jeff Johnson --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c -@@ -5519,12 +5519,24 @@ static __le16 ath12k_mac_setup_he_6ghz_c +@@ -6786,12 +6786,24 @@ static __le16 ath12k_mac_setup_he_6ghz_c return cpu_to_le16(bcap->he_6ghz_capa); } @@ -145,7 +156,7 @@ Acked-by: Jeff Johnson he_cap->has_he = true; memcpy(he_cap_elem->mac_cap_info, band_cap->he_cap_info, -@@ -5562,13 +5574,7 @@ static void ath12k_mac_copy_he_cap(struc +@@ -6829,13 +6841,7 @@ static void ath12k_mac_copy_he_cap(struc break; } diff --git a/package/kernel/mac80211/patches/ath12k/104-4-wifi-ath12k-generate-rx-and-tx-mcs-maps-for-supported-HE-mcs.patch b/package/kernel/mac80211/patches/ath12k/104-4-wifi-ath12k-generate-rx-and-tx-mcs-maps-for-supported-HE-mcs.patch index fe33f85a196..848fd412f96 100644 --- a/package/kernel/mac80211/patches/ath12k/104-4-wifi-ath12k-generate-rx-and-tx-mcs-maps-for-supported-HE-mcs.patch +++ b/package/kernel/mac80211/patches/ath12k/104-4-wifi-ath12k-generate-rx-and-tx-mcs-maps-for-supported-HE-mcs.patch @@ -1,68 +1,68 @@ -From patchwork Wed Sep 18 21:20:51 2024 +From patchwork Wed May 21 22:45:34 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pradeep Kumar Chitrapu -X-Patchwork-Id: 13807215 +X-Patchwork-Id: 14096123 X-Patchwork-Delegate: quic_jjohnson@quicinc.com Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) - by smtp.subspace.kernel.org (Postfix) with ESMTPS id A88651CB32C - for ; Wed, 18 Sep 2024 21:21:14 +0000 (UTC) + by smtp.subspace.kernel.org (Postfix) with ESMTPS id A3C04239581 + for ; Wed, 21 May 2025 22:45:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; - t=1726694476; cv=none; - b=Lkqx2oSLyeGRxKcm+N4Vmg+KOuwHpt6xhgWj9SpyWNXxxWkVExVyHvPrWaP/u4OXd0YjYBJC3Dg0NJYY9WJyL0A3RP8GK++s9CiRloNaEmEjI71S/f3+0HVXu5bCmi8cyiIMFzCpAcNuZ67J7r/WxvNRbeox3iZHmXK1WFUb4Hs= + t=1747867561; cv=none; + b=JUfYB6YNOea3E6luldlHf63eW7OUVXEtawJXGCeH7nt9iIJpG0ODfz3v+Zl+gtQtUZ1ELh/UAhCubbThHH30w661eEN5+cQarbiqdd1cN5dnkAsmZUNSD6l//QpurFV6Wsvv4Nr2fYgyuAVHf9JDoITZKNEbIki68J7WTV+fieU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; - s=arc-20240116; t=1726694476; c=relaxed/simple; - bh=nv4kc89H7eGC0FLgCwC70zFDhNkClMNiRf5HjDZHHuQ=; + s=arc-20240116; t=1747867561; c=relaxed/simple; + bh=e6/wBkUC5dKwNLeEqNLmC/3pJt4EcGfxZRx+zntD5Ek=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; - b=B1oJWv7vHZKRChjamOFJnRzQVtL7qBs7/Ho9GojLQtHyCKtrCEOJt/lWvhkqISf48/5MaQOCdkHhCrQT/eHP9hZ1wnCdeOKXh6Wmk/QYt9yEcc0X6HT5wUxgpaA3PooH/cMlJCX0c8hyhT7XBm6vWnPwQjt/FnLTubA3uj+X8oE= + b=bg3Y4gdyPqhSKZtqqeN+SjMvTgg+BVUsyqAvkS3YPjV+C7dPwxcByNFjDRsuBqwHuSvgolo2ISExqyfJkgT6Flp4H+hriFJHcMdI0WmDf9NrBPI+E07JvNLDvP5X59C6pSrqpjXYngUV6AvPCJL7ynVBFF80h0neCm0IRu8Ur8w= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com - header.b=WweZPnje; arc=none smtp.client-ip=205.220.180.131 + header.b=LbIprPEi; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com - header.b="WweZPnje" -Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) + header.b="LbIprPEi" +Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id - 48IACJst031540; - Wed, 18 Sep 2024 21:21:09 GMT + 54LIdAVE024983; + Wed, 21 May 2025 22:45:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= - ARu9Fu0s66NeuLm2pdCBchANS+rlgd275Q/E4KE2T1o=; b=WweZPnjehL/ZQW57 - 4JHJDsl8A5hyljMaJrVPdmZwNktTurJPMpD5z0akqx2dq3bfjzx2rx5NAtMb831x - ieysvT1ApK5V32fmb9xzG7FMIU3DH4eqr/9ApZbHFVPTglHrVoVzHJLps3I+Ts5P - gi1dsIAdwTai7hW1FchcW/pZ2kJMq6zN7oljoFs7pc1CvzHfIJowQM8gFfslkqlL - lvm9A9knvnUlkrEvzgpoZfZxm/91t9bQzkQDTX91wRc0oGR/9liT+z4Sdum2rLwb - fri8rhQIw8w1ExGM1nzChPaajmDIsE86ODjDL2xBbd/DcdsVvOYl8ewJ8AX45qNs - +LpHtg== -Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com + oR9JZ4DE7PwiZ/DcP72BpK9yTZspsBeRbWSrP3w24nY=; b=LbIprPEif55TZs6Z + ZsvTaIhFDxESbkxn/avX548dzh51JY3wFWHowpcPEnJJdIE1oNPWkxrPo0hHkyUb + UICPtIHoZHdMwN/uHPyglzBnBLNP82LGLHZI5eHx6jVz4INyCFm1Gmof8YNLLIo/ + pTKj4Qx3OO0jH6zSnAoKIIg39v5TWetjVZbL2qbNR+GImD0RtoefBQxRgyJWn11r + O3ycFAW9xlW8wYJql07vue+hM3MWNtk5EPqF70c7JrrmMAYvTyOFuP0Kaf11szIB + mF4bMyb+bb1/QA6moW7LDIoDBWEjCLINcTdGUPTnwnfBWlxZJhZoMqzU9ZuZgvsR + 1UjthA== +Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) - by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41n4j6uagq-1 + by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 46rwf4vc5x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); - Wed, 18 Sep 2024 21:21:09 +0000 (GMT) + Wed, 21 May 2025 22:45:54 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) - by NALASPPMTA03.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id - 48ILL8gM005103 + by NALASPPMTA05.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id + 54LMjrWL023291 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); - Wed, 18 Sep 2024 21:21:08 GMT -Received: from ath12k-linux1.qualcomm.com (10.80.80.8) by + Wed, 21 May 2025 22:45:53 GMT +Received: from ath12k-linux2.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id - 15.2.1544.9; Wed, 18 Sep 2024 14:21:07 -0700 + 15.2.1544.9; Wed, 21 May 2025 15:45:52 -0700 From: Pradeep Kumar Chitrapu To: CC: , @@ -71,13 +71,13 @@ CC: , Muna Sinada , "Jeff Johnson" -Subject: [PATCH V8 4/9] wifi: ath12k: generate rx and tx mcs maps for - supported HE mcs -Date: Wed, 18 Sep 2024 14:20:51 -0700 -Message-ID: <20240918212056.4137076-5-quic_pradeepc@quicinc.com> -X-Mailer: git-send-email 2.34.1 -In-Reply-To: <20240918212056.4137076-1-quic_pradeepc@quicinc.com> -References: <20240918212056.4137076-1-quic_pradeepc@quicinc.com> +Subject: [PATCH ath-next V14 4/9] wifi: ath12k: generate rx and tx mcs maps + for supported HE mcs +Date: Wed, 21 May 2025 15:45:34 -0700 +Message-ID: <20250521224539.355985-5-quic_pradeepc@quicinc.com> +X-Mailer: git-send-email 2.43.0 +In-Reply-To: <20250521224539.355985-1-quic_pradeepc@quicinc.com> +References: <20250521224539.355985-1-quic_pradeepc@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: @@ -89,17 +89,28 @@ X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 -X-Proofpoint-ORIG-GUID: wHJ63GZpWGKZ4XSyQZiVlsARNAgr5CQM -X-Proofpoint-GUID: wHJ63GZpWGKZ4XSyQZiVlsARNAgr5CQM +X-Proofpoint-GUID: mYgnUwiU6CWGXCKmK4mo491eQG1yf62Y +X-Proofpoint-ORIG-GUID: mYgnUwiU6CWGXCKmK4mo491eQG1yf62Y +X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTIxMDIyNiBTYWx0ZWRfX1nkoUF8smaXX + IWIOVUfe7hMPdAVBJy7J1imFvumQnVaEdoZ98Hgv5FTjeK2Ebgl2R2fohvg1z4LsyCLnU8qfg96 + 1OdC0+PM8u7DhRIEnk7H2EZt0UJoJRxlc7daiIvimTjbBLu53yfgzses5Gth0zLCzoih5ffW/H5 + 1h2tf1ZE4W6AmHjQJc+WE0P3RhBMdl286VT/kc0ko03He0+5/QdxsynqL2e4svB4f3035pzXOEK + dUS4nBFSZJXuBkq0d//SizRJgH9egq51A/OVPm8om04qEcOK3x9OmrrborAen5I0iuLaqAMMBXa + nlUKQ4fpPRovjAByevo6BIIwB698Nmo72bZcFiWOocONR92lAssB6pFXJnuwOC6VQ7MJE7DKc0x + 5UnlyGSMzMAM7cQXuGFk1AK16e6Tu/rC5YA6A4ogDKajrcBGepxGFKcZ+xK4+BwuwgI4Qysv +X-Authority-Analysis: v=2.4 cv=R7UDGcRX c=1 sm=1 tr=0 ts=682e57a2 cx=c_pps + a=ouPCqIW2jiPt+lZRy3xVPw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 + a=GEpy-HfZoHoA:10 a=dt9VzEwgFbYA:10 a=COk6AnOGAAAA:8 a=WmtfbAKxhnfIJFSrnnQA:9 + a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-Virus-Version: vendor=baseguard - engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 - definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 + engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 + definitions=2025-05-21_07,2025-05-20_03,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 - phishscore=0 mlxlogscore=999 - mlxscore=0 malwarescore=0 bulkscore=0 priorityscore=1501 clxscore=1015 - adultscore=0 suspectscore=0 lowpriorityscore=0 spamscore=0 impostorscore=0 - classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000 - definitions=main-2409180140 + phishscore=0 clxscore=1015 mlxlogscore=999 priorityscore=1501 spamscore=0 + bulkscore=0 lowpriorityscore=0 malwarescore=0 suspectscore=0 mlxscore=0 + impostorscore=0 adultscore=0 classifier=spam authscore=0 authtc=n/a authcc= + route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505160000 + definitions=main-2505210226 Generate rx and tx mcs maps in ath12k_mac_set_hemcsmap() based on number of supported tx/rx chains and set them in supported @@ -117,7 +128,7 @@ Acked-by: Jeff Johnson --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c -@@ -5519,20 +5519,40 @@ static __le16 ath12k_mac_setup_he_6ghz_c +@@ -6786,20 +6786,40 @@ static __le16 ath12k_mac_setup_he_6ghz_c return cpu_to_le16(bcap->he_6ghz_capa); } @@ -166,7 +177,7 @@ Acked-by: Jeff Johnson int iftype, u8 num_tx_chains, struct ieee80211_sta_he_cap *he_cap) { -@@ -5574,7 +5594,7 @@ static void ath12k_mac_copy_he_cap(struc +@@ -6841,7 +6861,7 @@ static void ath12k_mac_copy_he_cap(struc break; } @@ -175,7 +186,7 @@ Acked-by: Jeff Johnson memset(he_cap->ppe_thres, 0, sizeof(he_cap->ppe_thres)); if (he_cap_elem->phy_cap_info[6] & IEEE80211_HE_PHY_CAP6_PPE_THRESHOLD_PRESENT) -@@ -5763,7 +5783,7 @@ static int ath12k_mac_copy_sband_iftype_ +@@ -7030,7 +7050,7 @@ static int ath12k_mac_copy_sband_iftype_ data[idx].types_mask = BIT(i); diff --git a/package/kernel/mac80211/patches/ath12k/104-5-wifi-ath12k-fix-TX-and-RX-MCS-rate-configurations-in-HE-mode.patch b/package/kernel/mac80211/patches/ath12k/104-5-wifi-ath12k-fix-TX-and-RX-MCS-rate-configurations-in-HE-mode.patch index e1d109cd569..dae1682ead0 100644 --- a/package/kernel/mac80211/patches/ath12k/104-5-wifi-ath12k-fix-TX-and-RX-MCS-rate-configurations-in-HE-mode.patch +++ b/package/kernel/mac80211/patches/ath12k/104-5-wifi-ath12k-fix-TX-and-RX-MCS-rate-configurations-in-HE-mode.patch @@ -1,81 +1,81 @@ -From patchwork Wed Sep 18 21:20:52 2024 +From patchwork Wed May 21 22:45:35 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pradeep Kumar Chitrapu -X-Patchwork-Id: 13807211 +X-Patchwork-Id: 14096120 X-Patchwork-Delegate: quic_jjohnson@quicinc.com -Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com - [205.220.168.131]) +Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com + [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) - by smtp.subspace.kernel.org (Postfix) with ESMTPS id 77FB41CA6AC - for ; Wed, 18 Sep 2024 21:21:13 +0000 (UTC) + by smtp.subspace.kernel.org (Postfix) with ESMTPS id A3B9F239570 + for ; Wed, 21 May 2025 22:45:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; - arc=none smtp.client-ip=205.220.168.131 + arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; - t=1726694475; cv=none; - b=RN/ddoo5Vh8RVGeYZ8k8lXTOb7bzs7wSIAQGFjyvpfc9NICOpTDXpM3ai/D/fFtXLR8mFmYa4uIMFdrWML1x/UjZtd+jJnNyL/jo4/t5+ONN0nU4brd/dW7fv/biqLA6CkFbjnw01XnInXLzGT8IIm4NvxBkMy/RVj0tC33y7os= + t=1747867560; cv=none; + b=GmlOnDZdpnT/77kfeg7qPbZIn+pp+Rv41/WYnHylPZroDHwpWp5rzjObHMVoVIVB8f5dpHJSWNb5ucf0EdCqAqynnnDnAHne0d3j8kMBBH6ZVQr4AnIsYhkIrbmy6o7JffEBF094XVxGwQTjyWSEPi6VY94Md6L1NnuF0J5lJXw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; - s=arc-20240116; t=1726694475; c=relaxed/simple; - bh=bsvgv033jSAPUVmS0VlMcScTn/1aM6tw3aACOOiqxvA=; + s=arc-20240116; t=1747867560; c=relaxed/simple; + bh=Xdsuttpv57eTzMnRm7g3A0+frkCx/SnGj1xOjVOXHng=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; - b=rDT2TKhzEg9vR1RSVstUP/e9Z+sWhPbag7vxjm3nmkSJBFS5bR72jSO3YnpEGSQLOgd0c+ou8ce0GQOHHZBEpr8VlMP4o6SK8T3BVg4yPiHhqLzwadektVXzAofZ0K+caSvYUjsPvDd2wH1xDyUPHgvr/DjsPh8bhO1MP80pTYk= + b=DCZ4pyonUsAaIuBQUBu/1NYBINM2V/yqfV+6ngHC6I8x7PP5e0WLPB1zEyJgRG752GtXxlhP3WdI6a+eW/8O0I64lNeSLtCeGZQ2ljn0mAfcuMtjB3rZq3UejFTR8v3I78Chfhv8/eSjfW7gSO+sswpSCXiFykPgseD3Hhz6W/4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com - header.b=DbZeRJ9u; arc=none smtp.client-ip=205.220.168.131 + header.b=n5c8p9dB; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com - header.b="DbZeRJ9u" -Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) + header.b="n5c8p9dB" +Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id - 48I9TNqc020283; - Wed, 18 Sep 2024 21:21:09 GMT + 54LIhKMc027654; + Wed, 21 May 2025 22:45:54 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= - azR+5F3oXqRD0oIXJq+q0F3HbuiVUYwPuvX5vVskhnw=; b=DbZeRJ9uo40mL5rR - p0cASEsdLU8yr/aYeIXTSWCHBf5P73m5S26EYVv6MqTdcnmRT7flYyQWzotNV+gg - oHJpR7L5sN+omhK+7gDPRcm5j29/U9+7rMG7I0JwrfR6KbUUNJkrg+omW45ZdRPS - /92XJynSBDgzEGETs0AjLe+PLPW4Ucnncc+YscEVm/dtR4f5vQBYwGdCwv4IuczO - FJrEmDh3mj7m6JtNVV+A3LT5qS7PCAbiS7qhTAkDfhH9gDZJuUTO2b6ByyO4UkWp - afB41wIc4KUDYsTHkThkApxxp0vHfJJLGCweUi+YKYaqvQETgLhHx/UkSRdoRBII - N708pg== + igBIHxXxEIGErFGPWQKC8rBeF0DUPvb+tsDy6dmbEUQ=; b=n5c8p9dBo/+917ae + iUuuRoUPhgwmxRjEorR4N5thttRSLen0XwHulOSFzfVHZvX/ZX7Xb8qa67RpJUAw + jx3TGu38TFybZ9zCbXxa3PoR7FqIyl7TyaU+RpGmjLnDTRjq5ODiDDkcGM8aLJ6C + pgH1JDyjAtZODpP3W+kKpoMlU/N8QCB8wVOob4E3+nH0XDeYWh0cSY4dAnFcFYsC + dgkUoVt65T3wJptGX80bBT1muPG/3O+IiWrYoP6NVayscmgOnCqKVpuSjYrEn/02 + HlxMp7yg/I4LhlQquL2SfmAXdKThQLrOF/XiFsCW2VZETvSbXsLI0NXYRbRFUxC4 + e9SLmw== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) - by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41n4kjk65m-1 + by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 46rwf9cars-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); - Wed, 18 Sep 2024 21:21:09 +0000 (GMT) + Wed, 21 May 2025 22:45:54 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id - 48ILL8Gi009579 + 54LMjrc1023294 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); - Wed, 18 Sep 2024 21:21:08 GMT -Received: from ath12k-linux1.qualcomm.com (10.80.80.8) by + Wed, 21 May 2025 22:45:53 GMT +Received: from ath12k-linux2.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id - 15.2.1544.9; Wed, 18 Sep 2024 14:21:08 -0700 + 15.2.1544.9; Wed, 21 May 2025 15:45:53 -0700 From: Pradeep Kumar Chitrapu To: CC: , Pradeep Kumar Chitrapu , Jeff Johnson -Subject: [PATCH V8 5/9] wifi: ath12k: fix TX and RX MCS rate configurations in - HE mode -Date: Wed, 18 Sep 2024 14:20:52 -0700 -Message-ID: <20240918212056.4137076-6-quic_pradeepc@quicinc.com> -X-Mailer: git-send-email 2.34.1 -In-Reply-To: <20240918212056.4137076-1-quic_pradeepc@quicinc.com> -References: <20240918212056.4137076-1-quic_pradeepc@quicinc.com> +Subject: [PATCH ath-next V14 5/9] wifi: ath12k: fix TX and RX MCS rate + configurations in HE mode +Date: Wed, 21 May 2025 15:45:35 -0700 +Message-ID: <20250521224539.355985-6-quic_pradeepc@quicinc.com> +X-Mailer: git-send-email 2.43.0 +In-Reply-To: <20250521224539.355985-1-quic_pradeepc@quicinc.com> +References: <20250521224539.355985-1-quic_pradeepc@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: @@ -87,17 +87,28 @@ X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 -X-Proofpoint-GUID: JNJY4yItbZ8HP8WQjm82lNqNLkxUdf1v -X-Proofpoint-ORIG-GUID: JNJY4yItbZ8HP8WQjm82lNqNLkxUdf1v +X-Proofpoint-ORIG-GUID: lrtwH7rWiPRFD03fbbD0IavLBLpNgTW- +X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTIxMDIyNSBTYWx0ZWRfX0HS2wunF/V5Q + jQqxwakF2Imrc/4a4WgPSFOFxUyO27D7Yw6gnIBRodgtwOFgflHDfeJMrELW79jrSDvXvRC0nnc + lTonRisd7/CZWExy3sM2diYhHrZ5YT1dPhFtq33ItpY8BaOhwiLxc3wn0tlWRX8B/cd+xyEHTZY + A4nCDSw77SEdaZfmqAB81LMzQWIuTucnxkms4pM1CIIYZrgAPcBk4XN8tWVQ6JQKCpMpelTF6Hj + /XLCY2ByRqjtwd/zSjtcCfLOyKdT+uQtAJU1XZvedwqQW5MFk2GeD7O72PfhAP1V0YcbHdiTxde + roRpAlQg48k0Ug5EMIUPb9TYEP15vwtPDTw03C3u7eOhs6znDqvMYNAtXwbxfGeHRwjsbMgpWLG + +weN3zziLWlwb66N0xo5nfdJRHrOVDNcSx8/Z/xvCmHBTuVr44Q7It0iW+CGbHNqXrg4h4CH +X-Authority-Analysis: v=2.4 cv=GawXnRXL c=1 sm=1 tr=0 ts=682e57a2 cx=c_pps + a=ouPCqIW2jiPt+lZRy3xVPw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 + a=GEpy-HfZoHoA:10 a=dt9VzEwgFbYA:10 a=COk6AnOGAAAA:8 a=mu3tZSmwaZwQUXtd2tAA:9 + a=TjNXssC_j7lpFel5tvFf:22 +X-Proofpoint-GUID: lrtwH7rWiPRFD03fbbD0IavLBLpNgTW- X-Proofpoint-Virus-Version: vendor=baseguard - engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 - definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 + engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 + definitions=2025-05-21_07,2025-05-20_03,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 - bulkscore=0 adultscore=0 - suspectscore=0 mlxscore=0 clxscore=1015 lowpriorityscore=0 malwarescore=0 - phishscore=0 impostorscore=0 mlxlogscore=999 priorityscore=1501 - spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 - engine=8.19.0-2408220000 definitions=main-2409180140 + mlxscore=0 mlxlogscore=999 lowpriorityscore=0 impostorscore=0 + priorityscore=1501 clxscore=1015 malwarescore=0 phishscore=0 bulkscore=0 + spamscore=0 suspectscore=0 adultscore=0 classifier=spam authscore=0 + authtc=n/a authcc= route=outbound adjust=0 reason=mlx scancount=1 + engine=8.19.0-2505160000 definitions=main-2505210225 Currently, the TX and RX MCS rate configurations per peer are reversed when sent to the firmware. As a result, RX MCS rates @@ -116,7 +127,7 @@ Acked-by: Jeff Johnson --- a/drivers/net/wireless/ath/ath12k/wmi.c +++ b/drivers/net/wireless/ath/ath12k/wmi.c -@@ -2140,8 +2140,8 @@ int ath12k_wmi_send_peer_assoc_cmd(struc +@@ -2266,8 +2266,8 @@ int ath12k_wmi_send_peer_assoc_cmd(struc he_mcs->tlv_header = ath12k_wmi_tlv_cmd_hdr(WMI_TAG_HE_RATE_SET, sizeof(*he_mcs)); @@ -129,7 +140,7 @@ Acked-by: Jeff Johnson --- a/drivers/net/wireless/ath/ath12k/wmi.h +++ b/drivers/net/wireless/ath/ath12k/wmi.h -@@ -3953,7 +3953,9 @@ struct ath12k_wmi_vht_rate_set_params { +@@ -4083,7 +4083,9 @@ struct ath12k_wmi_vht_rate_set_params { struct ath12k_wmi_he_rate_set_params { __le32 tlv_header; diff --git a/package/kernel/mac80211/patches/ath12k/104-6-wifi-ath12k-add-support-for-setting-fixed-HE-rate-GI-LTF.patch b/package/kernel/mac80211/patches/ath12k/104-6-wifi-ath12k-add-support-for-setting-fixed-HE-rate-GI-LTF.patch index 72f3e9a5675..3f63eb08d17 100644 --- a/package/kernel/mac80211/patches/ath12k/104-6-wifi-ath12k-add-support-for-setting-fixed-HE-rate-GI-LTF.patch +++ b/package/kernel/mac80211/patches/ath12k/104-6-wifi-ath12k-add-support-for-setting-fixed-HE-rate-GI-LTF.patch @@ -1,83 +1,81 @@ -From patchwork Wed Sep 18 21:20:53 2024 +From patchwork Wed May 21 22:45:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pradeep Kumar Chitrapu -X-Patchwork-Id: 13807217 +X-Patchwork-Id: 14096125 X-Patchwork-Delegate: quic_jjohnson@quicinc.com -Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com - [205.220.168.131]) +Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com + [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) - by smtp.subspace.kernel.org (Postfix) with ESMTPS id 01CB41CB521 - for ; Wed, 18 Sep 2024 21:21:15 +0000 (UTC) + by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A17F1B0F20 + for ; Wed, 21 May 2025 22:45:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; - arc=none smtp.client-ip=205.220.168.131 + arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; - t=1726694478; cv=none; - b=CCnmzPX7wAnXz6jkBGnfJkO3OTVTa1pEVXaY+i3jcRKLwLmYLBkbQB7d5qZASnEWRw4vJRXQbpKaSNlechv1fw+VqQci5hz7GrwDmSDWwFwNKynwUkaS+V6CUoPkxGmvijlkSH5/Sp7n4JBdH9MZdY9ACaPCGZlgpTeAiRpgqyQ= + t=1747867562; cv=none; + b=bEGfSmKJAIERqJyK0yJndcYM+a7cpfrIkMLoGUTFvAkrcwqnlh3F9AqLbcb8fKznhfaQKFVRUdpVGSjFaplFVSp20RuXvPC2NLb0eKZrz5qS/4geTMxY/BeWuVN+i3ouoQzfYz8Vq6sTqLE5d6b650cCVf8hpY+VZ3ZTNWxVvdA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; - s=arc-20240116; t=1726694478; c=relaxed/simple; - bh=mOCMplbDFdsxafoM0lh9GOTg8poXfVWSA2JaaPzd5gg=; + s=arc-20240116; t=1747867562; c=relaxed/simple; + bh=hBxlXRYYCPbv8+evEatym1UfdpOfENFUVDWgibN+XTg=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; - b=m9Y3ZEQjhVcT6ObjX34KItzxLUdCbzQDCo4za4qtMsxHQCEQSny2a/lTtWTbAB42n+JZkBRjC1xrrdmRnXSxy58EZpvKNutjY0YonbJ/hMfa97U5qRTD/50prvNqxkFINPijMCNMgKsnCBz6tfcB78j3qnEvZjNP4eV4rbTicUg= + b=U32JKi6TAoRF/9e1cv0vPGUM6BaRhoFXM0b36j5PBpvKQmRXKDF/UNScd5EJnrFOPlgjPD7GOc+TdHqsFGk/7pNucA1++GU00SZ0q/223zg5dCsYLmfLrRu3G22WZS2hWuNKuUPFJEFFLEJ8UQWKtFB0oWsQcx+Oj1mWPbBrDU8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com - header.b=lKsSrYSp; arc=none smtp.client-ip=205.220.168.131 + header.b=bzVTzUcl; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com - header.b="lKsSrYSp" -Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) + header.b="bzVTzUcl" +Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id - 48IINFa1032091; - Wed, 18 Sep 2024 21:21:09 GMT + 54LJiK6V032422; + Wed, 21 May 2025 22:45:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= - 97aZlelAxnf1oZWK/vk3qg6OISdr4sArbqi18OQE/2Y=; b=lKsSrYSpewbykrq1 - 6WJRbLR0y481zo+GgIgfHUNcpF2NhItbbS8mgWYFPaMaoohciRsbAYdFFZrc9BG3 - 9IyAzZvpFzBox/oaJjDm/zLc2GVYMSGtwO3W0mMk2uVXU7ZB8dBDNimtsLmXTa1t - jyV6n0wj3jlGU1kDYu6zPgrcxWF1NnScnosftToVpHqM7TLfDaj8EJWuzsJnau2A - CUOS2o9wPZPAScyeL91kJOHtJddltuJrvLFxbi4gGZW7dWUus99UjFzGTAan/JVK - yb5Xr8iEzP2141KqZ9FMQqwqYOGc10t+yYXPMep/fo1mfziiB5kQ0tRtaWQ01Auw - uPa6OQ== -Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com + cpcIGD4iPSOaZzDkHZpoGs5Kor0sF3EnocHYcBOazgM=; b=bzVTzUclt3RkLn9A + YI8+MC64RjF5llUqmQ0G53D8sAQZ+95fc92X/ZrZvnyr7X0FBI+gU05yKzNuv4M5 + XcIWK7Y8gjr55i9w18cWHGW2Q/JGC8pJlx0A/SEAMIMXeeEmgJqdKowT2wMjzIIH + wb7JmE9d6z6ZKcgQYx9KICXaaEFQ9uxyRyjlJMMEJ3zb7MjxZPCCGtCI31Aqczpk + B3X+1UgRT+OJzV6vIF0kdn/sjU69iZNHoPAUDYqInWCs2lPLMUO5mckhOG3fH8s6 + jmhgpwlpUYx18jawRUpklvujXfFiDV4daXLeUKzL5b08f5OcSRvd7+iOytudYgr0 + U9VYkw== +Received: from nalasppmta03.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) - by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41n4geb5e1-1 + by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 46rwfb4b3w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); - Wed, 18 Sep 2024 21:21:09 +0000 (GMT) + Wed, 21 May 2025 22:45:55 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) - by NALASPPMTA04.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id - 48ILL8jN020567 + by NALASPPMTA03.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id + 54LMjsC2027097 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); - Wed, 18 Sep 2024 21:21:08 GMT -Received: from ath12k-linux1.qualcomm.com (10.80.80.8) by + Wed, 21 May 2025 22:45:54 GMT +Received: from ath12k-linux2.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id - 15.2.1544.9; Wed, 18 Sep 2024 14:21:08 -0700 + 15.2.1544.9; Wed, 21 May 2025 15:45:53 -0700 From: Pradeep Kumar Chitrapu To: CC: , Pradeep Kumar Chitrapu , - Muna Sinada , - "Jeff - Johnson" -Subject: [PATCH V8 6/9] wifi: ath12k: add support for setting fixed HE - rate/GI/LTF -Date: Wed, 18 Sep 2024 14:20:53 -0700 -Message-ID: <20240918212056.4137076-7-quic_pradeepc@quicinc.com> -X-Mailer: git-send-email 2.34.1 -In-Reply-To: <20240918212056.4137076-1-quic_pradeepc@quicinc.com> -References: <20240918212056.4137076-1-quic_pradeepc@quicinc.com> + Muna Sinada +Subject: [PATCH ath-next V14 6/9] wifi: ath12k: add support for setting fixed + HE rate/GI/LTF +Date: Wed, 21 May 2025 15:45:36 -0700 +Message-ID: <20250521224539.355985-7-quic_pradeepc@quicinc.com> +X-Mailer: git-send-email 2.43.0 +In-Reply-To: <20250521224539.355985-1-quic_pradeepc@quicinc.com> +References: <20250521224539.355985-1-quic_pradeepc@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: @@ -89,18 +87,28 @@ X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 -X-Proofpoint-GUID: GGIeqOgMFye5oFp39WDjK5DZ7YoCK3Ap -X-Proofpoint-ORIG-GUID: GGIeqOgMFye5oFp39WDjK5DZ7YoCK3Ap +X-Proofpoint-ORIG-GUID: 7uuxK_kl_b0JzKZoWIyq_ZYKeKL3it15 +X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTIxMDIyNiBTYWx0ZWRfX7sjoM15po0tB + FcR1nwzr8TocaDYnIXgl13rA+kjwsizlMt/N5cu8dCWo9YQKqFNy42Z2VEYmoDRw7dBnYnsMIL/ + wwv4hQYQslnxilRJaX/MVQ50/xxhSry8NrKA2QXvIg3btmiW4gQfrn3+k1Rm3o/gAGv2Yz4R8lw + YBPHVdQkgGJXYgsiB/b+copbnU621GYiYrCW6yUQHHIiwzjMljzzsk+9Koc6yeVByyPj86P80y7 + 2C8L1vuRAy8gCMSScMB9CyQ6+tLCKa1W2bhA0Oxz/+RGEXbujS4NDXCWz+EqIaYS5HXuD32pODy + O2wMURrbgE5PJIjjvpAdtqZL65QVaoVK1LWU6Co0NtHytEjuaZmr1hbb4hVDAtQio2Bw/K8yCM+ + ikcJ1sGkE78mu/U7gQjG6g0Z71Q/w13jBOz+RIocPFi2FyEjy5KDFmUBzY+jDCIRLi06R8sP +X-Proofpoint-GUID: 7uuxK_kl_b0JzKZoWIyq_ZYKeKL3it15 +X-Authority-Analysis: v=2.4 cv=dLCmmPZb c=1 sm=1 tr=0 ts=682e57a3 cx=c_pps + a=ouPCqIW2jiPt+lZRy3xVPw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 + a=GEpy-HfZoHoA:10 a=dt9VzEwgFbYA:10 a=COk6AnOGAAAA:8 a=KygRlO7-s-l5tpycOzUA:9 + a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-Virus-Version: vendor=baseguard - engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 - definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 + engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 + definitions=2025-05-21_07,2025-05-20_03,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 - malwarescore=0 - mlxlogscore=999 impostorscore=0 bulkscore=0 clxscore=1015 - lowpriorityscore=0 adultscore=0 phishscore=0 suspectscore=0 - priorityscore=1501 mlxscore=0 spamscore=0 classifier=spam adjust=0 - reason=mlx scancount=1 engine=8.19.0-2408220000 - definitions=main-2409180140 + mlxscore=0 clxscore=1015 adultscore=0 bulkscore=0 phishscore=0 suspectscore=0 + impostorscore=0 malwarescore=0 lowpriorityscore=0 mlxlogscore=999 spamscore=0 + priorityscore=1501 classifier=spam authscore=0 authtc=n/a authcc= + route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505160000 + definitions=main-2505210226 Add support to set fixed HE rate/GI/LTF values using nl80211. Reuse parts of the existing code path already used for HT/VHT @@ -112,15 +120,14 @@ Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Co-developed-by: Muna Sinada Signed-off-by: Muna Sinada Signed-off-by: Pradeep Kumar Chitrapu -Acked-by: Jeff Johnson --- - drivers/net/wireless/ath/ath12k/mac.c | 604 ++++++++++++++++++++++++-- - drivers/net/wireless/ath/ath12k/wmi.h | 18 + - 2 files changed, 574 insertions(+), 48 deletions(-) + drivers/net/wireless/ath/ath12k/mac.c | 650 +++++++++++++++++++++++--- + drivers/net/wireless/ath/ath12k/wmi.h | 27 ++ + 2 files changed, 625 insertions(+), 52 deletions(-) --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c -@@ -441,6 +441,18 @@ ath12k_mac_max_vht_nss(const u16 *vht_mc +@@ -518,6 +518,18 @@ ath12k_mac_max_vht_nss(const u16 *vht_mc return 1; } @@ -139,23 +146,27 @@ Acked-by: Jeff Johnson static u8 ath12k_parse_mpdudensity(u8 mpdudensity) { /* From IEEE Std 802.11-2020 defined values for "Minimum MPDU Start Spacing": -@@ -1916,6 +1928,14 @@ static void ath12k_peer_assoc_h_ht(struc +@@ -2135,9 +2147,15 @@ static void ath12k_peer_assoc_h_ht(struc arg->peer_rate_caps |= WMI_HOST_RC_CW40_FLAG; } +- if (arvif->bitrate_mask.control[band].gi != NL80211_TXRATE_FORCE_LGI) { +- if (ht_cap->cap & (IEEE80211_HT_CAP_SGI_20 | +- IEEE80211_HT_CAP_SGI_40)) + /* As firmware handles these two flags (IEEE80211_HT_CAP_SGI_20 + * and IEEE80211_HT_CAP_SGI_40) for enabling SGI, reset both -+ * flags if guard interval is Default GI ++ * flags if guard interval is to force Long GI + */ -+ if (arvif->bitrate_mask.control[band].gi == NL80211_TXRATE_DEFAULT_GI) -+ arg->peer_ht_caps &= ~(IEEE80211_HT_CAP_SGI_20 | -+ IEEE80211_HT_CAP_SGI_40); -+ - if (arvif->bitrate_mask.control[band].gi != NL80211_TXRATE_FORCE_LGI) { - if (ht_cap->cap & (IEEE80211_HT_CAP_SGI_20 | - IEEE80211_HT_CAP_SGI_40)) -@@ -2039,11 +2059,12 @@ static void ath12k_peer_assoc_h_vht(stru - struct ath12k_vif *arvif = ath12k_vif_to_arvif(vif); ++ if (arvif->bitrate_mask.control[band].gi == NL80211_TXRATE_FORCE_LGI) { ++ arg->peer_ht_caps &= ~(IEEE80211_HT_CAP_SGI_20 | IEEE80211_HT_CAP_SGI_40); ++ } else { ++ /* Enable SGI flag if either SGI_20 or SGI_40 is supported */ ++ if (ht_cap->cap & (IEEE80211_HT_CAP_SGI_20 | IEEE80211_HT_CAP_SGI_40)) + arg->peer_rate_caps |= WMI_HOST_RC_SGI_FLAG; + } + +@@ -2260,11 +2278,12 @@ static void ath12k_peer_assoc_h_vht(stru + struct ieee80211_link_sta *link_sta; struct cfg80211_chan_def def; enum nl80211_band band; - const u16 *vht_mcs_mask; @@ -167,17 +178,17 @@ Acked-by: Jeff Johnson + int i, vht_nss, nss_idx; + bool user_rate_valid = true; - if (WARN_ON(ath12k_mac_vif_chan(vif, &def))) - return; -@@ -2086,6 +2107,25 @@ static void ath12k_peer_assoc_h_vht(stru - if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_160) + lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy); + +@@ -2317,6 +2336,25 @@ static void ath12k_peer_assoc_h_vht(stru + if (link_sta->bandwidth == IEEE80211_STA_RX_BW_160) arg->bw_160 = true; + vht_nss = ath12k_mac_max_vht_nss(vht_mcs_mask); + -+ if (vht_nss > sta->deflink.rx_nss) { ++ if (vht_nss > link_sta->rx_nss) { + user_rate_valid = false; -+ for (nss_idx = sta->deflink.rx_nss - 1; nss_idx >= 0; nss_idx--) { ++ for (nss_idx = link_sta->rx_nss - 1; nss_idx >= 0; nss_idx--) { + if (vht_mcs_mask[nss_idx]) { + user_rate_valid = true; + break; @@ -188,14 +199,14 @@ Acked-by: Jeff Johnson + if (!user_rate_valid) { + ath12k_dbg(ar->ab, ATH12K_DBG_MAC, + "Setting vht range MCS value to peer supported nss:%d for peer %pM\n", -+ sta->deflink.rx_nss, sta->deflink.addr); -+ vht_mcs_mask[sta->deflink.rx_nss - 1] = vht_mcs_mask[vht_nss - 1]; ++ link_sta->rx_nss, arsta->addr); ++ vht_mcs_mask[link_sta->rx_nss - 1] = vht_mcs_mask[vht_nss - 1]; + } + /* Calculate peer NSS capability from VHT capabilities if STA * supports VHT. */ -@@ -2125,23 +2165,105 @@ static void ath12k_peer_assoc_h_vht(stru +@@ -2356,6 +2394,72 @@ static void ath12k_peer_assoc_h_vht(stru /* TODO: rxnss_override */ } @@ -266,18 +277,19 @@ Acked-by: Jeff Johnson +} + static void ath12k_peer_assoc_h_he(struct ath12k *ar, - struct ieee80211_vif *vif, - struct ieee80211_sta *sta, - struct ath12k_wmi_peer_assoc_arg *arg) - { - const struct ieee80211_sta_he_cap *he_cap = &sta->deflink.he_cap; -+ struct ath12k_vif *arvif = ath12k_vif_to_arvif(vif); + struct ath12k_link_vif *arvif, + struct ath12k_link_sta *arsta, +@@ -2366,18 +2470,28 @@ static void ath12k_peer_assoc_h_he(struc + const struct ieee80211_sta_he_cap *he_cap; + struct ieee80211_bss_conf *link_conf; + struct ieee80211_link_sta *link_sta; + struct cfg80211_chan_def def; int i; u8 ampdu_factor, max_nss; u8 rx_mcs_80 = IEEE80211_HE_MCS_NOT_SUPPORTED; u8 rx_mcs_160 = IEEE80211_HE_MCS_NOT_SUPPORTED; u16 mcs_160_map, mcs_80_map; ++ u8 link_id = arvif->link_id; bool support_160; - u16 v; + enum nl80211_band band; @@ -287,9 +299,18 @@ Acked-by: Jeff Johnson + int he_nss, nss_idx; + bool user_rate_valid = true; + -+ if (WARN_ON(ath12k_mac_vif_chan(vif, &def))) ++ if (WARN_ON(ath12k_mac_vif_link_chan(vif, link_id, &def))) + return; + link_conf = ath12k_mac_get_link_bss_conf(arvif); + if (!link_conf) { + ath12k_warn(ar->ab, "unable to access bss link conf in peer assoc he for vif %pM link %u", +- vif->addr, arvif->link_id); ++ vif->addr, link_id); + return; + } + +@@ -2392,6 +2506,12 @@ static void ath12k_peer_assoc_h_he(struc if (!he_cap->has_he) return; @@ -302,15 +323,15 @@ Acked-by: Jeff Johnson arg->he_flag = true; support_160 = !!(he_cap->he_cap_elem.phy_cap_info[0] & -@@ -2247,25 +2369,47 @@ static void ath12k_peer_assoc_h_he(struc +@@ -2497,25 +2617,47 @@ static void ath12k_peer_assoc_h_he(struc if (he_cap->he_cap_elem.mac_cap_info[0] & IEEE80211_HE_MAC_CAP0_TWT_REQ) arg->twt_requester = true; + he_nss = ath12k_mac_max_he_nss(he_mcs_mask); + -+ if (he_nss > sta->deflink.rx_nss) { ++ if (he_nss > link_sta->rx_nss) { + user_rate_valid = false; -+ for (nss_idx = sta->deflink.rx_nss - 1; nss_idx >= 0; nss_idx--) { ++ for (nss_idx = link_sta->rx_nss - 1; nss_idx >= 0; nss_idx--) { + if (he_mcs_mask[nss_idx]) { + user_rate_valid = true; + break; @@ -321,11 +342,11 @@ Acked-by: Jeff Johnson + if (!user_rate_valid) { + ath12k_dbg(ar->ab, ATH12K_DBG_MAC, + "Setting he range MCS value to peer supported nss:%d for peer %pM\n", -+ sta->deflink.rx_nss, sta->deflink.addr); -+ he_mcs_mask[sta->deflink.rx_nss - 1] = he_mcs_mask[he_nss - 1]; ++ link_sta->rx_nss, arsta->addr); ++ he_mcs_mask[link_sta->rx_nss - 1] = he_mcs_mask[he_nss - 1]; + } + - switch (sta->deflink.bandwidth) { + switch (link_sta->bandwidth) { case IEEE80211_STA_RX_BW_160: if (he_cap->he_cap_elem.phy_cap_info[0] & IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G) { @@ -352,7 +373,7 @@ Acked-by: Jeff Johnson fallthrough; default: -@@ -2273,11 +2417,34 @@ static void ath12k_peer_assoc_h_he(struc +@@ -2523,11 +2665,36 @@ static void ath12k_peer_assoc_h_he(struc arg->peer_he_rx_mcs_set[WMI_HECAP_TXRX_MCS_NSS_IDX_80] = v; v = le16_to_cpu(he_cap->he_mcs_nss_supp.tx_mcs_80); @@ -379,51 +400,67 @@ Acked-by: Jeff Johnson + he_mcs_mask[i]) + max_nss = i + 1; + } -+ arg->peer_nss = min(sta->deflink.rx_nss, max_nss); ++ ++ max_nss = min(max_nss, ar->num_tx_chains); ++ arg->peer_nss = min(link_sta->rx_nss, max_nss); + + ath12k_dbg(ar->ab, ATH12K_DBG_MAC, + "mac he peer %pM nss %d mcs cnt %d\n", -+ sta->deflink.addr, arg->peer_nss, arg->peer_he_mcs_count); ++ arsta->addr, arg->peer_nss, arg->peer_he_mcs_count); } static void ath12k_peer_assoc_h_he_6ghz(struct ath12k *ar, -@@ -2586,6 +2753,7 @@ static void ath12k_peer_assoc_h_phymode( +@@ -2863,6 +3030,7 @@ static void ath12k_peer_assoc_h_phymode( enum nl80211_band band; const u8 *ht_mcs_mask; const u16 *vht_mcs_mask; + const u16 *he_mcs_mask; enum wmi_phy_mode phymode = MODE_UNKNOWN; - if (WARN_ON(ath12k_mac_vif_chan(vif, &def))) -@@ -2594,6 +2762,7 @@ static void ath12k_peer_assoc_h_phymode( + lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy); +@@ -2876,6 +3044,7 @@ static void ath12k_peer_assoc_h_phymode( band = def.chan->band; ht_mcs_mask = arvif->bitrate_mask.control[band].ht_mcs; vht_mcs_mask = arvif->bitrate_mask.control[band].vht_mcs; + he_mcs_mask = arvif->bitrate_mask.control[band].he_mcs; - switch (band) { - case NL80211_BAND_2GHZ: -@@ -2602,7 +2771,8 @@ static void ath12k_peer_assoc_h_phymode( + link_sta = ath12k_mac_get_link_sta(arsta); + if (!link_sta) { +@@ -2891,7 +3060,8 @@ static void ath12k_peer_assoc_h_phymode( phymode = MODE_11BE_EHT40_2G; else phymode = MODE_11BE_EHT20_2G; -- } else if (sta->deflink.he_cap.has_he) { -+ } else if (sta->deflink.he_cap.has_he && +- } else if (link_sta->he_cap.has_he) { ++ } else if (link_sta->he_cap.has_he && + !ath12k_peer_assoc_h_he_masked(he_mcs_mask)) { - if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_80) + if (link_sta->bandwidth == IEEE80211_STA_RX_BW_80) phymode = MODE_11AX_HE80_2G; - else if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_40) -@@ -2632,7 +2802,8 @@ static void ath12k_peer_assoc_h_phymode( + else if (link_sta->bandwidth == IEEE80211_STA_RX_BW_40) +@@ -2921,7 +3091,8 @@ static void ath12k_peer_assoc_h_phymode( /* Check EHT first */ - if (sta->deflink.eht_cap.has_eht) { - phymode = ath12k_mac_get_phymode_eht(ar, sta); -- } else if (sta->deflink.he_cap.has_he) { -+ } else if (sta->deflink.he_cap.has_he && + if (link_sta->eht_cap.has_eht) { + phymode = ath12k_mac_get_phymode_eht(ar, link_sta); +- } else if (link_sta->he_cap.has_he) { ++ } else if (link_sta->he_cap.has_he && + !ath12k_peer_assoc_h_he_masked(he_mcs_mask)) { - phymode = ath12k_mac_get_phymode_he(ar, sta); - } else if (sta->deflink.vht_cap.vht_supported && + phymode = ath12k_mac_get_phymode_he(ar, link_sta); + } else if (link_sta->vht_cap.vht_supported && !ath12k_peer_assoc_h_vht_masked(vht_mcs_mask)) { -@@ -4311,6 +4482,20 @@ ath12k_mac_bitrate_mask_num_vht_rates(st +@@ -4190,10 +4361,13 @@ static struct ath12k_link_vif *ath12k_ma + + for (i = 0; i < ARRAY_SIZE(arvif->bitrate_mask.control); i++) { + arvif->bitrate_mask.control[i].legacy = 0xffffffff; ++ arvif->bitrate_mask.control[i].gi = NL80211_TXRATE_DEFAULT_GI; + memset(arvif->bitrate_mask.control[i].ht_mcs, 0xff, + sizeof(arvif->bitrate_mask.control[i].ht_mcs)); + memset(arvif->bitrate_mask.control[i].vht_mcs, 0xff, + sizeof(arvif->bitrate_mask.control[i].vht_mcs)); ++ memset(arvif->bitrate_mask.control[i].he_mcs, 0xff, ++ sizeof(arvif->bitrate_mask.control[i].he_mcs)); + } + + /* Allocate Default Queue now and reassign during actual vdev create */ +@@ -5083,6 +5257,20 @@ ath12k_mac_bitrate_mask_num_vht_rates(st } static int @@ -441,16 +478,16 @@ Acked-by: Jeff Johnson +} + +static int - ath12k_mac_set_peer_vht_fixed_rate(struct ath12k_vif *arvif, - struct ieee80211_sta *sta, + ath12k_mac_set_peer_vht_fixed_rate(struct ath12k_link_vif *arvif, + struct ath12k_link_sta *arsta, const struct cfg80211_bitrate_mask *mask, -@@ -4356,6 +4541,57 @@ ath12k_mac_set_peer_vht_fixed_rate(struc +@@ -5128,6 +5316,60 @@ ath12k_mac_set_peer_vht_fixed_rate(struc return ret; } +static int -+ath12k_mac_set_peer_he_fixed_rate(struct ath12k_vif *arvif, -+ struct ieee80211_sta *sta, ++ath12k_mac_set_peer_he_fixed_rate(struct ath12k_link_vif *arvif, ++ struct ath12k_link_sta *arsta, + const struct cfg80211_bitrate_mask *mask, + enum nl80211_band band) +{ @@ -458,9 +495,12 @@ Acked-by: Jeff Johnson + u8 he_rate, nss; + u32 rate_code; + int ret, i; ++ struct ath12k_sta *ahsta = arsta->ahsta; ++ struct ieee80211_sta *sta; + -+ lockdep_assert_held(&ar->conf_mutex); ++ lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy); + ++ sta = ath12k_ahsta_to_sta(ahsta); + nss = 0; + + for (i = 0; i < ARRAY_SIZE(mask->control[band].he_mcs); i++) { @@ -472,7 +512,7 @@ Acked-by: Jeff Johnson + + if (!nss) { + ath12k_warn(ar->ab, "No single HE Fixed rate found to set for %pM", -+ sta->deflink.addr); ++ arsta->addr); + return -EINVAL; + } + @@ -482,36 +522,36 @@ Acked-by: Jeff Johnson + + ath12k_dbg(ar->ab, ATH12K_DBG_MAC, + "Setting Fixed HE Rate for peer %pM. Device will not switch to any other selected rates", -+ sta->deflink.addr); ++ arsta->addr); + + rate_code = ATH12K_HW_RATE_CODE(he_rate, nss - 1, + WMI_RATE_PREAMBLE_HE); + -+ ret = ath12k_wmi_set_peer_param(ar, sta->deflink.addr, ++ ret = ath12k_wmi_set_peer_param(ar, arsta->addr, + arvif->vdev_id, + WMI_PEER_PARAM_FIXED_RATE, + rate_code); + if (ret) + ath12k_warn(ar->ab, + "failed to update STA %pM Fixed Rate %d: %d\n", -+ sta->deflink.addr, rate_code, ret); ++ arsta->addr, rate_code, ret); + + return ret; +} + - static int ath12k_station_assoc(struct ath12k *ar, - struct ieee80211_vif *vif, - struct ieee80211_sta *sta, -@@ -4367,7 +4603,7 @@ static int ath12k_station_assoc(struct a + static int ath12k_mac_station_assoc(struct ath12k *ar, + struct ath12k_link_vif *arvif, + struct ath12k_link_sta *arsta, +@@ -5140,7 +5382,7 @@ static int ath12k_mac_station_assoc(stru struct cfg80211_chan_def def; enum nl80211_band band; struct cfg80211_bitrate_mask *mask; - u8 num_vht_rates; + u8 num_vht_rates, num_he_rates; + u8 link_id = arvif->link_id; - lockdep_assert_held(&ar->conf_mutex); - -@@ -4398,15 +4634,19 @@ static int ath12k_station_assoc(struct a + lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy); +@@ -5180,9 +5422,10 @@ static int ath12k_mac_station_assoc(stru } num_vht_rates = ath12k_mac_bitrate_mask_num_vht_rates(ar, band, mask); @@ -524,18 +564,19 @@ Acked-by: Jeff Johnson * fixed param. * Note that all other rates and NSS will be disabled for this peer. */ - if (sta->deflink.vht_cap.vht_supported && num_vht_rates == 1) { -- ret = ath12k_mac_set_peer_vht_fixed_rate(arvif, sta, mask, +@@ -5193,8 +5436,9 @@ static int ath12k_mac_station_assoc(stru + } + + if (link_sta->vht_cap.vht_supported && num_vht_rates == 1) { +- ret = ath12k_mac_set_peer_vht_fixed_rate(arvif, arsta, mask, - band); -+ ret = ath12k_mac_set_peer_vht_fixed_rate(arvif, sta, mask, band); -+ if (ret) -+ return ret; -+ } else if (sta->deflink.he_cap.has_he && num_he_rates == 1) { -+ ret = ath12k_mac_set_peer_he_fixed_rate(arvif, sta, mask, band); ++ ret = ath12k_mac_set_peer_vht_fixed_rate(arvif, arsta, mask, band); ++ } else if (link_sta->he_cap.has_he && num_he_rates == 1) { ++ ret = ath12k_mac_set_peer_he_fixed_rate(arvif, arsta, mask, band); if (ret) return ret; } -@@ -4480,8 +4720,9 @@ static void ath12k_sta_rc_update_wk(stru +@@ -5258,8 +5502,9 @@ static void ath12k_sta_rc_update_wk(stru enum nl80211_band band; const u8 *ht_mcs_mask; const u16 *vht_mcs_mask; @@ -545,9 +586,9 @@ Acked-by: Jeff Johnson + u32 changed, bw, nss, mac_nss, smps, bw_prev; + int err, num_vht_rates, num_he_rates; const struct cfg80211_bitrate_mask *mask; - struct ath12k_wmi_peer_assoc_arg peer_arg; enum wmi_phy_mode peer_phymode; -@@ -4497,6 +4738,7 @@ static void ath12k_sta_rc_update_wk(stru + struct ath12k_link_sta *arsta; +@@ -5279,6 +5524,7 @@ static void ath12k_sta_rc_update_wk(stru band = def.chan->band; ht_mcs_mask = arvif->bitrate_mask.control[band].ht_mcs; vht_mcs_mask = arvif->bitrate_mask.control[band].vht_mcs; @@ -555,8 +596,8 @@ Acked-by: Jeff Johnson spin_lock_bh(&ar->data_lock); -@@ -4513,8 +4755,10 @@ static void ath12k_sta_rc_update_wk(stru - mutex_lock(&ar->conf_mutex); +@@ -5293,8 +5539,10 @@ static void ath12k_sta_rc_update_wk(stru + spin_unlock_bh(&ar->data_lock); nss = max_t(u32, 1, nss); - nss = min(nss, max(ath12k_mac_max_ht_nss(ht_mcs_mask), @@ -566,9 +607,9 @@ Acked-by: Jeff Johnson + ath12k_mac_max_he_nss(he_mcs_mask)); + nss = min(nss, mac_nss); - if (changed & IEEE80211_RC_BW_CHANGED) { - ath12k_peer_assoc_h_phymode(ar, arvif->vif, sta, &peer_arg); -@@ -4592,6 +4836,8 @@ static void ath12k_sta_rc_update_wk(stru + struct ath12k_wmi_peer_assoc_arg *peer_arg __free(kfree) = + kzalloc(sizeof(*peer_arg), GFP_KERNEL); +@@ -5377,6 +5625,8 @@ static void ath12k_sta_rc_update_wk(stru mask = &arvif->bitrate_mask; num_vht_rates = ath12k_mac_bitrate_mask_num_vht_rates(ar, band, mask); @@ -577,12 +618,12 @@ Acked-by: Jeff Johnson /* Peer_assoc_prepare will reject vht rates in * bitrate_mask if its not available in range format and -@@ -4607,11 +4853,24 @@ static void ath12k_sta_rc_update_wk(stru - if (sta->deflink.vht_cap.vht_supported && num_vht_rates == 1) { - ath12k_mac_set_peer_vht_fixed_rate(arvif, sta, mask, +@@ -5399,11 +5649,24 @@ static void ath12k_sta_rc_update_wk(stru + if (link_sta->vht_cap.vht_supported && num_vht_rates == 1) { + ath12k_mac_set_peer_vht_fixed_rate(arvif, arsta, mask, band); -+ } else if (sta->deflink.he_cap.has_he && num_he_rates == 1) { -+ ath12k_mac_set_peer_he_fixed_rate(arvif, sta, mask, band); ++ } else if (link_sta->he_cap.has_he && num_he_rates == 1) { ++ ath12k_mac_set_peer_he_fixed_rate(arvif, arsta, mask, band); } else { - /* If the peer is non-VHT or no fixed VHT rate + /* If the peer is non-VHT/HE or no fixed VHT/HE rate @@ -592,33 +633,19 @@ Acked-by: Jeff Johnson + * the peer fixed rate settings as it has higher proprity + * than peer assoc */ -+ -+ err = ath12k_wmi_set_peer_param(ar, sta->deflink.addr, ++ err = ath12k_wmi_set_peer_param(ar, arsta->addr, + arvif->vdev_id, + WMI_PEER_PARAM_FIXED_RATE, + WMI_FIXED_RATE_NONE); + if (err) + ath12k_warn(ar->ab, + "failed to disable peer fixed rate for STA %pM ret %d\n", -+ sta->deflink.addr, err); - ath12k_peer_assoc_prepare(ar, arvif->vif, sta, - &peer_arg, true); - -@@ -7059,10 +7318,13 @@ static int ath12k_mac_op_add_interface(s - - for (i = 0; i < ARRAY_SIZE(arvif->bitrate_mask.control); i++) { - arvif->bitrate_mask.control[i].legacy = 0xffffffff; -+ arvif->bitrate_mask.control[i].gi = NL80211_TXRATE_FORCE_SGI; - memset(arvif->bitrate_mask.control[i].ht_mcs, 0xff, - sizeof(arvif->bitrate_mask.control[i].ht_mcs)); - memset(arvif->bitrate_mask.control[i].vht_mcs, 0xff, - sizeof(arvif->bitrate_mask.control[i].vht_mcs)); -+ memset(arvif->bitrate_mask.control[i].he_mcs, 0xff, -+ sizeof(arvif->bitrate_mask.control[i].he_mcs)); - } ++ arsta->addr, err); ++ + ath12k_peer_assoc_prepare(ar, arvif, arsta, + peer_arg, true); - /* Allocate Default Queue now and reassign during actual vdev create */ -@@ -8223,19 +8485,40 @@ ath12k_mac_has_single_legacy_rate(struct +@@ -9903,19 +10166,40 @@ ath12k_mac_has_single_legacy_rate(struct if (ath12k_mac_bitrate_mask_num_vht_rates(ar, band, mask)) return false; @@ -659,7 +686,7 @@ Acked-by: Jeff Johnson int i; /* No need to consider legacy here. Basic rates are always present -@@ -8262,7 +8545,24 @@ ath12k_mac_bitrate_mask_get_single_nss(s +@@ -9942,7 +10226,24 @@ ath12k_mac_bitrate_mask_get_single_nss(s return false; } @@ -685,44 +712,49 @@ Acked-by: Jeff Johnson return false; if (ht_nss_mask == 0) -@@ -8309,54 +8609,158 @@ ath12k_mac_get_single_legacy_rate(struct +@@ -9989,54 +10290,182 @@ ath12k_mac_get_single_legacy_rate(struct return 0; } --static int ath12k_mac_set_fixed_rate_params(struct ath12k_vif *arvif, +-static int ath12k_mac_set_fixed_rate_params(struct ath12k_link_vif *arvif, - u32 rate, u8 nss, u8 sgi, u8 ldpc) +static int -+ath12k_mac_set_fixed_rate_gi_ltf(struct ath12k_vif *arvif, u8 he_gi, u8 he_ltf) ++ath12k_mac_set_fixed_rate_gi_ltf(struct ath12k_link_vif *arvif, u8 he_gi, u8 he_ltf) { struct ath12k *ar = arvif->ar; - u32 vdev_param; int ret; -- lockdep_assert_held(&ar->conf_mutex); + lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy); + +- ath12k_dbg(ar->ab, ATH12K_DBG_MAC, "mac set fixed rate params vdev %i rate 0x%02x nss %u sgi %u\n", +- arvif->vdev_id, rate, nss, sgi); + /* 0.8 = 0, 1.6 = 2 and 3.2 = 3. */ + if (he_gi && he_gi != 0xFF) + he_gi += 1; -- ath12k_dbg(ar->ab, ATH12K_DBG_MAC, "mac set fixed rate params vdev %i rate 0x%02x nss %u sgi %u\n", -- arvif->vdev_id, rate, nss, sgi); -+ ret = ath12k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, +- vdev_param = WMI_VDEV_PARAM_FIXED_RATE; + ret = ath12k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, +- vdev_param, rate); + WMI_VDEV_PARAM_SGI, he_gi); -+ if (ret) { + if (ret) { +- ath12k_warn(ar->ab, "failed to set fixed rate param 0x%02x: %d\n", +- rate, ret); + ath12k_warn(ar->ab, "failed to set HE GI:%d, error:%d\n", + he_gi, ret); -+ return ret; -+ } + return ret; + } + /* start from 1 */ + if (he_ltf != 0xFF) + he_ltf += 1; -- vdev_param = WMI_VDEV_PARAM_FIXED_RATE; +- vdev_param = WMI_VDEV_PARAM_NSS; ret = ath12k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, -- vdev_param, rate); +- vdev_param, nss); + WMI_VDEV_PARAM_HE_LTF, he_ltf); if (ret) { -- ath12k_warn(ar->ab, "failed to set fixed rate param 0x%02x: %d\n", -- rate, ret); +- ath12k_warn(ar->ab, "failed to set nss param %d: %d\n", +- nss, ret); + ath12k_warn(ar->ab, "failed to set HE LTF:%d, error:%d\n", + he_ltf, ret); return ret; @@ -731,7 +763,7 @@ Acked-by: Jeff Johnson +} + +static int -+ath12k_mac_set_auto_rate_gi_ltf(struct ath12k_vif *arvif, u16 he_gi, u8 he_ltf) ++ath12k_mac_set_auto_rate_gi_ltf(struct ath12k_link_vif *arvif, u16 he_gi, u8 he_ltf) +{ + struct ath12k *ar = arvif->ar; + int ret; @@ -773,33 +805,54 @@ Acked-by: Jeff Johnson + + he_ar_gi_ltf = he_gi | he_ltf; -- vdev_param = WMI_VDEV_PARAM_NSS; +- vdev_param = WMI_VDEV_PARAM_SGI; ret = ath12k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, -- vdev_param, nss); +- vdev_param, sgi); + WMI_VDEV_PARAM_AUTORATE_MISC_CFG, + he_ar_gi_ltf); if (ret) { -- ath12k_warn(ar->ab, "failed to set nss param %d: %d\n", -- nss, ret); +- ath12k_warn(ar->ab, "failed to set sgi param %d: %d\n", +- sgi, ret); + ath12k_warn(ar->ab, + "failed to set HE autorate GI:%u, LTF:%u params, error:%d\n", + he_gi, he_ltf, ret); return ret; } -- vdev_param = WMI_VDEV_PARAM_SGI; +- vdev_param = WMI_VDEV_PARAM_LDPC; + return 0; +} + -+static int ath12k_mac_set_rate_params(struct ath12k_vif *arvif, ++static u32 ath12k_mac_nlgi_to_wmigi(enum nl80211_txrate_gi gi) ++{ ++ switch (gi) { ++ case NL80211_TXRATE_DEFAULT_GI: ++ return WMI_GI_400_NS; ++ case NL80211_TXRATE_FORCE_LGI: ++ return WMI_GI_800_NS; ++ default: ++ return WMI_GI_400_NS; ++ } ++} ++ ++static int ath12k_mac_set_rate_params(struct ath12k_link_vif *arvif, + u32 rate, u8 nss, u8 sgi, u8 ldpc, + u8 he_gi, u8 he_ltf, bool he_fixed_rate) +{ ++ struct ieee80211_bss_conf *link_conf; + struct ath12k *ar = arvif->ar; + u32 vdev_param; ++ u32 param_value; + int ret; ++ bool he_support; + -+ lockdep_assert_held(&ar->conf_mutex); ++ lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy); ++ ++ link_conf = ath12k_mac_get_link_bss_conf(arvif); ++ if (!link_conf) ++ return -EINVAL; ++ ++ he_support = link_conf->he_support; + + ath12k_dbg(ar->ab, ATH12K_DBG_MAC, + "mac set rate params vdev %i rate 0x%02x nss 0x%02x sgi 0x%02x ldpc 0x%02x\n", @@ -809,7 +862,7 @@ Acked-by: Jeff Johnson + "he_gi 0x%02x he_ltf 0x%02x he_fixed_rate %d\n", he_gi, + he_ltf, he_fixed_rate); + -+ if (!arvif->vif->bss_conf.he_support) { ++ if (!he_support) { + vdev_param = WMI_VDEV_PARAM_FIXED_RATE; + ret = ath12k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, + vdev_param, rate); @@ -823,19 +876,15 @@ Acked-by: Jeff Johnson + vdev_param = WMI_VDEV_PARAM_NSS; + ret = ath12k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, -- vdev_param, sgi); +- vdev_param, ldpc); + vdev_param, nss); - if (ret) { -- ath12k_warn(ar->ab, "failed to set sgi param %d: %d\n", -- sgi, ret); ++ if (ret) { + ath12k_warn(ar->ab, "failed to set nss param %d: %d\n", + nss, ret); - return ret; - } - -- vdev_param = WMI_VDEV_PARAM_LDPC; - ret = ath12k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, -- vdev_param, ldpc); ++ return ret; ++ } ++ ++ ret = ath12k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, + WMI_VDEV_PARAM_LDPC, ldpc); if (ret) { ath12k_warn(ar->ab, "failed to set ldpc param %d: %d\n", @@ -843,7 +892,7 @@ Acked-by: Jeff Johnson return ret; } -+ if (arvif->vif->bss_conf.he_support) { ++ if (he_support) { + if (he_fixed_rate) + ret = ath12k_mac_set_fixed_rate_gi_ltf(arvif, he_gi, he_ltf); + else @@ -852,8 +901,9 @@ Acked-by: Jeff Johnson + return ret; + } else { + vdev_param = WMI_VDEV_PARAM_SGI; ++ param_value = ath12k_mac_nlgi_to_wmigi(sgi); + ret = ath12k_wmi_vdev_set_param_cmd(ar, arvif->vdev_id, -+ vdev_param, sgi); ++ vdev_param, param_value); + if (ret) { + ath12k_warn(ar->ab, "failed to set sgi param %d: %d\n", + sgi, ret); @@ -864,7 +914,7 @@ Acked-by: Jeff Johnson return 0; } -@@ -8385,6 +8789,31 @@ ath12k_mac_vht_mcs_range_present(struct +@@ -10065,6 +10494,31 @@ ath12k_mac_vht_mcs_range_present(struct return true; } @@ -896,18 +946,33 @@ Acked-by: Jeff Johnson static void ath12k_mac_set_bitrate_mask_iter(void *data, struct ieee80211_sta *sta) { -@@ -8424,6 +8853,54 @@ static void ath12k_mac_disable_peer_fixe +@@ -10073,7 +10527,10 @@ static void ath12k_mac_set_bitrate_mask_ + struct ath12k_link_sta *arsta; + struct ath12k *ar = arvif->ar; + +- arsta = rcu_dereference(ahsta->link[arvif->link_id]); ++ lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy); ++ ++ arsta = wiphy_dereference(ath12k_ar_to_hw(ar)->wiphy, ++ ahsta->link[arvif->link_id]); + if (!arsta || arsta->arvif != arvif) + return; + +@@ -10111,6 +10568,61 @@ static void ath12k_mac_disable_peer_fixe + arsta->addr, ret); } - static int -+ath12k_mac_validate_vht_he_fixed_rate_settings(struct ath12k *ar, enum nl80211_band band, -+ const struct cfg80211_bitrate_mask *mask) ++static bool ++ath12k_mac_validate_fixed_rate_settings(struct ath12k *ar, enum nl80211_band band, ++ const struct cfg80211_bitrate_mask *mask, ++ unsigned int link_id) +{ + bool he_fixed_rate = false, vht_fixed_rate = false; -+ struct ath12k_peer *peer; + const u16 *vht_mcs_mask, *he_mcs_mask; ++ struct ieee80211_link_sta *link_sta; ++ struct ath12k_peer *peer, *tmp; + u8 vht_nss, he_nss; -+ int ret = 0; ++ int ret = true; + + vht_mcs_mask = mask->control[band].vht_mcs; + he_mcs_mask = mask->control[band].he_mcs; @@ -919,24 +984,29 @@ Acked-by: Jeff Johnson + he_fixed_rate = true; + + if (!vht_fixed_rate && !he_fixed_rate) -+ return 0; ++ return true; + + vht_nss = ath12k_mac_max_vht_nss(vht_mcs_mask); + he_nss = ath12k_mac_max_he_nss(he_mcs_mask); + + rcu_read_lock(); + spin_lock_bh(&ar->ab->base_lock); -+ list_for_each_entry(peer, &ar->ab->peers, list) { ++ list_for_each_entry_safe(peer, tmp, &ar->ab->peers, list) { + if (peer->sta) { -+ if (vht_fixed_rate && -+ (!peer->sta->deflink.vht_cap.vht_supported || -+ peer->sta->deflink.rx_nss < vht_nss)) { -+ ret = -EINVAL; ++ link_sta = rcu_dereference(peer->sta->link[link_id]); ++ if (!link_sta) { ++ ret = false; ++ goto exit; ++ } ++ ++ if (vht_fixed_rate && (!link_sta->vht_cap.vht_supported || ++ link_sta->rx_nss < vht_nss)) { ++ ret = false; + goto exit; + } -+ if (he_fixed_rate && (!peer->sta->deflink.he_cap.has_he || -+ peer->sta->deflink.rx_nss < he_nss)) { -+ ret = -EINVAL; ++ if (he_fixed_rate && (!link_sta->he_cap.has_he || ++ link_sta->rx_nss < he_nss)) { ++ ret = false; + goto exit; + } + } @@ -947,11 +1017,10 @@ Acked-by: Jeff Johnson + return ret; +} + -+static int + static int ath12k_mac_op_set_bitrate_mask(struct ieee80211_hw *hw, struct ieee80211_vif *vif, - const struct cfg80211_bitrate_mask *mask) -@@ -8434,13 +8911,17 @@ ath12k_mac_op_set_bitrate_mask(struct ie +@@ -10123,13 +10635,17 @@ ath12k_mac_op_set_bitrate_mask(struct ie enum nl80211_band band; const u8 *ht_mcs_mask; const u16 *vht_mcs_mask; @@ -968,9 +1037,9 @@ Acked-by: Jeff Johnson int num_rates; + bool he_fixed_rate = false; - if (ath12k_mac_vif_chan(vif, &def)) - return -EPERM; -@@ -8448,6 +8929,7 @@ ath12k_mac_op_set_bitrate_mask(struct ie + lockdep_assert_wiphy(hw->wiphy); + +@@ -10144,14 +10660,18 @@ ath12k_mac_op_set_bitrate_mask(struct ie band = def.chan->band; ht_mcs_mask = mask->control[band].ht_mcs; vht_mcs_mask = mask->control[band].vht_mcs; @@ -978,7 +1047,9 @@ Acked-by: Jeff Johnson ldpc = !!(ar->ht_cap_info & WMI_HT_CAP_LDPC); sgi = mask->control[band].gi; -@@ -8456,6 +8938,9 @@ ath12k_mac_op_set_bitrate_mask(struct ie +- if (sgi == NL80211_TXRATE_FORCE_LGI) { ++ if (sgi == NL80211_TXRATE_FORCE_SGI) { + ret = -EINVAL; goto out; } @@ -988,7 +1059,11 @@ Acked-by: Jeff Johnson /* mac80211 doesn't support sending a fixed HT/VHT MCS alone, rather it * requires passing at least one of used basic rates along with them. * Fixed rate setting across different preambles(legacy, HT, VHT) is -@@ -8475,15 +8960,27 @@ ath12k_mac_op_set_bitrate_mask(struct ie +@@ -10168,18 +10688,31 @@ ath12k_mac_op_set_bitrate_mask(struct ie + arvif->vdev_id, ret); + goto out; + } ++ ieee80211_iterate_stations_mtx(hw, ath12k_mac_disable_peer_fixed_rate, arvif); @@ -997,21 +1072,21 @@ Acked-by: Jeff Johnson &single_nss)) { rate = WMI_FIXED_RATE_NONE; nss = single_nss; -+ mutex_lock(&ar->conf_mutex); + arvif->bitrate_mask = *mask; -+ ieee80211_iterate_stations_mtx(hw, -+ ath12k_mac_set_bitrate_mask_iter, -+ arvif); -+ mutex_unlock(&ar->conf_mutex); ++ ++ ieee80211_iterate_stations_atomic(hw, ++ ath12k_mac_set_bitrate_mask_iter, ++ arvif); } else { rate = WMI_FIXED_RATE_NONE; - nss = min_t(u32, ar->num_tx_chains, - max(ath12k_mac_max_ht_nss(ht_mcs_mask), - ath12k_mac_max_vht_nss(vht_mcs_mask))); + -+ if (!ath12k_mac_validate_vht_he_fixed_rate_settings(ar, band, mask)) ++ if (!ath12k_mac_validate_fixed_rate_settings(ar, band, ++ mask, arvif->link_id)) + ath12k_warn(ar->ab, -+ "could not update fixed rate settings to all peers due to mcs/nss incompatiblity\n"); ++ "failed to update fixed rate settings due to mcs/nss incompatibility\n"); + + mac_nss = max3(ath12k_mac_max_ht_nss(ht_mcs_mask), + ath12k_mac_max_vht_nss(vht_mcs_mask), @@ -1020,8 +1095,13 @@ Acked-by: Jeff Johnson /* If multiple rates across different preambles are given * we can reconfigure this info with all peers using PEER_ASSOC -@@ -8519,12 +9016,22 @@ ath12k_mac_op_set_bitrate_mask(struct ie - goto out; +@@ -10211,9 +10744,21 @@ ath12k_mac_op_set_bitrate_mask(struct ie + */ + ath12k_warn(ar->ab, + "Setting more than one MCS Value in bitrate mask not supported\n"); +- return -EINVAL; ++ ret = -EINVAL; ++ goto out; } + num_rates = ath12k_mac_bitrate_mask_num_he_rates(ar, band, mask); @@ -1032,22 +1112,15 @@ Acked-by: Jeff Johnson + num_rates > 1) { + ath12k_warn(ar->ab, + "Setting more than one HE MCS Value in bitrate mask not supported\n"); -+ return -EINVAL; ++ ret = -EINVAL; ++ goto out; + } -+ -+ mutex_lock(&ar->conf_mutex); ieee80211_iterate_stations_mtx(hw, ath12k_mac_disable_peer_fixed_rate, arvif); - -- mutex_lock(&ar->conf_mutex); -- - arvif->bitrate_mask = *mask; - ieee80211_iterate_stations_mtx(hw, - ath12k_mac_set_bitrate_mask_iter, -@@ -8535,9 +9042,10 @@ ath12k_mac_op_set_bitrate_mask(struct ie - - mutex_lock(&ar->conf_mutex); +@@ -10224,9 +10769,10 @@ ath12k_mac_op_set_bitrate_mask(struct ie + arvif); + } - ret = ath12k_mac_set_fixed_rate_params(arvif, rate, nss, sgi, ldpc); + ret = ath12k_mac_set_rate_params(arvif, rate, nss, sgi, ldpc, he_gi, @@ -1083,7 +1156,7 @@ Acked-by: Jeff Johnson enum wmi_cmd_group { /* 0 to 2 are reserved */ WMI_GRP_START = 0x3, -@@ -1132,7 +1148,9 @@ enum wmi_tlv_vdev_param { +@@ -1145,7 +1161,9 @@ enum wmi_tlv_vdev_param { WMI_VDEV_PARAM_HE_RANGE_EXT, WMI_VDEV_PARAM_ENABLE_BCAST_PROBE_RESPONSE, WMI_VDEV_PARAM_FILS_MAX_CHANNEL_GUARD_TIME, @@ -1093,3 +1166,19 @@ Acked-by: Jeff Johnson WMI_VDEV_PARAM_SET_HE_SOUNDING_MODE = 0x87, WMI_VDEV_PARAM_6GHZ_PARAMS = 0x99, WMI_VDEV_PARAM_PROTOTYPE = 0x8000, +@@ -3579,6 +3597,15 @@ struct wmi_force_fw_hang_cmd { + __le32 delay_time_ms; + } __packed; + ++/* Param values to be sent for WMI_VDEV_PARAM_SGI param_id ++ * which are used in 11n, 11ac systems ++ * @WMI_GI_800_NS - Always uses 0.8us (Long GI) ++ * @WMI_GI_400_NS - Firmware switches between 0.4us (Short GI) ++ * and 0.8us (Long GI) based on packet error rate. ++ */ ++#define WMI_GI_800_NS 0 ++#define WMI_GI_400_NS 1 ++ + struct wmi_vdev_set_param_cmd { + __le32 tlv_header; + __le32 vdev_id; diff --git a/package/kernel/mac80211/patches/ath12k/104-7-wifi-ath12k-clean-up-80P80-support.patch b/package/kernel/mac80211/patches/ath12k/104-7-wifi-ath12k-clean-up-80P80-support.patch index 93cbd3b8027..922cdf17fd4 100644 --- a/package/kernel/mac80211/patches/ath12k/104-7-wifi-ath12k-clean-up-80P80-support.patch +++ b/package/kernel/mac80211/patches/ath12k/104-7-wifi-ath12k-clean-up-80P80-support.patch @@ -1,80 +1,80 @@ -From patchwork Wed Sep 18 21:20:54 2024 +From patchwork Wed May 21 22:45:37 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pradeep Kumar Chitrapu -X-Patchwork-Id: 13807218 +X-Patchwork-Id: 14096121 X-Patchwork-Delegate: quic_jjohnson@quicinc.com -Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com - [205.220.168.131]) +Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com + [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) - by smtp.subspace.kernel.org (Postfix) with ESMTPS id E7A2C15853D - for ; Wed, 18 Sep 2024 21:21:29 +0000 (UTC) + by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED55023958A + for ; Wed, 21 May 2025 22:45:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; - arc=none smtp.client-ip=205.220.168.131 + arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; - t=1726694491; cv=none; - b=IDDUnQF/Tnpw/FvWitX7ofLgG/RwY2FyN79K1j9v3STIk2mbRSVtS7kUmHv83gWDgLeingrnJyz3kE7pWhAK5Zt+U/d3HoSbyXlaWdr1m98ZLPJnOIO51q8LBaUW4uPaZbMJiRGvTbhFw+0k6FNjQse034o2zQ5vHk1qETT9XsU= + t=1747867560; cv=none; + b=R6R1l/0hUMYWkLzVM4w8Z2s3aU01ujlrdBV4IEYLrqQ3CzuP8xd2fnZMcdbVAFvXd/hepJKOZrFod6RG43u2TuGCQ5wM3SKIqyk0c/MlskZk+jnUnvm9WtrezJS82phw1G2mJ8NiYsKzmcJGMQtaYfl3jWA4o+BGMGyOg0Keb/M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; - s=arc-20240116; t=1726694491; c=relaxed/simple; - bh=4Sbgjg6TXf4A547Y46Qiyw4U55YEFrIGdUXLZjEx5C0=; + s=arc-20240116; t=1747867560; c=relaxed/simple; + bh=HUqzq2V1sSbcLZxqxveNb5xXvMg5sfyIhSzn4mKsdms=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; - b=Y+NDqrjfpb1iFWpY9XYrVbCXhYRTFGsK7MN6jcsgZur7Ro+ZQsyZfhkFA+t+Bb52hk2p2N7v1TAdqLDK2CiFXaWPy/JfESHATwktCnNG+8/UL3n0VIjl+qxGTWt3pS/aWzI6yQjM2FB6tKc4kMnGX//RrgXhEIrh1M4ROs3IpJ0= + b=G9poRT2jwhhAC0htiaG4SIE8b1DuTf63uDCDCGj5WoQ4B/v/NWtaqtzBWJF4c7UuQBso4JO4X9auJyfxJ4SxUBrULdlJq7mvAs7nxFOPEBDBltLKWCZznLwuuuo690MjvUQ5mfKt/Oy+uREyur4vXsQtfSBZc0DSZUlC5R+Z2Mc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com - header.b=Kt1nBSex; arc=none smtp.client-ip=205.220.168.131 + header.b=cu63IdMd; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com - header.b="Kt1nBSex" -Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) + header.b="cu63IdMd" +Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id - 48IJrYUI005813; - Wed, 18 Sep 2024 21:21:27 GMT + 54LJgw7Z025025; + Wed, 21 May 2025 22:45:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= - 7iZtYFy4NRmF2YHXqLd4zDMUbigsFxIkBQ6OeDD3zOs=; b=Kt1nBSex9R0mUQFv - fimFwEUDD2mzhj9KyoJnJsvbpzJOV9sBCCp3nPyxHNB66qzQUi/U904HE+wQ26S+ - Dmo2aGOzcx4GHLU8agTSdb51h1ylcD1ulUXKpEqDIEkWv7leWNteXYTqoj2aUvXQ - MH261Yr4HRs5iWT53+FXUrPvY1eipkyG20XH2RcNT7XMMIT29hm5DRVTwU0kzAVU - /0hrrSBcgbTJP0KA5zSfO+bFE7fyWSxrjOzt7ugW9KdHlAj5iNAeePRUUlvqSGe7 - 07QprF1ixgWWpsIbUnZdd9UZLPKot8h5Vous/24QLAznqmj/FgipHLT6+Dy61eVq - L/T40w== + 90lF32RvbNU2yyxl2mGBEewKfDvRJ7MRRLe6DgCwXFs=; b=cu63IdMdS+nJIsqy + ktY/ZQ/qTTWf2MpubSMC9UftiwnI9Xj6K8LFE0q+NvCN2EgZKzf+OzyW9wbbRepN + Q3ZYBAR3lFyw40J6AZgpAuPiq7Y+eqt7l8jc+/2bb2+imOzvWHwFkXSvc8nijnHX + ZLEU29M0xloyHeJ7xLbumzRdfcCJ6357/HKp9U3mLvEfpLY97t5/H3yEJWHQmnvE + aHkFaLM6Ru2R2+nzPDylKcY+TZsqv306oEqydWI33ANyvfDkWJqbQjtQ+geTkJxC + syi9ZifD5zPdOjb9YWNn0V8mWUBRx6hW8ZKU/L3gWGXjkvyRHneZ4AOz83Tp9Ym4 + L34jSQ== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) - by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41n4jdu9q1-1 + by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 46rwf6vbsf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); - Wed, 18 Sep 2024 21:21:27 +0000 (GMT) + Wed, 21 May 2025 22:45:55 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id - 48ILL9Ux020570 + 54LMjsWN022226 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); - Wed, 18 Sep 2024 21:21:09 GMT -Received: from ath12k-linux1.qualcomm.com (10.80.80.8) by + Wed, 21 May 2025 22:45:54 GMT +Received: from ath12k-linux2.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id - 15.2.1544.9; Wed, 18 Sep 2024 14:21:08 -0700 + 15.2.1544.9; Wed, 21 May 2025 15:45:54 -0700 From: Pradeep Kumar Chitrapu To: CC: , Pradeep Kumar Chitrapu , Jeff Johnson -Subject: [PATCH V8 7/9] wifi: ath12k: clean up 80P80 support -Date: Wed, 18 Sep 2024 14:20:54 -0700 -Message-ID: <20240918212056.4137076-8-quic_pradeepc@quicinc.com> -X-Mailer: git-send-email 2.34.1 -In-Reply-To: <20240918212056.4137076-1-quic_pradeepc@quicinc.com> -References: <20240918212056.4137076-1-quic_pradeepc@quicinc.com> +Subject: [PATCH ath-next V14 7/9] wifi: ath12k: clean up 80P80 support +Date: Wed, 21 May 2025 15:45:37 -0700 +Message-ID: <20250521224539.355985-8-quic_pradeepc@quicinc.com> +X-Mailer: git-send-email 2.43.0 +In-Reply-To: <20250521224539.355985-1-quic_pradeepc@quicinc.com> +References: <20250521224539.355985-1-quic_pradeepc@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: @@ -86,17 +86,28 @@ X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 -X-Proofpoint-ORIG-GUID: zOl2cVhwvoAFaH70WioUIdrk_oIr5c-T -X-Proofpoint-GUID: zOl2cVhwvoAFaH70WioUIdrk_oIr5c-T +X-Proofpoint-GUID: xDBdjIlSrmWJZkBfMwcImhxnyTIR4551 +X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTIxMDIyNiBTYWx0ZWRfX75XKL//oF16a + YMA/60ZSduIYMzTQ+PpEhRfS8BSEJ3JAYNLLDjp3b1hmrHJmdqMnxgbya6RQ+qeAISgkr8ZWIMx + fGx/btrlFP2SbXd0JWwSMOApD3LJewBu/ZeBWBDEWbbO00LOGnR0aFqmCeym6YSeYyakVcNd8nQ + 0JnPxxBLeXeYPpIZTFMD6TpVFyfvtCG9jpMOI27FLBdHLednVW2yrOx5b62xwy181re5iN4XOki + 1M/HJRMACpfQJImHpO9X3rRh2j79oKIKVwa3UjV8A7vD3noV/pV0SOTZP0awMYQH/Pn91nji685 + auXzHG2pai3Byw89+jYZIG2xfiqBcBwIEARvw52XSv3glk0tSvLDxNo8nyFNPsZ63g70USl1IlC + AKhW+QOw9/zkn3oCB+3fZZ/y+F4vlu4OzN4gETU+6p3798YiFGWMvocQnI/Ig7Unex9rmOP5 +X-Authority-Analysis: v=2.4 cv=fZOty1QF c=1 sm=1 tr=0 ts=682e57a3 cx=c_pps + a=ouPCqIW2jiPt+lZRy3xVPw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 + a=GEpy-HfZoHoA:10 a=dt9VzEwgFbYA:10 a=COk6AnOGAAAA:8 a=QHHbJxpVzSBZVvfXPLwA:9 + a=TjNXssC_j7lpFel5tvFf:22 +X-Proofpoint-ORIG-GUID: xDBdjIlSrmWJZkBfMwcImhxnyTIR4551 X-Proofpoint-Virus-Version: vendor=baseguard - engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 - definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 + engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 + definitions=2025-05-21_07,2025-05-20_03,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 - phishscore=0 impostorscore=0 - clxscore=1015 adultscore=0 mlxscore=0 suspectscore=0 malwarescore=0 - priorityscore=1501 spamscore=0 bulkscore=0 lowpriorityscore=0 - mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 - engine=8.19.0-2408220000 definitions=main-2409180141 + clxscore=1015 mlxscore=0 adultscore=0 spamscore=0 bulkscore=0 suspectscore=0 + malwarescore=0 priorityscore=1501 impostorscore=0 mlxlogscore=999 + lowpriorityscore=0 phishscore=0 classifier=spam authscore=0 authtc=n/a + authcc= route=outbound adjust=0 reason=mlx scancount=1 + engine=8.19.0-2505160000 definitions=main-2505210226 Clean up unused 80P80 references as hardware does not support it. This is applicable to both QCN9274 and WCN7850. @@ -106,14 +117,14 @@ Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.0.1-00029-QCAHKSWPL_SILICONZ-1 Signed-off-by: Pradeep Kumar Chitrapu Acked-by: Jeff Johnson --- - drivers/net/wireless/ath/ath12k/mac.c | 51 ++++++--------------------- - drivers/net/wireless/ath/ath12k/wmi.c | 5 +-- + drivers/net/wireless/ath/ath12k/mac.c | 48 ++++++--------------------- + drivers/net/wireless/ath/ath12k/wmi.c | 2 -- drivers/net/wireless/ath/ath12k/wmi.h | 1 - - 3 files changed, 11 insertions(+), 46 deletions(-) + 3 files changed, 10 insertions(+), 41 deletions(-) --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c -@@ -206,7 +206,7 @@ ath12k_phymodes[NUM_NL80211_BANDS][ATH12 +@@ -207,7 +207,7 @@ ath12k_phymodes[NUM_NL80211_BANDS][ATH12 [NL80211_CHAN_WIDTH_40] = MODE_11BE_EHT40, [NL80211_CHAN_WIDTH_80] = MODE_11BE_EHT80, [NL80211_CHAN_WIDTH_160] = MODE_11BE_EHT160, @@ -122,7 +133,7 @@ Acked-by: Jeff Johnson [NL80211_CHAN_WIDTH_320] = MODE_11BE_EHT320, }, [NL80211_BAND_6GHZ] = { -@@ -217,7 +217,7 @@ ath12k_phymodes[NUM_NL80211_BANDS][ATH12 +@@ -218,7 +218,7 @@ ath12k_phymodes[NUM_NL80211_BANDS][ATH12 [NL80211_CHAN_WIDTH_40] = MODE_11BE_EHT40, [NL80211_CHAN_WIDTH_80] = MODE_11BE_EHT80, [NL80211_CHAN_WIDTH_160] = MODE_11BE_EHT160, @@ -131,9 +142,9 @@ Acked-by: Jeff Johnson [NL80211_CHAN_WIDTH_320] = MODE_11BE_EHT320, }, -@@ -2390,17 +2390,6 @@ static void ath12k_peer_assoc_h_he(struc +@@ -2638,17 +2638,6 @@ static void ath12k_peer_assoc_h_he(struc - switch (sta->deflink.bandwidth) { + switch (link_sta->bandwidth) { case IEEE80211_STA_RX_BW_160: - if (he_cap->he_cap_elem.phy_cap_info[0] & - IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G) { @@ -149,15 +160,14 @@ Acked-by: Jeff Johnson v = le16_to_cpu(he_cap->he_mcs_nss_supp.rx_mcs_160); arg->peer_he_rx_mcs_set[WMI_HECAP_TXRX_MCS_NSS_IDX_160] = v; -@@ -2658,16 +2647,11 @@ static enum wmi_phy_mode ath12k_mac_get_ - struct ieee80211_sta *sta) +@@ -2935,16 +2924,11 @@ static enum wmi_phy_mode ath12k_mac_get_ + struct ieee80211_link_sta *link_sta) { - if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_160) { -- switch (sta->deflink.vht_cap.cap & + if (link_sta->bandwidth == IEEE80211_STA_RX_BW_160) { +- switch (link_sta->vht_cap.cap & - IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_MASK) { - case IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ: -+ if (sta->deflink.vht_cap.cap & -+ IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ) ++ if (link_sta->vht_cap.cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ) return MODE_11AC_VHT160; - case IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160_80PLUS80MHZ: - return MODE_11AC_VHT80_80; @@ -166,15 +176,16 @@ Acked-by: Jeff Johnson - return MODE_11AC_VHT160; - } + -+ return MODE_UNKNOWN; ++ /* not sure if this is a valid case? */ ++ return MODE_11AC_VHT160; } - if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_80) -@@ -2689,11 +2673,8 @@ static enum wmi_phy_mode ath12k_mac_get_ - if (sta->deflink.he_cap.he_cap_elem.phy_cap_info[0] & + if (link_sta->bandwidth == IEEE80211_STA_RX_BW_80) +@@ -2966,11 +2950,8 @@ static enum wmi_phy_mode ath12k_mac_get_ + if (link_sta->he_cap.he_cap_elem.phy_cap_info[0] & IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G) return MODE_11AX_HE160; -- else if (sta->deflink.he_cap.he_cap_elem.phy_cap_info[0] & +- else if (link_sta->he_cap.he_cap_elem.phy_cap_info[0] & - IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G) - return MODE_11AX_HE80_80; - /* not sure if this is a valid case? */ @@ -183,24 +194,24 @@ Acked-by: Jeff Johnson + return MODE_UNKNOWN; } - if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_80) -@@ -2721,14 +2702,7 @@ static enum wmi_phy_mode ath12k_mac_get_ + if (link_sta->bandwidth == IEEE80211_STA_RX_BW_80) +@@ -2998,14 +2979,10 @@ static enum wmi_phy_mode ath12k_mac_get_ IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G) return MODE_11BE_EHT160; -- if (sta->deflink.he_cap.he_cap_elem.phy_cap_info[0] & +- if (link_sta->he_cap.he_cap_elem.phy_cap_info[0] & - IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G) - return MODE_11BE_EHT80_80; - -- ath12k_warn(ar->ab, "invalid EHT PHY capability info for 160 Mhz: %d\n", -- sta->deflink.he_cap.he_cap_elem.phy_cap_info[0]); -- + ath12k_warn(ar->ab, "invalid EHT PHY capability info for 160 Mhz: %d\n", + link_sta->he_cap.he_cap_elem.phy_cap_info[0]); + - return MODE_11BE_EHT160; + return MODE_UNKNOWN; } - if (sta->deflink.bandwidth == IEEE80211_STA_RX_BW_80) -@@ -5806,8 +5780,6 @@ static void ath12k_mac_set_hemcsmap(stru + if (link_sta->bandwidth == IEEE80211_STA_RX_BW_80) +@@ -7077,8 +7054,6 @@ static void ath12k_mac_set_hemcsmap(stru mcs_nss->tx_mcs_80 = cpu_to_le16(txmcs_map & 0xffff); mcs_nss->rx_mcs_160 = cpu_to_le16(rxmcs_map & 0xffff); mcs_nss->tx_mcs_160 = cpu_to_le16(txmcs_map & 0xffff); @@ -209,7 +220,7 @@ Acked-by: Jeff Johnson } static void ath12k_mac_copy_he_cap(struct ath12k *ar, -@@ -5829,6 +5801,7 @@ static void ath12k_mac_copy_he_cap(struc +@@ -7100,6 +7075,7 @@ static void ath12k_mac_copy_he_cap(struc IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_IN_2G | IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_40MHZ_80MHZ_IN_5G | IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_160MHZ_IN_5G; @@ -217,7 +228,7 @@ Acked-by: Jeff Johnson he_cap_elem->phy_cap_info[0] &= ~IEEE80211_HE_PHY_CAP0_CHANNEL_WIDTH_SET_80PLUS80_MHZ_IN_5G; he_cap_elem->phy_cap_info[5] &= -@@ -8495,10 +8468,6 @@ static __le16 +@@ -10176,10 +10152,6 @@ static __le16 ath12k_mac_get_tx_mcs_map(const struct ieee80211_sta_he_cap *he_cap) { if (he_cap->he_cap_elem.phy_cap_info[0] & @@ -230,25 +241,22 @@ Acked-by: Jeff Johnson --- a/drivers/net/wireless/ath/ath12k/wmi.c +++ b/drivers/net/wireless/ath/ath12k/wmi.c -@@ -986,10 +986,7 @@ static void ath12k_wmi_put_wmi_channel(s +@@ -1021,8 +1021,6 @@ static void ath12k_wmi_put_wmi_channel(s + chan->band_center_freq1 = cpu_to_le32(center_freq1 - 40); - chan->mhz = cpu_to_le32(arg->freq); - chan->band_center_freq1 = cpu_to_le32(arg->band_center_freq1); -- if (arg->mode == MODE_11AC_VHT80_80) + chan->band_center_freq2 = cpu_to_le32(center_freq1); +- } else if (arg->mode == MODE_11BE_EHT80_80) { - chan->band_center_freq2 = cpu_to_le32(arg->band_center_freq2); -- else -- chan->band_center_freq2 = 0; -+ chan->band_center_freq2 = 0; - - chan->info |= le32_encode_bits(arg->mode, WMI_CHAN_INFO_MODE); - if (arg->passive) + } else { + chan->band_center_freq2 = 0; + } --- a/drivers/net/wireless/ath/ath12k/wmi.h +++ b/drivers/net/wireless/ath/ath12k/wmi.h -@@ -3633,7 +3633,6 @@ struct wmi_vdev_install_key_arg { +@@ -3726,7 +3726,6 @@ struct wmi_vdev_install_key_arg { #define WMI_HOST_MAX_HE_RATE_SET 3 #define WMI_HECAP_TXRX_MCS_NSS_IDX_80 0 #define WMI_HECAP_TXRX_MCS_NSS_IDX_160 1 -#define WMI_HECAP_TXRX_MCS_NSS_IDX_80_80 2 - struct wmi_rate_set_arg { - u32 num_rates; + #define ATH12K_WMI_MLO_MAX_PARTNER_LINKS \ + (ATH12K_WMI_MLO_MAX_LINKS + ATH12K_MAX_NUM_BRIDGE_LINKS - 1) diff --git a/package/kernel/mac80211/patches/ath12k/104-8-wifi-ath12k-add-support-for-160-MHz-bandwidth.patch b/package/kernel/mac80211/patches/ath12k/104-8-wifi-ath12k-add-support-for-160-MHz-bandwidth.patch index e3956385bdc..24114e92acb 100644 --- a/package/kernel/mac80211/patches/ath12k/104-8-wifi-ath12k-add-support-for-160-MHz-bandwidth.patch +++ b/package/kernel/mac80211/patches/ath12k/104-8-wifi-ath12k-add-support-for-160-MHz-bandwidth.patch @@ -1,68 +1,68 @@ -From patchwork Wed Sep 18 21:20:55 2024 +From patchwork Wed May 21 22:45:38 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pradeep Kumar Chitrapu -X-Patchwork-Id: 13807216 +X-Patchwork-Id: 14096124 X-Patchwork-Delegate: quic_jjohnson@quicinc.com Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) - by smtp.subspace.kernel.org (Postfix) with ESMTPS id C64DB1CB518 - for ; Wed, 18 Sep 2024 21:21:15 +0000 (UTC) + by smtp.subspace.kernel.org (Postfix) with ESMTPS id DEE9223A9AA + for ; Wed, 21 May 2025 22:45:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; - t=1726694477; cv=none; - b=aWI5JISgL9c0iB/8EAXYKF/Lb2sJoeG+v5+Va4eb/voqwiSQ4FtwPkCC00b9attXvu4dD9wEHGKPW8Uh2kb1tSTl0uNHxijRmLYK2VUWkLHsZ3Pd6VvGoTpbtmOTgsGklZHZiFd+jyWgGkHB4ZBkHSkG9JH6VR44MSIgNj8g14A= + t=1747867561; cv=none; + b=qWgm5H8L0Zhrc5crkCw7SBoGEQ8yf+aC0TSWOzfiTwcAddeStpjorEa3XaBl0GOhHPRaECOhMSNqu88tQ5CzCGmumBQ3QLC6mod6Tb0Y0PdeUJm3YoGKcI+F0oE3g5kCHaU9LRKKnmMZQS72kE7dO+lEBfwMIuCX/VwV066B1p8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; - s=arc-20240116; t=1726694477; c=relaxed/simple; - bh=AYJpDHbXZ0n0NNHQi7/aGcqo7YfyoYhv+FrXZ143wMA=; + s=arc-20240116; t=1747867561; c=relaxed/simple; + bh=61S52HJJJauXcXkg3NpFqkwtGSPNO+bmTpNYu1v9AKM=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; - b=jD1C2mzFvENculg9HS0v02iWUDzrWXiuU5GXTyC/0BKAJirnQkOUdVm7u0AEPiMxfkktLT3QCJLuvnKu3ZqSXWNbc2zOdUHTyW12fKdDNHib1WYYySBnfqu4EmiJKGcTE57VFlVdbklngOCDTCqHvVgP7YitGg2fWLPqBP/4yhM= + b=gi5WIxM8SYlljyfdAVTdIK6JQ5jJHPGGfdxPkwbtEaPElRA55vurxkaaJ0RktTtDYYJEn7KLZFieBHAv5/nEcrDjL4NGvgT3wiAoGcbsd+TIF6w5J2RSmAwhAP008N5swveLHDzJ0M9TrtQj2HHndc8JPD4oGWbcEqKQqHSq8ck= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com - header.b=OMqc+btb; arc=none smtp.client-ip=205.220.180.131 + header.b=lMYw009C; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com - header.b="OMqc+btb" -Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) + header.b="lMYw009C" +Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id - 48I8sxTR020476; - Wed, 18 Sep 2024 21:21:11 GMT + 54LJgEPE029249; + Wed, 21 May 2025 22:45:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= - dFohRj9vqwjJTRRYk31/1oJCFqLLKUuQ/verxCo/cGo=; b=OMqc+btbHl9cHSxO - NauW5WX4C34QsGL/4d03QTtCDlctfB5PRmINiP2/jGcVZk3NZWS3d2f5zjPY7+hd - uaUDslDMQwvAj1Jay/we1qNaFIPuzj4c9BbHqvvXa0WiCgQWpBC2h2jcFLXbeVHE - 5bqH+plXU5cz1d2YbsRpCXsdUWL/+S3u6A6/qxj6UraJ1s/rkE4ndQe/AQuf96Ja - ylYiZPdtJJXzB6rPDN1bQsSET/PNXzIkrYTaDLF9A6688WU9izJdAjRcsu8oB8o1 - U+yftDfoegI7+ZyTZ4JUnQs7zJp171L/qsF0U9RONZCIbSLN9pkTo6xp6CrHGeLQ - 0tCmwQ== -Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com + ph+yJaIkwYsZzzEsymzTjupgmHjdwFMJhbEzuPrYvfY=; b=lMYw009CSvZqDxkz + +HCEzcZhy6QO8G2ut93TJxHdCbVLlRaMNReXGlGqx2KRNracyLRkAQsC16i+QcpJ + aHBvIE2c0/TEtBiyv3HzBf3/89R0POT080sz81P6go3m8w9bcIE+Q2DqjdhVNqu3 + AlV8qb6pj/QUVvDbJQxO1M9eCXSO6g2BBDjgRCktOu+x2TlxhdBZ/tJP+h0AUk+j + YsH1LhcLOZYCFTJyB6IFmHWvtGk5Ef6i6D/tXyCL7nQiDP/R1v2PcdlLlI5e5/PO + FhKB2+RCmSyJUtyaAHHi/mVen5yqFX2K3/vL3BtprRAJINhFxQrLs6xLIQabELzj + KCstuQ== +Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) - by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41n4j6uagr-1 + by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 46rwfb4b3x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); - Wed, 18 Sep 2024 21:21:10 +0000 (GMT) + Wed, 21 May 2025 22:45:55 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) - by NALASPPMTA05.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id - 48ILL9IB009589 + by NALASPPMTA04.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id + 54LMjtX2022238 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); - Wed, 18 Sep 2024 21:21:09 GMT -Received: from ath12k-linux1.qualcomm.com (10.80.80.8) by + Wed, 21 May 2025 22:45:55 GMT +Received: from ath12k-linux2.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id - 15.2.1544.9; Wed, 18 Sep 2024 14:21:09 -0700 + 15.2.1544.9; Wed, 21 May 2025 15:45:54 -0700 From: Pradeep Kumar Chitrapu To: CC: , @@ -71,12 +71,13 @@ CC: , P Praneesh , "Jeff Johnson" -Subject: [PATCH V8 8/9] wifi: ath12k: add support for 160 MHz bandwidth -Date: Wed, 18 Sep 2024 14:20:55 -0700 -Message-ID: <20240918212056.4137076-9-quic_pradeepc@quicinc.com> -X-Mailer: git-send-email 2.34.1 -In-Reply-To: <20240918212056.4137076-1-quic_pradeepc@quicinc.com> -References: <20240918212056.4137076-1-quic_pradeepc@quicinc.com> +Subject: [PATCH ath-next V14 8/9] wifi: ath12k: add support for 160 MHz + bandwidth +Date: Wed, 21 May 2025 15:45:38 -0700 +Message-ID: <20250521224539.355985-9-quic_pradeepc@quicinc.com> +X-Mailer: git-send-email 2.43.0 +In-Reply-To: <20250521224539.355985-1-quic_pradeepc@quicinc.com> +References: <20250521224539.355985-1-quic_pradeepc@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: @@ -88,17 +89,28 @@ X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 -X-Proofpoint-ORIG-GUID: wO0mnzqAAbcWYLNaoEhU3YfsdCyDJ2hk -X-Proofpoint-GUID: wO0mnzqAAbcWYLNaoEhU3YfsdCyDJ2hk +X-Proofpoint-ORIG-GUID: T9MbsOp4F8M93FD6ZEyfm1BTh5tEiCIl +X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTIxMDIyNiBTYWx0ZWRfX0EeEFBAyVxZV + WX6jh2dkCn4P+eViI8Gvz/6S+yZ+Avx9/8To2mbulh5j1kDm92bEDu7iQtI17ILPnOgbUXWAjjt + Z2LvemtbMzJe0lY0EjJNWWunihdlsXPAdOnZFjV0rOtakq8Xx4y8K45/1cGY9dQOApxDFC9HiLZ + +FK9apopZ2DyP6haLf5HQI+6DC3wwgbEQlE+89g69hXEM8UePlFlsf0fpfIVgiWG73gfzHkrRPM + 8ByVGmKpFSXIBmvY+EZZOPuPsQHt/91pIisXw5Joxdbl6Qf2anjuC0X4LPrTgTxgXWhljS4JdXo + djhNt09IBnNuagxN9aMx/frUhqQPNL54kp/cXbpgcLQX0XQg8SOvwyxJs+CALQUyymluDLHyH9w + UQUznCXFrps86AX/Fpnhrl9hqR5NO0/6oR340zsS7mvryRucOqzT7vc3WPMJEhW68VMCAl5Z +X-Proofpoint-GUID: T9MbsOp4F8M93FD6ZEyfm1BTh5tEiCIl +X-Authority-Analysis: v=2.4 cv=dLCmmPZb c=1 sm=1 tr=0 ts=682e57a4 cx=c_pps + a=ouPCqIW2jiPt+lZRy3xVPw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 + a=GEpy-HfZoHoA:10 a=dt9VzEwgFbYA:10 a=COk6AnOGAAAA:8 a=dOJm2eNAaUnF9U8lSB4A:9 + a=TjNXssC_j7lpFel5tvFf:22 X-Proofpoint-Virus-Version: vendor=baseguard - engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 - definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 + engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 + definitions=2025-05-21_07,2025-05-20_03,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 - phishscore=0 mlxlogscore=999 - mlxscore=0 malwarescore=0 bulkscore=0 priorityscore=1501 clxscore=1015 - adultscore=0 suspectscore=0 lowpriorityscore=0 spamscore=0 impostorscore=0 - classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2408220000 - definitions=main-2409180140 + mlxscore=0 clxscore=1015 adultscore=0 bulkscore=0 phishscore=0 suspectscore=0 + impostorscore=0 malwarescore=0 lowpriorityscore=0 mlxlogscore=999 spamscore=0 + priorityscore=1501 classifier=spam authscore=0 authtc=n/a authcc= + route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2505160000 + definitions=main-2505210226 Add support to configure maximum NSS in 160 MHz bandwidth. Firmware advertises support for handling NSS ratio information @@ -119,18 +131,18 @@ Signed-off-by: Pradeep Kumar Chitrapu Acked-by: Jeff Johnson --- drivers/net/wireless/ath/ath12k/core.h | 2 + - drivers/net/wireless/ath/ath12k/mac.c | 85 ++++++++++++++++++++++---- + drivers/net/wireless/ath/ath12k/mac.c | 89 ++++++++++++++++++++++---- drivers/net/wireless/ath/ath12k/mac.h | 2 + - drivers/net/wireless/ath/ath12k/wmi.c | 19 +++++- - drivers/net/wireless/ath/ath12k/wmi.h | 28 +++++++++ - 5 files changed, 124 insertions(+), 12 deletions(-) + drivers/net/wireless/ath/ath12k/wmi.c | 7 +- + drivers/net/wireless/ath/ath12k/wmi.h | 28 ++++++++ + 5 files changed, 115 insertions(+), 13 deletions(-) --- a/drivers/net/wireless/ath/ath12k/core.h +++ b/drivers/net/wireless/ath/ath12k/core.h -@@ -717,6 +717,8 @@ struct ath12k_pdev_cap { - u32 tx_chain_mask_shift; - u32 rx_chain_mask_shift; +@@ -789,6 +789,8 @@ struct ath12k_pdev_cap { struct ath12k_band_cap band[NUM_NL80211_BANDS]; + u32 eml_cap; + u32 mld_cap; + bool nss_ratio_enabled; + u8 nss_ratio_info; }; @@ -138,7 +150,7 @@ Acked-by: Jeff Johnson struct mlo_timestamp { --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c -@@ -2050,6 +2050,34 @@ ath12k_peer_assoc_h_vht_limit(u16 tx_mcs +@@ -2267,6 +2267,34 @@ ath12k_peer_assoc_h_vht_limit(u16 tx_mcs return tx_mcs_set; } @@ -171,28 +183,27 @@ Acked-by: Jeff Johnson +} + static void ath12k_peer_assoc_h_vht(struct ath12k *ar, - struct ieee80211_vif *vif, - struct ieee80211_sta *sta, -@@ -2065,6 +2093,7 @@ static void ath12k_peer_assoc_h_vht(stru + struct ath12k_link_vif *arvif, + struct ath12k_link_sta *arsta, +@@ -2284,6 +2312,7 @@ static void ath12k_peer_assoc_h_vht(stru u8 max_nss, vht_mcs; int i, vht_nss, nss_idx; bool user_rate_valid = true; + u32 rx_nss, tx_nss, nss_160; - if (WARN_ON(ath12k_mac_vif_chan(vif, &def))) - return; -@@ -2159,10 +2188,24 @@ static void ath12k_peer_assoc_h_vht(stru + lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy); + +@@ -2388,10 +2417,24 @@ static void ath12k_peer_assoc_h_vht(stru /* TODO: Check */ arg->tx_max_mcs_nss = 0xFF; - ath12k_dbg(ar->ab, ATH12K_DBG_MAC, "mac vht peer %pM max_mpdu %d flags 0x%x\n", -- sta->addr, arg->peer_max_mpdu, arg->peer_flags); +- arsta->addr, arg->peer_max_mpdu, arg->peer_flags); + if (arg->peer_phymode == MODE_11AC_VHT160) { + tx_nss = ath12k_get_nss_160mhz(ar, max_nss); + rx_nss = min(arg->peer_nss, tx_nss); + arg->peer_bw_rxnss_override = ATH12K_BW_NSS_MAP_ENABLE; - -- /* TODO: rxnss_override */ ++ + if (!rx_nss) { + ath12k_warn(ar->ab, "invalid max_nss\n"); + return; @@ -201,28 +212,26 @@ Acked-by: Jeff Johnson + nss_160 = u32_encode_bits(rx_nss - 1, ATH12K_PEER_RX_NSS_160MHZ); + arg->peer_bw_rxnss_override |= nss_160; + } -+ + +- /* TODO: rxnss_override */ + ath12k_dbg(ar->ab, ATH12K_DBG_MAC, + "mac vht peer %pM max_mpdu %d flags 0x%x nss_override 0x%x\n", -+ sta->addr, arg->peer_max_mpdu, arg->peer_flags, ++ arsta->addr, arg->peer_max_mpdu, arg->peer_flags, + arg->peer_bw_rxnss_override); } static int ath12k_mac_get_max_he_mcs_map(u16 mcs_map, int nss) -@@ -2251,6 +2294,7 @@ static void ath12k_peer_assoc_h_he(struc +@@ -2484,6 +2527,7 @@ static void ath12k_peer_assoc_h_he(struc u16 he_tx_mcs = 0, v = 0; int he_nss, nss_idx; bool user_rate_valid = true; + u32 rx_nss, tx_nss, nss_160; - if (WARN_ON(ath12k_mac_vif_chan(vif, &def))) + if (WARN_ON(ath12k_mac_vif_link_chan(vif, link_id, &def))) return; -@@ -2429,11 +2473,28 @@ static void ath12k_peer_assoc_h_he(struc - he_mcs_mask[i]) - max_nss = i + 1; - } -+ max_nss = min(max_nss, ar->num_tx_chains); - arg->peer_nss = min(sta->deflink.rx_nss, max_nss); +@@ -2681,9 +2725,25 @@ static void ath12k_peer_assoc_h_he(struc + max_nss = min(max_nss, ar->num_tx_chains); + arg->peer_nss = min(link_sta->rx_nss, max_nss); + if (arg->peer_phymode == MODE_11AX_HE160) { + tx_nss = ath12k_get_nss_160mhz(ar, max_nss); @@ -240,30 +249,31 @@ Acked-by: Jeff Johnson + ath12k_dbg(ar->ab, ATH12K_DBG_MAC, - "mac he peer %pM nss %d mcs cnt %d\n", -- sta->deflink.addr, arg->peer_nss, arg->peer_he_mcs_count); +- arsta->addr, arg->peer_nss, arg->peer_he_mcs_count); + "mac he peer %pM nss %d mcs cnt %d nss_override 0x%x\n", -+ sta->deflink.addr, arg->peer_nss, ++ arsta->addr, arg->peer_nss, + arg->peer_he_mcs_count, + arg->peer_bw_rxnss_override); } static void ath12k_peer_assoc_h_he_6ghz(struct ath12k *ar, -@@ -2965,13 +3026,13 @@ static void ath12k_peer_assoc_prepare(st - ath12k_peer_assoc_h_basic(ar, vif, sta, arg); - ath12k_peer_assoc_h_crypto(ar, vif, sta, arg); - ath12k_peer_assoc_h_rates(ar, vif, sta, arg); -+ ath12k_peer_assoc_h_phymode(ar, vif, sta, arg); - ath12k_peer_assoc_h_ht(ar, vif, sta, arg); - ath12k_peer_assoc_h_vht(ar, vif, sta, arg); - ath12k_peer_assoc_h_he(ar, vif, sta, arg); - ath12k_peer_assoc_h_he_6ghz(ar, vif, sta, arg); - ath12k_peer_assoc_h_eht(ar, vif, sta, arg); - ath12k_peer_assoc_h_qos(ar, vif, sta, arg); -- ath12k_peer_assoc_h_phymode(ar, vif, sta, arg); - ath12k_peer_assoc_h_smps(sta, arg); +@@ -2924,10 +2984,13 @@ static enum wmi_phy_mode ath12k_mac_get_ + struct ieee80211_link_sta *link_sta) + { + if (link_sta->bandwidth == IEEE80211_STA_RX_BW_160) { +- if (link_sta->vht_cap.cap & IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ) ++ if (link_sta->vht_cap.cap & (IEEE80211_VHT_CAP_SUPP_CHAN_WIDTH_160MHZ | ++ IEEE80211_VHT_CAP_EXT_NSS_BW_MASK)) + return MODE_11AC_VHT160; + +- /* not sure if this is a valid case? */ ++ /* Allow STA to connect even if it does not explicitly advertise 160 MHz ++ * support ++ */ + return MODE_11AC_VHT160; + } - /* TODO: amsdu_disable req? */ -@@ -5552,10 +5613,8 @@ ath12k_create_vht_cap(struct ath12k *ar, +@@ -6826,10 +6889,8 @@ ath12k_create_vht_cap(struct ath12k *ar, ath12k_set_vht_txbf_cap(ar, &vht_cap.cap); @@ -276,29 +286,29 @@ Acked-by: Jeff Johnson rxmcs_map = 0; txmcs_map = 0; -@@ -9711,7 +9770,8 @@ static int ath12k_mac_setup_iface_combin - combinations[0].radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) | - BIT(NL80211_CHAN_WIDTH_20) | - BIT(NL80211_CHAN_WIDTH_40) | -- BIT(NL80211_CHAN_WIDTH_80); -+ BIT(NL80211_CHAN_WIDTH_80) | -+ BIT(NL80211_CHAN_WIDTH_160); +@@ -11437,7 +11498,8 @@ ath12k_mac_setup_radio_iface_comb(struct + comb[0].radar_detect_widths = BIT(NL80211_CHAN_WIDTH_20_NOHT) | + BIT(NL80211_CHAN_WIDTH_20) | + BIT(NL80211_CHAN_WIDTH_40) | +- BIT(NL80211_CHAN_WIDTH_80); ++ BIT(NL80211_CHAN_WIDTH_80) | ++ BIT(NL80211_CHAN_WIDTH_160); - wiphy->iface_combinations = combinations; - wiphy->n_iface_combinations = 1; -@@ -9927,6 +9987,9 @@ static int ath12k_mac_hw_register(struct + return 0; + } +@@ -11811,6 +11873,9 @@ static int ath12k_mac_hw_register(struct ieee80211_hw_set(hw, SUPPORTS_TX_FRAG); ieee80211_hw_set(hw, REPORTS_LOW_ACK); + if (cap->nss_ratio_enabled) + ieee80211_hw_set(hw, SUPPORTS_VHT_EXT_NSS_BW); + - if ((ht_cap & WMI_HT_CAP_ENABLED) || ar->supports_6ghz) { + if ((ht_cap & WMI_HT_CAP_ENABLED) || is_6ghz) { ieee80211_hw_set(hw, AMPDU_AGGREGATION); ieee80211_hw_set(hw, TX_AMPDU_SETUP_IN_HW); --- a/drivers/net/wireless/ath/ath12k/mac.h +++ b/drivers/net/wireless/ath/ath12k/mac.h -@@ -37,6 +37,8 @@ struct ath12k_generic_iter { +@@ -38,6 +38,8 @@ struct ath12k_generic_iter { #define IEEE80211_DISABLE_VHT_MCS_SUPPORT_0_11 BIT(24) #define ATH12K_CHAN_WIDTH_NUM 14 @@ -320,35 +330,19 @@ Acked-by: Jeff Johnson } else { return -EINVAL; } -@@ -982,11 +986,24 @@ int ath12k_wmi_vdev_down(struct ath12k * - static void ath12k_wmi_put_wmi_channel(struct ath12k_wmi_channel_params *chan, - struct wmi_vdev_start_req_arg *arg) - { -+ u32 center_freq1 = arg->band_center_freq1; -+ - memset(chan, 0, sizeof(*chan)); +@@ -1014,7 +1018,8 @@ static void ath12k_wmi_put_wmi_channel(s - chan->mhz = cpu_to_le32(arg->freq); - chan->band_center_freq1 = cpu_to_le32(arg->band_center_freq1); -- chan->band_center_freq2 = 0; -+ if (arg->mode == MODE_11AX_HE160) { -+ if (arg->freq > center_freq1) -+ chan->band_center_freq1 = -+ cpu_to_le32(center_freq1 + 40); -+ else -+ chan->band_center_freq1 = -+ cpu_to_le32(center_freq1 - 40); -+ -+ chan->band_center_freq2 = cpu_to_le32(arg->band_center_freq1); -+ } else { -+ chan->band_center_freq2 = 0; -+ } + chan->band_center_freq2 = cpu_to_le32(center_freq1); - chan->info |= le32_encode_bits(arg->mode, WMI_CHAN_INFO_MODE); - if (arg->passive) +- } else if (arg->mode == MODE_11BE_EHT160) { ++ } else if (arg->mode == MODE_11BE_EHT160 || ++ arg->mode == MODE_11AX_HE160) { + if (arg->freq > center_freq1) + chan->band_center_freq1 = cpu_to_le32(center_freq1 + 40); + else --- a/drivers/net/wireless/ath/ath12k/wmi.h +++ b/drivers/net/wireless/ath/ath12k/wmi.h -@@ -2264,6 +2264,21 @@ enum wmi_direct_buffer_module { +@@ -2290,6 +2290,21 @@ enum wmi_direct_buffer_module { WMI_DIRECT_BUF_MAX }; @@ -370,7 +364,7 @@ Acked-by: Jeff Johnson struct ath12k_wmi_pdev_band_arg { u32 pdev_id; u32 start_freq; -@@ -2580,6 +2595,12 @@ struct ath12k_wmi_hw_mode_cap_params { +@@ -2606,6 +2621,12 @@ struct ath12k_wmi_hw_mode_cap_params { } __packed; #define WMI_MAX_HECAP_PHY_SIZE (3) @@ -383,7 +377,7 @@ Acked-by: Jeff Johnson /* pdev_id is present in lower 16 bits of pdev_and_hw_link_ids in * ath12k_wmi_mac_phy_caps_params & ath12k_wmi_caps_ext_params. -@@ -2621,6 +2642,13 @@ struct ath12k_wmi_mac_phy_caps_params { +@@ -2647,6 +2668,13 @@ struct ath12k_wmi_mac_phy_caps_params { __le32 he_cap_info_2g_ext; __le32 he_cap_info_5g_ext; __le32 he_cap_info_internal; diff --git a/package/kernel/mac80211/patches/ath12k/104-9-wifi-ath12k-add-extended-NSS-bandwidth-support-for-160-MHz.patch b/package/kernel/mac80211/patches/ath12k/104-9-wifi-ath12k-add-extended-NSS-bandwidth-support-for-160-MHz.patch index 709ef8ecc46..fbace1f705d 100644 --- a/package/kernel/mac80211/patches/ath12k/104-9-wifi-ath12k-add-extended-NSS-bandwidth-support-for-160-MHz.patch +++ b/package/kernel/mac80211/patches/ath12k/104-9-wifi-ath12k-add-extended-NSS-bandwidth-support-for-160-MHz.patch @@ -1,81 +1,81 @@ -From patchwork Wed Sep 18 21:20:56 2024 +From patchwork Wed May 21 22:45:39 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pradeep Kumar Chitrapu -X-Patchwork-Id: 13807214 +X-Patchwork-Id: 14096122 X-Patchwork-Delegate: quic_jjohnson@quicinc.com -Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com - [205.220.168.131]) +Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com + [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) - by smtp.subspace.kernel.org (Postfix) with ESMTPS id A44471CB32B - for ; Wed, 18 Sep 2024 21:21:14 +0000 (UTC) + by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9A1E9239E85 + for ; Wed, 21 May 2025 22:45:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; - arc=none smtp.client-ip=205.220.168.131 + arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; - t=1726694476; cv=none; - b=YnQUUZ4IfmLtgtYCtYRGhH8uRGd6VL74IRylGv6Ihb2PMO/n5UdfZlDk/m9w0OH4/sSsqULSz2lupiSTwXCPxc+73uK+OUjIEmCfPlNdrtzK2naXyiXAASPqonpnRBnyoIFwaE8zj8AHUqk5TAajedqpK9EnOaboX2XGYVbe0yI= + t=1747867561; cv=none; + b=YNQGoLeTsEUX0an1dYT8uFrTBxczoxLPoB0nXP+MEP3YMcemaxVf4zoi5GMSuKPLe4yeLz/R7AB090SrXrBTbY6MmwXLrUJGFBQUGwr05KQ5BnedSLyVE+PtNo01ZVjrjprsc5LC4z0vYHmQdBsqIfqP+bb+ATVkdkkKWV4Kg3A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; - s=arc-20240116; t=1726694476; c=relaxed/simple; - bh=TAPBD6g5pYNuC8Odk6t6JkL8GvKdG9H30IPHTEgA7C0=; + s=arc-20240116; t=1747867561; c=relaxed/simple; + bh=WkoD1wqfpiPds2ZNAwn7TY38LnC6cJOAuobqk3tWbSk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; - b=djAINL+wQRgQaGOI4fotrExnm1Yz5quwEW2I7s85hWLI3gB+HsjwPKWJypllDKm8W0FDcrsoZWFmOrfx0wJ5LIe+OtXJ4ijSG7xcJeGtgDXZ3hAA5ZBk/B+CD+g+NZ3c0mwkSKpUm5dUBPKi1+kJsPuVEwKeCmdMVj8QHSYMXPw= + b=aAO1mDb/PrwqKRHoeS0PAxgJAvDLPWPPBkzRX0hwJbFzcXtKdtWHDE83rjGbjR1bnM7lhkAU4SwoT87sOuciveNqdywUe6+9XTB2oWM/j0Tza/ZRKKRZFeByh7ib8Aibzc4y0ACg7Oaz/QhmWmPObPjc4oKuVzaH/P8Tub0rBcI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com - header.b=i4iTJD+Z; arc=none smtp.client-ip=205.220.168.131 + header.b=o3M+Sjyr; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com - header.b="i4iTJD+Z" -Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) + header.b="o3M+Sjyr" +Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id - 48I9VJ15022098; - Wed, 18 Sep 2024 21:21:11 GMT + 54LJHZNq001758; + Wed, 21 May 2025 22:45:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= - 2gwv4CbPGErAHv9NWtZrCSVk7NoZpHzKz9tuTs+8dV4=; b=i4iTJD+ZMXDp8Ul8 - HTo5IL/NLwS3mnlutEaaL+juUKm+wsFdl/BeMp9CC4H/sapolIhM4Zje9t3H9K0R - +z1OxQDEekvWrrfUlikEaUHjOEwQ4YKSPJ+1uAIrbbA3REWeW5z39IITJ3dGU05N - hnfPQEiFcPgDbFQv0Iaf434znv8rbOow6dc+M1E6EjpGd92Mq80BpsJqP8Ee0RUr - WO3rsws1kXzFs6ELsg/FmC3l6eG9A4z9SUxcZ7QqTaz8aPOAZS/lclN0cOJT7VgK - 7UNPGoDoJhTmHEX17W/rQR8RiV8c0hMciOuB1sfI7H/1uGkEPMjmfIsEdBjQ/9oa - DDiHrg== -Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com + wh8AVrVaz3Wne8xUCnRodQGPYbrNE8Rm9/NepU3KoQA=; b=o3M+SjyriKBrU+dH + +Uwb/f5RzskxDlOAgOvwNH7O5p766ueJYE/nAazyAuVI1fbDT1gkgvOM4VOLQAPP + zg9tDUD5Mz80GzBzSnheYbeedz7RgpaN14Qr6Gz/+1yrP4wWTh2quGduIAXBFDZR + QpWsQh2DxVOvXqoLRm64iurJNhvpq+YIAwpAxEA9Fp46SrXsFefc82nza6qgdk5P + pUjalFWnwLLxaSHJj2EoJhFDAf99q9N5KNKW/UCNY8A2CwQXqL9KmggTLRK1OC+S + ueHigeV9ydoGGD1W6zmEdydGv5JSaQRhjAxtJokUtrlUwn8mbpJyokm+Ie4GZV5v + tie1qQ== +Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) - by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 41n4hfk92c-1 + by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 46rwf6vbsg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); - Wed, 18 Sep 2024 21:21:11 +0000 (GMT) + Wed, 21 May 2025 22:45:56 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) - by NALASPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id - 48ILLA0u011397 + by NALASPPMTA04.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id + 54LMjtcB022245 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); - Wed, 18 Sep 2024 21:21:10 GMT -Received: from ath12k-linux1.qualcomm.com (10.80.80.8) by + Wed, 21 May 2025 22:45:55 GMT +Received: from ath12k-linux2.qualcomm.com (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id - 15.2.1544.9; Wed, 18 Sep 2024 14:21:09 -0700 + 15.2.1544.9; Wed, 21 May 2025 15:45:54 -0700 From: Pradeep Kumar Chitrapu To: CC: , Pradeep Kumar Chitrapu , Jeff Johnson -Subject: [PATCH V8 9/9] wifi: ath12k: add extended NSS bandwidth support for - 160 MHz -Date: Wed, 18 Sep 2024 14:20:56 -0700 -Message-ID: <20240918212056.4137076-10-quic_pradeepc@quicinc.com> -X-Mailer: git-send-email 2.34.1 -In-Reply-To: <20240918212056.4137076-1-quic_pradeepc@quicinc.com> -References: <20240918212056.4137076-1-quic_pradeepc@quicinc.com> +Subject: [PATCH ath-next V14 9/9] wifi: ath12k: add extended NSS bandwidth + support for 160 MHz +Date: Wed, 21 May 2025 15:45:39 -0700 +Message-ID: <20250521224539.355985-10-quic_pradeepc@quicinc.com> +X-Mailer: git-send-email 2.43.0 +In-Reply-To: <20250521224539.355985-1-quic_pradeepc@quicinc.com> +References: <20250521224539.355985-1-quic_pradeepc@quicinc.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: @@ -87,17 +87,28 @@ X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 -X-Proofpoint-GUID: Mta6b5FqdCLrvsiUf1WwMHFr8SiJUh5L -X-Proofpoint-ORIG-GUID: Mta6b5FqdCLrvsiUf1WwMHFr8SiJUh5L +X-Proofpoint-GUID: 3XlPaBNySyE2wx5TC6p1DVWVXzadsV9U +X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUwNTIxMDIyNiBTYWx0ZWRfX4g8vKznbpwuH + ZKoHe/eZESaXJ/nU0MF27s2mZH9kbhxkG1nYDBAxgIAR6HSB4Ir8V8BP9wvETNPaaV4xpgjbT6m + sDGIplm3HpwbpmQYiBtQIsOrs/s1B2t7uVdhqW02FHlFu/UIBLwZc7J8sLJcsYdxHYcx7MQ3nEe + tDoPrPTEwHw7n1CnzcfVsEUAuxuJ5iFaxBATgZF+LuAhijNvhyaoEWRUO2KUcBJaFHq/QbCYfpY + JBXWUNl+mlZxfQe4pogCpRmvEOONRvpKgZLFdEAxf2Fx0Z7OhaIV84gi99TYTjfe1aihjorJ/cp + cv78Jzcd3Pe3GwTFD0ZOqI30oSiaUyJS3E9XIjfDGLAVMK6FeM+KOYgnqo95ImgBH8HRshrA4LJ + qTKv2kKP1y4zPtpf7lmI2mcl7emiLGQx+t0d7Z8upCbYseoNAGHUkFJ45HF940Za9ZkEYTRq +X-Authority-Analysis: v=2.4 cv=fZOty1QF c=1 sm=1 tr=0 ts=682e57a4 cx=c_pps + a=ouPCqIW2jiPt+lZRy3xVPw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 + a=GEpy-HfZoHoA:10 a=dt9VzEwgFbYA:10 a=COk6AnOGAAAA:8 a=Opr4SxZhII4Vei-TI5AA:9 + a=TjNXssC_j7lpFel5tvFf:22 +X-Proofpoint-ORIG-GUID: 3XlPaBNySyE2wx5TC6p1DVWVXzadsV9U X-Proofpoint-Virus-Version: vendor=baseguard - engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 - definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 + engine=ICAP:2.0.293,Aquarius:18.0.1099,Hydra:6.0.736,FMLib:17.12.80.40 + definitions=2025-05-21_07,2025-05-20_03,2025-03-28_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 - priorityscore=1501 - clxscore=1015 phishscore=0 malwarescore=0 mlxlogscore=999 mlxscore=0 - impostorscore=0 adultscore=0 suspectscore=0 lowpriorityscore=0 spamscore=0 - bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 - engine=8.19.0-2408220000 definitions=main-2409180140 + clxscore=1015 mlxscore=0 adultscore=0 spamscore=0 bulkscore=0 suspectscore=0 + malwarescore=0 priorityscore=1501 impostorscore=0 mlxlogscore=999 + lowpriorityscore=0 phishscore=0 classifier=spam authscore=0 authtc=n/a + authcc= route=outbound adjust=0 reason=mlx scancount=1 + engine=8.19.0-2505160000 definitions=main-2505210226 Currently rx and tx MCS map for 160 MHz under HE capabilities are not updating properly, when 160 MHz is configured with NSS @@ -121,19 +132,19 @@ Acked-by: Jeff Johnson --- a/drivers/net/wireless/ath/ath12k/mac.c +++ b/drivers/net/wireless/ath/ath12k/mac.c -@@ -2477,8 +2477,10 @@ static void ath12k_peer_assoc_h_he(struc - arg->peer_nss = min(sta->deflink.rx_nss, max_nss); +@@ -2726,8 +2726,10 @@ static void ath12k_peer_assoc_h_he(struc + arg->peer_nss = min(link_sta->rx_nss, max_nss); if (arg->peer_phymode == MODE_11AX_HE160) { - tx_nss = ath12k_get_nss_160mhz(ar, max_nss); + tx_nss = ath12k_get_nss_160mhz(ar, ar->num_tx_chains); rx_nss = min(arg->peer_nss, tx_nss); + -+ arg->peer_nss = min(sta->deflink.rx_nss, ar->num_rx_chains); ++ arg->peer_nss = min(link_sta->rx_nss, ar->num_rx_chains); arg->peer_bw_rxnss_override = ATH12K_BW_NSS_MAP_ENABLE; if (!rx_nss) { -@@ -5636,6 +5638,12 @@ ath12k_create_vht_cap(struct ath12k *ar, +@@ -6912,6 +6914,12 @@ ath12k_create_vht_cap(struct ath12k *ar, vht_cap.vht_mcs.rx_mcs_map = cpu_to_le16(rxmcs_map); vht_cap.vht_mcs.tx_mcs_map = cpu_to_le16(txmcs_map); @@ -146,7 +157,7 @@ Acked-by: Jeff Johnson return vht_cap; } -@@ -5816,11 +5824,12 @@ static void ath12k_mac_set_hemcsmap(stru +@@ -7092,11 +7100,12 @@ static void ath12k_mac_set_hemcsmap(stru struct ieee80211_sta_he_cap *he_cap) { struct ieee80211_he_mcs_nss_supp *mcs_nss = &he_cap->he_mcs_nss_supp; @@ -162,7 +173,7 @@ Acked-by: Jeff Johnson for (i = 0; i < 8; i++) { if (i < ar->num_tx_chains && (ar->cfg_tx_chainmask >> cap->tx_chain_mask_shift) & BIT(i)) -@@ -5833,12 +5842,24 @@ static void ath12k_mac_set_hemcsmap(stru +@@ -7109,12 +7118,24 @@ static void ath12k_mac_set_hemcsmap(stru rxmcs_map |= IEEE80211_HE_MCS_SUPPORT_0_11 << (i * 2); else rxmcs_map |= IEEE80211_HE_MCS_NOT_SUPPORTED << (i * 2); diff --git a/package/kernel/mac80211/patches/ath12k/200-Revert-wifi-ath12k-convert-tasklet-to-BH-workqueue-f.patch b/package/kernel/mac80211/patches/ath12k/200-Revert-wifi-ath12k-convert-tasklet-to-BH-workqueue-f.patch new file mode 100644 index 00000000000..fb9cfd88914 --- /dev/null +++ b/package/kernel/mac80211/patches/ath12k/200-Revert-wifi-ath12k-convert-tasklet-to-BH-workqueue-f.patch @@ -0,0 +1,82 @@ +From cd911185014f773f0e227cabfb760b30968c3bca Mon Sep 17 00:00:00 2001 +From: Mantas Pucka +Date: Tue, 27 May 2025 14:13:27 +0300 +Subject: [PATCH] Revert "wifi: ath12k: convert tasklet to BH workqueue for CE + interrupts" + +This reverts commit cdad737160571a98cc4933a62c9f2728e965ab27. +--- + drivers/net/wireless/ath/ath12k/ce.h | 2 +- + drivers/net/wireless/ath/ath12k/pci.c | 14 +++++++------- + 2 files changed, 8 insertions(+), 8 deletions(-) + +--- a/drivers/net/wireless/ath/ath12k/ce.h ++++ b/drivers/net/wireless/ath/ath12k/ce.h +@@ -148,7 +148,7 @@ struct ath12k_ce_pipe { + void (*send_cb)(struct ath12k_ce_pipe *pipe); + void (*recv_cb)(struct ath12k_base *ab, struct sk_buff *skb); + +- struct work_struct intr_wq; ++ struct tasklet_struct intr_tq; + struct ath12k_ce_ring *src_ring; + struct ath12k_ce_ring *dest_ring; + struct ath12k_ce_ring *status_ring; +--- a/drivers/net/wireless/ath/ath12k/pci.c ++++ b/drivers/net/wireless/ath/ath12k/pci.c +@@ -430,9 +430,9 @@ static void ath12k_pci_sync_ce_irqs(stru + } + } + +-static void ath12k_pci_ce_workqueue(struct work_struct *work) ++static void ath12k_pci_ce_tasklet(struct tasklet_struct *t) + { +- struct ath12k_ce_pipe *ce_pipe = from_work(ce_pipe, work, intr_wq); ++ struct ath12k_ce_pipe *ce_pipe = from_tasklet(ce_pipe, t, intr_tq); + int irq_idx = ATH12K_PCI_IRQ_CE0_OFFSET + ce_pipe->pipe_num; + + ath12k_ce_per_engine_service(ce_pipe->ab, ce_pipe->pipe_num); +@@ -454,7 +454,7 @@ static irqreturn_t ath12k_pci_ce_interru + + disable_irq_nosync(ab->irq_num[irq_idx]); + +- queue_work(system_bh_wq, &ce_pipe->intr_wq); ++ tasklet_schedule(&ce_pipe->intr_tq); + + return IRQ_HANDLED; + } +@@ -683,7 +683,7 @@ static int ath12k_pci_config_irq(struct + + irq_idx = ATH12K_PCI_IRQ_CE0_OFFSET + i; + +- INIT_WORK(&ce_pipe->intr_wq, ath12k_pci_ce_workqueue); ++ tasklet_setup(&ce_pipe->intr_tq, ath12k_pci_ce_tasklet); + + ret = request_irq(irq, ath12k_pci_ce_interrupt_handler, + ab_pci->irq_flags, irq_name[irq_idx], +@@ -970,7 +970,7 @@ static void ath12k_pci_aspm_restore(stru + PCI_EXP_LNKCTL_ASPMC); + } + +-static void ath12k_pci_cancel_workqueue(struct ath12k_base *ab) ++static void ath12k_pci_kill_tasklets(struct ath12k_base *ab) + { + int i; + +@@ -980,7 +980,7 @@ static void ath12k_pci_cancel_workqueue( + if (ath12k_ce_get_attr_flags(ab, i) & CE_ATTR_DIS_INTR) + continue; + +- cancel_work_sync(&ce_pipe->intr_wq); ++ tasklet_kill(&ce_pipe->intr_tq); + } + } + +@@ -988,7 +988,7 @@ static void ath12k_pci_ce_irq_disable_sy + { + ath12k_pci_ce_irqs_disable(ab); + ath12k_pci_sync_ce_irqs(ab); +- ath12k_pci_cancel_workqueue(ab); ++ ath12k_pci_kill_tasklets(ab); + } + + int ath12k_pci_map_service_to_pipe(struct ath12k_base *ab, u16 service_id, diff --git a/package/kernel/mac80211/patches/ath9k/341-wifi-ath9k-obtain-system-gpios.patch b/package/kernel/mac80211/patches/ath9k/341-wifi-ath9k-obtain-system-gpios.patch index 4feb748229a..a14ed55ee9e 100644 --- a/package/kernel/mac80211/patches/ath9k/341-wifi-ath9k-obtain-system-gpios.patch +++ b/package/kernel/mac80211/patches/ath9k/341-wifi-ath9k-obtain-system-gpios.patch @@ -180,7 +180,7 @@ Best regards, #include #include "hw.h" -@@ -2727,19 +2727,25 @@ static void ath9k_hw_gpio_cfg_output_mux +@@ -2718,19 +2718,25 @@ static void ath9k_hw_gpio_cfg_output_mux static void ath9k_hw_gpio_cfg_soc(struct ath_hw *ah, u32 gpio, bool out, const char *label) { @@ -210,7 +210,7 @@ Best regards, } static void ath9k_hw_gpio_cfg_wmac(struct ath_hw *ah, u32 gpio, bool out, -@@ -2801,8 +2807,10 @@ void ath9k_hw_gpio_free(struct ath_hw *a +@@ -2792,8 +2798,10 @@ void ath9k_hw_gpio_free(struct ath_hw *a WARN_ON(gpio >= ah->caps.num_gpio_pins); @@ -223,7 +223,7 @@ Best regards, } EXPORT_SYMBOL(ath9k_hw_gpio_free); -@@ -2830,8 +2838,8 @@ u32 ath9k_hw_gpio_get(struct ath_hw *ah, +@@ -2821,8 +2829,8 @@ u32 ath9k_hw_gpio_get(struct ath_hw *ah, val = REG_READ(ah, AR_GPIO_IN(ah)) & BIT(gpio); else val = MS_REG_READ(AR, gpio); @@ -234,7 +234,7 @@ Best regards, } else { WARN_ON(1); } -@@ -2854,8 +2862,8 @@ void ath9k_hw_set_gpio(struct ath_hw *ah +@@ -2845,8 +2853,8 @@ void ath9k_hw_set_gpio(struct ath_hw *ah AR7010_GPIO_OUT : AR_GPIO_IN_OUT(ah); REG_RMW(ah, out_addr, val << gpio, BIT(gpio)); diff --git a/package/kernel/mac80211/patches/ath9k/356-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch b/package/kernel/mac80211/patches/ath9k/356-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch index 78ad7623b27..5cb891ed351 100644 --- a/package/kernel/mac80211/patches/ath9k/356-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch +++ b/package/kernel/mac80211/patches/ath9k/356-Revert-ath9k-interpret-requested-txpower-in-EIRP-dom.patch @@ -8,7 +8,7 @@ This reverts commit 71f5137bf010c6faffab50c0ec15374c59c4a411. --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -2983,7 +2983,8 @@ void ath9k_hw_apply_txpower(struct ath_h +@@ -2974,7 +2974,8 @@ void ath9k_hw_apply_txpower(struct ath_h { struct ath_regulatory *reg = ath9k_hw_regulatory(ah); struct ieee80211_channel *channel; @@ -18,7 +18,7 @@ This reverts commit 71f5137bf010c6faffab50c0ec15374c59c4a411. u16 ctl = NO_CTL; if (!chan) -@@ -2995,9 +2996,14 @@ void ath9k_hw_apply_txpower(struct ath_h +@@ -2986,9 +2987,14 @@ void ath9k_hw_apply_txpower(struct ath_h channel = chan->chan; chan_pwr = min_t(int, channel->max_power * 2, MAX_COMBINED_POWER); new_pwr = min_t(int, chan_pwr, reg->power_limit); diff --git a/package/kernel/mac80211/patches/ath9k/365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch b/package/kernel/mac80211/patches/ath9k/365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch index 21563bdaf58..14abb4035ab 100644 --- a/package/kernel/mac80211/patches/ath9k/365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch +++ b/package/kernel/mac80211/patches/ath9k/365-ath9k-adjust-tx-power-reduction-for-US-regulatory-do.patch @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -3002,6 +3002,10 @@ void ath9k_hw_apply_txpower(struct ath_h +@@ -2993,6 +2993,10 @@ void ath9k_hw_apply_txpower(struct ath_h if (ant_gain > max_gain) ant_reduction = ant_gain - max_gain; diff --git a/package/kernel/mac80211/patches/ath9k/401-ath9k_blink_default.patch b/package/kernel/mac80211/patches/ath9k/401-ath9k_blink_default.patch index 3eb57bb1cf5..7405e594fe6 100644 --- a/package/kernel/mac80211/patches/ath9k/401-ath9k_blink_default.patch +++ b/package/kernel/mac80211/patches/ath9k/401-ath9k_blink_default.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c -@@ -48,7 +48,7 @@ int ath9k_modparam_nohwcrypt; +@@ -47,7 +47,7 @@ int ath9k_modparam_nohwcrypt; module_param_named(nohwcrypt, ath9k_modparam_nohwcrypt, int, 0444); MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption"); diff --git a/package/kernel/mac80211/patches/ath9k/410-ath9k_allow_adhoc_and_ap.patch b/package/kernel/mac80211/patches/ath9k/410-ath9k_allow_adhoc_and_ap.patch index b2f2763e8e1..978d915c544 100644 --- a/package/kernel/mac80211/patches/ath9k/410-ath9k_allow_adhoc_and_ap.patch +++ b/package/kernel/mac80211/patches/ath9k/410-ath9k_allow_adhoc_and_ap.patch @@ -1,6 +1,6 @@ --- 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 +@@ -836,6 +836,7 @@ static const struct ieee80211_iface_limi BIT(NL80211_IFTYPE_AP) }, { .max = 1, .types = BIT(NL80211_IFTYPE_P2P_CLIENT) | BIT(NL80211_IFTYPE_P2P_GO) }, diff --git a/package/kernel/mac80211/patches/ath9k/450-ath9k-enabled-MFP-capability-unconditionally.patch b/package/kernel/mac80211/patches/ath9k/450-ath9k-enabled-MFP-capability-unconditionally.patch index f424ca530be..dffeb32611a 100644 --- a/package/kernel/mac80211/patches/ath9k/450-ath9k-enabled-MFP-capability-unconditionally.patch +++ b/package/kernel/mac80211/patches/ath9k/450-ath9k-enabled-MFP-capability-unconditionally.patch @@ -14,7 +14,7 @@ Signed-off-by: David Bauer --- 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 +@@ -917,6 +917,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); @@ -22,7 +22,7 @@ Signed-off-by: David Bauer if (ath9k_ps_enable) ieee80211_hw_set(hw, SUPPORTS_PS); -@@ -975,9 +976,6 @@ static void ath9k_set_hw_capab(struct at +@@ -929,9 +930,6 @@ static void ath9k_set_hw_capab(struct at IEEE80211_RADIOTAP_MCS_HAVE_STBC; } diff --git a/package/kernel/mac80211/patches/ath9k/500-ath9k_eeprom_debugfs.patch b/package/kernel/mac80211/patches/ath9k/500-ath9k_eeprom_debugfs.patch index f1431526bcd..8c139ac5531 100644 --- a/package/kernel/mac80211/patches/ath9k/500-ath9k_eeprom_debugfs.patch +++ b/package/kernel/mac80211/patches/ath9k/500-ath9k_eeprom_debugfs.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c -@@ -1429,6 +1429,7 @@ int ath9k_init_debug(struct ath_hw *ah) +@@ -1430,6 +1430,7 @@ int ath9k_init_debug(struct ath_hw *ah) ath9k_cmn_debug_base_eeprom(sc->debug.debugfs_phy, sc->sc_ah); ath9k_cmn_debug_modal_eeprom(sc->debug.debugfs_phy, sc->sc_ah); diff --git a/package/kernel/mac80211/patches/ath9k/501-ath9k_ahb_init.patch b/package/kernel/mac80211/patches/ath9k/501-ath9k_ahb_init.patch index 740ddc39dc3..2aee171608d 100644 --- a/package/kernel/mac80211/patches/ath9k/501-ath9k_ahb_init.patch +++ b/package/kernel/mac80211/patches/ath9k/501-ath9k_ahb_init.patch @@ -1,6 +1,6 @@ --- 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) +@@ -1132,25 +1132,25 @@ static int __init ath9k_init(void) { int error; diff --git a/package/kernel/mac80211/patches/ath9k/512-ath9k_channelbw_debugfs.patch b/package/kernel/mac80211/patches/ath9k/512-ath9k_channelbw_debugfs.patch index 87d18626da3..9a6063173c3 100644 --- a/package/kernel/mac80211/patches/ath9k/512-ath9k_channelbw_debugfs.patch +++ b/package/kernel/mac80211/patches/ath9k/512-ath9k_channelbw_debugfs.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c -@@ -1430,6 +1430,7 @@ int ath9k_init_debug(struct ath_hw *ah) +@@ -1431,6 +1431,7 @@ int ath9k_init_debug(struct ath_hw *ah) ath9k_cmn_debug_base_eeprom(sc->debug.debugfs_phy, sc->sc_ah); ath9k_cmn_debug_modal_eeprom(sc->debug.debugfs_phy, sc->sc_ah); ath9k_cmn_debug_eeprom(sc->debug.debugfs_phy, sc->sc_ah); @@ -181,7 +181,7 @@ 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 +@@ -691,6 +691,7 @@ static int ath9k_init_softc(u16 devid, s if (!ath9k_is_chanctx_enabled()) sc->cur_chan->hw_queue_base = 0; diff --git a/package/kernel/mac80211/patches/ath9k/530-ath9k_extra_leds.patch b/package/kernel/mac80211/patches/ath9k/530-ath9k_extra_leds.patch index 4bb27d558cc..4149e86e45e 100644 --- a/package/kernel/mac80211/patches/ath9k/530-ath9k_extra_leds.patch +++ b/package/kernel/mac80211/patches/ath9k/530-ath9k_extra_leds.patch @@ -24,7 +24,7 @@ struct ath_softc { struct ieee80211_hw *hw; struct device *dev; -@@ -1034,9 +1044,8 @@ struct ath_softc { +@@ -1036,9 +1046,8 @@ struct ath_softc { spinlock_t chan_lock; #ifdef CPTCFG_MAC80211_LEDS @@ -181,7 +181,7 @@ --- 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 +@@ -1043,7 +1043,7 @@ int ath9k_init_device(u16 devid, struct #ifdef CPTCFG_MAC80211_LEDS /* must be initialized before ieee80211_register_hw */ @@ -254,7 +254,7 @@ static ssize_t read_file_ani(struct file *file, char __user *user_buf, size_t count, loff_t *ppos) -@@ -1390,6 +1445,10 @@ int ath9k_init_debug(struct ath_hw *ah) +@@ -1391,6 +1446,10 @@ int ath9k_init_debug(struct ath_hw *ah) ath9k_tx99_init_debug(sc); ath9k_cmn_spectral_init_debug(&sc->spec_priv, sc->debug.debugfs_phy); diff --git a/package/kernel/mac80211/patches/ath9k/542-ath9k_debugfs_diag.patch b/package/kernel/mac80211/patches/ath9k/542-ath9k_debugfs_diag.patch index 35d39a05c73..4b8834ad28d 100644 --- a/package/kernel/mac80211/patches/ath9k/542-ath9k_debugfs_diag.patch +++ b/package/kernel/mac80211/patches/ath9k/542-ath9k_debugfs_diag.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c -@@ -1428,6 +1428,50 @@ void ath9k_deinit_debug(struct ath_softc +@@ -1429,6 +1429,50 @@ void ath9k_deinit_debug(struct ath_softc ath9k_cmn_spectral_deinit_debug(&sc->spec_priv); } @@ -51,7 +51,7 @@ int ath9k_init_debug(struct ath_hw *ah) { struct ath_common *common = ath9k_hw_common(ah); -@@ -1449,6 +1493,8 @@ int ath9k_init_debug(struct ath_hw *ah) +@@ -1450,6 +1494,8 @@ int ath9k_init_debug(struct ath_hw *ah) debugfs_create_file("gpio_led", S_IWUSR, sc->debug.debugfs_phy, sc, &fops_gpio_led); #endif @@ -94,7 +94,7 @@ struct ath_gen_timer *ath_gen_timer_alloc(struct ath_hw *ah, --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -1881,6 +1881,20 @@ u32 ath9k_hw_get_tsf_offset(struct times +@@ -1872,6 +1872,20 @@ u32 ath9k_hw_get_tsf_offset(ktime_t last } EXPORT_SYMBOL(ath9k_hw_get_tsf_offset); @@ -115,7 +115,7 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, struct ath9k_hw_cal_data *caldata, bool fastcc) { -@@ -2089,6 +2103,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st +@@ -2080,6 +2094,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st ar9003_hw_disable_phy_restart(ah); ath9k_hw_apply_gpio_override(ah); diff --git a/package/kernel/mac80211/patches/ath9k/543-ath9k_entropy_from_adc.patch b/package/kernel/mac80211/patches/ath9k/543-ath9k_entropy_from_adc.patch index 0fedc712701..8966cca2b6a 100644 --- a/package/kernel/mac80211/patches/ath9k/543-ath9k_entropy_from_adc.patch +++ b/package/kernel/mac80211/patches/ath9k/543-ath9k_entropy_from_adc.patch @@ -55,7 +55,7 @@ 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 +@@ -825,7 +825,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); @@ -65,7 +65,7 @@ } static const struct ieee80211_iface_limit if_limits[] = { -@@ -1049,6 +1050,18 @@ static void ath9k_set_hw_capab(struct at +@@ -1003,6 +1004,18 @@ static void ath9k_set_hw_capab(struct at wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CAN_REPLACE_PTK0); } @@ -84,7 +84,7 @@ 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 +@@ -1050,6 +1063,8 @@ int ath9k_init_device(u16 devid, struct wiphy_read_of_freq_limits(hw->wiphy); diff --git a/package/kernel/mac80211/patches/ath9k/544-ath9k-ar933x-usb-hang-workaround.patch b/package/kernel/mac80211/patches/ath9k/544-ath9k-ar933x-usb-hang-workaround.patch index 23a81864faa..926fbac9883 100644 --- a/package/kernel/mac80211/patches/ath9k/544-ath9k-ar933x-usb-hang-workaround.patch +++ b/package/kernel/mac80211/patches/ath9k/544-ath9k-ar933x-usb-hang-workaround.patch @@ -55,7 +55,7 @@ return -EINVAL; } -@@ -2114,6 +2139,9 @@ int ath9k_hw_reset(struct ath_hw *ah, st +@@ -2105,6 +2130,9 @@ int ath9k_hw_reset(struct ath_hw *ah, st ath9k_hw_set_radar_params(ah); } diff --git a/package/kernel/mac80211/patches/ath9k/548-ath9k_enable_gpio_chip.patch b/package/kernel/mac80211/patches/ath9k/548-ath9k_enable_gpio_chip.patch index 288948c8386..d7fe5b79f0a 100644 --- a/package/kernel/mac80211/patches/ath9k/548-ath9k_enable_gpio_chip.patch +++ b/package/kernel/mac80211/patches/ath9k/548-ath9k_enable_gpio_chip.patch @@ -19,7 +19,7 @@ Signed-off-by: Felix Fietkau #include "common.h" #include "debug.h" -@@ -1046,6 +1048,10 @@ struct ath_softc { +@@ -1048,6 +1050,10 @@ struct ath_softc { #ifdef CPTCFG_MAC80211_LEDS const char *led_default_trigger; struct list_head leds; diff --git a/package/kernel/mac80211/patches/ath9k/550-ath9k-of.patch b/package/kernel/mac80211/patches/ath9k/550-ath9k-of.patch index 604239188de..2db6177b283 100644 --- a/package/kernel/mac80211/patches/ath9k/550-ath9k-of.patch +++ b/package/kernel/mac80211/patches/ath9k/550-ath9k-of.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c -@@ -29,6 +29,11 @@ +@@ -28,6 +28,11 @@ #include "ath9k.h" @@ -12,7 +12,7 @@ struct ath9k_eeprom_ctx { struct completion complete; struct ath_hw *ah; -@@ -243,6 +248,81 @@ static unsigned int ath9k_reg_rmw(void * +@@ -242,6 +247,81 @@ static unsigned int ath9k_reg_rmw(void * return val; } @@ -94,7 +94,7 @@ /**************************/ /* Initialization */ /**************************/ -@@ -670,6 +750,7 @@ static int ath9k_of_init(struct ath_soft +@@ -626,6 +706,7 @@ static int ath9k_of_init(struct ath_soft struct ath_common *common = ath9k_hw_common(ah); enum ath_bus_type bus_type = common->bus_ops->ath_bus_type; char eeprom_name[100]; @@ -102,7 +102,7 @@ int ret; if (!of_device_is_available(np)) -@@ -677,6 +758,43 @@ static int ath9k_of_init(struct ath_soft +@@ -633,6 +714,43 @@ static int ath9k_of_init(struct ath_soft ath_dbg(common, CONFIG, "parsing configuration from OF node\n"); @@ -146,9 +146,9 @@ if (of_property_read_bool(np, "qca,no-eeprom")) { /* ath9k-eeprom--.bin */ scnprintf(eeprom_name, sizeof(eeprom_name), -@@ -693,6 +811,17 @@ static int ath9k_of_init(struct ath_soft - - of_get_mac_address(np, common->macaddr); +@@ -651,6 +769,17 @@ static int ath9k_of_init(struct ath_soft + if (ret == -EPROBE_DEFER) + return ret; + np = of_get_child_by_name(np, "led"); + if (np && of_device_is_available(np)) { diff --git a/package/kernel/mac80211/patches/ath9k/551-ath9k_ubnt_uap_plus_hsr.patch b/package/kernel/mac80211/patches/ath9k/551-ath9k_ubnt_uap_plus_hsr.patch index 5f32810fe9d..7f826b8a53f 100644 --- a/package/kernel/mac80211/patches/ath9k/551-ath9k_ubnt_uap_plus_hsr.patch +++ b/package/kernel/mac80211/patches/ath9k/551-ath9k_ubnt_uap_plus_hsr.patch @@ -7,7 +7,7 @@ +#include "hsr.h" /* Set/change channels. If the channel is really being changed, it's done - * by reseting the chip. To accomplish this we must first cleanup any pending + * by resetting the chip. To accomplish this we must first cleanup any pending @@ -22,6 +23,7 @@ */ static int ath_set_channel(struct ath_softc *sc) @@ -374,7 +374,7 @@ --- a/local-symbols +++ b/local-symbols -@@ -123,6 +123,7 @@ ATH9K_WOW= +@@ -117,6 +117,7 @@ ATH9K_WOW= ATH9K_RFKILL= ATH9K_CHANNEL_CONTEXT= ATH9K_PCOEM= diff --git a/package/kernel/mac80211/patches/ath9k/552-ath9k-ahb_of.patch b/package/kernel/mac80211/patches/ath9k/552-ath9k-ahb_of.patch index cb92f30aae7..04c821a97ba 100644 --- a/package/kernel/mac80211/patches/ath9k/552-ath9k-ahb_of.patch +++ b/package/kernel/mac80211/patches/ath9k/552-ath9k-ahb_of.patch @@ -1,40 +1,67 @@ --- a/drivers/net/wireless/ath/ath9k/ahb.c +++ b/drivers/net/wireless/ath/ath9k/ahb.c -@@ -20,6 +20,7 @@ +@@ -16,37 +16,21 @@ + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + ++#include ++#include + #include ++#include #include - #include - #include -+#include +-#include +-#include ++ #include "ath9k.h" - static const struct platform_device_id ath9k_platform_id_table[] = { -@@ -69,21 +70,28 @@ static const struct ath_bus_ops ath_ahb_ - .eeprom_read = ath_ahb_eeprom_read, +-static const struct platform_device_id ath9k_platform_id_table[] = { +- { +- .name = "ath9k", +- .driver_data = AR5416_AR9100_DEVID, +- }, +- { +- .name = "ar933x_wmac", +- .driver_data = AR9300_DEVID_AR9330, +- }, +- { +- .name = "ar934x_wmac", +- .driver_data = AR9300_DEVID_AR9340, +- }, +- { +- .name = "qca955x_wmac", +- .driver_data = AR9300_DEVID_QCA955X, +- }, +- { +- .name = "qca953x_wmac", +- .driver_data = AR9300_DEVID_AR953X, +- }, +- { +- .name = "qca956x_wmac", +- .driver_data = AR9300_DEVID_QCA956X, +- }, ++static const struct of_device_id ath9k_of_match_table[] = { ++ { .compatible = "qca,ar9130-wifi", .data = (void *)AR5416_AR9100_DEVID }, ++ { .compatible = "qca,ar9330-wifi", .data = (void *)AR9300_DEVID_AR9330 }, ++ { .compatible = "qca,ar9340-wifi", .data = (void *)AR9300_DEVID_AR9340 }, ++ { .compatible = "qca,qca9530-wifi", .data = (void *)AR9300_DEVID_AR953X }, ++ { .compatible = "qca,qca9550-wifi", .data = (void *)AR9300_DEVID_QCA955X }, ++ { .compatible = "qca,qca9560-wifi", .data = (void *)AR9300_DEVID_QCA956X }, + {}, }; -+const struct of_device_id of_ath_ahb_match[] = { -+ { .compatible = "qca,ar9130-wmac", .data = (void *)AR5416_AR9100_DEVID }, -+ { .compatible = "qca,ar9330-wmac", .data = (void *)AR9300_DEVID_AR9330 }, -+ { .compatible = "qca,ar9340-wmac", .data = (void *)AR9300_DEVID_AR9340 }, -+ { .compatible = "qca,qca9530-wmac", .data = (void *)AR9300_DEVID_AR953X }, -+ { .compatible = "qca,qca9550-wmac", .data = (void *)AR9300_DEVID_QCA955X }, -+ { .compatible = "qca,qca9560-wmac", .data = (void *)AR9300_DEVID_QCA956X }, -+ {}, -+}; -+MODULE_DEVICE_TABLE(of, of_ath_ahb_match); -+ +@@ -71,19 +55,14 @@ static const struct ath_bus_ops ath_ahb_ + static int ath_ahb_probe(struct platform_device *pdev) { - void __iomem *mem; - struct ath_softc *sc; -+ const struct of_device_id *match; struct ieee80211_hw *hw; - const struct platform_device_id *id = platform_get_device_id(pdev); - int irq; - int ret = 0; + struct ath_softc *sc; -+ void __iomem *mem; struct ath_hw *ah; ++ void __iomem *mem; char hw_name[64]; - - if (!dev_get_platdata(&pdev->dev)) { @@ -47,22 +74,27 @@ mem = devm_platform_ioremap_resource(pdev, 0); if (IS_ERR(mem)) { -@@ -117,7 +125,9 @@ static int ath_ahb_probe(struct platform +@@ -117,7 +96,8 @@ static int ath_ahb_probe(struct platform goto err_free_hw; } - ret = ath9k_init_device(id->driver_data, sc, &ath_ahb_bus_ops); -+ match = of_match_device(of_ath_ahb_match, &pdev->dev); -+ dev_id = (uintptr_t)match->data; ++ dev_id = (u16)(kernel_ulong_t)of_device_get_match_data(&pdev->dev); + ret = ath9k_init_device(dev_id, sc, &ath_ahb_bus_ops); if (ret) { dev_err(&pdev->dev, "failed to initialize device\n"); goto err_irq; -@@ -155,6 +165,7 @@ static struct platform_driver ath_ahb_dr - .remove_new = ath_ahb_remove, - .driver = { - .name = "ath9k", -+ .of_match_table = of_ath_ahb_match, +@@ -167,11 +147,11 @@ static struct platform_driver ath_ahb_dr + + .driver = { + .name = "ath9k", ++ .of_match_table = ath9k_of_match_table, }, - .id_table = ath9k_platform_id_table, +- .id_table = ath9k_platform_id_table, }; + +-MODULE_DEVICE_TABLE(platform, ath9k_platform_id_table); ++MODULE_DEVICE_TABLE(of, ath9k_of_match_table); + + int ath_ahb_init(void) + { diff --git a/package/kernel/mac80211/patches/brcm/860-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch b/package/kernel/mac80211/patches/brcm/860-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch index 84b989d8589..fe471923d21 100644 --- a/package/kernel/mac80211/patches/brcm/860-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch +++ b/package/kernel/mac80211/patches/brcm/860-brcmfmac-workaround-bug-with-some-inconsistent-BSSes.patch @@ -10,7 +10,7 @@ Signed-off-by: Rafał Miłecki --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -980,8 +980,36 @@ static struct wireless_dev *brcmf_cfg802 +@@ -984,8 +984,36 @@ static struct wireless_dev *brcmf_cfg802 struct brcmf_cfg80211_info *cfg = wiphy_to_cfg(wiphy); struct brcmf_pub *drvr = cfg->pub; struct wireless_dev *wdev; diff --git a/package/kernel/mac80211/patches/brcm/861-brcmfmac-add-in-driver-tables-with-country-codes.patch b/package/kernel/mac80211/patches/brcm/861-brcmfmac-add-in-driver-tables-with-country-codes.patch index 1f0609e3488..2f07212c56b 100644 --- a/package/kernel/mac80211/patches/brcm/861-brcmfmac-add-in-driver-tables-with-country-codes.patch +++ b/package/kernel/mac80211/patches/brcm/861-brcmfmac-add-in-driver-tables-with-country-codes.patch @@ -12,7 +12,7 @@ Signed-off-by: Rafał Miłecki --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/of.c -@@ -65,6 +65,36 @@ static int brcmf_of_get_country_codes(st +@@ -66,6 +66,36 @@ static int brcmf_of_get_country_codes(st return 0; } @@ -46,15 +46,15 @@ Signed-off-by: Rafał Miłecki + } +} + - void brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type, - struct brcmf_mp_device *settings) + int brcmf_of_probe(struct device *dev, enum brcmf_bus_type bus_type, + struct brcmf_mp_device *settings) { -@@ -113,6 +143,8 @@ void brcmf_of_probe(struct device *dev, - } - of_node_put(root); +@@ -121,6 +151,8 @@ int brcmf_of_probe(struct device *dev, e + + brcmf_dbg(INFO, "%s LPO clock\n", clk ? "enable" : "no"); + brcmf_of_probe_cc(dev, settings); + if (!np || !of_device_is_compatible(np, "brcm,bcm4329-fmac")) - return; + return 0; diff --git a/package/kernel/mac80211/patches/brcm/870-02-rpi-6.12-brcmfmac-Prefer-a-ccode-from-OTP-over-nvram-file.patch b/package/kernel/mac80211/patches/brcm/870-02-rpi-6.12-brcmfmac-Prefer-a-ccode-from-OTP-over-nvram-file.patch index 9a7f9eb2664..b9907f61296 100644 --- a/package/kernel/mac80211/patches/brcm/870-02-rpi-6.12-brcmfmac-Prefer-a-ccode-from-OTP-over-nvram-file.patch +++ b/package/kernel/mac80211/patches/brcm/870-02-rpi-6.12-brcmfmac-Prefer-a-ccode-from-OTP-over-nvram-file.patch @@ -22,7 +22,7 @@ Signed-off-by: Phil Elwell #include #include #include -@@ -8212,31 +8213,45 @@ static void brcmf_cfg80211_reg_notifier( +@@ -8215,31 +8216,45 @@ static void brcmf_cfg80211_reg_notifier( struct brcmf_if *ifp = brcmf_get_ifp(cfg->pub, 0); struct brcmf_pub *drvr = cfg->pub; struct brcmf_fil_country_le ccreq; diff --git a/package/kernel/mac80211/patches/brcm/870-03-rpi-6.12-brcmfmac-Increase-power-saving-delay-to-2s.patch b/package/kernel/mac80211/patches/brcm/870-03-rpi-6.12-brcmfmac-Increase-power-saving-delay-to-2s.patch index f197e890265..a05171be48d 100644 --- a/package/kernel/mac80211/patches/brcm/870-03-rpi-6.12-brcmfmac-Increase-power-saving-delay-to-2s.patch +++ b/package/kernel/mac80211/patches/brcm/870-03-rpi-6.12-brcmfmac-Increase-power-saving-delay-to-2s.patch @@ -14,7 +14,7 @@ Signed-off-by: Phil Elwell --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -3338,6 +3338,7 @@ brcmf_cfg80211_set_power_mgmt(struct wip +@@ -3342,6 +3342,7 @@ brcmf_cfg80211_set_power_mgmt(struct wip bphy_err(drvr, "error (%d)\n", err); } diff --git a/package/kernel/mac80211/patches/brcm/870-04-rpi-6.12-brcmfmac-non-upstream-support-DS1-exit-firmware-re-download.patch b/package/kernel/mac80211/patches/brcm/870-04-rpi-6.12-brcmfmac-non-upstream-support-DS1-exit-firmware-re-download.patch index 1e2016bcade..54cf073229a 100644 --- a/package/kernel/mac80211/patches/brcm/870-04-rpi-6.12-brcmfmac-non-upstream-support-DS1-exit-firmware-re-download.patch +++ b/package/kernel/mac80211/patches/brcm/870-04-rpi-6.12-brcmfmac-non-upstream-support-DS1-exit-firmware-re-download.patch @@ -112,7 +112,7 @@ JIRA: SWWLAN-136577 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; } @@ -121,7 +121,7 @@ JIRA: SWWLAN-136577 { 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); @@ -205,7 +205,7 @@ JIRA: SWWLAN-136577 void *data); --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c -@@ -2207,7 +2207,7 @@ static void brcmf_pcie_setup(struct devi +@@ -2210,7 +2210,7 @@ static void brcmf_pcie_setup(struct devi init_waitqueue_head(&devinfo->mbdata_resp_wait); @@ -482,7 +482,7 @@ JIRA: SWWLAN-136577 bus->tx_hdrlen = SDPCM_HWHDR_LEN + SDPCM_SWHDR_LEN; if (sdiodev->sg_support) { bus->txglom = false; -@@ -4215,7 +4413,7 @@ static void brcmf_sdio_firmware_callback +@@ -4217,7 +4415,7 @@ static void brcmf_sdio_firmware_callback u8 saveclk, bpreq; u8 devctl; @@ -491,7 +491,7 @@ JIRA: SWWLAN-136577 if (err) goto fail; -@@ -4392,12 +4590,25 @@ static void brcmf_sdio_firmware_callback +@@ -4394,12 +4592,25 @@ static void brcmf_sdio_firmware_callback } /* Attach to the common layer, reserve hdr space */ @@ -518,7 +518,7 @@ JIRA: SWWLAN-136577 /* ready */ return; -@@ -4640,3 +4851,40 @@ int brcmf_sdio_sleep(struct brcmf_sdio * +@@ -4646,3 +4857,40 @@ int brcmf_sdio_sleep(struct brcmf_sdio * return ret; } @@ -692,7 +692,7 @@ JIRA: SWWLAN-136577 #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 */ @@ -701,7 +701,7 @@ JIRA: SWWLAN-136577 if (ret) goto error; -@@ -1277,7 +1277,7 @@ static int brcmf_usb_probe_cb(struct brc +@@ -1282,7 +1282,7 @@ static int brcmf_usb_probe_cb(struct brc ret = brcmf_alloc(devinfo->dev, devinfo->settings); if (ret) goto fail; diff --git a/package/kernel/mac80211/patches/brcm/870-05-rpi-6.12-brcmfmac-Fix-interoperating-DPP-and-other-encryption.patch b/package/kernel/mac80211/patches/brcm/870-05-rpi-6.12-brcmfmac-Fix-interoperating-DPP-and-other-encryption.patch index 080ce2bb865..285eb99fac1 100644 --- a/package/kernel/mac80211/patches/brcm/870-05-rpi-6.12-brcmfmac-Fix-interoperating-DPP-and-other-encryption.patch +++ b/package/kernel/mac80211/patches/brcm/870-05-rpi-6.12-brcmfmac-Fix-interoperating-DPP-and-other-encryption.patch @@ -25,7 +25,7 @@ Signed-off-by: Chi-hsien Lin --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -2491,43 +2491,50 @@ brcmf_cfg80211_connect(struct wiphy *wip +@@ -2495,43 +2495,50 @@ brcmf_cfg80211_connect(struct wiphy *wip goto done; } diff --git a/package/kernel/mac80211/patches/brcm/871-brcmfmac-disable-dump_survey-on-bcm2835.patch b/package/kernel/mac80211/patches/brcm/871-brcmfmac-disable-dump_survey-on-bcm2835.patch index 0dd0d11c18a..be9e39e71af 100644 --- a/package/kernel/mac80211/patches/brcm/871-brcmfmac-disable-dump_survey-on-bcm2835.patch +++ b/package/kernel/mac80211/patches/brcm/871-brcmfmac-disable-dump_survey-on-bcm2835.patch @@ -9,7 +9,7 @@ Signed-off-by: Álvaro Fernández Rojas --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c -@@ -7991,6 +7991,7 @@ static s32 brcmf_translate_country_code( +@@ -7994,6 +7994,7 @@ static s32 brcmf_translate_country_code( return 0; } @@ -17,7 +17,7 @@ Signed-off-by: Álvaro Fernández Rojas static int brcmf_parse_dump_obss(char *buf, struct brcmf_dump_survey *survey) { -@@ -8213,6 +8214,7 @@ exit: +@@ -8216,6 +8217,7 @@ exit: brcmf_set_mpc(ifp, 1); return err; } @@ -25,7 +25,7 @@ Signed-off-by: Álvaro Fernández Rojas static void brcmf_cfg80211_reg_notifier(struct wiphy *wiphy, struct regulatory_request *req) -@@ -8379,8 +8381,10 @@ struct brcmf_cfg80211_info *brcmf_cfg802 +@@ -8382,8 +8384,10 @@ struct brcmf_cfg80211_info *brcmf_cfg802 if (brcmf_feat_is_enabled(ifp, BRCMF_FEAT_WOWL_GTK)) ops->set_rekey_data = brcmf_cfg80211_set_rekey_data; #endif diff --git a/package/kernel/mac80211/patches/build/100-backports-drop-QRTR-and-MHI.patch b/package/kernel/mac80211/patches/build/100-backports-drop-QRTR-and-MHI.patch index f4dc5508b11..52060f434b6 100644 --- a/package/kernel/mac80211/patches/build/100-backports-drop-QRTR-and-MHI.patch +++ b/package/kernel/mac80211/patches/build/100-backports-drop-QRTR-and-MHI.patch @@ -59,7 +59,7 @@ Signed-off-by: Robert Marko This module adds support for PCIE bus --- a/local-symbols +++ b/local-symbols -@@ -59,14 +59,6 @@ MAC80211_MESH_PS_DEBUG= +@@ -53,14 +53,6 @@ MAC80211_MESH_PS_DEBUG= MAC80211_TDLS_DEBUG= MAC80211_DEBUG_COUNTERS= MAC80211_STA_HASH_MAX_SIZE= diff --git a/package/kernel/mac80211/patches/build/110-backport-include-fix-linux-acpi_amd_wbrf.h-inclusion.patch b/package/kernel/mac80211/patches/build/110-backport-include-fix-linux-acpi_amd_wbrf.h-inclusion.patch deleted file mode 100644 index d8d3783ed60..00000000000 --- a/package/kernel/mac80211/patches/build/110-backport-include-fix-linux-acpi_amd_wbrf.h-inclusion.patch +++ /dev/null @@ -1,32 +0,0 @@ -From: Felix Fietkau -Date: Tue, 14 Jan 2025 11:42:25 +0100 -Subject: [PATCH] backport-include: fix linux/acpi_amd_wbrf.h inclusion - -Fix building for kernel >= 6.8 by adjusting incorrect guard usage, -otherwise an #include_next header is masked and compilation will fail -for net/mac80211/wbrf.c in the mac80211 kernel module. - -Fixes: 52cdcaab ("backport-include: backport linux/acpi_amd_wbrf.h") -Reported-by: Tony Ambardar -Signed-off-by: Felix Fietkau ---- - ---- a/backport-include/linux/acpi_amd_wbrf.h -+++ b/backport-include/linux/acpi_amd_wbrf.h -@@ -4,8 +4,8 @@ - * Copyright (C) 2023 Advanced Micro Devices - */ - --#ifndef _ACPI_AMD_WBRF_H --#define _ACPI_AMD_WBRF_H -+#ifndef __BACKPORT_ACPI_AMD_WBRF_H -+#define __BACKPORT_ACPI_AMD_WBRF_H - - #if LINUX_VERSION_IS_GEQ(6,8,0) - #include_next -@@ -83,4 +83,4 @@ int amd_wbrf_unregister_notifier(struct - } - - #endif /* >=6,8,0 */ --#endif /* _ACPI_AMD_WBRF_H */ -+#endif /* __BACKPORT_ACPI_AMD_WBRF_H */ diff --git a/package/kernel/mac80211/patches/build/210-wireless_netns_local_backport.patch b/package/kernel/mac80211/patches/build/210-wireless_netns_local_backport.patch index 9b0e95e8453..031cc183ca2 100644 --- a/package/kernel/mac80211/patches/build/210-wireless_netns_local_backport.patch +++ b/package/kernel/mac80211/patches/build/210-wireless_netns_local_backport.patch @@ -1,6 +1,6 @@ --- a/net/wireless/core.c +++ b/net/wireless/core.c -@@ -165,11 +165,15 @@ int cfg80211_switch_netns(struct cfg8021 +@@ -162,11 +162,15 @@ int cfg80211_switch_netns(struct cfg8021 list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) { if (!wdev->netdev) continue; @@ -16,7 +16,7 @@ } if (err) { -@@ -181,11 +185,15 @@ int cfg80211_switch_netns(struct cfg8021 +@@ -178,11 +182,15 @@ int cfg80211_switch_netns(struct cfg8021 list) { if (!wdev->netdev) continue; @@ -32,7 +32,7 @@ } return err; -@@ -1518,7 +1526,9 @@ static int cfg80211_netdev_notifier_call +@@ -1520,7 +1528,9 @@ static int cfg80211_netdev_notifier_call SET_NETDEV_DEVTYPE(dev, &wiphy_type); wdev->netdev = dev; /* can only change netns with wiphy */ diff --git a/package/kernel/mac80211/patches/build/220-brcmfmac_usb_driver_backport.patch b/package/kernel/mac80211/patches/build/220-brcmfmac_usb_driver_backport.patch index 25dab469054..1a093a77d9a 100644 --- a/package/kernel/mac80211/patches/build/220-brcmfmac_usb_driver_backport.patch +++ b/package/kernel/mac80211/patches/build/220-brcmfmac_usb_driver_backport.patch @@ -1,6 +1,6 @@ --- 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 +@@ -1579,7 +1579,11 @@ static int brcmf_usb_reset_device(struct void brcmf_usb_exit(void) { diff --git a/package/kernel/mac80211/patches/build/230-fix-init_vqs-build-error-on-kernel-6.6.patch b/package/kernel/mac80211/patches/build/230-fix-init_vqs-build-error-on-kernel-6.6.patch index 4b0fe6003f6..73a082a10c1 100644 --- a/package/kernel/mac80211/patches/build/230-fix-init_vqs-build-error-on-kernel-6.6.patch +++ b/package/kernel/mac80211/patches/build/230-fix-init_vqs-build-error-on-kernel-6.6.patch @@ -1,6 +1,6 @@ --- 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 +@@ -6670,6 +6670,7 @@ static void hwsim_virtio_rx_done(struct static int init_vqs(struct virtio_device *vdev) { @@ -8,7 +8,7 @@ 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 +@@ -6677,6 +6678,19 @@ static int init_vqs(struct virtio_device return virtio_find_vqs(vdev, HWSIM_NUM_VQS, hwsim_vqs, vqs_info, NULL); diff --git a/package/kernel/mac80211/patches/build/240-realtek-rtw88-BH-workqueue.patch b/package/kernel/mac80211/patches/build/240-realtek-rtw88-BH-workqueue.patch new file mode 100644 index 00000000000..0fb34e83cba --- /dev/null +++ b/package/kernel/mac80211/patches/build/240-realtek-rtw88-BH-workqueue.patch @@ -0,0 +1,14 @@ +--- a/drivers/net/wireless/realtek/rtw88/usb.c ++++ b/drivers/net/wireless/realtek/rtw88/usb.c +@@ -909,7 +909,11 @@ static int rtw_usb_init_rx(struct rtw_de + struct sk_buff *rx_skb; + int i; + ++#if LINUX_VERSION_IS_GEQ(6,9,0) + rtwusb->rxwq = alloc_workqueue("rtw88_usb: rx wq", WQ_BH, 0); ++#else ++ rtwusb->rxwq = create_singlethread_workqueue("rtw88_usb: rx wq"); ++#endif + if (!rtwusb->rxwq) { + rtw_err(rtwdev, "failed to create RX work queue\n"); + return -ENOMEM; diff --git a/package/kernel/mac80211/patches/build/360-change-read_new-to-read.patch b/package/kernel/mac80211/patches/build/360-change-read_new-to-read.patch new file mode 100644 index 00000000000..6387a8990f5 --- /dev/null +++ b/package/kernel/mac80211/patches/build/360-change-read_new-to-read.patch @@ -0,0 +1,20 @@ +--- a/drivers/net/wireless/ti/wlcore/sysfs.c ++++ b/drivers/net/wireless/ti/wlcore/sysfs.c +@@ -88,7 +88,7 @@ static ssize_t hw_pg_ver_show(struct dev + static DEVICE_ATTR_RO(hw_pg_ver); + + static ssize_t wl1271_sysfs_read_fwlog(struct file *filp, struct kobject *kobj, +- const struct bin_attribute *bin_attr, ++ struct bin_attribute *bin_attr, + char *buffer, loff_t pos, size_t count) + { + struct device *dev = kobj_to_dev(kobj); +@@ -121,7 +121,7 @@ static ssize_t wl1271_sysfs_read_fwlog(s + + static const struct bin_attribute fwlog_attr = { + .attr = { .name = "fwlog", .mode = 0400 }, +- .read_new = wl1271_sysfs_read_fwlog, ++ .read = wl1271_sysfs_read_fwlog, + }; + + int wlcore_sysfs_init(struct wl1271 *wl) diff --git a/package/kernel/mac80211/patches/build/400-restore-old-debugfs_fops.patch b/package/kernel/mac80211/patches/build/400-restore-old-debugfs_fops.patch new file mode 100644 index 00000000000..14a707b7ef5 --- /dev/null +++ b/package/kernel/mac80211/patches/build/400-restore-old-debugfs_fops.patch @@ -0,0 +1,252 @@ +--- a/drivers/net/wireless/ath/carl9170/debug.c ++++ b/drivers/net/wireless/ath/carl9170/debug.c +@@ -54,6 +54,7 @@ struct carl9170_debugfs_fops { + char *(*read)(struct ar9170 *ar, char *buf, size_t bufsize, + ssize_t *len); + ssize_t (*write)(struct ar9170 *aru, const char *buf, size_t size); ++ const struct file_operations fops; + + enum carl9170_device_state req_dev_state; + }; +@@ -61,7 +62,7 @@ struct carl9170_debugfs_fops { + static ssize_t carl9170_debugfs_read(struct file *file, char __user *userbuf, + size_t count, loff_t *ppos) + { +- const struct carl9170_debugfs_fops *dfops; ++ struct carl9170_debugfs_fops *dfops; + struct ar9170 *ar; + char *buf = NULL, *res_buf = NULL; + ssize_t ret = 0; +@@ -74,7 +75,8 @@ static ssize_t carl9170_debugfs_read(str + + if (!ar) + return -ENODEV; +- dfops = debugfs_get_aux(file); ++ dfops = container_of(debugfs_real_fops(file), ++ struct carl9170_debugfs_fops, fops); + + if (!dfops->read) + return -ENOSYS; +@@ -111,7 +113,7 @@ out_free: + static ssize_t carl9170_debugfs_write(struct file *file, + const char __user *userbuf, size_t count, loff_t *ppos) + { +- const struct carl9170_debugfs_fops *dfops; ++ struct carl9170_debugfs_fops *dfops; + struct ar9170 *ar; + char *buf = NULL; + int err = 0; +@@ -126,7 +128,8 @@ static ssize_t carl9170_debugfs_write(st + + if (!ar) + return -ENODEV; +- dfops = debugfs_get_aux(file); ++ dfops = container_of(debugfs_real_fops(file), ++ struct carl9170_debugfs_fops, fops); + + if (!dfops->write) + return -ENOSYS; +@@ -162,11 +165,6 @@ out_free: + return err; + } + +-static struct debugfs_short_fops debugfs_fops = { +- .read = carl9170_debugfs_read, +- .write = carl9170_debugfs_write, +-}; +- + #define __DEBUGFS_DECLARE_FILE(name, _read, _write, _read_bufsize, \ + _attr, _dstate) \ + static const struct carl9170_debugfs_fops carl_debugfs_##name ##_ops = {\ +@@ -175,6 +173,12 @@ static const struct carl9170_debugfs_fop + .write = _write, \ + .attr = _attr, \ + .req_dev_state = _dstate, \ ++ .fops = { \ ++ .open = simple_open, \ ++ .read = carl9170_debugfs_read, \ ++ .write = carl9170_debugfs_write, \ ++ .owner = THIS_MODULE \ ++ }, \ + } + + #define DEBUGFS_DECLARE_FILE(name, _read, _write, _read_bufsize, _attr) \ +@@ -812,9 +816,9 @@ void carl9170_debugfs_register(struct ar + ar->hw->wiphy->debugfsdir); + + #define DEBUGFS_ADD(name) \ +- debugfs_create_file_aux(#name, carl_debugfs_##name ##_ops.attr, \ +- ar->debug_dir, ar, &carl_debugfs_##name ## _ops, \ +- &debugfs_fops) ++ debugfs_create_file(#name, carl_debugfs_##name ##_ops.attr, \ ++ ar->debug_dir, ar, \ ++ &carl_debugfs_##name ## _ops.fops) + + DEBUGFS_ADD(usb_tx_anch_urbs); + DEBUGFS_ADD(usb_rx_pool_urbs); +--- a/drivers/net/wireless/broadcom/b43/debugfs.c ++++ b/drivers/net/wireless/broadcom/b43/debugfs.c +@@ -30,6 +30,7 @@ static struct dentry *rootdir; + struct b43_debugfs_fops { + ssize_t (*read)(struct b43_wldev *dev, char *buf, size_t bufsize); + int (*write)(struct b43_wldev *dev, const char *buf, size_t count); ++ struct file_operations fops; + /* Offset of struct b43_dfs_file in struct b43_dfsentry */ + size_t file_struct_offset; + }; +@@ -490,7 +491,7 @@ static ssize_t b43_debugfs_read(struct f + size_t count, loff_t *ppos) + { + struct b43_wldev *dev; +- const struct b43_debugfs_fops *dfops; ++ struct b43_debugfs_fops *dfops; + struct b43_dfs_file *dfile; + ssize_t ret; + char *buf; +@@ -510,7 +511,8 @@ static ssize_t b43_debugfs_read(struct f + goto out_unlock; + } + +- dfops = debugfs_get_aux(file); ++ dfops = container_of(debugfs_real_fops(file), ++ struct b43_debugfs_fops, fops); + if (!dfops->read) { + err = -ENOSYS; + goto out_unlock; +@@ -553,7 +555,7 @@ static ssize_t b43_debugfs_write(struct + size_t count, loff_t *ppos) + { + struct b43_wldev *dev; +- const struct b43_debugfs_fops *dfops; ++ struct b43_debugfs_fops *dfops; + char *buf; + int err = 0; + +@@ -571,7 +573,8 @@ static ssize_t b43_debugfs_write(struct + goto out_unlock; + } + +- dfops = debugfs_get_aux(file); ++ dfops = container_of(debugfs_real_fops(file), ++ struct b43_debugfs_fops, fops); + if (!dfops->write) { + err = -ENOSYS; + goto out_unlock; +@@ -599,16 +602,16 @@ out_unlock: + } + + +-static struct debugfs_short_fops debugfs_ops = { +- .read = b43_debugfs_read, +- .write = b43_debugfs_write, +- .llseek = generic_file_llseek, +-}; +- + #define B43_DEBUGFS_FOPS(name, _read, _write) \ + static struct b43_debugfs_fops fops_##name = { \ + .read = _read, \ + .write = _write, \ ++ .fops = { \ ++ .open = simple_open, \ ++ .read = b43_debugfs_read, \ ++ .write = b43_debugfs_write, \ ++ .llseek = generic_file_llseek, \ ++ }, \ + .file_struct_offset = offsetof(struct b43_dfsentry, \ + file_##name), \ + } +@@ -700,9 +703,9 @@ void b43_debugfs_add_device(struct b43_w + + #define ADD_FILE(name, mode) \ + do { \ +- debugfs_create_file_aux(__stringify(name), \ ++ debugfs_create_file(__stringify(name), \ + mode, e->subdir, dev, \ +- &fops_##name, &debugfs_ops); \ ++ &fops_##name.fops); \ + } while (0) + + +--- a/drivers/net/wireless/broadcom/b43legacy/debugfs.c ++++ b/drivers/net/wireless/broadcom/b43legacy/debugfs.c +@@ -31,6 +31,7 @@ static struct dentry *rootdir; + struct b43legacy_debugfs_fops { + ssize_t (*read)(struct b43legacy_wldev *dev, char *buf, size_t bufsize); + int (*write)(struct b43legacy_wldev *dev, const char *buf, size_t count); ++ struct file_operations fops; + /* Offset of struct b43legacy_dfs_file in struct b43legacy_dfsentry */ + size_t file_struct_offset; + /* Take wl->irq_lock before calling read/write? */ +@@ -187,7 +188,7 @@ static ssize_t b43legacy_debugfs_read(st + size_t count, loff_t *ppos) + { + struct b43legacy_wldev *dev; +- const struct b43legacy_debugfs_fops *dfops; ++ struct b43legacy_debugfs_fops *dfops; + struct b43legacy_dfs_file *dfile; + ssize_t ret; + char *buf; +@@ -207,7 +208,8 @@ static ssize_t b43legacy_debugfs_read(st + goto out_unlock; + } + +- dfops = debugfs_get_aux(file); ++ dfops = container_of(debugfs_real_fops(file), ++ struct b43legacy_debugfs_fops, fops); + if (!dfops->read) { + err = -ENOSYS; + goto out_unlock; +@@ -255,7 +257,7 @@ static ssize_t b43legacy_debugfs_write(s + size_t count, loff_t *ppos) + { + struct b43legacy_wldev *dev; +- const struct b43legacy_debugfs_fops *dfops; ++ struct b43legacy_debugfs_fops *dfops; + char *buf; + int err = 0; + +@@ -273,7 +275,8 @@ static ssize_t b43legacy_debugfs_write(s + goto out_unlock; + } + +- dfops = debugfs_get_aux(file); ++ dfops = container_of(debugfs_real_fops(file), ++ struct b43legacy_debugfs_fops, fops); + if (!dfops->write) { + err = -ENOSYS; + goto out_unlock; +@@ -305,16 +308,17 @@ out_unlock: + return err ? err : count; + } + +-static struct debugfs_short_fops debugfs_ops = { +- .read = b43legacy_debugfs_read, +- .write = b43legacy_debugfs_write, +- .llseek = generic_file_llseek +-}; + + #define B43legacy_DEBUGFS_FOPS(name, _read, _write, _take_irqlock) \ + static struct b43legacy_debugfs_fops fops_##name = { \ + .read = _read, \ + .write = _write, \ ++ .fops = { \ ++ .open = simple_open, \ ++ .read = b43legacy_debugfs_read, \ ++ .write = b43legacy_debugfs_write, \ ++ .llseek = generic_file_llseek, \ ++ }, \ + .file_struct_offset = offsetof(struct b43legacy_dfsentry, \ + file_##name), \ + .take_irqlock = _take_irqlock, \ +@@ -382,9 +386,9 @@ void b43legacy_debugfs_add_device(struct + + #define ADD_FILE(name, mode) \ + do { \ +- debugfs_create_file_aux(__stringify(name), mode, \ ++ debugfs_create_file(__stringify(name), mode, \ + e->subdir, dev, \ +- &fops_##name, &debugfs_ops); \ ++ &fops_##name.fops); \ + } while (0) + + diff --git a/package/kernel/mac80211/patches/build/410-mac80211-convert-short-fops-to-debugfs-files.patch b/package/kernel/mac80211/patches/build/410-mac80211-convert-short-fops-to-debugfs-files.patch new file mode 100644 index 00000000000..dcaa086cf51 --- /dev/null +++ b/package/kernel/mac80211/patches/build/410-mac80211-convert-short-fops-to-debugfs-files.patch @@ -0,0 +1,210 @@ +--- a/net/mac80211/debugfs.c ++++ b/net/mac80211/debugfs.c +@@ -42,8 +42,9 @@ static ssize_t name## _read(struct file + } + + #define DEBUGFS_READONLY_FILE_OPS(name) \ +-static const struct debugfs_short_fops name## _ops = { \ ++static const struct file_operations name## _ops = { \ + .read = name## _read, \ ++ .open = simple_open, \ + .llseek = generic_file_llseek, \ + }; + +@@ -141,9 +142,10 @@ static ssize_t aqm_write(struct file *fi + return -EINVAL; + } + +-static const struct debugfs_short_fops aqm_ops = { ++static const struct file_operations aqm_ops = { + .write = aqm_write, + .read = aqm_read, ++ .open = simple_open, + .llseek = default_llseek, + }; + +@@ -192,9 +194,10 @@ static ssize_t airtime_flags_write(struc + return count; + } + +-static const struct debugfs_short_fops airtime_flags_ops = { ++static const struct file_operations airtime_flags_ops = { + .write = airtime_flags_write, + .read = airtime_flags_read, ++ .open = simple_open, + .llseek = default_llseek, + }; + +@@ -222,8 +225,9 @@ static ssize_t aql_pending_read(struct f + buf, len); + } + +-static const struct debugfs_short_fops aql_pending_ops = { ++static const struct file_operations aql_pending_ops = { + .read = aql_pending_read, ++ .open = simple_open, + .llseek = default_llseek, + }; + +@@ -301,9 +305,10 @@ static ssize_t aql_txq_limit_write(struc + return count; + } + +-static const struct debugfs_short_fops aql_txq_limit_ops = { ++static const struct file_operations aql_txq_limit_ops = { + .write = aql_txq_limit_write, + .read = aql_txq_limit_read, ++ .open = simple_open, + .llseek = default_llseek, + }; + +@@ -350,9 +355,10 @@ static ssize_t aql_enable_write(struct f + return count; + } + +-static const struct debugfs_short_fops aql_enable_ops = { ++static const struct file_operations aql_enable_ops = { + .write = aql_enable_write, + .read = aql_enable_read, ++ .open = simple_open, + .llseek = default_llseek, + }; + +@@ -400,9 +406,10 @@ static ssize_t force_tx_status_write(str + return count; + } + +-static const struct debugfs_short_fops force_tx_status_ops = { ++static const struct file_operations force_tx_status_ops = { + .write = force_tx_status_write, + .read = force_tx_status_read, ++ .open = simple_open, + .llseek = default_llseek, + }; + +@@ -427,8 +434,9 @@ static ssize_t reset_write(struct file * + return count; + } + +-static const struct debugfs_short_fops reset_ops = { ++static const struct file_operations reset_ops = { + .write = reset_write, ++ .open = simple_open, + .llseek = noop_llseek, + }; + #endif +@@ -656,8 +664,9 @@ static ssize_t stats_ ##name## _read(str + print_devstats_##name); \ + } \ + \ +-static const struct debugfs_short_fops stats_ ##name## _ops = { \ ++static const struct file_operations stats_ ##name## _ops = { \ + .read = stats_ ##name## _read, \ ++ .open = simple_open, \ + .llseek = generic_file_llseek, \ + }; + +--- a/net/mac80211/debugfs_key.c ++++ b/net/mac80211/debugfs_key.c +@@ -26,15 +26,17 @@ static ssize_t key_##name##_read(struct + #define KEY_READ_X(name) KEY_READ(name, name, "0x%x\n") + + #define KEY_OPS(name) \ +-static const struct debugfs_short_fops key_ ##name## _ops = { \ ++static const struct file_operations key_ ##name## _ops = { \ + .read = key_##name##_read, \ ++ .open = simple_open, \ + .llseek = generic_file_llseek, \ + } + + #define KEY_OPS_W(name) \ +-static const struct debugfs_short_fops key_ ##name## _ops = { \ ++static const struct file_operations key_ ##name## _ops = { \ + .read = key_##name##_read, \ + .write = key_##name##_write, \ ++ .open = simple_open, \ + .llseek = generic_file_llseek, \ + } + +@@ -47,8 +49,9 @@ static const struct debugfs_short_fops k + #define KEY_CONF_READ_D(name) KEY_CONF_READ(name, "%d\n") + + #define KEY_CONF_OPS(name) \ +-static const struct debugfs_short_fops key_ ##name## _ops = { \ ++static const struct file_operations key_ ##name## _ops = { \ + .read = key_conf_##name##_read, \ ++ .open = simple_open, \ + .llseek = generic_file_llseek, \ + } + +--- a/net/mac80211/debugfs_netdev.c ++++ b/net/mac80211/debugfs_netdev.c +@@ -221,9 +221,10 @@ static ssize_t ieee80211_if_fmt_##name( + } + + #define _IEEE80211_IF_FILE_OPS(name, _read, _write) \ +-static const struct debugfs_short_fops name##_ops = { \ ++static const struct file_operations name##_ops = { \ + .read = (_read), \ + .write = (_write), \ ++ .open = simple_open, \ + .llseek = generic_file_llseek, \ + } + +--- a/net/mac80211/debugfs_sta.c ++++ b/net/mac80211/debugfs_sta.c +@@ -30,15 +30,17 @@ static ssize_t sta_ ##name## _read(struc + #define STA_READ_D(name, field) STA_READ(name, field, "%d\n") + + #define STA_OPS(name) \ +-static const struct debugfs_short_fops sta_ ##name## _ops = { \ ++static const struct file_operations sta_ ##name## _ops = { \ + .read = sta_##name##_read, \ ++ .open = simple_open, \ + .llseek = generic_file_llseek, \ + } + + #define STA_OPS_RW(name) \ +-static const struct debugfs_short_fops sta_ ##name## _ops = { \ ++static const struct file_operations sta_ ##name## _ops = { \ + .read = sta_##name##_read, \ + .write = sta_##name##_write, \ ++ .open = simple_open, \ + .llseek = generic_file_llseek, \ + } + +@@ -448,8 +450,9 @@ STA_OPS_RW(agg_status); + + /* link sta attributes */ + #define LINK_STA_OPS(name) \ +-static const struct debugfs_short_fops link_sta_ ##name## _ops = { \ ++static const struct file_operations link_sta_ ##name## _ops = { \ + .read = link_sta_##name##_read, \ ++ .open = simple_open, \ + .llseek = generic_file_llseek, \ + } + +--- a/net/mac80211/rate.c ++++ b/net/mac80211/rate.c +@@ -249,8 +249,9 @@ static ssize_t rcname_read(struct file * + ref->ops->name, len); + } + +-const struct debugfs_short_fops rcname_ops = { ++const struct file_operations rcname_ops = { + .read = rcname_read, ++ .open = simple_open, + .llseek = default_llseek, + }; + #endif +--- a/net/mac80211/rate.h ++++ b/net/mac80211/rate.h +@@ -62,7 +62,7 @@ static inline void rate_control_add_sta_ + #endif + } + +-extern const struct debugfs_short_fops rcname_ops; ++extern const struct file_operations rcname_ops; + + static inline void rate_control_add_debugfs(struct ieee80211_local *local) + { diff --git a/package/kernel/mac80211/patches/mwl/950-mwifiex-Print-stringified-name-of-command-in-error-l.patch b/package/kernel/mac80211/patches/mwl/950-mwifiex-Print-stringified-name-of-command-in-error-l.patch index 93a213265c6..1a3be12de0c 100644 --- a/package/kernel/mac80211/patches/mwl/950-mwifiex-Print-stringified-name-of-command-in-error-l.patch +++ b/package/kernel/mac80211/patches/mwl/950-mwifiex-Print-stringified-name-of-command-in-error-l.patch @@ -152,7 +152,7 @@ Signed-off-by: Pali Rohár --- a/drivers/net/wireless/marvell/mwifiex/main.h +++ b/drivers/net/wireless/marvell/mwifiex/main.h -@@ -1100,6 +1100,8 @@ void mwifiex_cancel_all_pending_cmd(stru +@@ -1096,6 +1096,8 @@ void mwifiex_cancel_all_pending_cmd(stru void mwifiex_cancel_pending_scan_cmd(struct mwifiex_adapter *adapter); void mwifiex_cancel_scan(struct mwifiex_adapter *adapter); diff --git a/package/kernel/mac80211/patches/rt2x00/602-01-wifi-rt2x00-Add-support-for-loading-EEPROM-from-user.patch b/package/kernel/mac80211/patches/rt2x00/602-01-wifi-rt2x00-Add-support-for-loading-EEPROM-from-user.patch index cc3aa566185..957da81d054 100644 --- a/package/kernel/mac80211/patches/rt2x00/602-01-wifi-rt2x00-Add-support-for-loading-EEPROM-from-user.patch +++ b/package/kernel/mac80211/patches/rt2x00/602-01-wifi-rt2x00-Add-support-for-loading-EEPROM-from-user.patch @@ -21,7 +21,7 @@ Signed-off-by: Christian Marangi --- a/local-symbols +++ b/local-symbols -@@ -339,6 +339,7 @@ RT2X00_LIB_FIRMWARE= +@@ -334,6 +334,7 @@ RT2X00_LIB_FIRMWARE= RT2X00_LIB_CRYPTO= RT2X00_LIB_LEDS= RT2X00_LIB_DEBUGFS= diff --git a/package/kernel/mac80211/patches/rt2x00/609-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch b/package/kernel/mac80211/patches/rt2x00/609-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch index de2cf2dca73..570b18d4422 100644 --- a/package/kernel/mac80211/patches/rt2x00/609-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch +++ b/package/kernel/mac80211/patches/rt2x00/609-rt2x00-make-wmac-loadable-via-OF-on-rt288x-305x-SoC.patch @@ -13,10 +13,11 @@ Signed-off-by: John Crispin --- a/drivers/net/wireless/ralink/rt2x00/rt2800soc.c +++ b/drivers/net/wireless/ralink/rt2x00/rt2800soc.c -@@ -230,10 +230,17 @@ static int rt2800soc_probe(struct platfo - return rt2x00soc_probe(pdev, &rt2800soc_ops); +@@ -237,10 +237,18 @@ static int bp_rt2x00soc_remove(struct pl + return 0; } - + #endif ++ +static const struct of_device_id rt2880_wmac_match[] = { + { .compatible = "ralink,rt2880-wmac" }, + {}, @@ -30,4 +31,4 @@ Signed-off-by: John Crispin + .of_match_table = rt2880_wmac_match, }, .probe = rt2800soc_probe, - .remove = rt2x00soc_remove, + #if LINUX_VERSION_IS_GEQ(6,11,0) diff --git a/package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch b/package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch index 4a819039da0..3adf74faa2d 100644 --- a/package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch +++ b/package/kernel/mac80211/patches/rt2x00/610-rt2x00-change-led-polarity-from-OF.patch @@ -8,7 +8,7 @@ #include "rt2x00.h" #include "rt2800lib.h" -@@ -11282,6 +11283,17 @@ static int rt2800_init_eeprom(struct rt2 +@@ -11276,6 +11277,17 @@ static int rt2800_init_eeprom(struct rt2 rt2800_init_led(rt2x00dev, &rt2x00dev->led_assoc, LED_TYPE_ASSOC); rt2800_init_led(rt2x00dev, &rt2x00dev->led_qual, LED_TYPE_QUALITY); diff --git a/package/kernel/mac80211/patches/rt2x00/620-01-rt2x00-respect-rt2800-hardware-TX-queue-index.patch b/package/kernel/mac80211/patches/rt2x00/620-01-rt2x00-respect-rt2800-hardware-TX-queue-index.patch index e2c75979dfe..1d88ac7c60c 100644 --- a/package/kernel/mac80211/patches/rt2x00/620-01-rt2x00-respect-rt2800-hardware-TX-queue-index.patch +++ b/package/kernel/mac80211/patches/rt2x00/620-01-rt2x00-respect-rt2800-hardware-TX-queue-index.patch @@ -114,7 +114,7 @@ Signed-off-by: Shiji Yang queue = rt2x00queue_get_tx_queue(rt2x00dev, qid); if (unlikely(rt2x00queue_empty(queue))) { -@@ -12188,8 +12197,9 @@ int rt2800_conf_tx(struct ieee80211_hw * +@@ -12182,8 +12191,9 @@ int rt2800_conf_tx(struct ieee80211_hw * queue = rt2x00queue_get_tx_queue(rt2x00dev, queue_idx); /* Update WMM TXOP register */ @@ -126,7 +126,7 @@ Signed-off-by: Shiji Yang field.bit_mask = 0xffff << field.bit_offset; reg = rt2800_register_read(rt2x00dev, offset); -@@ -12197,7 +12207,7 @@ int rt2800_conf_tx(struct ieee80211_hw * +@@ -12191,7 +12201,7 @@ int rt2800_conf_tx(struct ieee80211_hw * rt2800_register_write(rt2x00dev, offset, reg); /* Update WMM registers */ @@ -135,7 +135,7 @@ Signed-off-by: Shiji Yang field.bit_mask = 0xf << field.bit_offset; reg = rt2800_register_read(rt2x00dev, WMM_AIFSN_CFG); -@@ -12213,7 +12223,7 @@ int rt2800_conf_tx(struct ieee80211_hw * +@@ -12207,7 +12217,7 @@ int rt2800_conf_tx(struct ieee80211_hw * rt2800_register_write(rt2x00dev, WMM_CWMAX_CFG, reg); /* Update EDCA registers */ diff --git a/package/kernel/mac80211/patches/rt2x00/621-01-rt2x00-always-calibrate-MT7620-when-switching-channe.patch b/package/kernel/mac80211/patches/rt2x00/621-01-rt2x00-always-calibrate-MT7620-when-switching-channe.patch index e66fbd43694..01ae04e6e21 100644 --- a/package/kernel/mac80211/patches/rt2x00/621-01-rt2x00-always-calibrate-MT7620-when-switching-channe.patch +++ b/package/kernel/mac80211/patches/rt2x00/621-01-rt2x00-always-calibrate-MT7620-when-switching-channe.patch @@ -42,7 +42,7 @@ Signed-off-by: Shiji Yang } if (flags & IEEE80211_CONF_CHANGE_POWER) rt2800_config_txpower(rt2x00dev, libconf->conf->chandef.chan, -@@ -10427,15 +10438,19 @@ static void rt2800_restore_rf_bbp_rt6352 +@@ -10421,15 +10432,19 @@ static void rt2800_restore_rf_bbp_rt6352 } } @@ -65,7 +65,7 @@ Signed-off-by: Shiji Yang rt2800_rf_self_txdc_cal(rt2x00dev); rt2800_rxdcoc_calibration(rt2x00dev); rt2800_bw_filter_calibration(rt2x00dev, true); -@@ -10766,9 +10781,6 @@ static void rt2800_init_rfcsr_6352(struc +@@ -10760,9 +10775,6 @@ static void rt2800_init_rfcsr_6352(struc rt2800_rfcsr_write_dccal(rt2x00dev, 5, 0x00); rt2800_rfcsr_write_dccal(rt2x00dev, 17, 0x7C); diff --git a/package/kernel/mac80211/patches/rt2x00/621-04-rt2x00-fix-register-operation-on-RXIQ-calibration.patch b/package/kernel/mac80211/patches/rt2x00/621-04-rt2x00-fix-register-operation-on-RXIQ-calibration.patch index aa6f9c437c6..0e0245e4920 100644 --- a/package/kernel/mac80211/patches/rt2x00/621-04-rt2x00-fix-register-operation-on-RXIQ-calibration.patch +++ b/package/kernel/mac80211/patches/rt2x00/621-04-rt2x00-fix-register-operation-on-RXIQ-calibration.patch @@ -24,37 +24,3 @@ Signed-off-by: Shiji Yang rt2800_bbp_write(rt2x00dev, 4, bbpval); bbpval = rt2800_bbp_read(rt2x00dev, 21); -@@ -8928,13 +8928,13 @@ static void rt2800_rxiq_calibration(stru - for (ch_idx = 0; ch_idx < 2; ch_idx = ch_idx + 1) { - if (ch_idx == 0) { - rfval = rfb0r1 & (~0x3); -- rfval = rfb0r1 | 0x1; -+ rfval = rfval | 0x1; - rt2800_rfcsr_write_bank(rt2x00dev, 0, 1, rfval); - rfval = rfb0r2 & (~0x33); -- rfval = rfb0r2 | 0x11; -+ rfval = rfval | 0x11; - rt2800_rfcsr_write_bank(rt2x00dev, 0, 2, rfval); - rfval = rfb0r42 & (~0x50); -- rfval = rfb0r42 | 0x10; -+ rfval = rfval | 0x10; - rt2800_rfcsr_write_bank(rt2x00dev, 0, 42, rfval); - - rt2800_register_write(rt2x00dev, RF_CONTROL0, 0x00001006); -@@ -8947,13 +8947,13 @@ static void rt2800_rxiq_calibration(stru - rt2800_bbp_dcoc_write(rt2x00dev, 1, 0x00); - } else { - rfval = rfb0r1 & (~0x3); -- rfval = rfb0r1 | 0x2; -+ rfval = rfval | 0x2; - rt2800_rfcsr_write_bank(rt2x00dev, 0, 1, rfval); - rfval = rfb0r2 & (~0x33); -- rfval = rfb0r2 | 0x22; -+ rfval = rfval | 0x22; - rt2800_rfcsr_write_bank(rt2x00dev, 0, 2, rfval); - rfval = rfb0r42 & (~0x50); -- rfval = rfb0r42 | 0x40; -+ rfval = rfval | 0x40; - rt2800_rfcsr_write_bank(rt2x00dev, 0, 42, rfval); - - rt2800_register_write(rt2x00dev, RF_CONTROL0, 0x00002006); diff --git a/package/kernel/mac80211/patches/rt2x00/622-01-rt2x00-fix-RFCSR-register-init-values-for-RT5592.patch b/package/kernel/mac80211/patches/rt2x00/622-01-rt2x00-fix-RFCSR-register-init-values-for-RT5592.patch index 15d1601eef1..72a8f0073d2 100644 --- a/package/kernel/mac80211/patches/rt2x00/622-01-rt2x00-fix-RFCSR-register-init-values-for-RT5592.patch +++ b/package/kernel/mac80211/patches/rt2x00/622-01-rt2x00-fix-RFCSR-register-init-values-for-RT5592.patch @@ -77,7 +77,7 @@ Signed-off-by: Shiji Yang + rt2800_rfcsr_write(rt2x00dev, 59, 0x7C); + if (rf->channel <= 50) { -- rt2800_rfcsr_write(rt2x00dev, 55, 0x06), +- rt2800_rfcsr_write(rt2x00dev, 55, 0x06); - rt2800_rfcsr_write(rt2x00dev, 56, 0xD3); + rt2800_rfcsr_write(rt2x00dev, 44, 0X32); + rt2800_rfcsr_write(rt2x00dev, 54, 0xF9); diff --git a/package/kernel/mac80211/patches/rt2x00/994-rt2x00-import-support-for-external-LNA-on-MT7620.patch b/package/kernel/mac80211/patches/rt2x00/994-rt2x00-import-support-for-external-LNA-on-MT7620.patch index a92de135948..7b63c7ab5f2 100644 --- a/package/kernel/mac80211/patches/rt2x00/994-rt2x00-import-support-for-external-LNA-on-MT7620.patch +++ b/package/kernel/mac80211/patches/rt2x00/994-rt2x00-import-support-for-external-LNA-on-MT7620.patch @@ -52,7 +52,7 @@ Signed-off-by: Daniel Golle static const unsigned int rt2800_eeprom_map[EEPROM_WORD_COUNT] = { [EEPROM_CHIP_ID] = 0x0000, [EEPROM_VERSION] = 0x0001, -@@ -10428,8 +10446,10 @@ static void rt2800_restore_rf_bbp_rt6352 +@@ -10422,8 +10440,10 @@ static void rt2800_restore_rf_bbp_rt6352 static void rt2800_calibration_rt6352_stage1(struct rt2x00_dev *rt2x00dev) { if (rt2x00_has_cap_external_pa(rt2x00dev) || @@ -64,7 +64,7 @@ Signed-off-by: Daniel Golle rt2800_r_calibration(rt2x00dev); } -@@ -10453,6 +10473,8 @@ static void rt2800_calibration_rt6352_st +@@ -10447,6 +10467,8 @@ static void rt2800_calibration_rt6352_st !rt2x00_has_cap_external_lna_bg(rt2x00dev)) return; diff --git a/package/kernel/mac80211/patches/rt2x00/996-rt2x00-mt7620-differentiate-based-on-SoC-CHIP_VER.patch b/package/kernel/mac80211/patches/rt2x00/996-rt2x00-mt7620-differentiate-based-on-SoC-CHIP_VER.patch index eb0237a3893..0b2e7313dd7 100644 --- a/package/kernel/mac80211/patches/rt2x00/996-rt2x00-mt7620-differentiate-based-on-SoC-CHIP_VER.patch +++ b/package/kernel/mac80211/patches/rt2x00/996-rt2x00-mt7620-differentiate-based-on-SoC-CHIP_VER.patch @@ -203,7 +203,7 @@ /* BBP for G band GLRT function (BBP_128 ~ BBP_221) */ rt2800_bbp_glrt_write(rt2x00dev, 0, 0x00); -@@ -10404,6 +10434,9 @@ static void rt2800_restore_rf_bbp_rt6352 +@@ -10398,6 +10428,9 @@ static void rt2800_restore_rf_bbp_rt6352 rt2800_register_write(rt2x00dev, RF_BYPASS3, 0x0); } @@ -213,7 +213,7 @@ if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) { rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x16); rt2800_rfcsr_write_chanreg(rt2x00dev, 17, 0x23); -@@ -10485,6 +10518,9 @@ static void rt2800_calibration_rt6352_st +@@ -10479,6 +10512,9 @@ static void rt2800_calibration_rt6352_st rt2800_register_write(rt2x00dev, RF_BYPASS3, reg); } @@ -223,7 +223,7 @@ if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) { rt2800_rfcsr_write_chanreg(rt2x00dev, 14, 0x66); rt2800_rfcsr_write_chanreg(rt2x00dev, 17, 0x20); -@@ -10575,31 +10611,36 @@ static void rt2800_init_rfcsr_6352(struc +@@ -10569,31 +10605,36 @@ static void rt2800_init_rfcsr_6352(struc rt2800_rfcsr_write(rt2x00dev, 42, 0x5B); rt2800_rfcsr_write(rt2x00dev, 43, 0x00); @@ -285,7 +285,7 @@ /* Initialize RF channel register to default value */ rt2800_rfcsr_write_chanreg(rt2x00dev, 0, 0x03); -@@ -10665,63 +10706,71 @@ static void rt2800_init_rfcsr_6352(struc +@@ -10659,63 +10700,71 @@ static void rt2800_init_rfcsr_6352(struc rt2800_rfcsr_write_bank(rt2x00dev, 6, 45, 0xC5); @@ -412,7 +412,7 @@ /* Initialize RF DC calibration register to default value */ rt2800_rfcsr_write_dccal(rt2x00dev, 0, 0x47); -@@ -10784,12 +10833,17 @@ static void rt2800_init_rfcsr_6352(struc +@@ -10778,12 +10827,17 @@ static void rt2800_init_rfcsr_6352(struc rt2800_rfcsr_write_dccal(rt2x00dev, 62, 0x00); rt2800_rfcsr_write_dccal(rt2x00dev, 63, 0x00); diff --git a/package/kernel/mac80211/patches/rt2x00/997-rt2x00-change-remove-to-remove_new.patch b/package/kernel/mac80211/patches/rt2x00/997-rt2x00-change-remove-to-remove_new.patch deleted file mode 100644 index f1a7267b1a7..00000000000 --- a/package/kernel/mac80211/patches/rt2x00/997-rt2x00-change-remove-to-remove_new.patch +++ /dev/null @@ -1,42 +0,0 @@ ---- a/drivers/net/wireless/ralink/rt2x00/rt2800soc.c -+++ b/drivers/net/wireless/ralink/rt2x00/rt2800soc.c -@@ -273,7 +273,7 @@ static struct platform_driver rt2800soc_ - .of_match_table = rt2880_wmac_match, - }, - .probe = rt2800soc_probe, -- .remove = rt2x00soc_remove, -+ .remove_new = rt2x00soc_remove, - .suspend = rt2x00soc_suspend, - .resume = rt2x00soc_resume, - }; ---- a/drivers/net/wireless/ralink/rt2x00/rt2x00soc.c -+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00soc.c -@@ -124,7 +124,7 @@ exit_free_device: - } - EXPORT_SYMBOL_GPL(rt2x00soc_probe); - --int rt2x00soc_remove(struct platform_device *pdev) -+void rt2x00soc_remove(struct platform_device *pdev) - { - struct ieee80211_hw *hw = platform_get_drvdata(pdev); - struct rt2x00_dev *rt2x00dev = hw->priv; -@@ -135,8 +135,6 @@ int rt2x00soc_remove(struct platform_dev - rt2x00lib_remove_dev(rt2x00dev); - rt2x00soc_free_reg(rt2x00dev); - ieee80211_free_hw(hw); -- -- return 0; - } - EXPORT_SYMBOL_GPL(rt2x00soc_remove); - ---- a/drivers/net/wireless/ralink/rt2x00/rt2x00soc.h -+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00soc.h -@@ -17,7 +17,7 @@ - * SoC driver handlers. - */ - int rt2x00soc_probe(struct platform_device *pdev, const struct rt2x00_ops *ops); --int rt2x00soc_remove(struct platform_device *pdev); -+void rt2x00soc_remove(struct platform_device *pdev); - #ifdef CONFIG_PM - int rt2x00soc_suspend(struct platform_device *pdev, pm_message_t state); - int rt2x00soc_resume(struct platform_device *pdev); diff --git a/package/kernel/mac80211/patches/rtl/017-v6.13-wifi-rtw88-Constify-some-arrays-and-structs.patch b/package/kernel/mac80211/patches/rtl/017-v6.13-wifi-rtw88-Constify-some-arrays-and-structs.patch deleted file mode 100644 index 8d2bb9aa7a9..00000000000 --- a/package/kernel/mac80211/patches/rtl/017-v6.13-wifi-rtw88-Constify-some-arrays-and-structs.patch +++ /dev/null @@ -1,374 +0,0 @@ -From 140403599b74839b0a57c5397b7e8579e5332364 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Wed, 18 Sep 2024 01:53:55 +0300 -Subject: [PATCH] wifi: rtw88: Constify some arrays and structs - -These are never modified, so make them const: - -card_enable_flow_8703b -card_disable_flow_8703b -rtw8703b_ops - -rtw8723d_ops -card_enable_flow_8723d -card_disable_flow_8723d - -trans_carddis_to_cardemu_8821c -trans_cardemu_to_act_8821c -trans_act_to_cardemu_8821c -trans_cardemu_to_carddis_8821c -card_enable_flow_8821c -card_disable_flow_8821c -rtw8821c_dig -page_table_8821c -rqpn_table_8821c -prioq_addrs_8821c -rtw8821c_ops - -card_enable_flow_8822b -card_disable_flow_8822b -prioq_addrs_8822b -rtw8822b_ops -rtw8822b_edcca_th - -card_enable_flow_8822c -card_disable_flow_8822c -prioq_addrs_8822c -rtw8822c_ops -rtw8822c_edcca_th - -Signed-off-by: Bitterblue Smith -Acked-by: Ping-Ke Shih -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/dae7994f-3491-40de-b537-ebf68df084bb@gmail.com ---- - drivers/net/wireless/realtek/rtw88/fw.c | 2 +- - drivers/net/wireless/realtek/rtw88/mac.c | 4 ++-- - drivers/net/wireless/realtek/rtw88/main.h | 8 +++---- - drivers/net/wireless/realtek/rtw88/phy.c | 2 +- - drivers/net/wireless/realtek/rtw88/rtw8703b.c | 6 ++--- - drivers/net/wireless/realtek/rtw88/rtw8723d.c | 6 ++--- - drivers/net/wireless/realtek/rtw88/rtw8821c.c | 22 +++++++++---------- - drivers/net/wireless/realtek/rtw88/rtw8822b.c | 10 ++++----- - drivers/net/wireless/realtek/rtw88/rtw8822c.c | 10 ++++----- - 9 files changed, 35 insertions(+), 35 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/fw.c -+++ b/drivers/net/wireless/realtek/rtw88/fw.c -@@ -267,7 +267,7 @@ static void rtw_fw_scan_result(struct rt - static void rtw_fw_adaptivity_result(struct rtw_dev *rtwdev, u8 *payload, - u8 length) - { -- struct rtw_hw_reg_offset *edcca_th = rtwdev->chip->edcca_th; -+ const struct rtw_hw_reg_offset *edcca_th = rtwdev->chip->edcca_th; - struct rtw_c2h_adaptivity *result = (struct rtw_c2h_adaptivity *)payload; - - rtw_dbg(rtwdev, RTW_DBG_ADAPTIVITY, ---- a/drivers/net/wireless/realtek/rtw88/mac.c -+++ b/drivers/net/wireless/realtek/rtw88/mac.c -@@ -228,7 +228,7 @@ static int rtw_sub_pwr_seq_parser(struct - } - - static int rtw_pwr_seq_parser(struct rtw_dev *rtwdev, -- const struct rtw_pwr_seq_cmd **cmd_seq) -+ const struct rtw_pwr_seq_cmd * const *cmd_seq) - { - u8 cut_mask; - u8 intf_mask; -@@ -271,7 +271,7 @@ static int rtw_pwr_seq_parser(struct rtw - static int rtw_mac_power_switch(struct rtw_dev *rtwdev, bool pwr_on) - { - const struct rtw_chip_info *chip = rtwdev->chip; -- const struct rtw_pwr_seq_cmd **pwr_seq; -+ const struct rtw_pwr_seq_cmd * const *pwr_seq; - u32 imr = 0; - u8 rpwm; - bool cur_pwr; ---- a/drivers/net/wireless/realtek/rtw88/main.h -+++ b/drivers/net/wireless/realtek/rtw88/main.h -@@ -1167,7 +1167,7 @@ enum rtw_fwcd_item { - - /* hardware configuration for each IC */ - struct rtw_chip_info { -- struct rtw_chip_ops *ops; -+ const struct rtw_chip_ops *ops; - u8 id; - - const char *fw_name; -@@ -1209,8 +1209,8 @@ struct rtw_chip_info { - - /* init values */ - u8 sys_func_en; -- const struct rtw_pwr_seq_cmd **pwr_on_seq; -- const struct rtw_pwr_seq_cmd **pwr_off_seq; -+ const struct rtw_pwr_seq_cmd * const *pwr_on_seq; -+ const struct rtw_pwr_seq_cmd * const *pwr_off_seq; - const struct rtw_rqpn *rqpn_table; - const struct rtw_prioq_addrs *prioq_addrs; - const struct rtw_page_table *page_table; -@@ -1242,7 +1242,7 @@ struct rtw_chip_info { - u8 bfer_su_max_num; - u8 bfer_mu_max_num; - -- struct rtw_hw_reg_offset *edcca_th; -+ const struct rtw_hw_reg_offset *edcca_th; - s8 l2h_th_ini_cs; - s8 l2h_th_ini_ad; - ---- a/drivers/net/wireless/realtek/rtw88/phy.c -+++ b/drivers/net/wireless/realtek/rtw88/phy.c -@@ -123,7 +123,7 @@ static void rtw_phy_cck_pd_init(struct r - - void rtw_phy_set_edcca_th(struct rtw_dev *rtwdev, u8 l2h, u8 h2l) - { -- struct rtw_hw_reg_offset *edcca_th = rtwdev->chip->edcca_th; -+ const struct rtw_hw_reg_offset *edcca_th = rtwdev->chip->edcca_th; - - rtw_write32_mask(rtwdev, - edcca_th[EDCCA_TH_L2H_IDX].hw_reg.addr, ---- a/drivers/net/wireless/realtek/rtw88/rtw8703b.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8703b.c -@@ -481,14 +481,14 @@ static const struct rtw_pwr_seq_cmd tran - {TRANS_SEQ_END}, - }; - --static const struct rtw_pwr_seq_cmd *card_enable_flow_8703b[] = { -+static const struct rtw_pwr_seq_cmd * const card_enable_flow_8703b[] = { - trans_pre_enable_8703b, - trans_carddis_to_cardemu_8703b, - trans_cardemu_to_act_8703b, - NULL - }; - --static const struct rtw_pwr_seq_cmd *card_disable_flow_8703b[] = { -+static const struct rtw_pwr_seq_cmd * const card_disable_flow_8703b[] = { - trans_act_to_lps_8703b, - trans_act_to_reset_mcu_8703b, - trans_act_to_cardemu_8703b, -@@ -1941,7 +1941,7 @@ static const struct coex_tdma_para tdma_ - { {0x61, 0x08, 0x03, 0x11, 0x11} }, - }; - --static struct rtw_chip_ops rtw8703b_ops = { -+static const struct rtw_chip_ops rtw8703b_ops = { - .mac_init = rtw8723x_mac_init, - .dump_fw_crash = NULL, - .shutdown = NULL, ---- a/drivers/net/wireless/realtek/rtw88/rtw8723d.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8723d.c -@@ -1430,7 +1430,7 @@ static void rtw8723d_pwr_track(struct rt - dm_info->pwr_trk_triggered = false; - } - --static struct rtw_chip_ops rtw8723d_ops = { -+static const struct rtw_chip_ops rtw8723d_ops = { - .phy_set_param = rtw8723d_phy_set_param, - .read_efuse = rtw8723x_read_efuse, - .query_rx_desc = rtw8723d_query_rx_desc, -@@ -1788,7 +1788,7 @@ static const struct rtw_pwr_seq_cmd tran - RTW_PWR_CMD_END, 0, 0}, - }; - --static const struct rtw_pwr_seq_cmd *card_enable_flow_8723d[] = { -+static const struct rtw_pwr_seq_cmd * const card_enable_flow_8723d[] = { - trans_carddis_to_cardemu_8723d, - trans_cardemu_to_act_8723d, - NULL -@@ -2004,7 +2004,7 @@ static const struct rtw_pwr_seq_cmd tran - RTW_PWR_CMD_END, 0, 0}, - }; - --static const struct rtw_pwr_seq_cmd *card_disable_flow_8723d[] = { -+static const struct rtw_pwr_seq_cmd * const card_disable_flow_8723d[] = { - trans_act_to_lps_8723d, - trans_act_to_pre_carddis_8723d, - trans_act_to_cardemu_8723d, ---- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c -@@ -1254,7 +1254,7 @@ static void rtw8821c_fill_txdesc_checksu - fill_txdesc_checksum_common(txdesc, 16); - } - --static struct rtw_pwr_seq_cmd trans_carddis_to_cardemu_8821c[] = { -+static const struct rtw_pwr_seq_cmd trans_carddis_to_cardemu_8821c[] = { - {0x0086, - RTW_PWR_CUT_ALL_MSK, - RTW_PWR_INTF_SDIO_MSK, -@@ -1292,7 +1292,7 @@ static struct rtw_pwr_seq_cmd trans_card - RTW_PWR_CMD_END, 0, 0}, - }; - --static struct rtw_pwr_seq_cmd trans_cardemu_to_act_8821c[] = { -+static const struct rtw_pwr_seq_cmd trans_cardemu_to_act_8821c[] = { - {0x0020, - RTW_PWR_CUT_ALL_MSK, - RTW_PWR_INTF_USB_MSK | RTW_PWR_INTF_SDIO_MSK, -@@ -1396,7 +1396,7 @@ static struct rtw_pwr_seq_cmd trans_card - RTW_PWR_CMD_END, 0, 0}, - }; - --static struct rtw_pwr_seq_cmd trans_act_to_cardemu_8821c[] = { -+static const struct rtw_pwr_seq_cmd trans_act_to_cardemu_8821c[] = { - {0x0093, - RTW_PWR_CUT_ALL_MSK, - RTW_PWR_INTF_ALL_MSK, -@@ -1454,7 +1454,7 @@ static struct rtw_pwr_seq_cmd trans_act_ - RTW_PWR_CMD_END, 0, 0}, - }; - --static struct rtw_pwr_seq_cmd trans_cardemu_to_carddis_8821c[] = { -+static const struct rtw_pwr_seq_cmd trans_cardemu_to_carddis_8821c[] = { - {0x0007, - RTW_PWR_CUT_ALL_MSK, - RTW_PWR_INTF_USB_MSK | RTW_PWR_INTF_SDIO_MSK, -@@ -1567,13 +1567,13 @@ static struct rtw_pwr_seq_cmd trans_card - RTW_PWR_CMD_END, 0, 0}, - }; - --static const struct rtw_pwr_seq_cmd *card_enable_flow_8821c[] = { -+static const struct rtw_pwr_seq_cmd * const card_enable_flow_8821c[] = { - trans_carddis_to_cardemu_8821c, - trans_cardemu_to_act_8821c, - NULL - }; - --static const struct rtw_pwr_seq_cmd *card_disable_flow_8821c[] = { -+static const struct rtw_pwr_seq_cmd * const card_disable_flow_8821c[] = { - trans_act_to_cardemu_8821c, - trans_cardemu_to_carddis_8821c, - NULL -@@ -1629,7 +1629,7 @@ static const struct rtw_rfe_def rtw8821c - [6] = RTW_DEF_RFE(8821c, 0, 0), - }; - --static struct rtw_hw_reg rtw8821c_dig[] = { -+static const struct rtw_hw_reg rtw8821c_dig[] = { - [0] = { .addr = 0xc50, .mask = 0x7f }, - }; - -@@ -1639,7 +1639,7 @@ static const struct rtw_ltecoex_addr rtw - .rdata = LTECOEX_READ_DATA, - }; - --static struct rtw_page_table page_table_8821c[] = { -+static const struct rtw_page_table page_table_8821c[] = { - /* not sure what [0] stands for */ - {16, 16, 16, 14, 1}, - {16, 16, 16, 14, 1}, -@@ -1648,7 +1648,7 @@ static struct rtw_page_table page_table_ - {16, 16, 16, 14, 1}, - }; - --static struct rtw_rqpn rqpn_table_8821c[] = { -+static const struct rtw_rqpn rqpn_table_8821c[] = { - /* not sure what [0] stands for */ - {RTW_DMA_MAPPING_NORMAL, RTW_DMA_MAPPING_NORMAL, - RTW_DMA_MAPPING_LOW, RTW_DMA_MAPPING_LOW, -@@ -1667,7 +1667,7 @@ static struct rtw_rqpn rqpn_table_8821c[ - RTW_DMA_MAPPING_EXTRA, RTW_DMA_MAPPING_HIGH}, - }; - --static struct rtw_prioq_addrs prioq_addrs_8821c = { -+static const struct rtw_prioq_addrs prioq_addrs_8821c = { - .prio[RTW_DMA_MAPPING_EXTRA] = { - .rsvd = REG_FIFOPAGE_INFO_4, .avail = REG_FIFOPAGE_INFO_4 + 2, - }, -@@ -1683,7 +1683,7 @@ static struct rtw_prioq_addrs prioq_addr - .wsize = true, - }; - --static struct rtw_chip_ops rtw8821c_ops = { -+static const struct rtw_chip_ops rtw8821c_ops = { - .phy_set_param = rtw8821c_phy_set_param, - .read_efuse = rtw8821c_read_efuse, - .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 - RTW_PWR_CMD_END, 0, 0}, - }; - --static const struct rtw_pwr_seq_cmd *card_enable_flow_8822b[] = { -+static const struct rtw_pwr_seq_cmd * const card_enable_flow_8822b[] = { - trans_carddis_to_cardemu_8822b, - trans_cardemu_to_act_8822b, - NULL - }; - --static const struct rtw_pwr_seq_cmd *card_disable_flow_8822b[] = { -+static const struct rtw_pwr_seq_cmd * const card_disable_flow_8822b[] = { - trans_act_to_cardemu_8822b, - trans_cardemu_to_carddis_8822b, - NULL -@@ -2156,7 +2156,7 @@ static const struct rtw_rqpn rqpn_table_ - RTW_DMA_MAPPING_EXTRA, RTW_DMA_MAPPING_HIGH}, - }; - --static struct rtw_prioq_addrs prioq_addrs_8822b = { -+static const struct rtw_prioq_addrs prioq_addrs_8822b = { - .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 - .wsize = true, - }; - --static struct rtw_chip_ops rtw8822b_ops = { -+static const struct rtw_chip_ops rtw8822b_ops = { - .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_ - {0xc50, MASKBYTE0, RTW_REG_DOMAIN_MAC8}, - }; - --static struct rtw_hw_reg_offset rtw8822b_edcca_th[] = { -+static const struct rtw_hw_reg_offset rtw8822b_edcca_th[] = { - [EDCCA_TH_L2H_IDX] = {{.addr = 0x8a4, .mask = MASKBYTE0}, .offset = 0}, - [EDCCA_TH_H2L_IDX] = {{.addr = 0x8a4, .mask = MASKBYTE1}, .offset = 0}, - }; ---- 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 - RTW_PWR_CMD_END, 0, 0}, - }; - --static const struct rtw_pwr_seq_cmd *card_enable_flow_8822c[] = { -+static const struct rtw_pwr_seq_cmd * const card_enable_flow_8822c[] = { - trans_carddis_to_cardemu_8822c, - trans_cardemu_to_act_8822c, - NULL - }; - --static const struct rtw_pwr_seq_cmd *card_disable_flow_8822c[] = { -+static const struct rtw_pwr_seq_cmd * const card_disable_flow_8822c[] = { - trans_act_to_cardemu_8822c, - trans_cardemu_to_carddis_8822c, - NULL -@@ -4972,7 +4972,7 @@ static const struct rtw_rqpn rqpn_table_ - RTW_DMA_MAPPING_EXTRA, RTW_DMA_MAPPING_HIGH}, - }; - --static struct rtw_prioq_addrs prioq_addrs_8822c = { -+static const struct rtw_prioq_addrs prioq_addrs_8822c = { - .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 - .wsize = true, - }; - --static struct rtw_chip_ops rtw8822c_ops = { -+static const struct rtw_chip_ops rtw8822c_ops = { - .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 - .pwrtrk_2g_ccka_p = rtw8822c_pwrtrk_2g_cck_a_p, - }; - --static struct rtw_hw_reg_offset rtw8822c_edcca_th[] = { -+static const struct rtw_hw_reg_offset rtw8822c_edcca_th[] = { - [EDCCA_TH_L2H_IDX] = { - {.addr = 0x84c, .mask = MASKBYTE2}, .offset = 0x80 - }, diff --git a/package/kernel/mac80211/patches/rtl/019-v6.13-wifi-rtw88-Parse-the-RX-descriptor-with-a-single-fun.patch b/package/kernel/mac80211/patches/rtl/019-v6.13-wifi-rtw88-Parse-the-RX-descriptor-with-a-single-fun.patch deleted file mode 100644 index 4a32831ea3e..00000000000 --- a/package/kernel/mac80211/patches/rtl/019-v6.13-wifi-rtw88-Parse-the-RX-descriptor-with-a-single-fun.patch +++ /dev/null @@ -1,560 +0,0 @@ -From bbb6f9be7f99464d5ab7e2f321fa728d33eeec9a Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Fri, 20 Sep 2024 22:27:30 +0300 -Subject: [PATCH] wifi: rtw88: Parse the RX descriptor with a single function - -rtw8703b_query_rx_desc(), rtw8723d_query_rx_desc(), -rtw8821c_query_rx_desc(), rtw8822b_query_rx_desc(), and -rtw8822c_query_rx_desc() are almost identical, so replace them all with -a single function, rtw_rx_query_rx_desc(). - -Also, access the RX descriptor using a struct with __le32 members and -le32_get_bits(). - -Tested with RTL8811CU, RTL8811AU, and RTL8812AU. - -Signed-off-by: Bitterblue Smith -Tested-by: Ping-Ke Shih # RTL8723DE and RTL8822CE -Acked-by: Ping-Ke Shih -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/913f1747-38fc-4409-85a4-57bb9cee506b@gmail.com ---- - drivers/net/wireless/realtek/rtw88/main.h | 5 +- - drivers/net/wireless/realtek/rtw88/pci.c | 2 +- - drivers/net/wireless/realtek/rtw88/rtw8703b.c | 56 +-------------- - drivers/net/wireless/realtek/rtw88/rtw8723d.c | 43 +----------- - drivers/net/wireless/realtek/rtw88/rtw8821c.c | 43 +----------- - drivers/net/wireless/realtek/rtw88/rtw8822b.c | 43 +----------- - drivers/net/wireless/realtek/rtw88/rtw8822c.c | 44 +----------- - drivers/net/wireless/realtek/rtw88/rx.c | 70 +++++++++++++++++-- - drivers/net/wireless/realtek/rtw88/rx.h | 64 ++++++++--------- - drivers/net/wireless/realtek/rtw88/sdio.c | 3 +- - drivers/net/wireless/realtek/rtw88/usb.c | 4 +- - 11 files changed, 106 insertions(+), 271 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/main.h -+++ b/drivers/net/wireless/realtek/rtw88/main.h -@@ -848,9 +848,8 @@ struct rtw_chip_ops { - void (*phy_set_param)(struct rtw_dev *rtwdev); - void (*set_channel)(struct rtw_dev *rtwdev, u8 channel, - u8 bandwidth, u8 primary_chan_idx); -- void (*query_rx_desc)(struct rtw_dev *rtwdev, u8 *rx_desc, -- struct rtw_rx_pkt_stat *pkt_stat, -- struct ieee80211_rx_status *rx_status); -+ void (*query_phy_status)(struct rtw_dev *rtwdev, u8 *phy_status, -+ struct rtw_rx_pkt_stat *pkt_stat); - u32 (*read_rf)(struct rtw_dev *rtwdev, enum rtw_rf_path rf_path, - u32 addr, u32 mask); - 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 - dma_sync_single_for_cpu(rtwdev->dev, dma, RTK_PCI_RX_BUF_SIZE, - DMA_FROM_DEVICE); - rx_desc = skb->data; -- chip->ops->query_rx_desc(rtwdev, rx_desc, &pkt_stat, &rx_status); -+ rtw_rx_query_rx_desc(rtwdev, rx_desc, &pkt_stat, &rx_status); - - /* offset from rx_desc to payload */ - pkt_offset = pkt_desc_sz + pkt_stat.drv_info_sz + ---- a/drivers/net/wireless/realtek/rtw88/rtw8703b.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8703b.c -@@ -29,9 +29,6 @@ - #define TBTT_PROHIBIT_HOLD_TIME 0x80 - #define TBTT_PROHIBIT_HOLD_TIME_STOP_BCN 0x64 - --/* raw pkt_stat->drv_info_sz is in unit of 8-bytes */ --#define RX_DRV_INFO_SZ_UNIT_8703B 8 -- - #define TRANS_SEQ_END \ - 0xFFFF, \ - RTW_PWR_CUT_ALL_MSK, \ -@@ -1032,57 +1029,6 @@ static void query_phy_status(struct rtw_ - query_phy_status_ofdm(rtwdev, phy_status, pkt_stat); - } - --static void rtw8703b_query_rx_desc(struct rtw_dev *rtwdev, u8 *rx_desc, -- struct rtw_rx_pkt_stat *pkt_stat, -- struct ieee80211_rx_status *rx_status) --{ -- struct ieee80211_hdr *hdr; -- u32 desc_sz = rtwdev->chip->rx_pkt_desc_sz; -- u8 *phy_status = NULL; -- -- memset(pkt_stat, 0, sizeof(*pkt_stat)); -- -- pkt_stat->phy_status = GET_RX_DESC_PHYST(rx_desc); -- pkt_stat->icv_err = GET_RX_DESC_ICV_ERR(rx_desc); -- pkt_stat->crc_err = GET_RX_DESC_CRC32(rx_desc); -- pkt_stat->decrypted = !GET_RX_DESC_SWDEC(rx_desc) && -- GET_RX_DESC_ENC_TYPE(rx_desc) != RX_DESC_ENC_NONE; -- pkt_stat->is_c2h = GET_RX_DESC_C2H(rx_desc); -- pkt_stat->pkt_len = GET_RX_DESC_PKT_LEN(rx_desc); -- pkt_stat->drv_info_sz = GET_RX_DESC_DRV_INFO_SIZE(rx_desc); -- pkt_stat->shift = GET_RX_DESC_SHIFT(rx_desc); -- pkt_stat->rate = GET_RX_DESC_RX_RATE(rx_desc); -- pkt_stat->cam_id = GET_RX_DESC_MACID(rx_desc); -- pkt_stat->ppdu_cnt = 0; -- pkt_stat->tsf_low = GET_RX_DESC_TSFL(rx_desc); -- -- pkt_stat->drv_info_sz *= RX_DRV_INFO_SZ_UNIT_8703B; -- -- if (pkt_stat->is_c2h) -- return; -- -- hdr = (struct ieee80211_hdr *)(rx_desc + desc_sz + pkt_stat->shift + -- pkt_stat->drv_info_sz); -- -- pkt_stat->bw = GET_RX_DESC_BW(rx_desc); -- -- if (pkt_stat->phy_status) { -- phy_status = rx_desc + desc_sz + pkt_stat->shift; -- query_phy_status(rtwdev, phy_status, pkt_stat); -- } -- -- rtw_rx_fill_rx_status(rtwdev, pkt_stat, hdr, rx_status, phy_status); -- -- /* Rtl8723cs driver checks for size < 14 or size > 8192 and -- * simply drops the packet. Maybe this should go into -- * rtw_rx_fill_rx_status()? -- */ -- if (pkt_stat->pkt_len == 0) { -- rx_status->flag |= RX_FLAG_NO_PSDU; -- rtw_dbg(rtwdev, RTW_DBG_RX, "zero length packet"); -- } --} -- - #define ADDA_ON_VAL_8703B 0x03c00014 - - static -@@ -1948,7 +1894,7 @@ static const struct rtw_chip_ops rtw8703 - .read_efuse = rtw8703b_read_efuse, - .phy_set_param = rtw8703b_phy_set_param, - .set_channel = rtw8703b_set_channel, -- .query_rx_desc = rtw8703b_query_rx_desc, -+ .query_phy_status = query_phy_status, - .read_rf = rtw_phy_read_rf_sipi, - .write_rf = rtw_phy_write_rf_reg_sipi, - .set_tx_power_index = rtw8723x_set_tx_power_index, ---- a/drivers/net/wireless/realtek/rtw88/rtw8723d.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8723d.c -@@ -227,47 +227,6 @@ static void query_phy_status(struct rtw_ - } - } - --static void rtw8723d_query_rx_desc(struct rtw_dev *rtwdev, u8 *rx_desc, -- struct rtw_rx_pkt_stat *pkt_stat, -- struct ieee80211_rx_status *rx_status) --{ -- struct ieee80211_hdr *hdr; -- u32 desc_sz = rtwdev->chip->rx_pkt_desc_sz; -- u8 *phy_status = NULL; -- -- memset(pkt_stat, 0, sizeof(*pkt_stat)); -- -- pkt_stat->phy_status = GET_RX_DESC_PHYST(rx_desc); -- pkt_stat->icv_err = GET_RX_DESC_ICV_ERR(rx_desc); -- pkt_stat->crc_err = GET_RX_DESC_CRC32(rx_desc); -- pkt_stat->decrypted = !GET_RX_DESC_SWDEC(rx_desc) && -- GET_RX_DESC_ENC_TYPE(rx_desc) != RX_DESC_ENC_NONE; -- pkt_stat->is_c2h = GET_RX_DESC_C2H(rx_desc); -- pkt_stat->pkt_len = GET_RX_DESC_PKT_LEN(rx_desc); -- pkt_stat->drv_info_sz = GET_RX_DESC_DRV_INFO_SIZE(rx_desc); -- pkt_stat->shift = GET_RX_DESC_SHIFT(rx_desc); -- pkt_stat->rate = GET_RX_DESC_RX_RATE(rx_desc); -- pkt_stat->cam_id = GET_RX_DESC_MACID(rx_desc); -- pkt_stat->ppdu_cnt = 0; -- pkt_stat->tsf_low = GET_RX_DESC_TSFL(rx_desc); -- -- /* drv_info_sz is in unit of 8-bytes */ -- pkt_stat->drv_info_sz *= 8; -- -- /* c2h cmd pkt's rx/phy status is not interested */ -- if (pkt_stat->is_c2h) -- return; -- -- hdr = (struct ieee80211_hdr *)(rx_desc + desc_sz + pkt_stat->shift + -- pkt_stat->drv_info_sz); -- if (pkt_stat->phy_status) { -- phy_status = rx_desc + desc_sz + pkt_stat->shift; -- query_phy_status(rtwdev, phy_status, pkt_stat); -- } -- -- rtw_rx_fill_rx_status(rtwdev, pkt_stat, hdr, rx_status, phy_status); --} -- - static bool rtw8723d_check_spur_ov_thres(struct rtw_dev *rtwdev, - u8 channel, u32 thres) - { -@@ -1433,7 +1392,7 @@ static void rtw8723d_pwr_track(struct rt - static const struct rtw_chip_ops rtw8723d_ops = { - .phy_set_param = rtw8723d_phy_set_param, - .read_efuse = rtw8723x_read_efuse, -- .query_rx_desc = rtw8723d_query_rx_desc, -+ .query_phy_status = query_phy_status, - .set_channel = rtw8723d_set_channel, - .mac_init = rtw8723x_mac_init, - .shutdown = rtw8723d_shutdown, ---- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c -@@ -679,47 +679,6 @@ static void query_phy_status(struct rtw_ - } - } - --static void rtw8821c_query_rx_desc(struct rtw_dev *rtwdev, u8 *rx_desc, -- struct rtw_rx_pkt_stat *pkt_stat, -- struct ieee80211_rx_status *rx_status) --{ -- struct ieee80211_hdr *hdr; -- u32 desc_sz = rtwdev->chip->rx_pkt_desc_sz; -- u8 *phy_status = NULL; -- -- memset(pkt_stat, 0, sizeof(*pkt_stat)); -- -- pkt_stat->phy_status = GET_RX_DESC_PHYST(rx_desc); -- pkt_stat->icv_err = GET_RX_DESC_ICV_ERR(rx_desc); -- pkt_stat->crc_err = GET_RX_DESC_CRC32(rx_desc); -- pkt_stat->decrypted = !GET_RX_DESC_SWDEC(rx_desc) && -- GET_RX_DESC_ENC_TYPE(rx_desc) != RX_DESC_ENC_NONE; -- pkt_stat->is_c2h = GET_RX_DESC_C2H(rx_desc); -- pkt_stat->pkt_len = GET_RX_DESC_PKT_LEN(rx_desc); -- pkt_stat->drv_info_sz = GET_RX_DESC_DRV_INFO_SIZE(rx_desc); -- pkt_stat->shift = GET_RX_DESC_SHIFT(rx_desc); -- pkt_stat->rate = GET_RX_DESC_RX_RATE(rx_desc); -- pkt_stat->cam_id = GET_RX_DESC_MACID(rx_desc); -- pkt_stat->ppdu_cnt = GET_RX_DESC_PPDU_CNT(rx_desc); -- pkt_stat->tsf_low = GET_RX_DESC_TSFL(rx_desc); -- -- /* drv_info_sz is in unit of 8-bytes */ -- pkt_stat->drv_info_sz *= 8; -- -- /* c2h cmd pkt's rx/phy status is not interested */ -- if (pkt_stat->is_c2h) -- return; -- -- hdr = (struct ieee80211_hdr *)(rx_desc + desc_sz + pkt_stat->shift + -- pkt_stat->drv_info_sz); -- if (pkt_stat->phy_status) { -- phy_status = rx_desc + desc_sz + pkt_stat->shift; -- query_phy_status(rtwdev, phy_status, pkt_stat); -- } -- -- rtw_rx_fill_rx_status(rtwdev, pkt_stat, hdr, rx_status, phy_status); --} -- - static void - rtw8821c_set_tx_power_index_by_rate(struct rtw_dev *rtwdev, u8 path, u8 rs) - { -@@ -1686,7 +1645,7 @@ static const struct rtw_prioq_addrs prio - static const struct rtw_chip_ops rtw8821c_ops = { - .phy_set_param = rtw8821c_phy_set_param, - .read_efuse = rtw8821c_read_efuse, -- .query_rx_desc = rtw8821c_query_rx_desc, -+ .query_phy_status = query_phy_status, - .set_channel = rtw8821c_set_channel, - .mac_init = rtw8821c_mac_init, - .read_rf = rtw_phy_read_rf, ---- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c -@@ -934,47 +934,6 @@ static void query_phy_status(struct rtw_ - } - } - --static void rtw8822b_query_rx_desc(struct rtw_dev *rtwdev, u8 *rx_desc, -- struct rtw_rx_pkt_stat *pkt_stat, -- struct ieee80211_rx_status *rx_status) --{ -- struct ieee80211_hdr *hdr; -- u32 desc_sz = rtwdev->chip->rx_pkt_desc_sz; -- u8 *phy_status = NULL; -- -- memset(pkt_stat, 0, sizeof(*pkt_stat)); -- -- pkt_stat->phy_status = GET_RX_DESC_PHYST(rx_desc); -- pkt_stat->icv_err = GET_RX_DESC_ICV_ERR(rx_desc); -- pkt_stat->crc_err = GET_RX_DESC_CRC32(rx_desc); -- pkt_stat->decrypted = !GET_RX_DESC_SWDEC(rx_desc) && -- GET_RX_DESC_ENC_TYPE(rx_desc) != RX_DESC_ENC_NONE; -- pkt_stat->is_c2h = GET_RX_DESC_C2H(rx_desc); -- pkt_stat->pkt_len = GET_RX_DESC_PKT_LEN(rx_desc); -- pkt_stat->drv_info_sz = GET_RX_DESC_DRV_INFO_SIZE(rx_desc); -- pkt_stat->shift = GET_RX_DESC_SHIFT(rx_desc); -- pkt_stat->rate = GET_RX_DESC_RX_RATE(rx_desc); -- pkt_stat->cam_id = GET_RX_DESC_MACID(rx_desc); -- pkt_stat->ppdu_cnt = GET_RX_DESC_PPDU_CNT(rx_desc); -- pkt_stat->tsf_low = GET_RX_DESC_TSFL(rx_desc); -- -- /* drv_info_sz is in unit of 8-bytes */ -- pkt_stat->drv_info_sz *= 8; -- -- /* c2h cmd pkt's rx/phy status is not interested */ -- if (pkt_stat->is_c2h) -- return; -- -- hdr = (struct ieee80211_hdr *)(rx_desc + desc_sz + pkt_stat->shift + -- pkt_stat->drv_info_sz); -- if (pkt_stat->phy_status) { -- phy_status = rx_desc + desc_sz + pkt_stat->shift; -- query_phy_status(rtwdev, phy_status, pkt_stat); -- } -- -- rtw_rx_fill_rx_status(rtwdev, pkt_stat, hdr, rx_status, phy_status); --} -- - 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 - static const struct rtw_chip_ops rtw8822b_ops = { - .phy_set_param = rtw8822b_phy_set_param, - .read_efuse = rtw8822b_read_efuse, -- .query_rx_desc = rtw8822b_query_rx_desc, -+ .query_phy_status = query_phy_status, - .set_channel = rtw8822b_set_channel, - .mac_init = rtw8822b_mac_init, - .read_rf = rtw_phy_read_rf, ---- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c -@@ -2690,48 +2690,6 @@ static void query_phy_status(struct rtw_ - } - } - --static void rtw8822c_query_rx_desc(struct rtw_dev *rtwdev, u8 *rx_desc, -- struct rtw_rx_pkt_stat *pkt_stat, -- struct ieee80211_rx_status *rx_status) --{ -- struct ieee80211_hdr *hdr; -- u32 desc_sz = rtwdev->chip->rx_pkt_desc_sz; -- u8 *phy_status = NULL; -- -- memset(pkt_stat, 0, sizeof(*pkt_stat)); -- -- pkt_stat->phy_status = GET_RX_DESC_PHYST(rx_desc); -- pkt_stat->icv_err = GET_RX_DESC_ICV_ERR(rx_desc); -- pkt_stat->crc_err = GET_RX_DESC_CRC32(rx_desc); -- pkt_stat->decrypted = !GET_RX_DESC_SWDEC(rx_desc) && -- GET_RX_DESC_ENC_TYPE(rx_desc) != RX_DESC_ENC_NONE; -- pkt_stat->is_c2h = GET_RX_DESC_C2H(rx_desc); -- pkt_stat->pkt_len = GET_RX_DESC_PKT_LEN(rx_desc); -- pkt_stat->drv_info_sz = GET_RX_DESC_DRV_INFO_SIZE(rx_desc); -- pkt_stat->shift = GET_RX_DESC_SHIFT(rx_desc); -- pkt_stat->rate = GET_RX_DESC_RX_RATE(rx_desc); -- pkt_stat->cam_id = GET_RX_DESC_MACID(rx_desc); -- pkt_stat->ppdu_cnt = GET_RX_DESC_PPDU_CNT(rx_desc); -- pkt_stat->tsf_low = GET_RX_DESC_TSFL(rx_desc); -- -- /* drv_info_sz is in unit of 8-bytes */ -- pkt_stat->drv_info_sz *= 8; -- -- /* c2h cmd pkt's rx/phy status is not interested */ -- if (pkt_stat->is_c2h) -- return; -- -- hdr = (struct ieee80211_hdr *)(rx_desc + desc_sz + pkt_stat->shift + -- pkt_stat->drv_info_sz); -- pkt_stat->hdr = hdr; -- if (pkt_stat->phy_status) { -- phy_status = rx_desc + desc_sz + pkt_stat->shift; -- query_phy_status(rtwdev, phy_status, pkt_stat); -- } -- -- rtw_rx_fill_rx_status(rtwdev, pkt_stat, hdr, rx_status, phy_status); --} -- - 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 - static const struct rtw_chip_ops rtw8822c_ops = { - .phy_set_param = rtw8822c_phy_set_param, - .read_efuse = rtw8822c_read_efuse, -- .query_rx_desc = rtw8822c_query_rx_desc, -+ .query_phy_status = query_phy_status, - .set_channel = rtw8822c_set_channel, - .mac_init = rtw8822c_mac_init, - .dump_fw_crash = rtw8822c_dump_fw_crash, ---- a/drivers/net/wireless/realtek/rtw88/rx.c -+++ b/drivers/net/wireless/realtek/rtw88/rx.c -@@ -187,11 +187,10 @@ fill_rx_status: - } - EXPORT_SYMBOL(rtw_update_rx_freq_from_ie); - --void rtw_rx_fill_rx_status(struct rtw_dev *rtwdev, -- struct rtw_rx_pkt_stat *pkt_stat, -- struct ieee80211_hdr *hdr, -- struct ieee80211_rx_status *rx_status, -- u8 *phy_status) -+static void rtw_rx_fill_rx_status(struct rtw_dev *rtwdev, -+ struct rtw_rx_pkt_stat *pkt_stat, -+ struct ieee80211_hdr *hdr, -+ struct ieee80211_rx_status *rx_status) - { - struct ieee80211_hw *hw = rtwdev->hw; - u8 path; -@@ -242,5 +241,64 @@ void rtw_rx_fill_rx_status(struct rtw_de - } - - rtw_rx_addr_match(rtwdev, pkt_stat, hdr); -+ -+ /* Rtl8723cs driver checks for size < 14 or size > 8192 and -+ * simply drops the packet. -+ */ -+ if (rtwdev->chip->id == RTW_CHIP_TYPE_8703B && pkt_stat->pkt_len == 0) { -+ rx_status->flag |= RX_FLAG_NO_PSDU; -+ rtw_dbg(rtwdev, RTW_DBG_RX, "zero length packet"); -+ } -+} -+ -+void rtw_rx_query_rx_desc(struct rtw_dev *rtwdev, void *rx_desc8, -+ struct rtw_rx_pkt_stat *pkt_stat, -+ struct ieee80211_rx_status *rx_status) -+{ -+ u32 desc_sz = rtwdev->chip->rx_pkt_desc_sz; -+ struct rtw_rx_desc *rx_desc = rx_desc8; -+ struct ieee80211_hdr *hdr; -+ u32 enc_type, swdec; -+ void *phy_status; -+ -+ memset(pkt_stat, 0, sizeof(*pkt_stat)); -+ -+ pkt_stat->pkt_len = le32_get_bits(rx_desc->w0, RTW_RX_DESC_W0_PKT_LEN); -+ pkt_stat->crc_err = le32_get_bits(rx_desc->w0, RTW_RX_DESC_W0_CRC32); -+ pkt_stat->icv_err = le32_get_bits(rx_desc->w0, RTW_RX_DESC_W0_ICV_ERR); -+ pkt_stat->drv_info_sz = le32_get_bits(rx_desc->w0, -+ RTW_RX_DESC_W0_DRV_INFO_SIZE); -+ enc_type = le32_get_bits(rx_desc->w0, RTW_RX_DESC_W0_ENC_TYPE); -+ pkt_stat->shift = le32_get_bits(rx_desc->w0, RTW_RX_DESC_W0_SHIFT); -+ pkt_stat->phy_status = le32_get_bits(rx_desc->w0, RTW_RX_DESC_W0_PHYST); -+ swdec = le32_get_bits(rx_desc->w0, RTW_RX_DESC_W0_SWDEC); -+ pkt_stat->decrypted = !swdec && enc_type != RX_DESC_ENC_NONE; -+ -+ pkt_stat->cam_id = le32_get_bits(rx_desc->w1, RTW_RX_DESC_W1_MACID); -+ -+ pkt_stat->is_c2h = le32_get_bits(rx_desc->w2, RTW_RX_DESC_W2_C2H); -+ pkt_stat->ppdu_cnt = le32_get_bits(rx_desc->w2, RTW_RX_DESC_W2_PPDU_CNT); -+ -+ pkt_stat->rate = le32_get_bits(rx_desc->w3, RTW_RX_DESC_W3_RX_RATE); -+ -+ pkt_stat->bw = le32_get_bits(rx_desc->w4, RTW_RX_DESC_W4_BW); -+ -+ pkt_stat->tsf_low = le32_get_bits(rx_desc->w5, RTW_RX_DESC_W5_TSFL); -+ -+ /* drv_info_sz is in unit of 8-bytes */ -+ pkt_stat->drv_info_sz *= 8; -+ -+ /* c2h cmd pkt's rx/phy status is not interested */ -+ if (pkt_stat->is_c2h) -+ return; -+ -+ phy_status = rx_desc8 + desc_sz + pkt_stat->shift; -+ hdr = phy_status + pkt_stat->drv_info_sz; -+ pkt_stat->hdr = hdr; -+ -+ if (pkt_stat->phy_status) -+ rtwdev->chip->ops->query_phy_status(rtwdev, phy_status, pkt_stat); -+ -+ rtw_rx_fill_rx_status(rtwdev, pkt_stat, hdr, rx_status); - } --EXPORT_SYMBOL(rtw_rx_fill_rx_status); -+EXPORT_SYMBOL(rtw_rx_query_rx_desc); ---- a/drivers/net/wireless/realtek/rtw88/rx.h -+++ b/drivers/net/wireless/realtek/rtw88/rx.h -@@ -14,42 +14,40 @@ enum rtw_rx_desc_enc { - RX_DESC_ENC_WEP104 = 5, - }; - --#define GET_RX_DESC_PHYST(rxdesc) \ -- le32_get_bits(*((__le32 *)(rxdesc) + 0x00), BIT(26)) --#define GET_RX_DESC_ICV_ERR(rxdesc) \ -- le32_get_bits(*((__le32 *)(rxdesc) + 0x00), BIT(15)) --#define GET_RX_DESC_CRC32(rxdesc) \ -- le32_get_bits(*((__le32 *)(rxdesc) + 0x00), BIT(14)) --#define GET_RX_DESC_SWDEC(rxdesc) \ -- le32_get_bits(*((__le32 *)(rxdesc) + 0x00), BIT(27)) --#define GET_RX_DESC_C2H(rxdesc) \ -- le32_get_bits(*((__le32 *)(rxdesc) + 0x02), BIT(28)) --#define GET_RX_DESC_PKT_LEN(rxdesc) \ -- le32_get_bits(*((__le32 *)(rxdesc) + 0x00), GENMASK(13, 0)) --#define GET_RX_DESC_DRV_INFO_SIZE(rxdesc) \ -- le32_get_bits(*((__le32 *)(rxdesc) + 0x00), GENMASK(19, 16)) --#define GET_RX_DESC_SHIFT(rxdesc) \ -- le32_get_bits(*((__le32 *)(rxdesc) + 0x00), GENMASK(25, 24)) --#define GET_RX_DESC_ENC_TYPE(rxdesc) \ -- le32_get_bits(*((__le32 *)(rxdesc) + 0x00), GENMASK(22, 20)) --#define GET_RX_DESC_RX_RATE(rxdesc) \ -- le32_get_bits(*((__le32 *)(rxdesc) + 0x03), GENMASK(6, 0)) --#define GET_RX_DESC_MACID(rxdesc) \ -- le32_get_bits(*((__le32 *)(rxdesc) + 0x01), GENMASK(6, 0)) --#define GET_RX_DESC_PPDU_CNT(rxdesc) \ -- le32_get_bits(*((__le32 *)(rxdesc) + 0x02), GENMASK(30, 29)) --#define GET_RX_DESC_TSFL(rxdesc) \ -- le32_get_bits(*((__le32 *)(rxdesc) + 0x05), GENMASK(31, 0)) --#define GET_RX_DESC_BW(rxdesc) \ -- (le32_get_bits(*((__le32 *)(rxdesc) + 0x04), GENMASK(5, 4))) -+struct rtw_rx_desc { -+ __le32 w0; -+ __le32 w1; -+ __le32 w2; -+ __le32 w3; -+ __le32 w4; -+ __le32 w5; -+} __packed; -+ -+#define RTW_RX_DESC_W0_PKT_LEN GENMASK(13, 0) -+#define RTW_RX_DESC_W0_CRC32 BIT(14) -+#define RTW_RX_DESC_W0_ICV_ERR BIT(15) -+#define RTW_RX_DESC_W0_DRV_INFO_SIZE GENMASK(19, 16) -+#define RTW_RX_DESC_W0_ENC_TYPE GENMASK(22, 20) -+#define RTW_RX_DESC_W0_SHIFT GENMASK(25, 24) -+#define RTW_RX_DESC_W0_PHYST BIT(26) -+#define RTW_RX_DESC_W0_SWDEC BIT(27) -+ -+#define RTW_RX_DESC_W1_MACID GENMASK(6, 0) -+ -+#define RTW_RX_DESC_W2_C2H BIT(28) -+#define RTW_RX_DESC_W2_PPDU_CNT GENMASK(30, 29) -+ -+#define RTW_RX_DESC_W3_RX_RATE GENMASK(6, 0) -+ -+#define RTW_RX_DESC_W4_BW GENMASK(5, 4) -+ -+#define RTW_RX_DESC_W5_TSFL GENMASK(31, 0) - - void rtw_rx_stats(struct rtw_dev *rtwdev, struct ieee80211_vif *vif, - struct sk_buff *skb); --void rtw_rx_fill_rx_status(struct rtw_dev *rtwdev, -- struct rtw_rx_pkt_stat *pkt_stat, -- struct ieee80211_hdr *hdr, -- struct ieee80211_rx_status *rx_status, -- u8 *phy_status); -+void rtw_rx_query_rx_desc(struct rtw_dev *rtwdev, void *rx_desc8, -+ struct rtw_rx_pkt_stat *pkt_stat, -+ struct ieee80211_rx_status *rx_status); - void rtw_update_rx_freq_from_ie(struct rtw_dev *rtwdev, struct sk_buff *skb, - struct ieee80211_rx_status *rx_status, - 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 - - while (true) { - rx_desc = skb->data; -- chip->ops->query_rx_desc(rtwdev, rx_desc, &pkt_stat, -- &rx_status); -+ rtw_rx_query_rx_desc(rtwdev, rx_desc, &pkt_stat, &rx_status); - pkt_offset = pkt_desc_sz + pkt_stat.drv_info_sz + - pkt_stat.shift; - ---- 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 - - do { - rx_desc = skb->data; -- chip->ops->query_rx_desc(rtwdev, rx_desc, &pkt_stat, -- &rx_status); -+ rtw_rx_query_rx_desc(rtwdev, rx_desc, &pkt_stat, -+ &rx_status); - pkt_offset = pkt_desc_sz + pkt_stat.drv_info_sz + - pkt_stat.shift; - diff --git a/package/kernel/mac80211/patches/rtl/022-v6.13-wifi-rtw88-Refactor-looping-in-rtw_phy_store_tx_powe.patch b/package/kernel/mac80211/patches/rtl/022-v6.13-wifi-rtw88-Refactor-looping-in-rtw_phy_store_tx_powe.patch deleted file mode 100644 index 4f019617d47..00000000000 --- a/package/kernel/mac80211/patches/rtl/022-v6.13-wifi-rtw88-Refactor-looping-in-rtw_phy_store_tx_powe.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 7846f0b63562f4db45f712cc7dab091985baf07b Mon Sep 17 00:00:00 2001 -From: Mohammed Anees -Date: Thu, 17 Oct 2024 13:36:38 +0530 -Subject: [PATCH] wifi: rtw88: Refactor looping in - rtw_phy_store_tx_power_by_rate - -The previous implementation included an unnecessary else -condition paired with a continue statement. Since a check -is already performed to determine if the band is either -2G or 5G, the else condition will never be triggered. -We can remove this check. - -Signed-off-by: Mohammed Anees -Acked-by: Ping-Ke Shih -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/20241017080638.13074-1-pvmohammedanees2003@gmail.com ---- - drivers/net/wireless/realtek/rtw88/phy.c | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/phy.c -+++ b/drivers/net/wireless/realtek/rtw88/phy.c -@@ -1470,10 +1470,8 @@ static void rtw_phy_store_tx_power_by_ra - rate = rates[i]; - if (band == PHY_BAND_2G) - hal->tx_pwr_by_rate_offset_2g[rfpath][rate] = offset; -- else if (band == PHY_BAND_5G) -- hal->tx_pwr_by_rate_offset_5g[rfpath][rate] = offset; - else -- continue; -+ hal->tx_pwr_by_rate_offset_5g[rfpath][rate] = offset; - } - } - diff --git a/package/kernel/mac80211/patches/rtl/023-v6.13-wifi-rtw88-Report-the-signal-strength-only-if-it-s-k.patch b/package/kernel/mac80211/patches/rtl/023-v6.13-wifi-rtw88-Report-the-signal-strength-only-if-it-s-k.patch deleted file mode 100644 index accbf2b484f..00000000000 --- a/package/kernel/mac80211/patches/rtl/023-v6.13-wifi-rtw88-Report-the-signal-strength-only-if-it-s-k.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 47f754b3f838205f3b25c4839f74801d180995bf Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Tue, 22 Oct 2024 20:20:26 +0300 -Subject: [PATCH] wifi: rtw88: Report the signal strength only if it's known - -RTL8811CU doesn't report the signal strength for many (any?) data -frames. When the signal strength is not known, set -RX_FLAG_NO_SIGNAL_VAL in order to avoid reporting a signal -strength of 0. - -Signed-off-by: Bitterblue Smith -Acked-by: Ping-Ke Shih -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/f7e1e448-2c9b-498f-b8b1-a14dd967d7d3@gmail.com ---- - drivers/net/wireless/realtek/rtw88/rx.c | 12 ++++++++---- - 1 file changed, 8 insertions(+), 4 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/rx.c -+++ b/drivers/net/wireless/realtek/rtw88/rx.c -@@ -234,10 +234,14 @@ static void rtw_rx_fill_rx_status(struct - else - rx_status->bw = RATE_INFO_BW_20; - -- rx_status->signal = pkt_stat->signal_power; -- for (path = 0; path < rtwdev->hal.rf_path_num; path++) { -- rx_status->chains |= BIT(path); -- rx_status->chain_signal[path] = pkt_stat->rx_power[path]; -+ if (pkt_stat->phy_status) { -+ rx_status->signal = pkt_stat->signal_power; -+ for (path = 0; path < rtwdev->hal.rf_path_num; path++) { -+ rx_status->chains |= BIT(path); -+ rx_status->chain_signal[path] = pkt_stat->rx_power[path]; -+ } -+ } else { -+ rx_status->flag |= RX_FLAG_NO_SIGNAL_VAL; - } - - rtw_rx_addr_match(rtwdev, pkt_stat, hdr); diff --git a/package/kernel/mac80211/patches/rtl/024-v6.13-wifi-rtw88-Add-some-definitions-for-RTL8821AU-RTL881.patch b/package/kernel/mac80211/patches/rtl/024-v6.13-wifi-rtw88-Add-some-definitions-for-RTL8821AU-RTL881.patch deleted file mode 100644 index bf3d2fe267f..00000000000 --- a/package/kernel/mac80211/patches/rtl/024-v6.13-wifi-rtw88-Add-some-definitions-for-RTL8821AU-RTL881.patch +++ /dev/null @@ -1,490 +0,0 @@ -From d12722830ea4f562e91586927ec21b64d0369544 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Wed, 23 Oct 2024 17:00:59 +0300 -Subject: [PATCH] wifi: rtw88: Add some definitions for RTL8821AU/RTL8812AU - -Add 8821A and 8812A chip type enums. - -Add cck_high_power member to struct rtw_hal. This will be used to -calculate the RX signal strength of RTL8812AU. - -Add various register definitions which will be used by the new drivers. - -Move some existing register definitions from rtw8821c.h and rtw8822b.h. -They were duplicated in those headers and will also be used by the new -drivers. - -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/9279a9cd-6f86-4dc3-a095-7c36cb9b9d06@gmail.com ---- - drivers/net/wireless/realtek/rtw88/main.h | 3 + - drivers/net/wireless/realtek/rtw88/reg.h | 174 ++++++++++++++++++ - drivers/net/wireless/realtek/rtw88/rtw8821c.h | 24 --- - drivers/net/wireless/realtek/rtw88/rtw8822b.h | 12 -- - 4 files changed, 177 insertions(+), 36 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/main.h -+++ b/drivers/net/wireless/realtek/rtw88/main.h -@@ -189,6 +189,8 @@ enum rtw_chip_type { - RTW_CHIP_TYPE_8723D, - RTW_CHIP_TYPE_8821C, - RTW_CHIP_TYPE_8703B, -+ RTW_CHIP_TYPE_8821A, -+ RTW_CHIP_TYPE_8812A, - }; - - enum rtw_tx_queue_type { -@@ -1934,6 +1936,7 @@ struct rtw_hal { - u32 antenna_rx; - u8 bfee_sts_cap; - bool txrx_1ss; -+ bool cck_high_power; - - /* protect tx power section */ - struct mutex tx_power_mutex; ---- a/drivers/net/wireless/realtek/rtw88/reg.h -+++ b/drivers/net/wireless/realtek/rtw88/reg.h -@@ -9,6 +9,7 @@ - #define BIT_FEN_EN_25_1 BIT(13) - #define BIT_FEN_ELDR BIT(12) - #define BIT_FEN_CPUEN BIT(2) -+#define BIT_FEN_USBA BIT(2) - #define BIT_FEN_BB_GLB_RST BIT(1) - #define BIT_FEN_BB_RSTB BIT(0) - #define BIT_R_DIS_PRST BIT(6) -@@ -16,6 +17,10 @@ - #define REG_SYS_PW_CTRL 0x0004 - #define BIT_PFM_WOWL BIT(3) - #define BIT_APFM_OFFMAC BIT(9) -+#define REG_APS_FSMCO 0x0004 -+#define APS_FSMCO_MAC_ENABLE BIT(8) -+#define APS_FSMCO_MAC_OFF BIT(9) -+#define APS_FSMCO_HW_POWERDOWN BIT(15) - #define REG_SYS_CLK_CTRL 0x0008 - #define BIT_CPU_CLK_EN BIT(14) - -@@ -58,6 +63,8 @@ - #define BIT_SHIFT_LDO25_VOLTAGE 4 - #define BIT_LDO25_EN BIT(7) - -+#define REG_ACLK_MON 0x3e -+ - #define REG_GPIO_MUXCFG 0x0040 - #define BIT_FSPI_EN BIT(19) - #define BIT_EN_SIC BIT(12) -@@ -90,6 +97,8 @@ - #define BIT_USB_SUS_DIS BIT(8) - #define BIT_SDIO_PAD_E5 BIT(18) - -+#define REG_RF_B_CTRL 0x76 -+ - #define REG_AFE_CTRL_4 0x0078 - #define BIT_CK320M_AFE_EN BIT(4) - #define BIT_EN_SYN BIT(15) -@@ -134,6 +143,11 @@ - #define REG_PMC_DBG_CTRL1 0xa8 - #define BITS_PMC_BT_IQK_STS GENMASK(22, 21) - -+#define REG_HIMR0 0xb0 -+#define REG_HISR0 0xb4 -+#define REG_HIMR1 0xb8 -+#define REG_HISR1 0xbc -+ - #define REG_PAD_CTRL2 0x00C4 - #define BIT_RSM_EN_V1 BIT(16) - #define BIT_NO_PDN_CHIPOFF_V1 BIT(17) -@@ -185,6 +199,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 REG_PBP 0x104 -+#define PBP_RX_MASK 0x0f -+#define PBP_TX_MASK 0xf0 -+#define PBP_64 0x0 -+#define PBP_128 0x1 -+#define PBP_256 0x2 -+#define PBP_512 0x3 -+#define PBP_1024 0x4 -+ - #define BIT_SHIFT_TXDMA_VOQ_MAP 4 - #define BIT_MASK_TXDMA_VOQ_MAP 0x3 - #define BIT_TXDMA_VOQ_MAP(x) \ -@@ -256,6 +279,8 @@ - #define REG_HMEBOX1 0x01D4 - #define REG_HMEBOX2 0x01D8 - #define REG_HMEBOX3 0x01DC -+#define REG_LLT_INIT 0x01E0 -+#define BIT_LLT_WRITE_ACCESS BIT(30) - #define REG_HMEBOX0_EX 0x01F0 - #define REG_HMEBOX1_EX 0x01F4 - #define REG_HMEBOX2_EX 0x01F8 -@@ -298,6 +323,7 @@ - - #define REG_AUTO_LLT 0x0224 - #define BIT_AUTO_INIT_LLT BIT(16) -+#define REG_DWBCN1_CTRL 0x0228 - #define REG_RQPN_CTRL_1 0x0228 - #define REG_RQPN_CTRL_2 0x022C - #define BIT_LD_RQPN BIT(31) -@@ -329,6 +355,7 @@ - #define BIT_DMA_BURST_SIZE_1024 0 - - #define REG_RXPKTNUM 0x02B0 -+#define REG_EARLY_MODE_CONTROL 0x02BC - - #define REG_INT_MIG 0x0304 - #define REG_HCI_MIX_CFG 0x03FC -@@ -336,6 +363,7 @@ - - #define REG_BCNQ_INFO 0x0418 - #define BIT_MGQ_CPU_EMPTY BIT(24) -+#define REG_TXPKT_EMPTY 0x041A - #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 @@ - #define REG_AMPDU_MAX_TIME_V1 0x0455 - #define REG_BCNQ1_BDNY_V1 0x0456 - #define REG_AMPDU_MAX_TIME 0x0456 -+#define REG_AMPDU_MAX_LENGTH 0x0458 - #define REG_WMAC_LBK_BF_HD 0x045D - #define REG_TX_HANG_CTRL 0x045E - #define BIT_EN_GNT_BT_AWAKE BIT(3) - #define BIT_EN_EOF_V1 BIT(2) -+#define REG_FAST_EDCA_CTRL 0x0460 - #define REG_DATA_SC 0x0483 - #define REG_ARFR2_V1 0x048C - #define REG_ARFRH2_V1 0x0490 -@@ -390,6 +420,8 @@ - #define REG_PRECNT_CTRL 0x04E5 - #define BIT_BTCCA_CTRL (BIT(0) | BIT(1)) - #define BIT_EN_PRECNT BIT(11) -+#define REG_TX_RPT_CTRL 0x04EC -+#define REG_TX_RPT_TIME 0x04F0 - #define REG_DUMMY_PAGE4_V1 0x04FC - - #define REG_EDCA_VO_PARAM 0x0500 -@@ -400,6 +432,7 @@ - #define BIT_MASK_CWMAX GENMASK(15, 12) - #define BIT_MASK_CWMIN GENMASK(11, 8) - #define BIT_MASK_AIFS GENMASK(7, 0) -+#define REG_BCNTCFG 0x0510 - #define REG_PIFS 0x0512 - #define REG_SIFS 0x0514 - #define BIT_SHIFT_SIFS_OFDM_CTX 8 -@@ -526,6 +559,8 @@ - #define REG_BT_COEX_V2 0x0762 - #define BIT_GNT_BT_POLARITY BIT(12) - #define BIT_LTE_COEX_EN BIT(7) -+#define REG_GNT_BT 0x0765 -+#define BIT_PTA_SW_CTL GENMASK(4, 3) - #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 @@ - #define REG_FPGA0_RFMOD 0x0800 - #define BIT_CCKEN BIT(24) - #define BIT_OFDMEN BIT(25) -+#define REG_CCK_RPT_FORMAT 0x0804 -+#define BIT_CCK_RPT_FORMAT BIT(16) -+#define REG_RXPSEL 0x0808 -+#define BIT_RX_PSEL_RST (BIT(28) | BIT(29)) -+#define REG_TXPSEL 0x080C - #define REG_RX_GAIN_EN 0x081c -+#define REG_CCASEL 0x082C -+#define REG_PDMFTH 0x0830 -+#define REG_BWINDICATION 0x0834 -+#define REG_CCA2ND 0x0838 -+#define REG_L1PKTH 0x0848 -+#define REG_CLKTRK 0x0860 -+#define REG_ADCCLK 0x08AC -+#define REG_HSSI_READ 0x08B0 -+#define REG_FPGA0_XCD_RF_PARA 0x08B4 -+#define REG_RX_MCS_LIMIT 0x08BC -+#define REG_ADC160 0x08C4 -+#define REG_ANTSEL_SW 0x0900 -+#define REG_DAC_RSTB 0x090c -+#define REG_SINGLE_TONE_CONT_TX 0x0914 - - #define REG_RFE_CTRL_E 0x0974 - #define REG_2ND_CCA_CTRL 0x0976 -+#define REG_IQK_COM00 0x0978 -+#define REG_IQK_COM32 0x097c -+#define REG_IQK_COM64 0x0980 -+#define REG_IQK_COM96 0x0984 -+ -+#define REG_FAS 0x09a4 -+#define REG_RXSB 0x0a00 -+#define REG_CCK_RX 0x0a04 -+#define REG_CCK_PD_TH 0x0a0a - - #define REG_CCK0_FAREPORT 0xa2c - #define BIT_CCK0_2RX BIT(18) - #define BIT_CCK0_MRC BIT(22) -+#define REG_FA_CCK 0x0a5c - - #define REG_DIS_DPD 0x0a70 - #define DIS_DPD_MASK GENMASK(9, 0) -@@ -566,13 +630,109 @@ - #define DIS_DPD_RATEVHT2SS_MCS1 BIT(9) - #define DIS_DPD_RATEALL GENMASK(9, 0) - -+#define REG_CNTRST 0x0b58 -+ -+#define REG_3WIRE_SWA 0x0c00 -+#define REG_RX_IQC_AB_A 0x0c10 -+#define REG_TXSCALE_A 0x0c1c -+#define BB_SWING_MASK GENMASK(31, 21) -+#define REG_TX_AGC_A_CCK_11_CCK_1 0xc20 -+#define REG_TX_AGC_A_OFDM18_OFDM6 0xc24 -+#define REG_TX_AGC_A_OFDM54_OFDM24 0xc28 -+#define REG_TX_AGC_A_MCS3_MCS0 0xc2c -+#define REG_TX_AGC_A_MCS7_MCS4 0xc30 -+#define REG_TX_AGC_A_MCS11_MCS8 0xc34 -+#define REG_TX_AGC_A_MCS15_MCS12 0xc38 -+#define REG_TX_AGC_A_NSS1_INDEX3_NSS1_INDEX0 0xc3c -+#define REG_TX_AGC_A_NSS1_INDEX7_NSS1_INDEX4 0xc40 -+#define REG_TX_AGC_A_NSS2_INDEX1_NSS1_INDEX8 0xc44 -+#define REG_TX_AGC_A_NSS2_INDEX5_NSS2_INDEX2 0xc48 -+#define REG_TX_AGC_A_NSS2_INDEX9_NSS2_INDEX6 0xc4c -+#define REG_RXIGI_A 0x0c50 -+#define REG_TX_PWR_TRAINING_A 0x0c54 -+#define REG_CK_MONHA 0x0c5c -+#define REG_AFE_PWR1_A 0x0c60 -+#define REG_AFE_PWR2_A 0x0c64 -+#define REG_RX_WAIT_CCA_TX_CCK_RFON_A 0x0c68 -+#define REG_OFDM0_XA_TX_IQ_IMBALANCE 0x0c80 -+#define REG_OFDM0_A_TX_AFE 0x0c84 -+#define REG_OFDM0_XB_TX_IQ_IMBALANCE 0x0c88 -+#define REG_TSSI_TRK_SW 0x0c8c -+#define REG_LSSI_WRITE_A 0x0c90 -+#define REG_PREDISTA 0x0c90 -+#define REG_TXAGCIDX 0x0c94 -+ -+#define REG_RFE_PINMUX_A 0x0cb0 -+#define REG_RFE_INV_A 0x0cb4 - #define REG_RFE_CTRL8 0x0cb4 - #define BIT_MASK_RFE_SEL89 GENMASK(7, 0) -+#define PTA_CTRL_PIN 0x66 -+#define DPDT_CTRL_PIN 0x77 -+#define RFE_INV_MASK 0x3ff00000 -+#define REG_RFECTL_A 0x0cb8 - #define REG_RFE_INV8 0x0cbd - #define BIT_MASK_RFE_INV89 GENMASK(1, 0) - #define REG_RFE_INV16 0x0cbe - #define BIT_RFE_BUF_EN BIT(3) - -+#define REG_IQK_DPD_CFG 0x0cc4 -+#define REG_CFG_PMPD 0x0cc8 -+#define REG_IQC_Y 0x0ccc -+#define REG_IQC_X 0x0cd4 -+#define REG_INTPO_SETA 0x0ce8 -+ -+#define REG_IQKA_END 0x0d00 -+#define REG_PI_READ_A 0x0d04 -+#define REG_SI_READ_A 0x0d08 -+#define REG_IQKB_END 0x0d40 -+#define REG_PI_READ_B 0x0d44 -+#define REG_SI_READ_B 0x0d48 -+ -+#define REG_3WIRE_SWB 0x0e00 -+#define REG_RX_IQC_AB_B 0x0e10 -+#define REG_TXSCALE_B 0x0e1c -+#define REG_TX_AGC_B_CCK_11_CCK_1 0xe20 -+#define REG_TX_AGC_B_OFDM18_OFDM6 0xe24 -+#define REG_TX_AGC_B_OFDM54_OFDM24 0xe28 -+#define REG_TX_AGC_B_MCS3_MCS0 0xe2c -+#define REG_TX_AGC_B_MCS7_MCS4 0xe30 -+#define REG_TX_AGC_B_MCS11_MCS8 0xe34 -+#define REG_TX_AGC_B_MCS15_MCS12 0xe38 -+#define REG_TX_AGC_B_NSS1_INDEX3_NSS1_INDEX0 0xe3c -+#define REG_TX_AGC_B_NSS1_INDEX7_NSS1_INDEX4 0xe40 -+#define REG_TX_AGC_B_NSS2_INDEX1_NSS1_INDEX8 0xe44 -+#define REG_TX_AGC_B_NSS2_INDEX5_NSS2_INDEX2 0xe48 -+#define REG_TX_AGC_B_NSS2_INDEX9_NSS2_INDEX6 0xe4c -+#define REG_RXIGI_B 0x0e50 -+#define REG_TX_PWR_TRAINING_B 0x0e54 -+#define REG_CK_MONHB 0x0e5c -+#define REG_AFE_PWR1_B 0x0e60 -+#define REG_AFE_PWR2_B 0x0e64 -+#define REG_RX_WAIT_CCA_TX_CCK_RFON_B 0x0e68 -+#define REG_TXTONEB 0x0e80 -+#define REG_RXTONEB 0x0e84 -+#define REG_TXPITMB 0x0e88 -+#define REG_RXPITMB 0x0e8c -+#define REG_LSSI_WRITE_B 0x0e90 -+#define REG_PREDISTB 0x0e90 -+#define REG_INIDLYB 0x0e94 -+#define REG_RFE_PINMUX_B 0x0eb0 -+#define REG_RFE_INV_B 0x0eb4 -+#define REG_RFECTL_B 0x0eb8 -+#define REG_BPBDB 0x0ec4 -+#define REG_PHYTXONB 0x0ec8 -+#define REG_IQKYB 0x0ecc -+#define REG_IQKXB 0x0ed4 -+#define REG_INTPO_SETB 0x0ee8 -+ -+#define REG_CRC_CCK 0x0f04 -+#define REG_CCA_OFDM 0x0f08 -+#define REG_CRC_VHT 0x0f0c -+#define REG_CRC_HT 0x0f10 -+#define REG_CRC_OFDM 0x0f14 -+#define REG_FA_OFDM 0x0f48 -+#define REG_CCA_CCK 0x0fcc -+ - #define REG_ANAPARSW_MAC_0 0x1010 - #define BIT_CF_L_V2 GENMASK(29, 28) - -@@ -709,6 +869,10 @@ - - #define REG_IGN_GNTBT4 0x4160 - -+#define REG_USB_MOD 0xf008 -+#define REG_USB3_RXITV 0xf050 -+#define REG_USB_HRPWM 0xfe58 -+ - #define RF_MODE 0x00 - #define RF_MODOPT 0x01 - #define RF_WLINT 0x01 -@@ -716,7 +880,13 @@ - #define RF_DTXLOK 0x08 - #define RF_CFGCH 0x18 - #define BIT_BAND GENMASK(18, 16) -+#define RF18_BAND_MASK (BIT(16) | BIT(9) | BIT(8)) -+#define RF18_CHANNEL_MASK (MASKBYTE0) -+#define RF18_RFSI_MASK (BIT(18) | BIT(17)) - #define RF_RCK 0x1d -+#define RF_MODE_TABLE_ADDR 0x30 -+#define RF_MODE_TABLE_DATA0 0x31 -+#define RF_MODE_TABLE_DATA1 0x32 - #define RF_LUTWA 0x33 - #define RF_LUTWD1 0x3e - #define RF_LUTWD0 0x3f -@@ -725,10 +895,14 @@ - #define RF_T_METER 0x42 - #define RF_BSPAD 0x54 - #define RF_GAINTX 0x56 -+#define RF_TXMOD 0x58 - #define RF_TXATANK 0x64 -+#define RF_TXA_PREPAD 0x65 - #define RF_TRXIQ 0x66 - #define RF_RXIQGEN 0x8d -+#define RF_RXBB2 0x8f - #define RF_SYN_PFD 0xb0 -+#define RF_LCK 0xb4 - #define RF_XTALX2 0xb8 - #define RF_SYN_CTRL 0xbb - #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 - #define BIT_FEN_EN BIT(26) - #define REG_INIRTS_RATE_SEL 0x0480 - #define REG_HTSTFWT 0x800 --#define REG_RXPSEL 0x808 --#define BIT_RX_PSEL_RST (BIT(28) | BIT(29)) --#define REG_TXPSEL 0x80c - #define REG_RXCCAMSK 0x814 --#define REG_CCASEL 0x82c --#define REG_PDMFTH 0x830 --#define REG_CCA2ND 0x838 - #define REG_L1WT 0x83c - #define REG_L1PKWT 0x840 - #define REG_MRC 0x850 --#define REG_CLKTRK 0x860 --#define REG_ADCCLK 0x8ac --#define REG_ADC160 0x8c4 - #define REG_ADC40 0x8c8 - #define REG_CHFIR 0x8f0 - #define REG_CDDTXP 0x93c -@@ -234,14 +225,11 @@ extern const struct rtw_chip_info rtw882 - #define REG_ACBB0 0x948 - #define REG_ACBBRXFIR 0x94c - #define REG_ACGG2TBL 0x958 --#define REG_FAS 0x9a4 --#define REG_RXSB 0xa00 - #define REG_ADCINI 0xa04 - #define REG_PWRTH 0xa08 - #define REG_CCA_FLTR 0xa20 - #define REG_TXSF2 0xa24 - #define REG_TXSF6 0xa28 --#define REG_FA_CCK 0xa5c - #define REG_RXDESC 0xa2c - #define REG_ENTXCCK 0xa80 - #define BTG_LNA 0xfc84 -@@ -252,12 +240,8 @@ extern const struct rtw_chip_info rtw882 - #define REG_PWRTH2 0xaa8 - #define REG_CSRATIO 0xaaa - #define REG_TXFILTER 0xaac --#define REG_CNTRST 0xb58 - #define REG_AGCTR_A 0xc08 --#define REG_TXSCALE_A 0xc1c - #define REG_TXDFIR 0xc20 --#define REG_RXIGI_A 0xc50 --#define REG_TXAGCIDX 0xc94 - #define REG_TRSW 0xca0 - #define REG_RFESEL0 0xcb0 - #define REG_RFESEL8 0xcb4 -@@ -269,14 +253,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_RXIGI_B 0xe50 --#define REG_CRC_CCK 0xf04 --#define REG_CRC_OFDM 0xf14 --#define REG_CRC_HT 0xf10 --#define REG_CRC_VHT 0xf0c --#define REG_CCA_OFDM 0xf08 --#define REG_FA_OFDM 0xf48 --#define REG_CCA_CCK 0xfcc - #define REG_DMEM_CTRL 0x1080 - #define BIT_WL_RST BIT(16) - #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 - #define RTW8822B_EDCCA_MAX 0x7f - #define RTW8822B_EDCCA_SRC_DEF 1 - #define REG_HTSTFWT 0x800 --#define REG_RXPSEL 0x808 --#define BIT_RX_PSEL_RST (BIT(28) | BIT(29)) --#define REG_TXPSEL 0x80c - #define REG_RXCCAMSK 0x814 --#define REG_CCASEL 0x82c --#define REG_PDMFTH 0x830 --#define REG_CCA2ND 0x838 - #define REG_L1WT 0x83c - #define REG_L1PKWT 0x840 - #define REG_MRC 0x850 --#define REG_CLKTRK 0x860 - #define REG_EDCCA_POW_MA 0x8a0 - #define BIT_MA_LEVEL GENMASK(1, 0) --#define REG_ADCCLK 0x8ac --#define REG_ADC160 0x8c4 - #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 - #define REG_ACBB0 0x948 - #define REG_ACBBRXFIR 0x94c - #define REG_ACGG2TBL 0x958 --#define REG_RXSB 0xa00 - #define REG_ADCINI 0xa04 - #define REG_TXSF2 0xa24 - #define REG_TXSF6 0xa28 -@@ -184,14 +174,12 @@ _rtw_write32s_mask(struct rtw_dev *rtwde - #define REG_ENTXCCK 0xa80 - #define REG_AGCTR_A 0xc08 - #define REG_TXDFIR 0xc20 --#define REG_RXIGI_A 0xc50 - #define REG_TRSW 0xca0 - #define REG_RFESEL0 0xcb0 - #define REG_RFESEL8 0xcb4 - #define REG_RFECTL 0xcb8 - #define REG_RFEINV 0xcbc - #define REG_AGCTR_B 0xe08 --#define REG_RXIGI_B 0xe50 - #define REG_ANTWT 0x1904 - #define REG_IQKFAILMSK 0x1bf0 - diff --git a/package/kernel/mac80211/patches/rtl/025-v6.13-wifi-rtw88-Dump-the-HW-features-only-for-some-chips.patch b/package/kernel/mac80211/patches/rtl/025-v6.13-wifi-rtw88-Dump-the-HW-features-only-for-some-chips.patch deleted file mode 100644 index 279e8ba761d..00000000000 --- a/package/kernel/mac80211/patches/rtl/025-v6.13-wifi-rtw88-Dump-the-HW-features-only-for-some-chips.patch +++ /dev/null @@ -1,93 +0,0 @@ -From 87341ca1eac9a3bac23bd41f6e24f3c93b77452f Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Wed, 23 Oct 2024 17:02:05 +0300 -Subject: [PATCH] wifi: rtw88: Dump the HW features only for some chips - -RTL8821AU and RTL8812AU don't support this. They hit the "failed to read -hw feature report" error. - -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/8becd851-8760-4480-8e8c-c4869ce72507@gmail.com ---- - drivers/net/wireless/realtek/rtw88/main.c | 3 +++ - drivers/net/wireless/realtek/rtw88/main.h | 1 + - drivers/net/wireless/realtek/rtw88/rtw8703b.c | 1 + - drivers/net/wireless/realtek/rtw88/rtw8723d.c | 1 + - drivers/net/wireless/realtek/rtw88/rtw8821c.c | 1 + - drivers/net/wireless/realtek/rtw88/rtw8822b.c | 1 + - drivers/net/wireless/realtek/rtw88/rtw8822c.c | 1 + - 7 files changed, 9 insertions(+) - ---- 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 - u8 bw; - int i; - -+ if (!rtwdev->chip->hw_feature_report) -+ return 0; -+ - id = rtw_read8(rtwdev, REG_C2HEVT); - if (id != C2H_HW_FEATURE_REPORT) { - rtw_err(rtwdev, "failed to read hw feature report\n"); ---- a/drivers/net/wireless/realtek/rtw88/main.h -+++ b/drivers/net/wireless/realtek/rtw88/main.h -@@ -1200,6 +1200,7 @@ struct rtw_chip_info { - const struct rtw_fwcd_segs *fwcd_segs; - - u8 usb_tx_agg_desc_num; -+ bool hw_feature_report; - - u8 default_1ss_tx_path; - ---- a/drivers/net/wireless/realtek/rtw88/rtw8703b.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8703b.c -@@ -1960,6 +1960,7 @@ const struct rtw_chip_info rtw8703b_hw_s - .max_power_index = 0x3f, - .ampdu_density = IEEE80211_HT_MPDU_DENSITY_16, - .usb_tx_agg_desc_num = 1, /* Not sure if this chip has USB interface */ -+ .hw_feature_report = true, - - .path_div_supported = false, - .ht_supported = true, ---- a/drivers/net/wireless/realtek/rtw88/rtw8723d.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8723d.c -@@ -2131,6 +2131,7 @@ const struct rtw_chip_info rtw8723d_hw_s - .page_size = TX_PAGE_SIZE, - .dig_min = 0x20, - .usb_tx_agg_desc_num = 1, -+ .hw_feature_report = true, - .ht_supported = true, - .vht_supported = false, - .lps_deep_mode_supported = 0, ---- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c -@@ -1968,6 +1968,7 @@ const struct rtw_chip_info rtw8821c_hw_s - .page_size = TX_PAGE_SIZE, - .dig_min = 0x1c, - .usb_tx_agg_desc_num = 3, -+ .hw_feature_report = true, - .ht_supported = true, - .vht_supported = true, - .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 - .page_size = TX_PAGE_SIZE, - .dig_min = 0x1c, - .usb_tx_agg_desc_num = 3, -+ .hw_feature_report = true, - .ht_supported = true, - .vht_supported = 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 -@@ -5329,6 +5329,7 @@ const struct rtw_chip_info rtw8822c_hw_s - .page_size = TX_PAGE_SIZE, - .dig_min = 0x20, - .usb_tx_agg_desc_num = 3, -+ .hw_feature_report = true, - .default_1ss_tx_path = BB_PATH_A, - .path_div_supported = true, - .ht_supported = true, diff --git a/package/kernel/mac80211/patches/rtl/026-v6.13-wifi-rtw88-Allow-different-C2H-RA-report-sizes.patch b/package/kernel/mac80211/patches/rtl/026-v6.13-wifi-rtw88-Allow-different-C2H-RA-report-sizes.patch deleted file mode 100644 index 0e97febb727..00000000000 --- a/package/kernel/mac80211/patches/rtl/026-v6.13-wifi-rtw88-Allow-different-C2H-RA-report-sizes.patch +++ /dev/null @@ -1,175 +0,0 @@ -From d9018f4373517d4560ce2ebf12684f77f5fbdad6 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Wed, 23 Oct 2024 17:06:14 +0300 -Subject: [PATCH] wifi: rtw88: Allow different C2H RA report sizes - -The RTL8821AU and RTL8812AU have smaller RA report size, only 4 bytes. -Avoid the "invalid ra report c2h length" error. - -Also, use a struct and u8_get_bits() to access the RA report C2H. - -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/c3e73c3a-fb2f-4013-9f06-d5274211e282@gmail.com ---- - drivers/net/wireless/realtek/rtw88/fw.c | 21 +++++++++++++------ - drivers/net/wireless/realtek/rtw88/fw.h | 17 +++++++++++---- - drivers/net/wireless/realtek/rtw88/main.h | 1 + - drivers/net/wireless/realtek/rtw88/rtw8703b.c | 1 + - drivers/net/wireless/realtek/rtw88/rtw8723d.c | 1 + - drivers/net/wireless/realtek/rtw88/rtw8821c.c | 1 + - drivers/net/wireless/realtek/rtw88/rtw8822b.c | 1 + - drivers/net/wireless/realtek/rtw88/rtw8822c.c | 1 + - 8 files changed, 34 insertions(+), 10 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/fw.c -+++ b/drivers/net/wireless/realtek/rtw88/fw.c -@@ -139,25 +139,30 @@ static u16 get_max_amsdu_len(u32 bit_rat - struct rtw_fw_iter_ra_data { - struct rtw_dev *rtwdev; - u8 *payload; -+ u8 length; - }; - - static void rtw_fw_ra_report_iter(void *data, struct ieee80211_sta *sta) - { - struct rtw_fw_iter_ra_data *ra_data = data; -+ struct rtw_c2h_ra_rpt *ra_rpt = (struct rtw_c2h_ra_rpt *)ra_data->payload; - struct rtw_sta_info *si = (struct rtw_sta_info *)sta->drv_priv; - u8 mac_id, rate, sgi, bw; - u8 mcs, nss; - u32 bit_rate; - -- mac_id = GET_RA_REPORT_MACID(ra_data->payload); -+ mac_id = ra_rpt->mac_id; - if (si->mac_id != mac_id) - return; - - si->ra_report.txrate.flags = 0; - -- rate = GET_RA_REPORT_RATE(ra_data->payload); -- sgi = GET_RA_REPORT_SGI(ra_data->payload); -- bw = GET_RA_REPORT_BW(ra_data->payload); -+ rate = u8_get_bits(ra_rpt->rate_sgi, RTW_C2H_RA_RPT_RATE); -+ sgi = u8_get_bits(ra_rpt->rate_sgi, RTW_C2H_RA_RPT_SGI); -+ if (ra_data->length >= offsetofend(typeof(*ra_rpt), bw)) -+ bw = ra_rpt->bw; -+ else -+ bw = si->bw_mode; - - if (rate < DESC_RATEMCS0) { - si->ra_report.txrate.legacy = rtw_desc_to_bitrate(rate); -@@ -197,14 +202,18 @@ legacy: - static void rtw_fw_ra_report_handle(struct rtw_dev *rtwdev, u8 *payload, - u8 length) - { -+ struct rtw_c2h_ra_rpt *ra_rpt = (struct rtw_c2h_ra_rpt *)payload; - struct rtw_fw_iter_ra_data ra_data; - -- if (WARN(length < 7, "invalid ra report c2h length\n")) -+ if (WARN(length < rtwdev->chip->c2h_ra_report_size, -+ "invalid ra report c2h length %d\n", length)) - return; - -- rtwdev->dm_info.tx_rate = GET_RA_REPORT_RATE(payload); -+ rtwdev->dm_info.tx_rate = u8_get_bits(ra_rpt->rate_sgi, -+ RTW_C2H_RA_RPT_RATE); - ra_data.rtwdev = rtwdev; - ra_data.payload = payload; -+ ra_data.length = length; - rtw_iterate_stas_atomic(rtwdev, rtw_fw_ra_report_iter, &ra_data); - } - ---- a/drivers/net/wireless/realtek/rtw88/fw.h -+++ b/drivers/net/wireless/realtek/rtw88/fw.h -@@ -85,6 +85,19 @@ struct rtw_c2h_adaptivity { - u8 option; - } __packed; - -+struct rtw_c2h_ra_rpt { -+ u8 rate_sgi; -+ u8 mac_id; -+ u8 byte2; -+ u8 status; -+ u8 byte4; -+ u8 ra_ratio; -+ u8 bw; -+} __packed; -+ -+#define RTW_C2H_RA_RPT_RATE GENMASK(6, 0) -+#define RTW_C2H_RA_RPT_SGI BIT(7) -+ - struct rtw_h2c_register { - u32 w0; - u32 w1; -@@ -364,10 +377,6 @@ struct rtw_fw_hdr_legacy { - #define GET_CHAN_SWITCH_CENTRAL_CH(c2h_payload) (c2h_payload[2]) - #define GET_CHAN_SWITCH_ID(c2h_payload) (c2h_payload[3]) - #define GET_CHAN_SWITCH_STATUS(c2h_payload) (c2h_payload[4]) --#define GET_RA_REPORT_RATE(c2h_payload) (c2h_payload[0] & 0x7f) --#define GET_RA_REPORT_SGI(c2h_payload) ((c2h_payload[0] & 0x80) >> 7) --#define GET_RA_REPORT_BW(c2h_payload) (c2h_payload[6]) --#define GET_RA_REPORT_MACID(c2h_payload) (c2h_payload[1]) - - #define GET_BCN_FILTER_NOTIFY_TYPE(c2h_payload) (c2h_payload[1] & 0xf) - #define GET_BCN_FILTER_NOTIFY_EVENT(c2h_payload) (c2h_payload[1] & 0x10) ---- a/drivers/net/wireless/realtek/rtw88/main.h -+++ b/drivers/net/wireless/realtek/rtw88/main.h -@@ -1201,6 +1201,7 @@ struct rtw_chip_info { - - u8 usb_tx_agg_desc_num; - bool hw_feature_report; -+ u8 c2h_ra_report_size; - - u8 default_1ss_tx_path; - ---- a/drivers/net/wireless/realtek/rtw88/rtw8703b.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8703b.c -@@ -1961,6 +1961,7 @@ const struct rtw_chip_info rtw8703b_hw_s - .ampdu_density = IEEE80211_HT_MPDU_DENSITY_16, - .usb_tx_agg_desc_num = 1, /* Not sure if this chip has USB interface */ - .hw_feature_report = true, -+ .c2h_ra_report_size = 7, - - .path_div_supported = false, - .ht_supported = true, ---- a/drivers/net/wireless/realtek/rtw88/rtw8723d.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8723d.c -@@ -2132,6 +2132,7 @@ const struct rtw_chip_info rtw8723d_hw_s - .dig_min = 0x20, - .usb_tx_agg_desc_num = 1, - .hw_feature_report = true, -+ .c2h_ra_report_size = 7, - .ht_supported = true, - .vht_supported = false, - .lps_deep_mode_supported = 0, ---- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c -@@ -1969,6 +1969,7 @@ const struct rtw_chip_info rtw8821c_hw_s - .dig_min = 0x1c, - .usb_tx_agg_desc_num = 3, - .hw_feature_report = true, -+ .c2h_ra_report_size = 7, - .ht_supported = true, - .vht_supported = true, - .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 - .dig_min = 0x1c, - .usb_tx_agg_desc_num = 3, - .hw_feature_report = true, -+ .c2h_ra_report_size = 7, - .ht_supported = true, - .vht_supported = 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 - .dig_min = 0x20, - .usb_tx_agg_desc_num = 3, - .hw_feature_report = true, -+ .c2h_ra_report_size = 7, - .default_1ss_tx_path = BB_PATH_A, - .path_div_supported = true, - .ht_supported = true, diff --git a/package/kernel/mac80211/patches/rtl/027-v6.13-wifi-rtw88-Extend-the-init-table-parsing-for-RTL8812.patch b/package/kernel/mac80211/patches/rtl/027-v6.13-wifi-rtw88-Extend-the-init-table-parsing-for-RTL8812.patch deleted file mode 100644 index aec2e6aaecf..00000000000 --- a/package/kernel/mac80211/patches/rtl/027-v6.13-wifi-rtw88-Extend-the-init-table-parsing-for-RTL8812.patch +++ /dev/null @@ -1,165 +0,0 @@ -From 95a772e30b60e7954d03f3372268722475aa303f Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Wed, 23 Oct 2024 17:08:24 +0300 -Subject: [PATCH] wifi: rtw88: Extend the init table parsing for RTL8812AU - -The chips supported so far only use the first condition, and so the -parsing code ignores the second condition. RTL8812AU's init tables use -the second condition also. Make the parsing code check it. - -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/1bee6b74-6eab-44a3-9f40-794ca006c72d@gmail.com ---- - drivers/net/wireless/realtek/rtw88/main.h | 15 ++++++ - drivers/net/wireless/realtek/rtw88/phy.c | 62 ++++++++++++++++++++--- - 2 files changed, 69 insertions(+), 8 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/main.h -+++ b/drivers/net/wireless/realtek/rtw88/main.h -@@ -1835,6 +1835,20 @@ struct rtw_phy_cond { - #define BRANCH_ENDIF 3 - }; - -+struct rtw_phy_cond2 { -+#ifdef __LITTLE_ENDIAN -+ u8 type_glna; -+ u8 type_gpa; -+ u8 type_alna; -+ u8 type_apa; -+#else -+ u8 type_apa; -+ u8 type_alna; -+ u8 type_gpa; -+ u8 type_glna; -+#endif -+}; -+ - struct rtw_fifo_conf { - /* tx fifo information */ - u16 rsvd_boundary; -@@ -1916,6 +1930,7 @@ struct rtw_hal { - u8 oem_id; - u8 pkg_type; - struct rtw_phy_cond phy_cond; -+ struct rtw_phy_cond2 phy_cond2; - bool rfe_btg; - - u8 ps_mode; ---- a/drivers/net/wireless/realtek/rtw88/phy.c -+++ b/drivers/net/wireless/realtek/rtw88/phy.c -@@ -18,7 +18,10 @@ struct phy_cfg_pair { - }; - - union phy_table_tile { -- struct rtw_phy_cond cond; -+ struct { -+ struct rtw_phy_cond cond; -+ struct rtw_phy_cond2 cond2; -+ } __packed; - struct phy_cfg_pair cfg; - }; - -@@ -1041,7 +1044,8 @@ void rtw_phy_setup_phy_cond(struct rtw_d - { - struct rtw_hal *hal = &rtwdev->hal; - struct rtw_efuse *efuse = &rtwdev->efuse; -- struct rtw_phy_cond cond = {0}; -+ struct rtw_phy_cond cond = {}; -+ struct rtw_phy_cond2 cond2 = {}; - - cond.cut = hal->cut_version ? hal->cut_version : 15; - cond.pkg = pkg ? pkg : 15; -@@ -1061,15 +1065,34 @@ void rtw_phy_setup_phy_cond(struct rtw_d - break; - } - -+ if (rtwdev->chip->id == RTW_CHIP_TYPE_8812A || -+ rtwdev->chip->id == RTW_CHIP_TYPE_8821A) { -+ cond.rfe = 0; -+ cond.rfe |= efuse->ext_lna_2g; -+ cond.rfe |= efuse->ext_pa_2g << 1; -+ cond.rfe |= efuse->ext_lna_5g << 2; -+ cond.rfe |= efuse->ext_pa_5g << 3; -+ cond.rfe |= efuse->btcoex << 4; -+ -+ cond2.type_alna = efuse->alna_type; -+ cond2.type_glna = efuse->glna_type; -+ cond2.type_apa = efuse->apa_type; -+ cond2.type_gpa = efuse->gpa_type; -+ } -+ - hal->phy_cond = cond; -+ hal->phy_cond2 = cond2; - -- rtw_dbg(rtwdev, RTW_DBG_PHY, "phy cond=0x%08x\n", *((u32 *)&hal->phy_cond)); -+ rtw_dbg(rtwdev, RTW_DBG_PHY, "phy cond=0x%08x cond2=0x%08x\n", -+ *((u32 *)&hal->phy_cond), *((u32 *)&hal->phy_cond2)); - } - --static bool check_positive(struct rtw_dev *rtwdev, struct rtw_phy_cond cond) -+static bool check_positive(struct rtw_dev *rtwdev, struct rtw_phy_cond cond, -+ struct rtw_phy_cond2 cond2) - { - struct rtw_hal *hal = &rtwdev->hal; - struct rtw_phy_cond drv_cond = hal->phy_cond; -+ struct rtw_phy_cond2 drv_cond2 = hal->phy_cond2; - - if (cond.cut && cond.cut != drv_cond.cut) - return false; -@@ -1080,8 +1103,29 @@ static bool check_positive(struct rtw_de - if (cond.intf && cond.intf != drv_cond.intf) - return false; - -- if (cond.rfe != drv_cond.rfe) -- return false; -+ if (rtwdev->chip->id == RTW_CHIP_TYPE_8812A || -+ rtwdev->chip->id == RTW_CHIP_TYPE_8821A) { -+ if (!(cond.rfe & 0x0f)) -+ return true; -+ -+ if ((cond.rfe & drv_cond.rfe) != cond.rfe) -+ return false; -+ -+ if ((cond.rfe & BIT(0)) && cond2.type_glna != drv_cond2.type_glna) -+ return false; -+ -+ if ((cond.rfe & BIT(1)) && cond2.type_gpa != drv_cond2.type_gpa) -+ return false; -+ -+ if ((cond.rfe & BIT(2)) && cond2.type_alna != drv_cond2.type_alna) -+ return false; -+ -+ if ((cond.rfe & BIT(3)) && cond2.type_apa != drv_cond2.type_apa) -+ return false; -+ } else { -+ if (cond.rfe != drv_cond.rfe) -+ return false; -+ } - - return true; - } -@@ -1090,7 +1134,8 @@ void rtw_parse_tbl_phy_cond(struct rtw_d - { - const union phy_table_tile *p = tbl->data; - const union phy_table_tile *end = p + tbl->size / 2; -- struct rtw_phy_cond pos_cond = {0}; -+ struct rtw_phy_cond pos_cond = {}; -+ struct rtw_phy_cond2 pos_cond2 = {}; - bool is_matched = true, is_skipped = false; - - BUILD_BUG_ON(sizeof(union phy_table_tile) != sizeof(struct phy_cfg_pair)); -@@ -1109,11 +1154,12 @@ void rtw_parse_tbl_phy_cond(struct rtw_d - case BRANCH_ELIF: - default: - pos_cond = p->cond; -+ pos_cond2 = p->cond2; - break; - } - } else if (p->cond.neg) { - if (!is_skipped) { -- if (check_positive(rtwdev, pos_cond)) { -+ if (check_positive(rtwdev, pos_cond, pos_cond2)) { - is_matched = true; - is_skipped = true; - } else { diff --git a/package/kernel/mac80211/patches/rtl/028-v6.13-wifi-rtw88-Allow-rtw_chip_info.ltecoex_addr-to-be-NU.patch b/package/kernel/mac80211/patches/rtl/028-v6.13-wifi-rtw88-Allow-rtw_chip_info.ltecoex_addr-to-be-NU.patch deleted file mode 100644 index 5486fb2d25e..00000000000 --- a/package/kernel/mac80211/patches/rtl/028-v6.13-wifi-rtw88-Allow-rtw_chip_info.ltecoex_addr-to-be-NU.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 7c5bbeba7c36575a3a57ef4be775b2f3fb68c3f9 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Wed, 23 Oct 2024 17:09:04 +0300 -Subject: [PATCH] wifi: rtw88: Allow rtw_chip_info.ltecoex_addr to be NULL - -RTL8821A doesn't have this. Trying to use it results in error messages, -so don't try if ltecoex_addr is NULL. - -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/d1004817-1760-41d1-9136-3d799757c444@gmail.com ---- - drivers/net/wireless/realtek/rtw88/coex.c | 14 +++++++++++--- - 1 file changed, 11 insertions(+), 3 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/coex.c -+++ b/drivers/net/wireless/realtek/rtw88/coex.c -@@ -950,12 +950,18 @@ static void rtw_coex_coex_ctrl_owner(str - - static void rtw_coex_set_gnt_bt(struct rtw_dev *rtwdev, u8 state) - { -+ if (!rtwdev->chip->ltecoex_addr) -+ return; -+ - rtw_coex_write_indirect_reg(rtwdev, LTE_COEX_CTRL, 0xc000, state); - rtw_coex_write_indirect_reg(rtwdev, LTE_COEX_CTRL, 0x0c00, state); - } - - static void rtw_coex_set_gnt_wl(struct rtw_dev *rtwdev, u8 state) - { -+ if (!rtwdev->chip->ltecoex_addr) -+ return; -+ - rtw_coex_write_indirect_reg(rtwdev, LTE_COEX_CTRL, 0x3000, state); - rtw_coex_write_indirect_reg(rtwdev, LTE_COEX_CTRL, 0x0300, state); - } -@@ -3904,7 +3910,7 @@ void rtw_coex_display_coex_info(struct r - u8 sys_lte; - u16 score_board_WB, score_board_BW; - u32 wl_reg_6c0, wl_reg_6c4, wl_reg_6c8, wl_reg_778, wl_reg_6cc; -- u32 lte_coex, bt_coex; -+ u32 lte_coex = 0, bt_coex = 0; - int i; - - score_board_BW = rtw_coex_read_scbd(rtwdev); -@@ -3916,8 +3922,10 @@ void rtw_coex_display_coex_info(struct r - wl_reg_778 = rtw_read8(rtwdev, REG_BT_STAT_CTRL); - - sys_lte = rtw_read8(rtwdev, 0x73); -- lte_coex = rtw_coex_read_indirect_reg(rtwdev, 0x38); -- bt_coex = rtw_coex_read_indirect_reg(rtwdev, 0x54); -+ if (rtwdev->chip->ltecoex_addr) { -+ lte_coex = rtw_coex_read_indirect_reg(rtwdev, 0x38); -+ bt_coex = rtw_coex_read_indirect_reg(rtwdev, 0x54); -+ } - - if (!coex_stat->wl_under_ips && - (!coex_stat->wl_under_lps || coex_stat->wl_force_lps_ctrl) && diff --git a/package/kernel/mac80211/patches/rtl/029-v6.13-wifi-rtw88-Let-each-driver-control-the-power-on-off-.patch b/package/kernel/mac80211/patches/rtl/029-v6.13-wifi-rtw88-Let-each-driver-control-the-power-on-off-.patch deleted file mode 100644 index 10464b80cd0..00000000000 --- a/package/kernel/mac80211/patches/rtl/029-v6.13-wifi-rtw88-Let-each-driver-control-the-power-on-off-.patch +++ /dev/null @@ -1,272 +0,0 @@ -From fbb5e1b3637a720c83c91a7b1476ab0429bfc747 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Wed, 23 Oct 2024 17:09:47 +0300 -Subject: [PATCH] wifi: rtw88: Let each driver control the power on/off process - -RTL8821AU and RTL8812AU have to do some things differently, so let -them have full control. - -The other chips use the same functions as before. - -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/98ab839f-9100-44ae-9551-9af743a4aa3a@gmail.com ---- - drivers/net/wireless/realtek/rtw88/coex.c | 3 +++ - drivers/net/wireless/realtek/rtw88/mac.c | 11 +++++++---- - drivers/net/wireless/realtek/rtw88/mac.h | 3 +++ - drivers/net/wireless/realtek/rtw88/main.c | 13 ++++++++----- - drivers/net/wireless/realtek/rtw88/main.h | 5 +++++ - drivers/net/wireless/realtek/rtw88/rtw8703b.c | 2 ++ - drivers/net/wireless/realtek/rtw88/rtw8723d.c | 2 ++ - drivers/net/wireless/realtek/rtw88/rtw8821c.c | 2 ++ - drivers/net/wireless/realtek/rtw88/rtw8822b.c | 2 ++ - drivers/net/wireless/realtek/rtw88/rtw8822c.c | 2 ++ - 10 files changed, 36 insertions(+), 9 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/coex.c -+++ b/drivers/net/wireless/realtek/rtw88/coex.c -@@ -2753,16 +2753,19 @@ void rtw_coex_power_on_setting(struct rt - rtw_write8(rtwdev, 0xff1a, 0x0); - rtw_coex_set_gnt_debug(rtwdev); - } -+EXPORT_SYMBOL(rtw_coex_power_on_setting); - - void rtw_coex_power_off_setting(struct rtw_dev *rtwdev) - { - rtw_write16(rtwdev, REG_WIFI_BT_INFO, BIT_BT_INT_EN); - } -+EXPORT_SYMBOL(rtw_coex_power_off_setting); - - void rtw_coex_init_hw_config(struct rtw_dev *rtwdev, bool wifi_only) - { - __rtw_coex_init_hw_config(rtwdev, wifi_only); - } -+EXPORT_SYMBOL(rtw_coex_init_hw_config); - - void rtw_coex_ips_notify(struct rtw_dev *rtwdev, u8 type) - { ---- a/drivers/net/wireless/realtek/rtw88/mac.c -+++ b/drivers/net/wireless/realtek/rtw88/mac.c -@@ -227,8 +227,8 @@ static int rtw_sub_pwr_seq_parser(struct - return 0; - } - --static int rtw_pwr_seq_parser(struct rtw_dev *rtwdev, -- const struct rtw_pwr_seq_cmd * const *cmd_seq) -+int rtw_pwr_seq_parser(struct rtw_dev *rtwdev, -+ const struct rtw_pwr_seq_cmd * const *cmd_seq) - { - u8 cut_mask; - u8 intf_mask; -@@ -267,6 +267,7 @@ static int rtw_pwr_seq_parser(struct rtw - - return 0; - } -+EXPORT_SYMBOL(rtw_pwr_seq_parser); - - static int rtw_mac_power_switch(struct rtw_dev *rtwdev, bool pwr_on) - { -@@ -994,6 +995,7 @@ int rtw_download_firmware(struct rtw_dev - - return 0; - } -+EXPORT_SYMBOL(rtw_download_firmware); - - static u32 get_priority_queues(struct rtw_dev *rtwdev, u32 queues) - { -@@ -1127,7 +1129,7 @@ static int txdma_queue_mapping(struct rt - return 0; - } - --static int set_trx_fifo_info(struct rtw_dev *rtwdev) -+int rtw_set_trx_fifo_info(struct rtw_dev *rtwdev) - { - 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_ - - return 0; - } -+EXPORT_SYMBOL(rtw_set_trx_fifo_info); - - 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 - u16 pubq_num; - int ret; - -- ret = set_trx_fifo_info(rtwdev); -+ ret = rtw_set_trx_fifo_info(rtwdev); - if (ret) - return ret; - ---- a/drivers/net/wireless/realtek/rtw88/mac.h -+++ b/drivers/net/wireless/realtek/rtw88/mac.h -@@ -30,11 +30,14 @@ - - void rtw_set_channel_mac(struct rtw_dev *rtwdev, u8 channel, u8 bw, - u8 primary_ch_idx); -+int rtw_pwr_seq_parser(struct rtw_dev *rtwdev, -+ 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); - 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); -+int rtw_set_trx_fifo_info(struct rtw_dev *rtwdev); - int rtw_ddma_to_fw_fifo(struct rtw_dev *rtwdev, u32 ocp_src, u32 size); - - static inline void rtw_mac_flush_all_queues(struct rtw_dev *rtwdev, bool drop) ---- a/drivers/net/wireless/realtek/rtw88/main.c -+++ b/drivers/net/wireless/realtek/rtw88/main.c -@@ -1309,7 +1309,7 @@ void rtw_update_sta_info(struct rtw_dev - rtw_fw_send_ra_info(rtwdev, si, reset_ra_mask); - } - --static int rtw_wait_firmware_completion(struct rtw_dev *rtwdev) -+int rtw_wait_firmware_completion(struct rtw_dev *rtwdev) - { - const struct rtw_chip_info *chip = rtwdev->chip; - struct rtw_fw_state *fw; -@@ -1329,6 +1329,7 @@ static int rtw_wait_firmware_completion( - - return ret; - } -+EXPORT_SYMBOL(rtw_wait_firmware_completion); - - static enum rtw_lps_deep_mode rtw_update_lps_deep_mode(struct rtw_dev *rtwdev, - struct rtw_fw_state *fw) -@@ -1350,7 +1351,7 @@ static enum rtw_lps_deep_mode rtw_update - return LPS_DEEP_MODE_NONE; - } - --static int rtw_power_on(struct rtw_dev *rtwdev) -+int rtw_power_on(struct rtw_dev *rtwdev) - { - const struct rtw_chip_info *chip = rtwdev->chip; - struct rtw_fw_state *fw = &rtwdev->fw; -@@ -1413,6 +1414,7 @@ err_off: - err: - return ret; - } -+EXPORT_SYMBOL(rtw_power_on); - - void rtw_core_fw_scan_notify(struct rtw_dev *rtwdev, bool start) - { -@@ -1485,7 +1487,7 @@ int rtw_core_start(struct rtw_dev *rtwde - { - int ret; - -- ret = rtw_power_on(rtwdev); -+ ret = rtwdev->chip->ops->power_on(rtwdev); - if (ret) - return ret; - -@@ -1505,12 +1507,13 @@ int rtw_core_start(struct rtw_dev *rtwde - return 0; - } - --static void rtw_power_off(struct rtw_dev *rtwdev) -+void rtw_power_off(struct rtw_dev *rtwdev) - { - rtw_hci_stop(rtwdev); - rtw_coex_power_off_setting(rtwdev); - rtw_mac_power_off(rtwdev); - } -+EXPORT_SYMBOL(rtw_power_off); - - void rtw_core_stop(struct rtw_dev *rtwdev) - { -@@ -1535,7 +1538,7 @@ void rtw_core_stop(struct rtw_dev *rtwde - - mutex_lock(&rtwdev->mutex); - -- rtw_power_off(rtwdev); -+ rtwdev->chip->ops->power_off(rtwdev); - } - - static void rtw_init_ht_cap(struct rtw_dev *rtwdev, ---- a/drivers/net/wireless/realtek/rtw88/main.h -+++ b/drivers/net/wireless/realtek/rtw88/main.h -@@ -843,6 +843,8 @@ struct rtw_regd { - }; - - struct rtw_chip_ops { -+ int (*power_on)(struct rtw_dev *rtwdev); -+ void (*power_off)(struct rtw_dev *rtwdev); - int (*mac_init)(struct rtw_dev *rtwdev); - int (*dump_fw_crash)(struct rtw_dev *rtwdev); - void (*shutdown)(struct rtw_dev *rtwdev); -@@ -2209,6 +2211,7 @@ void rtw_core_scan_start(struct rtw_dev - void rtw_core_scan_complete(struct rtw_dev *rtwdev, struct ieee80211_vif *vif, - bool hw_scan); - int rtw_core_start(struct rtw_dev *rtwdev); -+void rtw_power_off(struct rtw_dev *rtwdev); - void rtw_core_stop(struct rtw_dev *rtwdev); - int rtw_chip_info_setup(struct rtw_dev *rtwdev); - int rtw_core_init(struct rtw_dev *rtwdev); -@@ -2223,6 +2226,8 @@ int rtw_sta_add(struct rtw_dev *rtwdev, - void rtw_sta_remove(struct rtw_dev *rtwdev, struct ieee80211_sta *sta, - bool fw_exist); - void rtw_fw_recovery(struct rtw_dev *rtwdev); -+int rtw_wait_firmware_completion(struct rtw_dev *rtwdev); -+int rtw_power_on(struct rtw_dev *rtwdev); - void rtw_core_fw_scan_notify(struct rtw_dev *rtwdev, bool start); - int rtw_dump_fw(struct rtw_dev *rtwdev, const u32 ocp_src, u32 size, - u32 fwcd_item); ---- a/drivers/net/wireless/realtek/rtw88/rtw8703b.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8703b.c -@@ -1888,6 +1888,8 @@ static const struct coex_tdma_para tdma_ - }; - - static const struct rtw_chip_ops rtw8703b_ops = { -+ .power_on = rtw_power_on, -+ .power_off = rtw_power_off, - .mac_init = rtw8723x_mac_init, - .dump_fw_crash = NULL, - .shutdown = NULL, ---- a/drivers/net/wireless/realtek/rtw88/rtw8723d.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8723d.c -@@ -1390,6 +1390,8 @@ static void rtw8723d_pwr_track(struct rt - } - - static const struct rtw_chip_ops rtw8723d_ops = { -+ .power_on = rtw_power_on, -+ .power_off = rtw_power_off, - .phy_set_param = rtw8723d_phy_set_param, - .read_efuse = rtw8723x_read_efuse, - .query_phy_status = query_phy_status, ---- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c -@@ -1643,6 +1643,8 @@ static const struct rtw_prioq_addrs prio - }; - - static const struct rtw_chip_ops rtw8821c_ops = { -+ .power_on = rtw_power_on, -+ .power_off = rtw_power_off, - .phy_set_param = rtw8821c_phy_set_param, - .read_efuse = rtw8821c_read_efuse, - .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 - }; - - static const struct rtw_chip_ops rtw8822b_ops = { -+ .power_on = rtw_power_on, -+ .power_off = rtw_power_off, - .phy_set_param = rtw8822b_phy_set_param, - .read_efuse = rtw8822b_read_efuse, - .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 - }; - - static const struct rtw_chip_ops rtw8822c_ops = { -+ .power_on = rtw_power_on, -+ .power_off = rtw_power_off, - .phy_set_param = rtw8822c_phy_set_param, - .read_efuse = rtw8822c_read_efuse, - .query_phy_status = query_phy_status, diff --git a/package/kernel/mac80211/patches/rtl/030-v6.13-wifi-rtw88-Enable-data-rate-fallback-for-older-chips.patch b/package/kernel/mac80211/patches/rtl/030-v6.13-wifi-rtw88-Enable-data-rate-fallback-for-older-chips.patch deleted file mode 100644 index 944985edc97..00000000000 --- a/package/kernel/mac80211/patches/rtl/030-v6.13-wifi-rtw88-Enable-data-rate-fallback-for-older-chips.patch +++ /dev/null @@ -1,194 +0,0 @@ -From c7706b1173c77185a2ef40c7d1811021566563f3 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Wed, 23 Oct 2024 17:10:32 +0300 -Subject: [PATCH] wifi: rtw88: Enable data rate fallback for older chips - -RTL8811AU fails to perform the 4-way handshake when the AP is too far -because it transmits the EAPOL frames at MCS9 and when that doesn't -work it retries 48 times with the same rate, to no avail. - -Retrying 48 times with the same rate seems pointless. Set the -appropriate field in the TX descriptor to allow it to use lower rates -when retrying. - -Set it for RTL8723D and RTL8703B because they interpret this field the -same way as RTL8811A. - -The newer RTL8822C, RTL8822B, RTL8821C seem to interpret this field in -the TX descriptor differently, so leave it alone for those chips. - -Tested with RTL8811AU and RTL8723DU. - -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/2b3e3e6f-541b-4a3b-8ca3-65b267e6a95a@gmail.com ---- - drivers/net/wireless/realtek/rtw88/fw.c | 2 +- - drivers/net/wireless/realtek/rtw88/main.h | 1 + - drivers/net/wireless/realtek/rtw88/pci.c | 2 +- - drivers/net/wireless/realtek/rtw88/rtw8703b.c | 1 + - drivers/net/wireless/realtek/rtw88/rtw8723d.c | 1 + - drivers/net/wireless/realtek/rtw88/rtw8821c.c | 1 + - drivers/net/wireless/realtek/rtw88/rtw8822b.c | 1 + - drivers/net/wireless/realtek/rtw88/rtw8822c.c | 1 + - drivers/net/wireless/realtek/rtw88/sdio.c | 2 +- - drivers/net/wireless/realtek/rtw88/tx.c | 6 +++++- - drivers/net/wireless/realtek/rtw88/tx.h | 4 +++- - drivers/net/wireless/realtek/rtw88/usb.c | 4 ++-- - 12 files changed, 19 insertions(+), 7 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/fw.c -+++ b/drivers/net/wireless/realtek/rtw88/fw.c -@@ -1290,7 +1290,7 @@ static void rtw_fill_rsvd_page_desc(stru - rtw_tx_rsvd_page_pkt_info_update(rtwdev, &pkt_info, skb, type); - pkt_desc = skb_push(skb, chip->tx_pkt_desc_sz); - memset(pkt_desc, 0, chip->tx_pkt_desc_sz); -- rtw_tx_fill_tx_desc(&pkt_info, skb); -+ rtw_tx_fill_tx_desc(rtwdev, &pkt_info, skb); - } - - static inline u8 rtw_len_to_page(unsigned int len, u8 page_size) ---- a/drivers/net/wireless/realtek/rtw88/main.h -+++ b/drivers/net/wireless/realtek/rtw88/main.h -@@ -1204,6 +1204,7 @@ struct rtw_chip_info { - u8 usb_tx_agg_desc_num; - bool hw_feature_report; - u8 c2h_ra_report_size; -+ bool old_datarate_fb_limit; - - u8 default_1ss_tx_path; - ---- 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 - 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); -- rtw_tx_fill_tx_desc(pkt_info, skb); -+ rtw_tx_fill_tx_desc(rtwdev, pkt_info, skb); - dma = dma_map_single(&rtwpci->pdev->dev, skb->data, skb->len, - DMA_TO_DEVICE); - if (dma_mapping_error(&rtwpci->pdev->dev, dma)) ---- a/drivers/net/wireless/realtek/rtw88/rtw8703b.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8703b.c -@@ -1964,6 +1964,7 @@ const struct rtw_chip_info rtw8703b_hw_s - .usb_tx_agg_desc_num = 1, /* Not sure if this chip has USB interface */ - .hw_feature_report = true, - .c2h_ra_report_size = 7, -+ .old_datarate_fb_limit = true, - - .path_div_supported = false, - .ht_supported = true, ---- a/drivers/net/wireless/realtek/rtw88/rtw8723d.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8723d.c -@@ -2135,6 +2135,7 @@ const struct rtw_chip_info rtw8723d_hw_s - .usb_tx_agg_desc_num = 1, - .hw_feature_report = true, - .c2h_ra_report_size = 7, -+ .old_datarate_fb_limit = true, - .ht_supported = true, - .vht_supported = false, - .lps_deep_mode_supported = 0, ---- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c -@@ -1972,6 +1972,7 @@ const struct rtw_chip_info rtw8821c_hw_s - .usb_tx_agg_desc_num = 3, - .hw_feature_report = true, - .c2h_ra_report_size = 7, -+ .old_datarate_fb_limit = false, - .ht_supported = true, - .vht_supported = true, - .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 - .usb_tx_agg_desc_num = 3, - .hw_feature_report = true, - .c2h_ra_report_size = 7, -+ .old_datarate_fb_limit = false, - .ht_supported = true, - .vht_supported = 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 -@@ -5333,6 +5333,7 @@ const struct rtw_chip_info rtw8822c_hw_s - .usb_tx_agg_desc_num = 3, - .hw_feature_report = true, - .c2h_ra_report_size = 7, -+ .old_datarate_fb_limit = false, - .default_1ss_tx_path = BB_PATH_A, - .path_div_supported = true, - .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 - - pkt_info->qsel = rtw_sdio_get_tx_qsel(rtwdev, skb, queue); - -- rtw_tx_fill_tx_desc(pkt_info, skb); -+ rtw_tx_fill_tx_desc(rtwdev, pkt_info, skb); - rtw_tx_fill_txdesc_checksum(rtwdev, pkt_info, pkt_desc); - } - ---- a/drivers/net/wireless/realtek/rtw88/tx.c -+++ b/drivers/net/wireless/realtek/rtw88/tx.c -@@ -32,7 +32,8 @@ void rtw_tx_stats(struct rtw_dev *rtwdev - } - } - --void rtw_tx_fill_tx_desc(struct rtw_tx_pkt_info *pkt_info, struct sk_buff *skb) -+void rtw_tx_fill_tx_desc(struct rtw_dev *rtwdev, -+ struct rtw_tx_pkt_info *pkt_info, struct sk_buff *skb) - { - struct rtw_tx_desc *tx_desc = (struct rtw_tx_desc *)skb->data; - bool more_data = false; -@@ -67,6 +68,9 @@ void rtw_tx_fill_tx_desc(struct rtw_tx_p - - tx_desc->w4 = le32_encode_bits(pkt_info->rate, RTW_TX_DESC_W4_DATARATE); - -+ if (rtwdev->chip->old_datarate_fb_limit) -+ tx_desc->w4 |= le32_encode_bits(0x1f, RTW_TX_DESC_W4_DATARATE_FB_LIMIT); -+ - tx_desc->w5 = le32_encode_bits(pkt_info->short_gi, RTW_TX_DESC_W5_DATA_SHORT) | - le32_encode_bits(pkt_info->bw, RTW_TX_DESC_W5_DATA_BW) | - le32_encode_bits(pkt_info->ldpc, RTW_TX_DESC_W5_DATA_LDPC) | ---- a/drivers/net/wireless/realtek/rtw88/tx.h -+++ b/drivers/net/wireless/realtek/rtw88/tx.h -@@ -44,6 +44,7 @@ struct rtw_tx_desc { - #define RTW_TX_DESC_W3_NAVUSEHDR BIT(15) - #define RTW_TX_DESC_W3_MAX_AGG_NUM GENMASK(21, 17) - #define RTW_TX_DESC_W4_DATARATE GENMASK(6, 0) -+#define RTW_TX_DESC_W4_DATARATE_FB_LIMIT GENMASK(12, 8) - #define RTW_TX_DESC_W4_RTSRATE GENMASK(28, 24) - #define RTW_TX_DESC_W5_DATA_SHORT BIT(4) - #define RTW_TX_DESC_W5_DATA_BW GENMASK(6, 5) -@@ -94,7 +95,8 @@ void rtw_tx_pkt_info_update(struct rtw_d - struct rtw_tx_pkt_info *pkt_info, - struct ieee80211_sta *sta, - struct sk_buff *skb); --void rtw_tx_fill_tx_desc(struct rtw_tx_pkt_info *pkt_info, struct sk_buff *skb); -+void rtw_tx_fill_tx_desc(struct rtw_dev *rtwdev, -+ struct rtw_tx_pkt_info *pkt_info, struct sk_buff *skb); - void rtw_tx_report_enqueue(struct rtw_dev *rtwdev, struct sk_buff *skb, u8 sn); - void rtw_tx_report_handle(struct rtw_dev *rtwdev, struct sk_buff *skb, int src); - 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 - 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_tx_desc(pkt_info, skb); -+ rtw_tx_fill_tx_desc(rtwdev, pkt_info, skb); - 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 - 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); -- rtw_tx_fill_tx_desc(pkt_info, skb); -+ rtw_tx_fill_tx_desc(rtwdev, pkt_info, skb); - rtw_tx_fill_txdesc_checksum(rtwdev, pkt_info, skb->data); - tx_data = rtw_usb_get_tx_data(skb); - tx_data->sn = pkt_info->sn; diff --git a/package/kernel/mac80211/patches/rtl/031-v6.13-wifi-rtw88-Make-txagc_remnant_ofdm-an-array.patch b/package/kernel/mac80211/patches/rtl/031-v6.13-wifi-rtw88-Make-txagc_remnant_ofdm-an-array.patch deleted file mode 100644 index 10fc773b47f..00000000000 --- a/package/kernel/mac80211/patches/rtl/031-v6.13-wifi-rtw88-Make-txagc_remnant_ofdm-an-array.patch +++ /dev/null @@ -1,85 +0,0 @@ -From abb0f19492ba6289ffba6ec1057c0426240958af Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Wed, 23 Oct 2024 17:10:54 +0300 -Subject: [PATCH] wifi: rtw88: Make txagc_remnant_ofdm an array - -txagc_remnant_ofdm member of struct rtw_dm_info should be different for -each RF path, so make it an array of size RTW_RF_PATH_MAX (4). - -Until now all the chips using this had only one RF path, but RTL8812AU -has two, and RTL8814AU has four. - -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/68571ba9-e504-4b2d-bfa1-62f468753649@gmail.com ---- - drivers/net/wireless/realtek/rtw88/main.h | 2 +- - drivers/net/wireless/realtek/rtw88/phy.c | 4 ++-- - drivers/net/wireless/realtek/rtw88/rtw8703b.c | 4 ++-- - drivers/net/wireless/realtek/rtw88/rtw8723d.c | 4 ++-- - 4 files changed, 7 insertions(+), 7 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/main.h -+++ b/drivers/net/wireless/realtek/rtw88/main.h -@@ -1715,7 +1715,7 @@ struct rtw_dm_info { - bool pwr_trk_init_trigger; - struct ewma_thermal avg_thermal[RTW_RF_PATH_MAX]; - s8 txagc_remnant_cck; -- s8 txagc_remnant_ofdm; -+ s8 txagc_remnant_ofdm[RTW_RF_PATH_MAX]; - u8 rx_cck_agc_report_type; - - /* backup dack results for each path and I/Q */ ---- a/drivers/net/wireless/realtek/rtw88/phy.c -+++ b/drivers/net/wireless/realtek/rtw88/phy.c -@@ -2169,8 +2169,8 @@ void rtw_get_tx_power_params(struct rtw_ - - *limit = rtw_phy_get_tx_power_limit(rtwdev, band, bw, path, - rate, ch, regd); -- *remnant = (rate <= DESC_RATE11M ? dm_info->txagc_remnant_cck : -- dm_info->txagc_remnant_ofdm); -+ *remnant = rate <= DESC_RATE11M ? dm_info->txagc_remnant_cck : -+ dm_info->txagc_remnant_ofdm[path]; - *sar = rtw_phy_get_tx_power_sar(rtwdev, hal->sar_band, path, rate); - } - ---- a/drivers/net/wireless/realtek/rtw88/rtw8703b.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8703b.c -@@ -637,7 +637,7 @@ static void rtw8703b_pwrtrack_init(struc - dm_info->pwr_trk_init_trigger = true; - dm_info->thermal_meter_k = rtwdev->efuse.thermal_meter_k; - dm_info->txagc_remnant_cck = 0; -- dm_info->txagc_remnant_ofdm = 0; -+ dm_info->txagc_remnant_ofdm[RF_PATH_A] = 0; - } - - static void rtw8703b_phy_set_param(struct rtw_dev *rtwdev) -@@ -1589,7 +1589,7 @@ static void rtw8703b_pwrtrack_set_ofdm_p - { - struct rtw_dm_info *dm_info = &rtwdev->dm_info; - -- dm_info->txagc_remnant_ofdm = txagc_idx; -+ dm_info->txagc_remnant_ofdm[RF_PATH_A] = txagc_idx; - - /* Only path A is calibrated for rtl8703b */ - rtw8703b_set_iqk_matrix(rtwdev, swing_idx, RF_PATH_A); ---- a/drivers/net/wireless/realtek/rtw88/rtw8723d.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8723d.c -@@ -79,7 +79,7 @@ static void rtw8723d_pwrtrack_init(struc - dm_info->pwr_trk_init_trigger = true; - dm_info->thermal_meter_k = rtwdev->efuse.thermal_meter_k; - dm_info->txagc_remnant_cck = 0; -- dm_info->txagc_remnant_ofdm = 0; -+ dm_info->txagc_remnant_ofdm[RF_PATH_A] = 0; - } - - static void rtw8723d_phy_set_param(struct rtw_dev *rtwdev) -@@ -1265,7 +1265,7 @@ static void rtw8723d_pwrtrack_set_ofdm_p - { - struct rtw_dm_info *dm_info = &rtwdev->dm_info; - -- dm_info->txagc_remnant_ofdm = txagc_idx; -+ dm_info->txagc_remnant_ofdm[RF_PATH_A] = txagc_idx; - - rtw8723d_set_iqk_matrix(rtwdev, swing_idx, RF_PATH_A); - rtw8723d_set_iqk_matrix(rtwdev, swing_idx, RF_PATH_B); diff --git a/package/kernel/mac80211/patches/rtl/032-v6.13-wifi-rtw88-Support-TX-page-sizes-bigger-than-128.patch b/package/kernel/mac80211/patches/rtl/032-v6.13-wifi-rtw88-Support-TX-page-sizes-bigger-than-128.patch deleted file mode 100644 index 7d77e0e6717..00000000000 --- a/package/kernel/mac80211/patches/rtl/032-v6.13-wifi-rtw88-Support-TX-page-sizes-bigger-than-128.patch +++ /dev/null @@ -1,115 +0,0 @@ -From 82a617413e8545775ec03a1970809ac5f549ef32 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Wed, 23 Oct 2024 17:12:06 +0300 -Subject: [PATCH] wifi: rtw88: Support TX page sizes bigger than 128 - -All the chips supported so far have a TX page size of 128 bytes. - -Change the type of the page_size member of struct rtw_chip_info from u8 -to u16 in order to support RTL8821AU (page size of 256 bytes) and -RTL8812AU (page size of 512 bytes). Also change the types of several -related variables and function parameters from u8 to u16. - -The TX page size is used, among other things, to construct the beacon, -null data, QOS null data, and PS poll templates which are uploaded to -the chip's reserved page. Each template needs to be aligned on a -multiple of the TX page size. Power saving can't work if the TX page -size is wrong. - -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/acdefbb1-3daf-4349-9e03-9472754d5f1e@gmail.com ---- - drivers/net/wireless/realtek/rtw88/debug.c | 2 +- - drivers/net/wireless/realtek/rtw88/fw.c | 21 +++++++++++---------- - drivers/net/wireless/realtek/rtw88/mac.c | 2 +- - drivers/net/wireless/realtek/rtw88/main.h | 2 +- - 4 files changed, 14 insertions(+), 13 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/debug.c -+++ b/drivers/net/wireless/realtek/rtw88/debug.c -@@ -308,7 +308,7 @@ static int rtw_debugfs_get_rsvd_page(str - { - struct rtw_debugfs_priv *debugfs_priv = m->private; - struct rtw_dev *rtwdev = debugfs_priv->rtwdev; -- u8 page_size = rtwdev->chip->page_size; -+ u16 page_size = rtwdev->chip->page_size; - u32 buf_size = debugfs_priv->rsvd_page.page_num * page_size; - u32 offset = debugfs_priv->rsvd_page.page_offset * page_size; - u8 *buf; ---- a/drivers/net/wireless/realtek/rtw88/fw.c -+++ b/drivers/net/wireless/realtek/rtw88/fw.c -@@ -1293,13 +1293,13 @@ static void rtw_fill_rsvd_page_desc(stru - rtw_tx_fill_tx_desc(rtwdev, &pkt_info, skb); - } - --static inline u8 rtw_len_to_page(unsigned int len, u8 page_size) -+static inline u8 rtw_len_to_page(unsigned int len, u16 page_size) - { - return DIV_ROUND_UP(len, page_size); - } - --static void rtw_rsvd_page_list_to_buf(struct rtw_dev *rtwdev, u8 page_size, -- u8 page_margin, u32 page, u8 *buf, -+static void rtw_rsvd_page_list_to_buf(struct rtw_dev *rtwdev, u16 page_size, -+ u16 page_margin, u32 page, u8 *buf, - struct rtw_rsvd_page *rsvd_pkt) - { - struct sk_buff *skb = rsvd_pkt->skb; -@@ -1601,13 +1601,13 @@ static int __rtw_build_rsvd_page_from_v - - static u8 *rtw_build_rsvd_page(struct rtw_dev *rtwdev, u32 *size) - { -- struct ieee80211_hw *hw = rtwdev->hw; - const struct rtw_chip_info *chip = rtwdev->chip; -- struct sk_buff *iter; -+ struct ieee80211_hw *hw = rtwdev->hw; - struct rtw_rsvd_page *rsvd_pkt; -- u32 page = 0; -+ struct sk_buff *iter; -+ u16 page_size, page_margin, tx_desc_sz; - u8 total_page = 0; -- u8 page_size, page_margin, tx_desc_sz; -+ u32 page = 0; - u8 *buf; - int ret; - -@@ -2013,12 +2013,13 @@ static int _rtw_hw_scan_update_probe_req - { - const struct rtw_chip_info *chip = rtwdev->chip; - struct sk_buff *skb, *tmp; -- u8 page_offset = 1, *buf, page_size = chip->page_size; - u16 pg_addr = rtwdev->fifo.rsvd_h2c_info_addr, loc; -- u16 buf_offset = page_size * page_offset; - u8 tx_desc_sz = chip->tx_pkt_desc_sz; -- u8 page_cnt, pages; -+ u16 page_size = chip->page_size; -+ u8 page_offset = 1, *buf; -+ u16 buf_offset = page_size * page_offset; - unsigned int pkt_len; -+ u8 page_cnt, pages; - int ret; - - 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 - - /* config rsvd page num */ - fifo->rsvd_drv_pg_num = chip->rsvd_drv_pg_num; -- fifo->txff_pg_num = chip->txff_size >> 7; -+ fifo->txff_pg_num = chip->txff_size / chip->page_size; - if (rtw_chip_wcpu_11n(rtwdev)) - fifo->rsvd_pg_num = fifo->rsvd_drv_pg_num; - else ---- a/drivers/net/wireless/realtek/rtw88/main.h -+++ b/drivers/net/wireless/realtek/rtw88/main.h -@@ -1187,7 +1187,7 @@ struct rtw_chip_info { - u32 fw_rxff_size; - u16 rsvd_drv_pg_num; - u8 band; -- u8 page_size; -+ u16 page_size; - u8 csi_buf_pg_num; - u8 dig_max; - u8 dig_min; diff --git a/package/kernel/mac80211/patches/rtl/033-v6.13-wifi-rtw88-Move-pwr_track_tbl-to-struct-rtw_rfe_def.patch b/package/kernel/mac80211/patches/rtl/033-v6.13-wifi-rtw88-Move-pwr_track_tbl-to-struct-rtw_rfe_def.patch deleted file mode 100644 index cda3e7a56e0..00000000000 --- a/package/kernel/mac80211/patches/rtl/033-v6.13-wifi-rtw88-Move-pwr_track_tbl-to-struct-rtw_rfe_def.patch +++ /dev/null @@ -1,297 +0,0 @@ -From 67d915604e6993ff627ac001983a2de63ff71b13 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Wed, 23 Oct 2024 17:12:39 +0300 -Subject: [PATCH] wifi: rtw88: Move pwr_track_tbl to struct rtw_rfe_def - -RTL8812AU uses one set of TX power tracking tables for RFE 3, and -another set for everything else. - -Move pwr_track_tbl from struct rtw_chip_info to struct rtw_rfe_def in -order to load the right set of tables for each RFE (RF front end) type. - -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/904d0ab1-c046-40cd-a3a3-d4fdcf663c9d@gmail.com ---- - drivers/net/wireless/realtek/rtw88/main.h | 8 ++++--- - drivers/net/wireless/realtek/rtw88/phy.c | 3 ++- - drivers/net/wireless/realtek/rtw88/rtw8703b.c | 12 +++++----- - drivers/net/wireless/realtek/rtw88/rtw8723d.c | 12 +++++----- - drivers/net/wireless/realtek/rtw88/rtw8723x.c | 3 ++- - drivers/net/wireless/realtek/rtw88/rtw8821c.c | 17 +++++++------- - drivers/net/wireless/realtek/rtw88/rtw8822b.c | 15 ++++++------ - drivers/net/wireless/realtek/rtw88/rtw8822c.c | 23 +++++++++---------- - 8 files changed, 47 insertions(+), 46 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/main.h -+++ b/drivers/net/wireless/realtek/rtw88/main.h -@@ -1099,17 +1099,20 @@ enum rtw_rfe_fem { - struct rtw_rfe_def { - const struct rtw_table *phy_pg_tbl; - const struct rtw_table *txpwr_lmt_tbl; -+ const struct rtw_pwr_track_tbl *pwr_track_tbl; - const struct rtw_table *agc_btg_tbl; - }; - --#define RTW_DEF_RFE(chip, bb_pg, pwrlmt) { \ -+#define RTW_DEF_RFE(chip, bb_pg, pwrlmt, track) { \ - .phy_pg_tbl = &rtw ## chip ## _bb_pg_type ## bb_pg ## _tbl, \ - .txpwr_lmt_tbl = &rtw ## chip ## _txpwr_lmt_type ## pwrlmt ## _tbl, \ -+ .pwr_track_tbl = &rtw ## chip ## _pwr_track_type ## track ## _tbl, \ - } - --#define RTW_DEF_RFE_EXT(chip, bb_pg, pwrlmt, btg) { \ -+#define RTW_DEF_RFE_EXT(chip, bb_pg, pwrlmt, track, btg) { \ - .phy_pg_tbl = &rtw ## chip ## _bb_pg_type ## bb_pg ## _tbl, \ - .txpwr_lmt_tbl = &rtw ## chip ## _txpwr_lmt_type ## pwrlmt ## _tbl, \ -+ .pwr_track_tbl = &rtw ## chip ## _pwr_track_type ## track ## _tbl, \ - .agc_btg_tbl = &rtw ## chip ## _agc_btg_type ## btg ## _tbl, \ - } - -@@ -1243,7 +1246,6 @@ struct rtw_chip_info { - u16 dpd_ratemask; - u8 iqk_threshold; - u8 lck_threshold; -- const struct rtw_pwr_track_tbl *pwr_track_tbl; - - u8 bfer_su_max_num; - u8 bfer_mu_max_num; ---- a/drivers/net/wireless/realtek/rtw88/phy.c -+++ b/drivers/net/wireless/realtek/rtw88/phy.c -@@ -2384,7 +2384,8 @@ void rtw_phy_init_tx_power(struct rtw_de - void rtw_phy_config_swing_table(struct rtw_dev *rtwdev, - struct rtw_swing_table *swing_table) - { -- const struct rtw_pwr_track_tbl *tbl = rtwdev->chip->pwr_track_tbl; -+ const struct rtw_rfe_def *rfe_def = rtw_get_rfe_def(rtwdev); -+ const struct rtw_pwr_track_tbl *tbl = rfe_def->pwr_track_tbl; - u8 channel = rtwdev->hal.current_channel; - - if (IS_CH_2G_BAND(channel)) { ---- a/drivers/net/wireless/realtek/rtw88/rtw8703b.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8703b.c -@@ -493,11 +493,6 @@ static const struct rtw_pwr_seq_cmd * co - NULL - }; - --static const struct rtw_rfe_def rtw8703b_rfe_defs[] = { -- [0] = { .phy_pg_tbl = &rtw8703b_bb_pg_tbl, -- .txpwr_lmt_tbl = &rtw8703b_txpwr_lmt_tbl,}, --}; -- - static const struct rtw_page_table page_table_8703b[] = { - {12, 2, 2, 0, 1}, - {12, 2, 2, 0, 1}, -@@ -1818,6 +1813,12 @@ static const struct rtw_pwr_track_tbl rt - .pwrtrk_xtal_p = rtw8703b_pwrtrk_xtal_p, - }; - -+static const struct rtw_rfe_def rtw8703b_rfe_defs[] = { -+ [0] = { .phy_pg_tbl = &rtw8703b_bb_pg_tbl, -+ .txpwr_lmt_tbl = &rtw8703b_txpwr_lmt_tbl, -+ .pwr_track_tbl = &rtw8703b_rtw_pwr_track_tbl, }, -+}; -+ - /* Shared-Antenna Coex Table */ - static const struct coex_table_para table_sant_8703b[] = { - {0xffffffff, 0xffffffff}, /* case-0 */ -@@ -1997,7 +1998,6 @@ const struct rtw_chip_info rtw8703b_hw_s - .rfe_defs_size = ARRAY_SIZE(rtw8703b_rfe_defs), - - .iqk_threshold = 8, -- .pwr_track_tbl = &rtw8703b_rtw_pwr_track_tbl, - - /* WOWLAN firmware exists, but not implemented yet */ - .wow_fw_name = "rtw88/rtw8703b_wow_fw.bin", ---- a/drivers/net/wireless/realtek/rtw88/rtw8723d.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8723d.c -@@ -2020,11 +2020,6 @@ static const struct rtw_intf_phy_para_ta - .n_gen1_para = ARRAY_SIZE(pcie_gen1_param_8723d), - }; - --static const struct rtw_rfe_def rtw8723d_rfe_defs[] = { -- [0] = { .phy_pg_tbl = &rtw8723d_bb_pg_tbl, -- .txpwr_lmt_tbl = &rtw8723d_txpwr_lmt_tbl,}, --}; -- - static const u8 rtw8723d_pwrtrk_2gb_n[] = { - 0, 0, 1, 1, 1, 2, 2, 3, 4, 4, 4, 4, 5, 5, 5, - 6, 6, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 10 -@@ -2088,6 +2083,12 @@ static const struct rtw_pwr_track_tbl rt - .pwrtrk_xtal_n = rtw8723d_pwrtrk_xtal_n, - }; - -+static const struct rtw_rfe_def rtw8723d_rfe_defs[] = { -+ [0] = { .phy_pg_tbl = &rtw8723d_bb_pg_tbl, -+ .txpwr_lmt_tbl = &rtw8723d_txpwr_lmt_tbl, -+ .pwr_track_tbl = &rtw8723d_rtw_pwr_track_tbl, }, -+}; -+ - static const struct rtw_reg_domain coex_info_hw_regs_8723d[] = { - {0x948, MASKDWORD, RTW_REG_DOMAIN_MAC32}, - {0x67, BIT(7), RTW_REG_DOMAIN_MAC8}, -@@ -2159,7 +2160,6 @@ const struct rtw_chip_info rtw8723d_hw_s - .rfe_defs = rtw8723d_rfe_defs, - .rfe_defs_size = ARRAY_SIZE(rtw8723d_rfe_defs), - .rx_ldpc = false, -- .pwr_track_tbl = &rtw8723d_rtw_pwr_track_tbl, - .iqk_threshold = 8, - .ampdu_density = IEEE80211_HT_MPDU_DENSITY_16, - .max_scan_ie_len = IEEE80211_MAX_DATA_LEN, ---- a/drivers/net/wireless/realtek/rtw88/rtw8723x.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8723x.c -@@ -595,7 +595,8 @@ void __rtw8723x_pwrtrack_set_xtal(struct - u8 delta) - { - struct rtw_dm_info *dm_info = &rtwdev->dm_info; -- const struct rtw_pwr_track_tbl *tbl = rtwdev->chip->pwr_track_tbl; -+ const struct rtw_rfe_def *rfe_def = rtw_get_rfe_def(rtwdev); -+ const struct rtw_pwr_track_tbl *tbl = rfe_def->pwr_track_tbl; - const s8 *pwrtrk_xtal; - s8 xtal_cap; - ---- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c -@@ -1581,13 +1581,6 @@ static const struct rtw_intf_phy_para_ta - .n_gen2_para = ARRAY_SIZE(pcie_gen2_param_8821c), - }; - --static const struct rtw_rfe_def rtw8821c_rfe_defs[] = { -- [0] = RTW_DEF_RFE(8821c, 0, 0), -- [2] = RTW_DEF_RFE_EXT(8821c, 0, 0, 2), -- [4] = RTW_DEF_RFE_EXT(8821c, 0, 0, 2), -- [6] = RTW_DEF_RFE(8821c, 0, 0), --}; -- - static const struct rtw_hw_reg rtw8821c_dig[] = { - [0] = { .addr = 0xc50, .mask = 0x7f }, - }; -@@ -1899,7 +1892,7 @@ static const u8 rtw8821c_pwrtrk_2g_cck_a - 5, 6, 6, 7, 7, 7, 8, 8, 9, 9, 9, 9, 9, 9 - }; - --static const struct rtw_pwr_track_tbl rtw8821c_rtw_pwr_track_tbl = { -+static const struct rtw_pwr_track_tbl rtw8821c_pwr_track_type0_tbl = { - .pwrtrk_5gb_n[0] = rtw8821c_pwrtrk_5gb_n[0], - .pwrtrk_5gb_n[1] = rtw8821c_pwrtrk_5gb_n[1], - .pwrtrk_5gb_n[2] = rtw8821c_pwrtrk_5gb_n[2], -@@ -1922,6 +1915,13 @@ static const struct rtw_pwr_track_tbl rt - .pwrtrk_2g_ccka_p = rtw8821c_pwrtrk_2g_cck_a_p, - }; - -+static const struct rtw_rfe_def rtw8821c_rfe_defs[] = { -+ [0] = RTW_DEF_RFE(8821c, 0, 0, 0), -+ [2] = RTW_DEF_RFE_EXT(8821c, 0, 0, 0, 2), -+ [4] = RTW_DEF_RFE_EXT(8821c, 0, 0, 0, 2), -+ [6] = RTW_DEF_RFE(8821c, 0, 0, 0), -+}; -+ - static const struct rtw_reg_domain coex_info_hw_regs_8821c[] = { - {0xCB0, MASKDWORD, RTW_REG_DOMAIN_MAC32}, - {0xCB4, MASKDWORD, RTW_REG_DOMAIN_MAC32}, -@@ -1994,7 +1994,6 @@ const struct rtw_chip_info rtw8821c_hw_s - .rfe_defs = rtw8821c_rfe_defs, - .rfe_defs_size = ARRAY_SIZE(rtw8821c_rfe_defs), - .rx_ldpc = false, -- .pwr_track_tbl = &rtw8821c_rtw_pwr_track_tbl, - .iqk_threshold = 8, - .bfer_su_max_num = 2, - .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 - .n_gen2_para = ARRAY_SIZE(pcie_gen2_param_8822b), - }; - --static const struct rtw_rfe_def rtw8822b_rfe_defs[] = { -- [2] = RTW_DEF_RFE(8822b, 2, 2), -- [3] = RTW_DEF_RFE(8822b, 3, 0), -- [5] = RTW_DEF_RFE(8822b, 5, 5), --}; -- - 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 - 10, 11, 11, 12, 12, 13, 13, 14, 14, 15 - }; - --static const struct rtw_pwr_track_tbl rtw8822b_rtw_pwr_track_tbl = { -+static const struct rtw_pwr_track_tbl rtw8822b_pwr_track_type0_tbl = { - .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 - .pwrtrk_2g_ccka_p = rtw8822b_pwrtrk_2g_cck_a_p, - }; - -+static const struct rtw_rfe_def rtw8822b_rfe_defs[] = { -+ [2] = RTW_DEF_RFE(8822b, 2, 2, 0), -+ [3] = RTW_DEF_RFE(8822b, 3, 0, 0), -+ [5] = RTW_DEF_RFE(8822b, 5, 5, 0), -+}; -+ - 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 - .rf_tbl = {&rtw8822b_rf_a_tbl, &rtw8822b_rf_b_tbl}, - .rfe_defs = rtw8822b_rfe_defs, - .rfe_defs_size = ARRAY_SIZE(rtw8822b_rfe_defs), -- .pwr_track_tbl = &rtw8822b_rtw_pwr_track_tbl, - .iqk_threshold = 8, - .bfer_su_max_num = 2, - .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 - .n_gen2_para = ARRAY_SIZE(pcie_gen2_param_8822c), - }; - --static const struct rtw_rfe_def rtw8822c_rfe_defs[] = { -- [0] = RTW_DEF_RFE(8822c, 0, 0), -- [1] = RTW_DEF_RFE(8822c, 0, 0), -- [2] = RTW_DEF_RFE(8822c, 0, 0), -- [3] = RTW_DEF_RFE(8822c, 0, 0), -- [4] = RTW_DEF_RFE(8822c, 0, 0), -- [5] = RTW_DEF_RFE(8822c, 0, 5), -- [6] = RTW_DEF_RFE(8822c, 0, 0), --}; -- - 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 - 18, 18, 19, 20, 21, 22, 23, 24, 24, 25 - }; - --static const struct rtw_pwr_track_tbl rtw8822c_rtw_pwr_track_tbl = { -+static const struct rtw_pwr_track_tbl rtw8822c_pwr_track_type0_tbl = { - .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 - .pwrtrk_2g_ccka_p = rtw8822c_pwrtrk_2g_cck_a_p, - }; - -+static const struct rtw_rfe_def rtw8822c_rfe_defs[] = { -+ [0] = RTW_DEF_RFE(8822c, 0, 0, 0), -+ [1] = RTW_DEF_RFE(8822c, 0, 0, 0), -+ [2] = RTW_DEF_RFE(8822c, 0, 0, 0), -+ [3] = RTW_DEF_RFE(8822c, 0, 0, 0), -+ [4] = RTW_DEF_RFE(8822c, 0, 0, 0), -+ [5] = RTW_DEF_RFE(8822c, 0, 5, 0), -+ [6] = RTW_DEF_RFE(8822c, 0, 0, 0), -+}; -+ - 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 - .rfe_defs_size = ARRAY_SIZE(rtw8822c_rfe_defs), - .en_dis_dpd = true, - .dpd_ratemask = DIS_DPD_RATEALL, -- .pwr_track_tbl = &rtw8822c_rtw_pwr_track_tbl, - .iqk_threshold = 8, - .lck_threshold = 8, - .bfer_su_max_num = 2, diff --git a/package/kernel/mac80211/patches/rtl/034-v6.13-wifi-rtw88-usb-Set-pkt_info.ls-for-the-reserved-page.patch b/package/kernel/mac80211/patches/rtl/034-v6.13-wifi-rtw88-usb-Set-pkt_info.ls-for-the-reserved-page.patch deleted file mode 100644 index 67d7d230f4e..00000000000 --- a/package/kernel/mac80211/patches/rtl/034-v6.13-wifi-rtw88-usb-Set-pkt_info.ls-for-the-reserved-page.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 85bf3041a0ea40a60b5295749268e179f056546a Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Wed, 23 Oct 2024 17:13:10 +0300 -Subject: [PATCH] wifi: rtw88: usb: Set pkt_info.ls for the reserved page - -"ls" meaning "last segment". Without this RTL8812AU can't upload the -reserved page in USB 2 mode. (Somehow it's fine in USB 3 mode.) - -Also tested with RTL8822CU, RTL8812BU, RTL8811CU, RTL8723DU, RTL8811AU. - -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/e443f5d9-4b53-4f64-985c-64313ec80bef@gmail.com ---- - drivers/net/wireless/realtek/rtw88/usb.c | 1 + - 1 file changed, 1 insertion(+) - ---- 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( - pkt_info.tx_pkt_size = size; - pkt_info.qsel = TX_DESC_QSEL_BEACON; - pkt_info.offset = chip->tx_pkt_desc_sz; -+ pkt_info.ls = true; - - return rtw_usb_write_data(rtwdev, &pkt_info, buf); - } diff --git a/package/kernel/mac80211/patches/rtl/035-v6.13-wifi-rtw88-Detect-beacon-loss-with-chips-other-than-.patch b/package/kernel/mac80211/patches/rtl/035-v6.13-wifi-rtw88-Detect-beacon-loss-with-chips-other-than-.patch deleted file mode 100644 index de64f33e43e..00000000000 --- a/package/kernel/mac80211/patches/rtl/035-v6.13-wifi-rtw88-Detect-beacon-loss-with-chips-other-than-.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 57289d30cd2ae315ab9b28213d63d1dbf8570cf3 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Wed, 23 Oct 2024 17:13:45 +0300 -Subject: [PATCH] wifi: rtw88: Detect beacon loss with chips other than 8822c - -The driver is supposed to avoid entering LPS (power saving) when there -is beacon loss, but only RTL8822C detects the beacon loss (because it -has beacon filtering in the firmware). - -Detect beacon loss with the other chips by checking if we received less -than half the expected number of beacons in the last 2-second interval. - -This gets rid of the occasional "failed to get tx report from firmware" -warnings with RTL8821AU. It may also avoid some disconnections. - -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/f52b2fcf-bf94-48bc-89bd-e55ebc3a2f2d@gmail.com ---- - drivers/net/wireless/realtek/rtw88/main.c | 18 ++++++++++++++++++ - 1 file changed, 18 insertions(+) - ---- a/drivers/net/wireless/realtek/rtw88/main.c -+++ b/drivers/net/wireless/realtek/rtw88/main.c -@@ -202,6 +202,21 @@ static void rtw_vif_watch_dog_iter(void - rtwvif->stats.rx_cnt = 0; - } - -+static void rtw_sw_beacon_loss_check(struct rtw_dev *rtwdev, -+ struct rtw_vif *rtwvif, int received_beacons) -+{ -+ int watchdog_delay = 2000000 / 1024; /* TU */ -+ int beacon_int, expected_beacons; -+ -+ if (rtw_fw_feature_check(&rtwdev->fw, FW_FEATURE_BCN_FILTER) || !rtwvif) -+ return; -+ -+ beacon_int = rtwvif_to_vif(rtwvif)->bss_conf.beacon_int; -+ expected_beacons = DIV_ROUND_UP(watchdog_delay, beacon_int); -+ -+ rtwdev->beacon_loss = received_beacons < expected_beacons / 2; -+} -+ - /* process TX/RX statistics periodically for hardware, - * the information helps hardware to enhance performance - */ -@@ -212,6 +227,7 @@ static void rtw_watch_dog_work(struct wo - struct rtw_traffic_stats *stats = &rtwdev->stats; - struct rtw_watch_dog_iter_data data = {}; - bool busy_traffic = test_bit(RTW_FLAG_BUSY_TRAFFIC, rtwdev->flags); -+ int received_beacons = rtwdev->dm_info.cur_pkt_count.num_bcn_pkt; - u32 tx_unicast_mbps, rx_unicast_mbps; - bool ps_active; - -@@ -270,6 +286,8 @@ static void rtw_watch_dog_work(struct wo - */ - rtw_iterate_vifs(rtwdev, rtw_vif_watch_dog_iter, &data); - -+ rtw_sw_beacon_loss_check(rtwdev, data.rtwvif, received_beacons); -+ - /* fw supports only one station associated to enter lps, if there are - * more than two stations associated to the AP, then we can not enter - * lps, because fw does not handle the overlapped beacon interval diff --git a/package/kernel/mac80211/patches/rtl/036-v6.13-wifi-rtw88-coex-Support-chips-without-a-scoreboard.patch b/package/kernel/mac80211/patches/rtl/036-v6.13-wifi-rtw88-coex-Support-chips-without-a-scoreboard.patch deleted file mode 100644 index b2fb04fd31c..00000000000 --- a/package/kernel/mac80211/patches/rtl/036-v6.13-wifi-rtw88-coex-Support-chips-without-a-scoreboard.patch +++ /dev/null @@ -1,66 +0,0 @@ -From b19840afc05121293ae59f017cb9924814eb5d77 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Wed, 23 Oct 2024 17:14:12 +0300 -Subject: [PATCH] wifi: rtw88: coex: Support chips without a scoreboard - -All the chips currently supported have a "scoreboard": the chip keeps -track of certain things related to bluetooth, for example, whether -bluetooth is active. The information can be read from register 0xaa. - -RTL8821AU doesn't have this. Implement bluetooth activity detection in -rtw_coex_monitor_bt_enable() based on the bluetooth TX/RX counters. - -This is mostly important for RTL8811AU, the version of RTL8821AU without -bluetooth. Without this change, the driver thinks bluetooth is active -and the wifi speeds are low. - -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/5058f23d-2086-42cd-82ad-eef31a348467@gmail.com ---- - drivers/net/wireless/realtek/rtw88/coex.c | 18 ++++++++++++++++++ - drivers/net/wireless/realtek/rtw88/main.h | 1 + - 2 files changed, 19 insertions(+) - ---- a/drivers/net/wireless/realtek/rtw88/coex.c -+++ b/drivers/net/wireless/realtek/rtw88/coex.c -@@ -494,11 +494,29 @@ static void rtw_coex_monitor_bt_enable(s - struct rtw_coex_stat *coex_stat = &coex->stat; - struct rtw_coex_dm *coex_dm = &coex->dm; - bool bt_disabled = false; -+ bool bt_active = true; - u16 score_board; - - if (chip->scbd_support) { - score_board = rtw_coex_read_scbd(rtwdev); - bt_disabled = !(score_board & COEX_SCBD_ONOFF); -+ } else { -+ if (coex_stat->hi_pri_tx == 0 && coex_stat->hi_pri_rx == 0 && -+ coex_stat->lo_pri_tx == 0 && coex_stat->lo_pri_rx == 0) -+ bt_active = false; -+ -+ if (coex_stat->hi_pri_tx == 0xffff && coex_stat->hi_pri_rx == 0xffff && -+ coex_stat->lo_pri_tx == 0xffff && coex_stat->lo_pri_rx == 0xffff) -+ bt_active = false; -+ -+ if (bt_active) { -+ coex_stat->bt_disable_cnt = 0; -+ bt_disabled = false; -+ } else { -+ coex_stat->bt_disable_cnt++; -+ if (coex_stat->bt_disable_cnt >= 10) -+ bt_disabled = true; -+ } - } - - if (coex_stat->bt_disabled != bt_disabled) { ---- a/drivers/net/wireless/realtek/rtw88/main.h -+++ b/drivers/net/wireless/realtek/rtw88/main.h -@@ -1494,6 +1494,7 @@ struct rtw_coex_stat { - u8 bt_hid_slot; - u8 bt_a2dp_bitpool; - u8 bt_iqk_state; -+ u8 bt_disable_cnt; - - u16 wl_beacon_interval; - u8 wl_noisy_level; diff --git a/package/kernel/mac80211/patches/rtl/037-v6.13-wifi-rtw88-8821a-Regularly-ask-for-BT-info-updates.patch b/package/kernel/mac80211/patches/rtl/037-v6.13-wifi-rtw88-8821a-Regularly-ask-for-BT-info-updates.patch deleted file mode 100644 index e0e840f0fad..00000000000 --- a/package/kernel/mac80211/patches/rtl/037-v6.13-wifi-rtw88-8821a-Regularly-ask-for-BT-info-updates.patch +++ /dev/null @@ -1,67 +0,0 @@ -From bfcee5ee924fc5f706d20f5dc31586ca47912304 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Wed, 23 Oct 2024 17:14:45 +0300 -Subject: [PATCH] wifi: rtw88: 8821a: Regularly ask for BT info updates - -The RTL8821AU firmware sends C2H_BT_INFO by itself when bluetooth -headphones are connected, but not when they are disconnected. This leads -to the coexistence code still using the A2DP algorithm long after the -headphones are disconnected, which means the wifi speeds are much lower -than they should be. Work around this by asking for updates every two -seconds if the chip is RTL8821AU. - -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/358acdd2-6aae-46c1-9c66-fcce4e700b96@gmail.com ---- - drivers/net/wireless/realtek/rtw88/coex.c | 2 +- - drivers/net/wireless/realtek/rtw88/coex.h | 11 +++++++++++ - drivers/net/wireless/realtek/rtw88/main.c | 1 + - 3 files changed, 13 insertions(+), 1 deletion(-) - ---- a/drivers/net/wireless/realtek/rtw88/coex.c -+++ b/drivers/net/wireless/realtek/rtw88/coex.c -@@ -446,7 +446,7 @@ static void rtw_coex_check_rfk(struct rt - } - } - --static void rtw_coex_query_bt_info(struct rtw_dev *rtwdev) -+void rtw_coex_query_bt_info(struct rtw_dev *rtwdev) - { - struct rtw_coex *coex = &rtwdev->coex; - struct rtw_coex_stat *coex_stat = &coex->stat; ---- a/drivers/net/wireless/realtek/rtw88/coex.h -+++ b/drivers/net/wireless/realtek/rtw88/coex.h -@@ -384,6 +384,7 @@ u32 rtw_coex_read_indirect_reg(struct rt - void rtw_coex_write_indirect_reg(struct rtw_dev *rtwdev, u16 addr, - u32 mask, u32 val); - void rtw_coex_write_scbd(struct rtw_dev *rtwdev, u16 bitpos, bool set); -+void rtw_coex_query_bt_info(struct rtw_dev *rtwdev); - - void rtw_coex_bt_relink_work(struct work_struct *work); - void rtw_coex_bt_reenable_work(struct work_struct *work); -@@ -419,4 +420,14 @@ static inline bool rtw_coex_disabled(str - return coex_stat->bt_disabled; - } - -+static inline void rtw_coex_active_query_bt_info(struct rtw_dev *rtwdev) -+{ -+ /* The RTL8821AU firmware doesn't send C2H_BT_INFO by itself -+ * when bluetooth headphones are disconnected, so we have to -+ * ask for it regularly. -+ */ -+ if (rtwdev->chip->id == RTW_CHIP_TYPE_8821A && rtwdev->efuse.btcoex) -+ rtw_coex_query_bt_info(rtwdev); -+} -+ - #endif ---- a/drivers/net/wireless/realtek/rtw88/main.c -+++ b/drivers/net/wireless/realtek/rtw88/main.c -@@ -274,6 +274,7 @@ static void rtw_watch_dog_work(struct wo - rtw_leave_lps(rtwdev); - rtw_coex_wl_status_check(rtwdev); - rtw_coex_query_bt_hid_list(rtwdev); -+ rtw_coex_active_query_bt_info(rtwdev); - - rtw_phy_dynamic_mechanism(rtwdev); - diff --git a/package/kernel/mac80211/patches/rtl/038-v6.13-wifi-rtw88-8812a-Mitigate-beacon-loss.patch b/package/kernel/mac80211/patches/rtl/038-v6.13-wifi-rtw88-8812a-Mitigate-beacon-loss.patch deleted file mode 100644 index f862f80460d..00000000000 --- a/package/kernel/mac80211/patches/rtl/038-v6.13-wifi-rtw88-8812a-Mitigate-beacon-loss.patch +++ /dev/null @@ -1,37 +0,0 @@ -From f9e0189cbc2d6447dde392944c769546cdf48140 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Wed, 23 Oct 2024 17:15:13 +0300 -Subject: [PATCH] wifi: rtw88: 8812a: Mitigate beacon loss - -The RTL8812AU has a reception problem, maybe only in the 5 GHz band. -Sometimes, in some positions, it stops receiving anything even though -the distance to the AP is only ~3 meters and there are no obstacles. -Moving it a few centimeters fixes it. - -Switch the initial gain to maximum coverage when there is beacon loss. -This only helps sometimes. This is similar to what the official driver -does. - -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/203f5043-4fe1-4f35-8b8f-d3b6f44e1fd9@gmail.com ---- - drivers/net/wireless/realtek/rtw88/phy.c | 7 +++++++ - 1 file changed, 7 insertions(+) - ---- a/drivers/net/wireless/realtek/rtw88/phy.c -+++ b/drivers/net/wireless/realtek/rtw88/phy.c -@@ -530,6 +530,13 @@ static void rtw_phy_dig(struct rtw_dev * - */ - rtw_phy_dig_recorder(dm_info, cur_igi, fa_cnt); - -+ /* Mitigate beacon loss and connectivity issues, mainly (only?) -+ * in the 5 GHz band -+ */ -+ if (rtwdev->chip->id == RTW_CHIP_TYPE_8812A && rtwdev->beacon_loss && -+ linked && dm_info->total_fa_cnt < DIG_PERF_FA_TH_EXTRA_HIGH) -+ cur_igi = DIG_CVRG_MIN; -+ - if (cur_igi != pre_igi) - rtw_phy_dig_write(rtwdev, cur_igi); - } diff --git a/package/kernel/mac80211/patches/rtl/039-v6.13-wifi-rtw88-Add-rtw8812a_table.-c-h.patch b/package/kernel/mac80211/patches/rtl/039-v6.13-wifi-rtw88-Add-rtw8812a_table.-c-h.patch deleted file mode 100644 index 59a04b4d16b..00000000000 --- a/package/kernel/mac80211/patches/rtl/039-v6.13-wifi-rtw88-Add-rtw8812a_table.-c-h.patch +++ /dev/null @@ -1,2862 +0,0 @@ -From 528f902ecc0eb8fb766bde519421255729623dd8 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Wed, 30 Oct 2024 20:24:33 +0200 -Subject: [PATCH] wifi: rtw88: Add rtw8812a_table.{c,h} - -These contain various arrays for initialising RTL8812AU. Also TX power -limits. - -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/086f476c-e832-4867-963c-a64a63252fd6@gmail.com ---- - .../wireless/realtek/rtw88/rtw8812a_table.c | 2812 +++++++++++++++++ - .../wireless/realtek/rtw88/rtw8812a_table.h | 26 + - 2 files changed, 2838 insertions(+) - create mode 100644 drivers/net/wireless/realtek/rtw88/rtw8812a_table.c - create mode 100644 drivers/net/wireless/realtek/rtw88/rtw8812a_table.h - ---- /dev/null -+++ b/drivers/net/wireless/realtek/rtw88/rtw8812a_table.c -@@ -0,0 +1,2812 @@ -+// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause -+/* Copyright(c) 2024 Realtek Corporation -+ */ -+ -+#include "main.h" -+#include "phy.h" -+#include "rtw8812a_table.h" -+ -+static const u32 rtw8812a_mac[] = { -+ 0x010, 0x0000000C, -+ 0x80000200, 0x00000000, 0x40000000, 0x00000000, -+ 0x011, 0x00000066, -+ 0xA0000000, 0x00000000, -+ 0x011, 0x0000005A, -+ 0xB0000000, 0x00000000, -+ 0x025, 0x0000000F, -+ 0x072, 0x00000000, -+ 0x420, 0x00000080, -+ 0x428, 0x0000000A, -+ 0x429, 0x00000010, -+ 0x430, 0x00000000, -+ 0x431, 0x00000000, -+ 0x432, 0x00000000, -+ 0x433, 0x00000001, -+ 0x434, 0x00000002, -+ 0x435, 0x00000003, -+ 0x436, 0x00000005, -+ 0x437, 0x00000007, -+ 0x438, 0x00000000, -+ 0x439, 0x00000000, -+ 0x43A, 0x00000000, -+ 0x43B, 0x00000001, -+ 0x43C, 0x00000002, -+ 0x43D, 0x00000003, -+ 0x43E, 0x00000005, -+ 0x43F, 0x00000007, -+ 0x440, 0x0000005D, -+ 0x441, 0x00000001, -+ 0x442, 0x00000000, -+ 0x444, 0x00000010, -+ 0x445, 0x00000000, -+ 0x446, 0x00000000, -+ 0x447, 0x00000000, -+ 0x448, 0x00000000, -+ 0x449, 0x000000F0, -+ 0x44A, 0x0000000F, -+ 0x44B, 0x0000003E, -+ 0x44C, 0x00000010, -+ 0x44D, 0x00000000, -+ 0x44E, 0x00000000, -+ 0x44F, 0x00000000, -+ 0x450, 0x00000000, -+ 0x451, 0x000000F0, -+ 0x452, 0x0000000F, -+ 0x453, 0x00000000, -+ 0x45B, 0x00000080, -+ 0x460, 0x00000066, -+ 0x461, 0x00000066, -+ 0x4C8, 0x000000FF, -+ 0x4C9, 0x00000008, -+ 0x4CC, 0x000000FF, -+ 0x4CD, 0x000000FF, -+ 0x4CE, 0x00000001, -+ 0x500, 0x00000026, -+ 0x501, 0x000000A2, -+ 0x502, 0x0000002F, -+ 0x503, 0x00000000, -+ 0x504, 0x00000028, -+ 0x505, 0x000000A3, -+ 0x506, 0x0000005E, -+ 0x507, 0x00000000, -+ 0x508, 0x0000002B, -+ 0x509, 0x000000A4, -+ 0x50A, 0x0000005E, -+ 0x50B, 0x00000000, -+ 0x50C, 0x0000004F, -+ 0x50D, 0x000000A4, -+ 0x50E, 0x00000000, -+ 0x50F, 0x00000000, -+ 0x512, 0x0000001C, -+ 0x514, 0x0000000A, -+ 0x516, 0x0000000A, -+ 0x525, 0x0000004F, -+ 0x550, 0x00000010, -+ 0x551, 0x00000010, -+ 0x559, 0x00000002, -+ 0x55C, 0x00000050, -+ 0x55D, 0x000000FF, -+ 0x604, 0x00000009, -+ 0x605, 0x00000030, -+ 0x607, 0x00000003, -+ 0x608, 0x0000000E, -+ 0x609, 0x0000002A, -+ 0x620, 0x000000FF, -+ 0x621, 0x000000FF, -+ 0x622, 0x000000FF, -+ 0x623, 0x000000FF, -+ 0x624, 0x000000FF, -+ 0x625, 0x000000FF, -+ 0x626, 0x000000FF, -+ 0x627, 0x000000FF, -+ 0x638, 0x00000050, -+ 0x63C, 0x0000000A, -+ 0x63D, 0x0000000A, -+ 0x63E, 0x0000000E, -+ 0x63F, 0x0000000E, -+ 0x640, 0x00000080, -+ 0x642, 0x00000040, -+ 0x643, 0x00000000, -+ 0x652, 0x000000C8, -+ 0x66E, 0x00000005, -+ 0x700, 0x00000021, -+ 0x701, 0x00000043, -+ 0x702, 0x00000065, -+ 0x703, 0x00000087, -+ 0x708, 0x00000021, -+ 0x709, 0x00000043, -+ 0x70A, 0x00000065, -+ 0x70B, 0x00000087, -+ 0x718, 0x00000040, -+}; -+ -+RTW_DECL_TABLE_PHY_COND(rtw8812a_mac, rtw_phy_cfg_mac); -+ -+static const u32 rtw8812a_agc[] = { -+ 0x80000001, 0x00000000, 0x40000000, 0x00000000, -+ 0x81C, 0xFC000001, -+ 0x81C, 0xFB020001, -+ 0x81C, 0xFA040001, -+ 0x81C, 0xF9060001, -+ 0x81C, 0xF8080001, -+ 0x81C, 0xF70A0001, -+ 0x81C, 0xF60C0001, -+ 0x81C, 0xF50E0001, -+ 0x81C, 0xF4100001, -+ 0x81C, 0xF3120001, -+ 0x81C, 0xF2140001, -+ 0x81C, 0xF1160001, -+ 0x81C, 0xF0180001, -+ 0x81C, 0xEF1A0001, -+ 0x81C, 0xEE1C0001, -+ 0x81C, 0xED1E0001, -+ 0x81C, 0xEC200001, -+ 0x81C, 0xEB220001, -+ 0x81C, 0xEA240001, -+ 0x81C, 0xCD260001, -+ 0x81C, 0xCC280001, -+ 0x81C, 0xCB2A0001, -+ 0x81C, 0xCA2C0001, -+ 0x81C, 0xC92E0001, -+ 0x81C, 0xC8300001, -+ 0x81C, 0xA6320001, -+ 0x81C, 0xA5340001, -+ 0x81C, 0xA4360001, -+ 0x81C, 0xA3380001, -+ 0x81C, 0xA23A0001, -+ 0x81C, 0x883C0001, -+ 0x81C, 0x873E0001, -+ 0x81C, 0x86400001, -+ 0x81C, 0x85420001, -+ 0x81C, 0x84440001, -+ 0x81C, 0x83460001, -+ 0x81C, 0x82480001, -+ 0x81C, 0x814A0001, -+ 0x81C, 0x484C0001, -+ 0x81C, 0x474E0001, -+ 0x81C, 0x46500001, -+ 0x81C, 0x45520001, -+ 0x81C, 0x44540001, -+ 0x81C, 0x43560001, -+ 0x81C, 0x42580001, -+ 0x81C, 0x415A0001, -+ 0x81C, 0x255C0001, -+ 0x81C, 0x245E0001, -+ 0x81C, 0x23600001, -+ 0x81C, 0x22620001, -+ 0x81C, 0x21640001, -+ 0x81C, 0x21660001, -+ 0x81C, 0x21680001, -+ 0x81C, 0x216A0001, -+ 0x81C, 0x216C0001, -+ 0x81C, 0x216E0001, -+ 0x81C, 0x21700001, -+ 0x81C, 0x21720001, -+ 0x81C, 0x21740001, -+ 0x81C, 0x21760001, -+ 0x81C, 0x21780001, -+ 0x81C, 0x217A0001, -+ 0x81C, 0x217C0001, -+ 0x81C, 0x217E0001, -+ 0x90000001, 0x00000005, 0x40000000, 0x00000000, -+ 0x81C, 0xF9000001, -+ 0x81C, 0xF8020001, -+ 0x81C, 0xF7040001, -+ 0x81C, 0xF6060001, -+ 0x81C, 0xF5080001, -+ 0x81C, 0xF40A0001, -+ 0x81C, 0xF30C0001, -+ 0x81C, 0xF20E0001, -+ 0x81C, 0xF1100001, -+ 0x81C, 0xF0120001, -+ 0x81C, 0xEF140001, -+ 0x81C, 0xEE160001, -+ 0x81C, 0xED180001, -+ 0x81C, 0xEC1A0001, -+ 0x81C, 0xEB1C0001, -+ 0x81C, 0xEA1E0001, -+ 0x81C, 0xCD200001, -+ 0x81C, 0xCC220001, -+ 0x81C, 0xCB240001, -+ 0x81C, 0xCA260001, -+ 0x81C, 0xC9280001, -+ 0x81C, 0xC82A0001, -+ 0x81C, 0xC72C0001, -+ 0x81C, 0xC62E0001, -+ 0x81C, 0xA5300001, -+ 0x81C, 0xA4320001, -+ 0x81C, 0xA3340001, -+ 0x81C, 0xA2360001, -+ 0x81C, 0x88380001, -+ 0x81C, 0x873A0001, -+ 0x81C, 0x863C0001, -+ 0x81C, 0x853E0001, -+ 0x81C, 0x84400001, -+ 0x81C, 0x83420001, -+ 0x81C, 0x82440001, -+ 0x81C, 0x81460001, -+ 0x81C, 0x48480001, -+ 0x81C, 0x474A0001, -+ 0x81C, 0x464C0001, -+ 0x81C, 0x454E0001, -+ 0x81C, 0x44500001, -+ 0x81C, 0x43520001, -+ 0x81C, 0x42540001, -+ 0x81C, 0x41560001, -+ 0x81C, 0x25580001, -+ 0x81C, 0x245A0001, -+ 0x81C, 0x235C0001, -+ 0x81C, 0x225E0001, -+ 0x81C, 0x21600001, -+ 0x81C, 0x21620001, -+ 0x81C, 0x21640001, -+ 0x81C, 0x21660001, -+ 0x81C, 0x21680001, -+ 0x81C, 0x216A0001, -+ 0x81C, 0x236C0001, -+ 0x81C, 0x226E0001, -+ 0x81C, 0x21700001, -+ 0x81C, 0x21720001, -+ 0x81C, 0x21740001, -+ 0x81C, 0x21760001, -+ 0x81C, 0x21780001, -+ 0x81C, 0x217A0001, -+ 0x81C, 0x217C0001, -+ 0x81C, 0x217E0001, -+ 0xA0000000, 0x00000000, -+ 0x81C, 0xFF000001, -+ 0x81C, 0xFF020001, -+ 0x81C, 0xFF040001, -+ 0x81C, 0xFF060001, -+ 0x81C, 0xFF080001, -+ 0x81C, 0xFE0A0001, -+ 0x81C, 0xFD0C0001, -+ 0x81C, 0xFC0E0001, -+ 0x81C, 0xFB100001, -+ 0x81C, 0xFA120001, -+ 0x81C, 0xF9140001, -+ 0x81C, 0xF8160001, -+ 0x81C, 0xF7180001, -+ 0x81C, 0xF61A0001, -+ 0x81C, 0xF51C0001, -+ 0x81C, 0xF41E0001, -+ 0x81C, 0xF3200001, -+ 0x81C, 0xF2220001, -+ 0x81C, 0xF1240001, -+ 0x81C, 0xF0260001, -+ 0x81C, 0xEF280001, -+ 0x81C, 0xEE2A0001, -+ 0x81C, 0xED2C0001, -+ 0x81C, 0xEC2E0001, -+ 0x81C, 0xEB300001, -+ 0x81C, 0xEA320001, -+ 0x81C, 0xE9340001, -+ 0x81C, 0xE8360001, -+ 0x81C, 0xE7380001, -+ 0x81C, 0xE63A0001, -+ 0x81C, 0xE53C0001, -+ 0x81C, 0xC73E0001, -+ 0x81C, 0xC6400001, -+ 0x81C, 0xC5420001, -+ 0x81C, 0xC4440001, -+ 0x81C, 0xC3460001, -+ 0x81C, 0xC2480001, -+ 0x81C, 0xC14A0001, -+ 0x81C, 0xA74C0001, -+ 0x81C, 0xA64E0001, -+ 0x81C, 0xA5500001, -+ 0x81C, 0xA4520001, -+ 0x81C, 0xA3540001, -+ 0x81C, 0xA2560001, -+ 0x81C, 0xA1580001, -+ 0x81C, 0x675A0001, -+ 0x81C, 0x665C0001, -+ 0x81C, 0x655E0001, -+ 0x81C, 0x64600001, -+ 0x81C, 0x63620001, -+ 0x81C, 0x48640001, -+ 0x81C, 0x47660001, -+ 0x81C, 0x46680001, -+ 0x81C, 0x456A0001, -+ 0x81C, 0x446C0001, -+ 0x81C, 0x436E0001, -+ 0x81C, 0x42700001, -+ 0x81C, 0x41720001, -+ 0x81C, 0x41740001, -+ 0x81C, 0x41760001, -+ 0x81C, 0x41780001, -+ 0x81C, 0x417A0001, -+ 0x81C, 0x417C0001, -+ 0x81C, 0x417E0001, -+ 0xB0000000, 0x00000000, -+ 0x80000004, 0x00000000, 0x40000000, 0x00000000, -+ 0x81C, 0xFC800001, -+ 0x81C, 0xFB820001, -+ 0x81C, 0xFA840001, -+ 0x81C, 0xF9860001, -+ 0x81C, 0xF8880001, -+ 0x81C, 0xF78A0001, -+ 0x81C, 0xF68C0001, -+ 0x81C, 0xF58E0001, -+ 0x81C, 0xF4900001, -+ 0x81C, 0xF3920001, -+ 0x81C, 0xF2940001, -+ 0x81C, 0xF1960001, -+ 0x81C, 0xF0980001, -+ 0x81C, 0xEF9A0001, -+ 0x81C, 0xEE9C0001, -+ 0x81C, 0xED9E0001, -+ 0x81C, 0xECA00001, -+ 0x81C, 0xEBA20001, -+ 0x81C, 0xEAA40001, -+ 0x81C, 0xE9A60001, -+ 0x81C, 0xE8A80001, -+ 0x81C, 0xE7AA0001, -+ 0x81C, 0xE6AC0001, -+ 0x81C, 0xE5AE0001, -+ 0x81C, 0xE4B00001, -+ 0x81C, 0xE3B20001, -+ 0x81C, 0xA8B40001, -+ 0x81C, 0xA7B60001, -+ 0x81C, 0xA6B80001, -+ 0x81C, 0xA5BA0001, -+ 0x81C, 0xA4BC0001, -+ 0x81C, 0xA3BE0001, -+ 0x81C, 0xA2C00001, -+ 0x81C, 0xA1C20001, -+ 0x81C, 0x68C40001, -+ 0x81C, 0x67C60001, -+ 0x81C, 0x66C80001, -+ 0x81C, 0x65CA0001, -+ 0x81C, 0x64CC0001, -+ 0x81C, 0x47CE0001, -+ 0x81C, 0x46D00001, -+ 0x81C, 0x45D20001, -+ 0x81C, 0x44D40001, -+ 0x81C, 0x43D60001, -+ 0x81C, 0x42D80001, -+ 0x81C, 0x08DA0001, -+ 0x81C, 0x07DC0001, -+ 0x81C, 0x06DE0001, -+ 0x81C, 0x05E00001, -+ 0x81C, 0x04E20001, -+ 0x81C, 0x03E40001, -+ 0x81C, 0x02E60001, -+ 0x81C, 0x01E80001, -+ 0x81C, 0x01EA0001, -+ 0x81C, 0x01EC0001, -+ 0x81C, 0x01EE0001, -+ 0x81C, 0x01F00001, -+ 0x81C, 0x01F20001, -+ 0x81C, 0x01F40001, -+ 0x81C, 0x01F60001, -+ 0x81C, 0x01F80001, -+ 0x81C, 0x01FA0001, -+ 0x81C, 0x01FC0001, -+ 0x81C, 0x01FE0001, -+ 0xA0000000, 0x00000000, -+ 0x81C, 0xFF800001, -+ 0x81C, 0xFF820001, -+ 0x81C, 0xFF840001, -+ 0x81C, 0xFE860001, -+ 0x81C, 0xFD880001, -+ 0x81C, 0xFC8A0001, -+ 0x81C, 0xFB8C0001, -+ 0x81C, 0xFA8E0001, -+ 0x81C, 0xF9900001, -+ 0x81C, 0xF8920001, -+ 0x81C, 0xF7940001, -+ 0x81C, 0xF6960001, -+ 0x81C, 0xF5980001, -+ 0x81C, 0xF49A0001, -+ 0x81C, 0xF39C0001, -+ 0x81C, 0xF29E0001, -+ 0x81C, 0xF1A00001, -+ 0x81C, 0xF0A20001, -+ 0x81C, 0xEFA40001, -+ 0x81C, 0xEEA60001, -+ 0x81C, 0xEDA80001, -+ 0x81C, 0xECAA0001, -+ 0x81C, 0xEBAC0001, -+ 0x81C, 0xEAAE0001, -+ 0x81C, 0xE9B00001, -+ 0x81C, 0xE8B20001, -+ 0x81C, 0xE7B40001, -+ 0x81C, 0xE6B60001, -+ 0x81C, 0xE5B80001, -+ 0x81C, 0xE4BA0001, -+ 0x81C, 0xE3BC0001, -+ 0x81C, 0xA8BE0001, -+ 0x81C, 0xA7C00001, -+ 0x81C, 0xA6C20001, -+ 0x81C, 0xA5C40001, -+ 0x81C, 0xA4C60001, -+ 0x81C, 0xA3C80001, -+ 0x81C, 0xA2CA0001, -+ 0x81C, 0xA1CC0001, -+ 0x81C, 0x68CE0001, -+ 0x81C, 0x67D00001, -+ 0x81C, 0x66D20001, -+ 0x81C, 0x65D40001, -+ 0x81C, 0x64D60001, -+ 0x81C, 0x47D80001, -+ 0x81C, 0x46DA0001, -+ 0x81C, 0x45DC0001, -+ 0x81C, 0x44DE0001, -+ 0x81C, 0x43E00001, -+ 0x81C, 0x42E20001, -+ 0x81C, 0x08E40001, -+ 0x81C, 0x07E60001, -+ 0x81C, 0x06E80001, -+ 0x81C, 0x05EA0001, -+ 0x81C, 0x04EC0001, -+ 0x81C, 0x03EE0001, -+ 0x81C, 0x02F00001, -+ 0x81C, 0x01F20001, -+ 0x81C, 0x01F40001, -+ 0x81C, 0x01F60001, -+ 0x81C, 0x01F80001, -+ 0x81C, 0x01FA0001, -+ 0x81C, 0x01FC0001, -+ 0x81C, 0x01FE0001, -+ 0xB0000000, 0x00000000, -+ 0xC50, 0x00000022, -+ 0xC50, 0x00000020, -+ 0xE50, 0x00000022, -+ 0xE50, 0x00000020, -+}; -+ -+RTW_DECL_TABLE_PHY_COND(rtw8812a_agc, rtw_phy_cfg_agc); -+ -+static const u32 rtw8812a_agc_diff_lb[] = { -+ 0x80000004, 0x00000000, 0x40000000, 0x00000000, -+ 0x81C, 0x47CE0001, -+ 0x81C, 0x46D00001, -+ 0x81C, 0x45D20001, -+ 0x81C, 0x44D40001, -+ 0x81C, 0x43D60001, -+ 0x81C, 0x42D80001, -+ 0x81C, 0x08DA0001, -+ 0x81C, 0x07DC0001, -+ 0x81C, 0x06DE0001, -+ 0x81C, 0x05E00001, -+ 0x81C, 0x04E20001, -+ 0x81C, 0x03E40001, -+ 0x81C, 0x02E60001, -+ 0xA0000000, 0x00000000, -+ 0x81C, 0x47D80001, -+ 0x81C, 0x46DA0001, -+ 0x81C, 0x45DC0001, -+ 0x81C, 0x44DE0001, -+ 0x81C, 0x43E00001, -+ 0x81C, 0x42E20001, -+ 0x81C, 0x08E40001, -+ 0x81C, 0x07E60001, -+ 0x81C, 0x06E80001, -+ 0x81C, 0x05EA0001, -+ 0x81C, 0x04EC0001, -+ 0x81C, 0x03EE0001, -+ 0x81C, 0x02F00001, -+ 0xB0000000, 0x00000000, -+}; -+ -+RTW_DECL_TABLE_PHY_COND(rtw8812a_agc_diff_lb, rtw_phy_cfg_agc); -+ -+static const u32 rtw8812a_agc_diff_hb[] = { -+ 0x80000004, 0x00000000, 0x40000000, 0x00000000, -+ 0x81C, 0x45CE0001, -+ 0x81C, 0x44D00001, -+ 0x81C, 0x43D20001, -+ 0x81C, 0x42D40001, -+ 0x81C, 0x08D60001, -+ 0x81C, 0x07D80001, -+ 0x81C, 0x06DA0001, -+ 0x81C, 0x05DC0001, -+ 0x81C, 0x04DE0001, -+ 0x81C, 0x03E00001, -+ 0x81C, 0x02E20001, -+ 0x81C, 0x01E40001, -+ 0x81C, 0x01E60001, -+ 0xA0000000, 0x00000000, -+ 0x81C, 0x45D80001, -+ 0x81C, 0x44DA0001, -+ 0x81C, 0x43DC0001, -+ 0x81C, 0x42DE0001, -+ 0x81C, 0x08E00001, -+ 0x81C, 0x07E20001, -+ 0x81C, 0x06E40001, -+ 0x81C, 0x05E60001, -+ 0x81C, 0x04E80001, -+ 0x81C, 0x03EA0001, -+ 0x81C, 0x02EC0001, -+ 0x81C, 0x01EE0001, -+ 0x81C, 0x01F00001, -+ 0xB0000000, 0x00000000, -+}; -+ -+RTW_DECL_TABLE_PHY_COND(rtw8812a_agc_diff_hb, rtw_phy_cfg_agc); -+ -+static const u32 rtw8812a_bb[] = { -+ 0x800, 0x8020D010, -+ 0x804, 0x080112E0, -+ 0x808, 0x0E028233, -+ 0x80C, 0x12131113, -+ 0x810, 0x20101263, -+ 0x814, 0x020C3D10, -+ 0x818, 0x03A00385, -+ 0x820, 0x00000000, -+ 0x824, 0x00030FE0, -+ 0x828, 0x00000000, -+ 0x82C, 0x002083DD, -+ 0x830, 0x2EAAEEB8, -+ 0x834, 0x0037A706, -+ 0x838, 0x06C89B44, -+ 0x83C, 0x0000095B, -+ 0x840, 0xC0000001, -+ 0x844, 0x40003CDE, -+ 0x848, 0x6210FF8B, -+ 0x84C, 0x6CFDFFB8, -+ 0x850, 0x28874706, -+ 0x854, 0x0001520C, -+ 0x858, 0x8060E000, -+ 0x85C, 0x74210168, -+ 0x860, 0x6929C321, -+ 0x864, 0x79727432, -+ 0x868, 0x8CA7A314, -+ 0x86C, 0x338C2878, -+ 0x870, 0x03333333, -+ 0x874, 0x31602C2E, -+ 0x878, 0x00003152, -+ 0x87C, 0x000FC000, -+ 0x8A0, 0x00000013, -+ 0x8A4, 0x7F7F7F7F, -+ 0x8A8, 0xA202033E, -+ 0x8AC, 0x0FF0FA0A, -+ 0x8B0, 0x00000600, -+ 0x8B4, 0x000FC080, -+ 0x8B8, 0x6C10D7FF, -+ 0x8BC, 0x4CA520A3, -+ 0x8C0, 0x27F00020, -+ 0x8C4, 0x00000000, -+ 0x8C8, 0x00012D69, -+ 0x8CC, 0x08248492, -+ 0x8D0, 0x0000B800, -+ 0x8DC, 0x00000000, -+ 0x8D4, 0x940008A0, -+ 0x8D8, 0x290B5612, -+ 0x8F8, 0x400002C0, -+ 0x8FC, 0x00000000, -+ 0x900, 0x00000701, -+ 0x90C, 0x00000000, -+ 0x910, 0x0000FC00, -+ 0x914, 0x00000404, -+ 0x918, 0x1C1028C0, -+ 0x91C, 0x64B11A1C, -+ 0x920, 0xE0767233, -+ 0x924, 0x055AA500, -+ 0x928, 0x00000004, -+ 0x92C, 0xFFFE0000, -+ 0x930, 0xFFFFFFFE, -+ 0x934, 0x001FFFFF, -+ 0x960, 0x00000000, -+ 0x964, 0x00000000, -+ 0x968, 0x00000000, -+ 0x96C, 0x00000000, -+ 0x970, 0x801FFFFF, -+ 0x978, 0x00000000, -+ 0x97C, 0x00000000, -+ 0x980, 0x00000000, -+ 0x984, 0x00000000, -+ 0x988, 0x00000000, -+ 0x990, 0x27100000, -+ 0x994, 0xFFFF0100, -+ 0x998, 0xFFFFFF5C, -+ 0x99C, 0xFFFFFFFF, -+ 0x9A0, 0x000000FF, -+ 0x9A4, 0x00080080, -+ 0x9A8, 0x00000000, -+ 0x9AC, 0x00000000, -+ 0x9B0, 0x81081008, -+ 0x9B4, 0x00000000, -+ 0x9B8, 0x01081008, -+ 0x9BC, 0x01081008, -+ 0x9D0, 0x00000000, -+ 0x9D4, 0x00000000, -+ 0x9D8, 0x00000000, -+ 0x9DC, 0x00000000, -+ 0x9E4, 0x00000003, -+ 0x9E8, 0x000002D5, -+ 0xA00, 0x00D047C8, -+ 0xA04, 0x01FF000C, -+ 0xA08, 0x8C838300, -+ 0xA0C, 0x2E7F000F, -+ 0xA10, 0x9500BB78, -+ 0xA14, 0x11144028, -+ 0xA18, 0x00881117, -+ 0xA1C, 0x89140F00, -+ 0xA20, 0x1A1B0000, -+ 0xA24, 0x090E1217, -+ 0xA28, 0x00000305, -+ 0xA2C, 0x00900000, -+ 0xA70, 0x101FFF00, -+ 0xA74, 0x00000008, -+ 0xA78, 0x00000900, -+ 0xA7C, 0x225B0606, -+ 0xA80, 0x218075B2, -+ 0xA84, 0x001F8C80, -+ 0xB00, 0x03100000, -+ 0xB04, 0x0000B000, -+ 0xB08, 0xAE0201EB, -+ 0xB0C, 0x01003207, -+ 0xB10, 0x00009807, -+ 0xB14, 0x01000000, -+ 0xB18, 0x00000002, -+ 0xB1C, 0x00000002, -+ 0xB20, 0x0000001F, -+ 0xB24, 0x03020100, -+ 0xB28, 0x07060504, -+ 0xB2C, 0x0B0A0908, -+ 0xB30, 0x0F0E0D0C, -+ 0xB34, 0x13121110, -+ 0xB38, 0x17161514, -+ 0xB3C, 0x0000003A, -+ 0xB40, 0x00000000, -+ 0xB44, 0x00000000, -+ 0xB48, 0x13000032, -+ 0xB4C, 0x48080000, -+ 0xB50, 0x00000000, -+ 0xB54, 0x00000000, -+ 0xB58, 0x00000000, -+ 0xB5C, 0x00000000, -+ 0xC00, 0x00000007, -+ 0xC04, 0x00042020, -+ 0xC08, 0x80410231, -+ 0xC0C, 0x00000000, -+ 0xC10, 0x00000100, -+ 0xC14, 0x01000000, -+ 0xC1C, 0x40000003, -+ 0xC20, 0x12121212, -+ 0xC24, 0x12121212, -+ 0xC28, 0x12121212, -+ 0xC2C, 0x12121212, -+ 0xC30, 0x12121212, -+ 0xC34, 0x12121212, -+ 0xC38, 0x12121212, -+ 0xC3C, 0x12121212, -+ 0xC40, 0x12121212, -+ 0xC44, 0x12121212, -+ 0xC48, 0x12121212, -+ 0xC4C, 0x12121212, -+ 0xC50, 0x00000020, -+ 0xC54, 0x0008121C, -+ 0xC58, 0x30000C1C, -+ 0xC5C, 0x00000058, -+ 0xC60, 0x34344443, -+ 0xC64, 0x07003333, -+ 0x80000008, 0x00000000, 0x40000000, 0x00000000, -+ 0xC68, 0x59791979, -+ 0x90000008, 0x05000000, 0x40000000, 0x00000000, -+ 0xC68, 0x59791979, -+ 0x90000002, 0x00000000, 0x40000000, 0x00000000, -+ 0xC68, 0x59791979, -+ 0x90000004, 0x00000000, 0x40000000, 0x00000000, -+ 0xC68, 0x59791979, -+ 0x90000001, 0x00000000, 0x40000000, 0x00000000, -+ 0xC68, 0x59791979, -+ 0x90000001, 0x00000005, 0x40000000, 0x00000000, -+ 0xC68, 0x59791979, -+ 0xA0000000, 0x00000000, -+ 0xC68, 0x59799979, -+ 0xB0000000, 0x00000000, -+ 0xC6C, 0x59795979, -+ 0xC70, 0x19795979, -+ 0xC74, 0x19795979, -+ 0xC78, 0x19791979, -+ 0xC7C, 0x19791979, -+ 0xC80, 0x19791979, -+ 0xC84, 0x19791979, -+ 0xC94, 0x0100005C, -+ 0xC98, 0x00000000, -+ 0xC9C, 0x00000000, -+ 0xCA0, 0x00000029, -+ 0xCA4, 0x08040201, -+ 0xCA8, 0x80402010, -+ 0xCB0, 0x77547777, -+ 0xCB4, 0x00000077, -+ 0xCB8, 0x00508242, -+ 0xE00, 0x00000007, -+ 0xE04, 0x00042020, -+ 0xE08, 0x80410231, -+ 0xE0C, 0x00000000, -+ 0xE10, 0x00000100, -+ 0xE14, 0x01000000, -+ 0xE1C, 0x40000003, -+ 0xE20, 0x12121212, -+ 0xE24, 0x12121212, -+ 0xE28, 0x12121212, -+ 0xE2C, 0x12121212, -+ 0xE30, 0x12121212, -+ 0xE34, 0x12121212, -+ 0xE38, 0x12121212, -+ 0xE3C, 0x12121212, -+ 0xE40, 0x12121212, -+ 0xE44, 0x12121212, -+ 0xE48, 0x12121212, -+ 0xE4C, 0x12121212, -+ 0xE50, 0x00000020, -+ 0xE54, 0x0008121C, -+ 0xE58, 0x30000C1C, -+ 0xE5C, 0x00000058, -+ 0xE60, 0x34344443, -+ 0xE64, 0x07003333, -+ 0xE68, 0x59791979, -+ 0xE6C, 0x59795979, -+ 0xE70, 0x19795979, -+ 0xE74, 0x19795979, -+ 0xE78, 0x19791979, -+ 0xE7C, 0x19791979, -+ 0xE80, 0x19791979, -+ 0xE84, 0x19791979, -+ 0xE94, 0x0100005C, -+ 0xE98, 0x00000000, -+ 0xE9C, 0x00000000, -+ 0xEA0, 0x00000029, -+ 0xEA4, 0x08040201, -+ 0xEA8, 0x80402010, -+ 0xEB0, 0x77547777, -+ 0xEB4, 0x00000077, -+ 0xEB8, 0x00508242, -+}; -+ -+RTW_DECL_TABLE_PHY_COND(rtw8812a_bb, rtw_phy_cfg_bb); -+ -+static const struct rtw_phy_pg_cfg_pair rtw8812a_bb_pg[] = { -+ { 0, 0, 0, 0x00000c20, 0xffffffff, 0x34363840, }, -+ { 0, 0, 0, 0x00000c24, 0xffffffff, 0x42424444, }, -+ { 0, 0, 0, 0x00000c28, 0xffffffff, 0x30323638, }, -+ { 0, 0, 0, 0x00000c2c, 0xffffffff, 0x40424444, }, -+ { 0, 0, 0, 0x00000c30, 0xffffffff, 0x28303236, }, -+ { 0, 0, 1, 0x00000c34, 0xffffffff, 0x38404242, }, -+ { 0, 0, 1, 0x00000c38, 0xffffffff, 0x26283034, }, -+ { 0, 0, 0, 0x00000c3c, 0xffffffff, 0x40424444, }, -+ { 0, 0, 0, 0x00000c40, 0xffffffff, 0x28303236, }, -+ { 0, 0, 0, 0x00000c44, 0xffffffff, 0x42422426, }, -+ { 0, 0, 1, 0x00000c48, 0xffffffff, 0x30343840, }, -+ { 0, 0, 1, 0x00000c4c, 0xffffffff, 0x22242628, }, -+ { 0, 1, 0, 0x00000e20, 0xffffffff, 0x34363840, }, -+ { 0, 1, 0, 0x00000e24, 0xffffffff, 0x42424444, }, -+ { 0, 1, 0, 0x00000e28, 0xffffffff, 0x30323638, }, -+ { 0, 1, 0, 0x00000e2c, 0xffffffff, 0x40424444, }, -+ { 0, 1, 0, 0x00000e30, 0xffffffff, 0x28303236, }, -+ { 0, 1, 1, 0x00000e34, 0xffffffff, 0x38404242, }, -+ { 0, 1, 1, 0x00000e38, 0xffffffff, 0x26283034, }, -+ { 0, 1, 0, 0x00000e3c, 0xffffffff, 0x40424444, }, -+ { 0, 1, 0, 0x00000e40, 0xffffffff, 0x28303236, }, -+ { 0, 1, 0, 0x00000e44, 0xffffffff, 0x42422426, }, -+ { 0, 1, 1, 0x00000e48, 0xffffffff, 0x30343840, }, -+ { 0, 1, 1, 0x00000e4c, 0xffffffff, 0x22242628, }, -+ { 1, 0, 0, 0x00000c24, 0xffffffff, 0x42424444, }, -+ { 1, 0, 0, 0x00000c28, 0xffffffff, 0x30323640, }, -+ { 1, 0, 0, 0x00000c2c, 0xffffffff, 0x40424444, }, -+ { 1, 0, 0, 0x00000c30, 0xffffffff, 0x28303236, }, -+ { 1, 0, 1, 0x00000c34, 0xffffffff, 0x38404242, }, -+ { 1, 0, 1, 0x00000c38, 0xffffffff, 0x26283034, }, -+ { 1, 0, 0, 0x00000c3c, 0xffffffff, 0x40424444, }, -+ { 1, 0, 0, 0x00000c40, 0xffffffff, 0x28303236, }, -+ { 1, 0, 0, 0x00000c44, 0xffffffff, 0x42422426, }, -+ { 1, 0, 1, 0x00000c48, 0xffffffff, 0x30343840, }, -+ { 1, 0, 1, 0x00000c4c, 0xffffffff, 0x22242628, }, -+ { 1, 1, 0, 0x00000e24, 0xffffffff, 0x42424444, }, -+ { 1, 1, 0, 0x00000e28, 0xffffffff, 0x30323640, }, -+ { 1, 1, 0, 0x00000e2c, 0xffffffff, 0x40424444, }, -+ { 1, 1, 0, 0x00000e30, 0xffffffff, 0x28303236, }, -+ { 1, 1, 1, 0x00000e34, 0xffffffff, 0x38404242, }, -+ { 1, 1, 1, 0x00000e38, 0xffffffff, 0x26283034, }, -+ { 1, 1, 0, 0x00000e3c, 0xffffffff, 0x40424444, }, -+ { 1, 1, 0, 0x00000e40, 0xffffffff, 0x28303236, }, -+ { 1, 1, 0, 0x00000e44, 0xffffffff, 0x42422426, }, -+ { 1, 1, 1, 0x00000e48, 0xffffffff, 0x30343840, }, -+ { 1, 1, 1, 0x00000e4c, 0xffffffff, 0x22242628, }, -+}; -+ -+RTW_DECL_TABLE_BB_PG(rtw8812a_bb_pg); -+ -+static const struct rtw_phy_pg_cfg_pair rtw8812a_bb_pg_rfe3[] = { -+ { 0, 0, 0, 0x00000c20, 0xffffffff, 0x34343434, }, -+ { 0, 0, 0, 0x00000c24, 0xffffffff, 0x32323232, }, -+ { 0, 0, 0, 0x00000c28, 0xffffffff, 0x28303232, }, -+ { 0, 0, 0, 0x00000c2c, 0xffffffff, 0x32323232, }, -+ { 0, 0, 0, 0x00000c30, 0xffffffff, 0x28303232, }, -+ { 0, 0, 1, 0x00000c34, 0xffffffff, 0x32323232, }, -+ { 0, 0, 1, 0x00000c38, 0xffffffff, 0x26283032, }, -+ { 0, 0, 0, 0x00000c3c, 0xffffffff, 0x32323232, }, -+ { 0, 0, 0, 0x00000c40, 0xffffffff, 0x28303232, }, -+ { 0, 0, 0, 0x00000c44, 0xffffffff, 0x32322426, }, -+ { 0, 0, 1, 0x00000c48, 0xffffffff, 0x32323232, }, -+ { 0, 0, 1, 0x00000c4c, 0xffffffff, 0x24262830, }, -+ { 0, 1, 0, 0x00000e20, 0xffffffff, 0x34343434, }, -+ { 0, 1, 0, 0x00000e24, 0xffffffff, 0x32323232, }, -+ { 0, 1, 0, 0x00000e28, 0xffffffff, 0x28303232, }, -+ { 0, 1, 0, 0x00000e2c, 0xffffffff, 0x32323232, }, -+ { 0, 1, 0, 0x00000e30, 0xffffffff, 0x28303232, }, -+ { 0, 1, 1, 0x00000e34, 0xffffffff, 0x32323232, }, -+ { 0, 1, 1, 0x00000e38, 0xffffffff, 0x26283032, }, -+ { 0, 1, 0, 0x00000e3c, 0xffffffff, 0x32323232, }, -+ { 0, 1, 0, 0x00000e40, 0xffffffff, 0x28303232, }, -+ { 0, 1, 0, 0x00000e44, 0xffffffff, 0x32322426, }, -+ { 0, 1, 1, 0x00000e48, 0xffffffff, 0x32323232, }, -+ { 0, 1, 1, 0x00000e4c, 0xffffffff, 0x24262830, }, -+ { 1, 0, 0, 0x00000c24, 0xffffffff, 0x32323232, }, -+ { 1, 0, 0, 0x00000c28, 0xffffffff, 0x28303232, }, -+ { 1, 0, 0, 0x00000c2c, 0xffffffff, 0x32323232, }, -+ { 1, 0, 0, 0x00000c30, 0xffffffff, 0x24262830, }, -+ { 1, 0, 1, 0x00000c34, 0xffffffff, 0x32323232, }, -+ { 1, 0, 1, 0x00000c38, 0xffffffff, 0x24262830, }, -+ { 1, 0, 0, 0x00000c3c, 0xffffffff, 0x32323232, }, -+ { 1, 0, 0, 0x00000c40, 0xffffffff, 0x24262830, }, -+ { 1, 0, 0, 0x00000c44, 0xffffffff, 0x32322222, }, -+ { 1, 0, 1, 0x00000c48, 0xffffffff, 0x28303232, }, -+ { 1, 0, 1, 0x00000c4c, 0xffffffff, 0x22222426, }, -+ { 1, 1, 0, 0x00000e24, 0xffffffff, 0x32323232, }, -+ { 1, 1, 0, 0x00000e28, 0xffffffff, 0x28303232, }, -+ { 1, 1, 0, 0x00000e2c, 0xffffffff, 0x32323232, }, -+ { 1, 1, 0, 0x00000e30, 0xffffffff, 0x24262830, }, -+ { 1, 1, 1, 0x00000e34, 0xffffffff, 0x32323232, }, -+ { 1, 1, 1, 0x00000e38, 0xffffffff, 0x24262830, }, -+ { 1, 1, 0, 0x00000e3c, 0xffffffff, 0x32323232, }, -+ { 1, 1, 0, 0x00000e40, 0xffffffff, 0x24262830, }, -+ { 1, 1, 0, 0x00000e44, 0xffffffff, 0x32322222, }, -+ { 1, 1, 1, 0x00000e48, 0xffffffff, 0x28303232, }, -+ { 1, 1, 1, 0x00000e4c, 0xffffffff, 0x22222426, }, -+}; -+ -+RTW_DECL_TABLE_BB_PG(rtw8812a_bb_pg_rfe3); -+ -+static const u32 rtw8812a_rf_a[] = { -+ 0x000, 0x00010000, -+ 0x018, 0x0001712A, -+ 0x056, 0x00051CF2, -+ 0x066, 0x00040000, -+ 0x01E, 0x00080000, -+ 0x089, 0x00000080, -+ 0x80000001, 0x00000000, 0x40000000, 0x00000000, -+ 0x086, 0x00014B3A, -+ 0x90000001, 0x00000005, 0x40000000, 0x00000000, -+ 0x086, 0x00014B3A, -+ 0xA0000000, 0x00000000, -+ 0x086, 0x00014B38, -+ 0xB0000000, 0x00000000, -+ 0x80000004, 0x00000000, 0x40000000, 0x00000000, -+ 0x08B, 0x00080180, -+ 0xA0000000, 0x00000000, -+ 0x08B, 0x00087180, -+ 0xB0000000, 0x00000000, -+ 0x0B1, 0x0001FC1A, -+ 0x0B3, 0x000F0810, -+ 0x0B4, 0x0001A78D, -+ 0x0BA, 0x00086180, -+ 0x018, 0x00000006, -+ 0x0EF, 0x00002000, -+ 0x80000001, 0x00000000, 0x40000000, 0x00000000, -+ 0x03B, 0x0003F218, -+ 0x03B, 0x00030A58, -+ 0x03B, 0x0002FA58, -+ 0x03B, 0x00022590, -+ 0x03B, 0x0001FA50, -+ 0x03B, 0x00010248, -+ 0x03B, 0x00008240, -+ 0x90000001, 0x00000005, 0x40000000, 0x00000000, -+ 0x03B, 0x0003F218, -+ 0x03B, 0x00030A58, -+ 0x03B, 0x0002FA58, -+ 0x03B, 0x00022590, -+ 0x03B, 0x0001FA50, -+ 0x03B, 0x00010248, -+ 0x03B, 0x00008240, -+ 0xA0000000, 0x00000000, -+ 0x03B, 0x00038A58, -+ 0x03B, 0x00037A58, -+ 0x03B, 0x0002A590, -+ 0x03B, 0x00027A50, -+ 0x03B, 0x00018248, -+ 0x03B, 0x00010240, -+ 0x03B, 0x00008240, -+ 0xB0000000, 0x00000000, -+ 0x0EF, 0x00000100, -+ 0x80000002, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x0000A4EE, -+ 0x034, 0x00009076, -+ 0x034, 0x00008073, -+ 0x034, 0x00007070, -+ 0x034, 0x0000606D, -+ 0x034, 0x0000506A, -+ 0x034, 0x00004049, -+ 0x034, 0x00003046, -+ 0x034, 0x00002028, -+ 0x034, 0x00001025, -+ 0x034, 0x00000022, -+ 0xA0000000, 0x00000000, -+ 0x034, 0x0000ADF4, -+ 0x034, 0x00009DF1, -+ 0x034, 0x00008DEE, -+ 0x034, 0x00007DEB, -+ 0x034, 0x00006DE8, -+ 0x034, 0x00005DE5, -+ 0x034, 0x00004DE2, -+ 0x034, 0x00003CE6, -+ 0x034, 0x000024E7, -+ 0x034, 0x000014E4, -+ 0x034, 0x000004E1, -+ 0xB0000000, 0x00000000, -+ 0x0EF, 0x00000000, -+ 0x0EF, 0x000020A2, -+ 0x0DF, 0x00000080, -+ 0x035, 0x00000192, -+ 0x035, 0x00008192, -+ 0x035, 0x00010192, -+ 0x036, 0x00000024, -+ 0x036, 0x00008024, -+ 0x036, 0x00010024, -+ 0x036, 0x00018024, -+ 0x0EF, 0x00000000, -+ 0x051, 0x00000C21, -+ 0x052, 0x000006D9, -+ 0x053, 0x000FC649, -+ 0x054, 0x0000017E, -+ 0x0EF, 0x00000002, -+ 0x008, 0x00008400, -+ 0x018, 0x0001712A, -+ 0x0EF, 0x00001000, -+ 0x03A, 0x00000080, -+ 0x03B, 0x0003A02C, -+ 0x03C, 0x00004000, -+ 0x03A, 0x00000400, -+ 0x03B, 0x0003202C, -+ 0x03C, 0x00010000, -+ 0x03A, 0x000000A0, -+ 0x03B, 0x0002B064, -+ 0x03C, 0x00004000, -+ 0x03A, 0x000000D8, -+ 0x03B, 0x00023070, -+ 0x03C, 0x00004000, -+ 0x03A, 0x00000468, -+ 0x03B, 0x0001B870, -+ 0x03C, 0x00010000, -+ 0x03A, 0x00000098, -+ 0x03B, 0x00012085, -+ 0x03C, 0x000E4000, -+ 0x03A, 0x00000418, -+ 0x03B, 0x0000A080, -+ 0x03C, 0x000F0000, -+ 0x03A, 0x00000418, -+ 0x03B, 0x00002080, -+ 0x03C, 0x00010000, -+ 0x03A, 0x00000080, -+ 0x03B, 0x0007A02C, -+ 0x03C, 0x00004000, -+ 0x03A, 0x00000400, -+ 0x03B, 0x0007202C, -+ 0x03C, 0x00010000, -+ 0x03A, 0x000000A0, -+ 0x03B, 0x0006B064, -+ 0x03C, 0x00004000, -+ 0x03A, 0x000000D8, -+ 0x03B, 0x00063070, -+ 0x03C, 0x00004000, -+ 0x03A, 0x00000468, -+ 0x03B, 0x0005B870, -+ 0x03C, 0x00010000, -+ 0x03A, 0x00000098, -+ 0x03B, 0x00052085, -+ 0x03C, 0x000E4000, -+ 0x03A, 0x00000418, -+ 0x03B, 0x0004A080, -+ 0x03C, 0x000F0000, -+ 0x03A, 0x00000418, -+ 0x03B, 0x00042080, -+ 0x03C, 0x00010000, -+ 0x03A, 0x00000080, -+ 0x03B, 0x000BA02C, -+ 0x03C, 0x00004000, -+ 0x03A, 0x00000400, -+ 0x03B, 0x000B202C, -+ 0x03C, 0x00010000, -+ 0x03A, 0x000000A0, -+ 0x03B, 0x000AB064, -+ 0x03C, 0x00004000, -+ 0x03A, 0x000000D8, -+ 0x03B, 0x000A3070, -+ 0x03C, 0x00004000, -+ 0x03A, 0x00000468, -+ 0x03B, 0x0009B870, -+ 0x03C, 0x00010000, -+ 0x03A, 0x00000098, -+ 0x03B, 0x00092085, -+ 0x03C, 0x000E4000, -+ 0x03A, 0x00000418, -+ 0x03B, 0x0008A080, -+ 0x03C, 0x000F0000, -+ 0x03A, 0x00000418, -+ 0x03B, 0x00082080, -+ 0x03C, 0x00010000, -+ 0x0EF, 0x00001100, -+ 0x80000008, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x0004A0B2, -+ 0x034, 0x000490AF, -+ 0x034, 0x00048070, -+ 0x034, 0x0004706D, -+ 0x034, 0x00046050, -+ 0x034, 0x0004504D, -+ 0x034, 0x0004404A, -+ 0x034, 0x00043047, -+ 0x034, 0x0004200A, -+ 0x034, 0x00041007, -+ 0x034, 0x00040004, -+ 0x90000008, 0x05000000, 0x40000000, 0x00000000, -+ 0x034, 0x0004A0B2, -+ 0x034, 0x000490AF, -+ 0x034, 0x00048070, -+ 0x034, 0x0004706D, -+ 0x034, 0x0004604D, -+ 0x034, 0x0004504A, -+ 0x034, 0x00044047, -+ 0x034, 0x00043044, -+ 0x034, 0x00042007, -+ 0x034, 0x00041004, -+ 0x034, 0x00040001, -+ 0xA0000000, 0x00000000, -+ 0x034, 0x0004ADF5, -+ 0x034, 0x00049DF2, -+ 0x034, 0x00048DEF, -+ 0x034, 0x00047DEC, -+ 0x034, 0x00046DE9, -+ 0x034, 0x00045DE6, -+ 0x034, 0x00044DE3, -+ 0x034, 0x000438C8, -+ 0x034, 0x000428C5, -+ 0x034, 0x000418C2, -+ 0x034, 0x000408C0, -+ 0xB0000000, 0x00000000, -+ 0x80000008, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x0002A0B2, -+ 0x034, 0x000290AF, -+ 0x034, 0x00028070, -+ 0x034, 0x0002706D, -+ 0x034, 0x00026050, -+ 0x034, 0x0002504D, -+ 0x034, 0x0002404A, -+ 0x034, 0x00023047, -+ 0x034, 0x0002200A, -+ 0x034, 0x00021007, -+ 0x034, 0x00020004, -+ 0x90000008, 0x05000000, 0x40000000, 0x00000000, -+ 0x034, 0x0002A0B4, -+ 0x034, 0x000290B1, -+ 0x034, 0x00028072, -+ 0x034, 0x0002706F, -+ 0x034, 0x0002604F, -+ 0x034, 0x0002504C, -+ 0x034, 0x00024049, -+ 0x034, 0x00023046, -+ 0x034, 0x00022009, -+ 0x034, 0x00021006, -+ 0x034, 0x00020003, -+ 0xA0000000, 0x00000000, -+ 0x034, 0x0002ADF5, -+ 0x034, 0x00029DF2, -+ 0x034, 0x00028DEF, -+ 0x034, 0x00027DEC, -+ 0x034, 0x00026DE9, -+ 0x034, 0x00025DE6, -+ 0x034, 0x00024DE3, -+ 0x034, 0x000238C8, -+ 0x034, 0x000228C5, -+ 0x034, 0x000218C2, -+ 0x034, 0x000208C0, -+ 0xB0000000, 0x00000000, -+ 0x80000008, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x0000A0B2, -+ 0x034, 0x000090AF, -+ 0x034, 0x00008070, -+ 0x034, 0x0000706D, -+ 0x034, 0x00006050, -+ 0x034, 0x0000504D, -+ 0x034, 0x0000404A, -+ 0x034, 0x00003047, -+ 0x034, 0x0000200A, -+ 0x034, 0x00001007, -+ 0x034, 0x00000004, -+ 0x90000008, 0x05000000, 0x40000000, 0x00000000, -+ 0x034, 0x0000A0B2, -+ 0x034, 0x000090AF, -+ 0x034, 0x00008070, -+ 0x034, 0x0000706D, -+ 0x034, 0x0000604D, -+ 0x034, 0x0000504A, -+ 0x034, 0x00004047, -+ 0x034, 0x00003044, -+ 0x034, 0x00002007, -+ 0x034, 0x00001004, -+ 0x034, 0x00000001, -+ 0xA0000000, 0x00000000, -+ 0x034, 0x0000AFF7, -+ 0x034, 0x00009DF7, -+ 0x034, 0x00008DF4, -+ 0x034, 0x00007DF1, -+ 0x034, 0x00006DEE, -+ 0x034, 0x00005DEB, -+ 0x034, 0x00004DE8, -+ 0x034, 0x000038CC, -+ 0x034, 0x000028C9, -+ 0x034, 0x000018C6, -+ 0x034, 0x000008C3, -+ 0xB0000000, 0x00000000, -+ 0x0EF, 0x00000000, -+ 0x80000008, 0x00000000, 0x40000000, 0x00000000, -+ 0x018, 0x0001712A, -+ 0x0EF, 0x00000040, -+ 0x035, 0x000001D4, -+ 0x035, 0x000081D4, -+ 0x035, 0x000101D4, -+ 0x035, 0x000201B4, -+ 0x035, 0x000281B4, -+ 0x035, 0x000301B4, -+ 0x035, 0x000401B4, -+ 0x035, 0x000481B4, -+ 0x035, 0x000501B4, -+ 0x90000008, 0x05000000, 0x40000000, 0x00000000, -+ 0x018, 0x0001712A, -+ 0x0EF, 0x00000040, -+ 0x035, 0x000001D4, -+ 0x035, 0x000081D4, -+ 0x035, 0x000101D4, -+ 0x035, 0x000201B4, -+ 0x035, 0x000281B4, -+ 0x035, 0x000301B4, -+ 0x035, 0x000401B4, -+ 0x035, 0x000481B4, -+ 0x035, 0x000501B4, -+ 0xA0000000, 0x00000000, -+ 0x018, 0x0001712A, -+ 0x0EF, 0x00000040, -+ 0x035, 0x00000188, -+ 0x035, 0x00008147, -+ 0x035, 0x00010147, -+ 0x035, 0x000201D7, -+ 0x035, 0x000281D7, -+ 0x035, 0x000301D7, -+ 0x035, 0x000401D8, -+ 0x035, 0x000481D8, -+ 0x035, 0x000501D8, -+ 0xB0000000, 0x00000000, -+ 0x0EF, 0x00000000, -+ 0x80000008, 0x00000000, 0x40000000, 0x00000000, -+ 0x018, 0x0001712A, -+ 0x0EF, 0x00000010, -+ 0x036, 0x00004BFB, -+ 0x036, 0x0000CBFB, -+ 0x036, 0x00014BFB, -+ 0x036, 0x0001CBFB, -+ 0x036, 0x00024F4B, -+ 0x036, 0x0002CF4B, -+ 0x036, 0x00034F4B, -+ 0x036, 0x0003CF4B, -+ 0x036, 0x00044F4B, -+ 0x036, 0x0004CF4B, -+ 0x036, 0x00054F4B, -+ 0x036, 0x0005CF4B, -+ 0x90000008, 0x05000000, 0x40000000, 0x00000000, -+ 0x018, 0x0001712A, -+ 0x0EF, 0x00000010, -+ 0x036, 0x00004BFB, -+ 0x036, 0x0000CBFB, -+ 0x036, 0x00014BFB, -+ 0x036, 0x0001CBFB, -+ 0x036, 0x00024F4B, -+ 0x036, 0x0002CF4B, -+ 0x036, 0x00034F4B, -+ 0x036, 0x0003CF4B, -+ 0x036, 0x00044F4B, -+ 0x036, 0x0004CF4B, -+ 0x036, 0x00054F4B, -+ 0x036, 0x0005CF4B, -+ 0xA0000000, 0x00000000, -+ 0x018, 0x0001712A, -+ 0x0EF, 0x00000010, -+ 0x036, 0x00084EB4, -+ 0x036, 0x0008CC35, -+ 0x036, 0x00094C35, -+ 0x036, 0x0009CC35, -+ 0x036, 0x000A4C35, -+ 0x036, 0x000ACC35, -+ 0x036, 0x000B4C35, -+ 0x036, 0x000BCC35, -+ 0x036, 0x000C4C34, -+ 0x036, 0x000CCC35, -+ 0x036, 0x000D4C35, -+ 0x036, 0x000DCC35, -+ 0xB0000000, 0x00000000, -+ 0x0EF, 0x00000000, -+ 0x0EF, 0x00000008, -+ 0x80000008, 0x00000000, 0x40000000, 0x00000000, -+ 0x03C, 0x000002CC, -+ 0x03C, 0x00000522, -+ 0x03C, 0x00000902, -+ 0x90000008, 0x05000000, 0x40000000, 0x00000000, -+ 0x03C, 0x000002CC, -+ 0x03C, 0x00000522, -+ 0x03C, 0x00000902, -+ 0xA0000000, 0x00000000, -+ 0x03C, 0x000002A8, -+ 0x03C, 0x000005A2, -+ 0x03C, 0x00000880, -+ 0xB0000000, 0x00000000, -+ 0x0EF, 0x00000000, -+ 0x018, 0x0001712A, -+ 0x0EF, 0x00000002, -+ 0x0DF, 0x00000080, -+ 0x01F, 0x00000064, -+ 0x80000008, 0x00000000, 0x40000000, 0x00000000, -+ 0x061, 0x000FDD43, -+ 0x062, 0x00038F4B, -+ 0x063, 0x00032117, -+ 0x064, 0x000194AC, -+ 0x065, 0x000931D1, -+ 0x90000008, 0x05000000, 0x40000000, 0x00000000, -+ 0x061, 0x000FDD43, -+ 0x062, 0x00038F4B, -+ 0x063, 0x00032117, -+ 0x064, 0x000194AC, -+ 0x065, 0x000931D2, -+ 0xA0000000, 0x00000000, -+ 0x061, 0x000E5D53, -+ 0x062, 0x00038FCD, -+ 0x063, 0x000114EB, -+ 0x064, 0x000196AC, -+ 0x065, 0x000911D7, -+ 0xB0000000, 0x00000000, -+ 0x008, 0x00008400, -+ 0x01C, 0x000739D2, -+ 0x0B4, 0x0001E78D, -+ 0x018, 0x0001F12A, -+ 0xFFE, 0x00000000, -+ 0xFFE, 0x00000000, -+ 0xFFE, 0x00000000, -+ 0xFFE, 0x00000000, -+ 0x0B4, 0x0001A78D, -+ 0x018, 0x0001712A, -+}; -+ -+RTW_DECL_TABLE_RF_RADIO(rtw8812a_rf_a, A); -+ -+static const u32 rtw8812a_rf_b[] = { -+ 0x056, 0x00051CF2, -+ 0x066, 0x00040000, -+ 0x089, 0x00000080, -+ 0x80000001, 0x00000000, 0x40000000, 0x00000000, -+ 0x086, 0x00014B3A, -+ 0x90000001, 0x00000005, 0x40000000, 0x00000000, -+ 0x086, 0x00014B3A, -+ 0xA0000000, 0x00000000, -+ 0x086, 0x00014B38, -+ 0xB0000000, 0x00000000, -+ 0x80000004, 0x00000000, 0x40000000, 0x00000000, -+ 0x08B, 0x00080180, -+ 0xA0000000, 0x00000000, -+ 0x08B, 0x00087180, -+ 0xB0000000, 0x00000000, -+ 0x018, 0x00000006, -+ 0x0EF, 0x00002000, -+ 0x80000001, 0x00000000, 0x40000000, 0x00000000, -+ 0x03B, 0x0003F218, -+ 0x03B, 0x00030A58, -+ 0x03B, 0x0002FA58, -+ 0x03B, 0x00022590, -+ 0x03B, 0x0001FA50, -+ 0x03B, 0x00010248, -+ 0x03B, 0x00008240, -+ 0x90000001, 0x00000005, 0x40000000, 0x00000000, -+ 0x03B, 0x0003F218, -+ 0x03B, 0x00030A58, -+ 0x03B, 0x0002FA58, -+ 0x03B, 0x00022590, -+ 0x03B, 0x0001FA50, -+ 0x03B, 0x00010248, -+ 0x03B, 0x00008240, -+ 0xA0000000, 0x00000000, -+ 0x03B, 0x00038A58, -+ 0x03B, 0x00037A58, -+ 0x03B, 0x0002A590, -+ 0x03B, 0x00027A50, -+ 0x03B, 0x00018248, -+ 0x03B, 0x00010240, -+ 0x03B, 0x00008240, -+ 0xB0000000, 0x00000000, -+ 0x0EF, 0x00000100, -+ 0x80000002, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x0000A4EE, -+ 0x034, 0x00009076, -+ 0x034, 0x00008073, -+ 0x034, 0x00007070, -+ 0x034, 0x0000606D, -+ 0x034, 0x0000506A, -+ 0x034, 0x00004049, -+ 0x034, 0x00003046, -+ 0x034, 0x00002028, -+ 0x034, 0x00001025, -+ 0x034, 0x00000022, -+ 0xA0000000, 0x00000000, -+ 0x034, 0x0000ADF4, -+ 0x034, 0x00009DF1, -+ 0x034, 0x00008DEE, -+ 0x034, 0x00007DEB, -+ 0x034, 0x00006DE8, -+ 0x034, 0x00005DE5, -+ 0x034, 0x00004DE2, -+ 0x034, 0x00003CE6, -+ 0x034, 0x000024E7, -+ 0x034, 0x000014E4, -+ 0x034, 0x000004E1, -+ 0xB0000000, 0x00000000, -+ 0x0EF, 0x00000000, -+ 0x0EF, 0x000020A2, -+ 0x0DF, 0x00000080, -+ 0x035, 0x00000192, -+ 0x035, 0x00008192, -+ 0x035, 0x00010192, -+ 0x036, 0x00000024, -+ 0x036, 0x00008024, -+ 0x036, 0x00010024, -+ 0x036, 0x00018024, -+ 0x0EF, 0x00000000, -+ 0x051, 0x00000C21, -+ 0x052, 0x000006D9, -+ 0x053, 0x000FC649, -+ 0x054, 0x0000017E, -+ 0x0EF, 0x00000002, -+ 0x008, 0x00008400, -+ 0x018, 0x0001712A, -+ 0x0EF, 0x00001000, -+ 0x03A, 0x00000080, -+ 0x03B, 0x0003A02C, -+ 0x03C, 0x00004000, -+ 0x03A, 0x00000400, -+ 0x03B, 0x0003202C, -+ 0x03C, 0x00010000, -+ 0x03A, 0x000000A0, -+ 0x03B, 0x0002B064, -+ 0x03C, 0x00004000, -+ 0x03A, 0x000000D8, -+ 0x03B, 0x00023070, -+ 0x03C, 0x00004000, -+ 0x03A, 0x00000468, -+ 0x03B, 0x0001B870, -+ 0x03C, 0x00010000, -+ 0x03A, 0x00000098, -+ 0x03B, 0x00012085, -+ 0x03C, 0x000E4000, -+ 0x03A, 0x00000418, -+ 0x03B, 0x0000A080, -+ 0x03C, 0x000F0000, -+ 0x03A, 0x00000418, -+ 0x03B, 0x00002080, -+ 0x03C, 0x00010000, -+ 0x03A, 0x00000080, -+ 0x03B, 0x0007A02C, -+ 0x03C, 0x00004000, -+ 0x03A, 0x00000400, -+ 0x03B, 0x0007202C, -+ 0x03C, 0x00010000, -+ 0x03A, 0x000000A0, -+ 0x03B, 0x0006B064, -+ 0x03C, 0x00004000, -+ 0x03A, 0x000000D8, -+ 0x03B, 0x00063070, -+ 0x03C, 0x00004000, -+ 0x03A, 0x00000468, -+ 0x03B, 0x0005B870, -+ 0x03C, 0x00010000, -+ 0x03A, 0x00000098, -+ 0x03B, 0x00052085, -+ 0x03C, 0x000E4000, -+ 0x03A, 0x00000418, -+ 0x03B, 0x0004A080, -+ 0x03C, 0x000F0000, -+ 0x03A, 0x00000418, -+ 0x03B, 0x00042080, -+ 0x03C, 0x00010000, -+ 0x03A, 0x00000080, -+ 0x03B, 0x000BA02C, -+ 0x03C, 0x00004000, -+ 0x03A, 0x00000400, -+ 0x03B, 0x000B202C, -+ 0x03C, 0x00010000, -+ 0x03A, 0x000000A0, -+ 0x03B, 0x000AB064, -+ 0x03C, 0x00004000, -+ 0x03A, 0x000000D8, -+ 0x03B, 0x000A3070, -+ 0x03C, 0x00004000, -+ 0x03A, 0x00000468, -+ 0x03B, 0x0009B870, -+ 0x03C, 0x00010000, -+ 0x03A, 0x00000098, -+ 0x03B, 0x00092085, -+ 0x03C, 0x000E4000, -+ 0x03A, 0x00000418, -+ 0x03B, 0x0008A080, -+ 0x03C, 0x000F0000, -+ 0x03A, 0x00000418, -+ 0x03B, 0x00082080, -+ 0x03C, 0x00010000, -+ 0x0EF, 0x00001100, -+ 0x80000008, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x0004A0B2, -+ 0x034, 0x000490AF, -+ 0x034, 0x00048070, -+ 0x034, 0x0004706D, -+ 0x034, 0x00046050, -+ 0x034, 0x0004504D, -+ 0x034, 0x0004404A, -+ 0x034, 0x00043047, -+ 0x034, 0x0004200A, -+ 0x034, 0x00041007, -+ 0x034, 0x00040004, -+ 0x90000008, 0x05000000, 0x40000000, 0x00000000, -+ 0x034, 0x0004A0B1, -+ 0x034, 0x000490AE, -+ 0x034, 0x0004806F, -+ 0x034, 0x0004706C, -+ 0x034, 0x0004604C, -+ 0x034, 0x00045049, -+ 0x034, 0x00044046, -+ 0x034, 0x00043043, -+ 0x034, 0x00042006, -+ 0x034, 0x00041003, -+ 0x034, 0x00040000, -+ 0xA0000000, 0x00000000, -+ 0x034, 0x0004ADF5, -+ 0x034, 0x00049DF2, -+ 0x034, 0x00048DEF, -+ 0x034, 0x00047DEC, -+ 0x034, 0x00046DE9, -+ 0x034, 0x00045DE6, -+ 0x034, 0x00044DE3, -+ 0x034, 0x000438C8, -+ 0x034, 0x000428C5, -+ 0x034, 0x000418C2, -+ 0x034, 0x000408C0, -+ 0xB0000000, 0x00000000, -+ 0x80000008, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x0002A0B2, -+ 0x034, 0x000290AF, -+ 0x034, 0x00028070, -+ 0x034, 0x0002706D, -+ 0x034, 0x00026050, -+ 0x034, 0x0002504D, -+ 0x034, 0x0002404A, -+ 0x034, 0x00023047, -+ 0x034, 0x0002200A, -+ 0x034, 0x00021007, -+ 0x034, 0x00020004, -+ 0x90000008, 0x05000000, 0x40000000, 0x00000000, -+ 0x034, 0x0002A0B3, -+ 0x034, 0x000290B0, -+ 0x034, 0x00028071, -+ 0x034, 0x0002706E, -+ 0x034, 0x0002604E, -+ 0x034, 0x0002504B, -+ 0x034, 0x00024048, -+ 0x034, 0x00023045, -+ 0x034, 0x00022008, -+ 0x034, 0x00021005, -+ 0x034, 0x00020002, -+ 0xA0000000, 0x00000000, -+ 0x034, 0x0002ADF5, -+ 0x034, 0x00029DF2, -+ 0x034, 0x00028DEF, -+ 0x034, 0x00027DEC, -+ 0x034, 0x00026DE9, -+ 0x034, 0x00025DE6, -+ 0x034, 0x00024DE3, -+ 0x034, 0x000238C8, -+ 0x034, 0x000228C5, -+ 0x034, 0x000218C2, -+ 0x034, 0x000208C0, -+ 0xB0000000, 0x00000000, -+ 0x80000008, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x0000A0B2, -+ 0x034, 0x000090AF, -+ 0x034, 0x00008070, -+ 0x034, 0x0000706D, -+ 0x034, 0x00006050, -+ 0x034, 0x0000504D, -+ 0x034, 0x0000404A, -+ 0x034, 0x00003047, -+ 0x034, 0x0000200A, -+ 0x034, 0x00001007, -+ 0x034, 0x00000004, -+ 0x90000008, 0x05000000, 0x40000000, 0x00000000, -+ 0x034, 0x0000A0B3, -+ 0x034, 0x000090B0, -+ 0x034, 0x00008070, -+ 0x034, 0x0000706D, -+ 0x034, 0x0000604D, -+ 0x034, 0x0000504A, -+ 0x034, 0x00004047, -+ 0x034, 0x00003044, -+ 0x034, 0x00002007, -+ 0x034, 0x00001004, -+ 0x034, 0x00000001, -+ 0xA0000000, 0x00000000, -+ 0x034, 0x0000AFF7, -+ 0x034, 0x00009DF7, -+ 0x034, 0x00008DF4, -+ 0x034, 0x00007DF1, -+ 0x034, 0x00006DEE, -+ 0x034, 0x00005DEB, -+ 0x034, 0x00004DE8, -+ 0x034, 0x000038CC, -+ 0x034, 0x000028C9, -+ 0x034, 0x000018C6, -+ 0x034, 0x000008C3, -+ 0xB0000000, 0x00000000, -+ 0x0EF, 0x00000000, -+ 0x80000008, 0x00000000, 0x40000000, 0x00000000, -+ 0x018, 0x0001712A, -+ 0x0EF, 0x00000040, -+ 0x035, 0x000001C5, -+ 0x035, 0x000081C5, -+ 0x035, 0x000101C5, -+ 0x035, 0x00020174, -+ 0x035, 0x00028174, -+ 0x035, 0x00030174, -+ 0x035, 0x00040185, -+ 0x035, 0x00048185, -+ 0x035, 0x00050185, -+ 0x0EF, 0x00000000, -+ 0x90000008, 0x05000000, 0x40000000, 0x00000000, -+ 0x018, 0x0001712A, -+ 0x0EF, 0x00000040, -+ 0x035, 0x000001C5, -+ 0x035, 0x000081C5, -+ 0x035, 0x000101C5, -+ 0x035, 0x00020174, -+ 0x035, 0x00028174, -+ 0x035, 0x00030174, -+ 0x035, 0x00040185, -+ 0x035, 0x00048185, -+ 0x035, 0x00050185, -+ 0x0EF, 0x00000000, -+ 0xA0000000, 0x00000000, -+ 0x018, 0x0001712A, -+ 0x0EF, 0x00000040, -+ 0x035, 0x00000188, -+ 0x035, 0x00008147, -+ 0x035, 0x00010147, -+ 0x035, 0x000201D7, -+ 0x035, 0x000281D7, -+ 0x035, 0x000301D7, -+ 0x035, 0x000401D8, -+ 0x035, 0x000481D8, -+ 0x035, 0x000501D8, -+ 0x0EF, 0x00000000, -+ 0xB0000000, 0x00000000, -+ 0x80000008, 0x00000000, 0x40000000, 0x00000000, -+ 0x018, 0x0001712A, -+ 0x0EF, 0x00000010, -+ 0x036, 0x00005B8B, -+ 0x036, 0x0000DB8B, -+ 0x036, 0x00015B8B, -+ 0x036, 0x0001DB8B, -+ 0x036, 0x000262DB, -+ 0x036, 0x0002E2DB, -+ 0x036, 0x000362DB, -+ 0x036, 0x0003E2DB, -+ 0x036, 0x0004553B, -+ 0x036, 0x0004D53B, -+ 0x036, 0x0005553B, -+ 0x036, 0x0005D53B, -+ 0x90000008, 0x05000000, 0x40000000, 0x00000000, -+ 0x018, 0x0001712A, -+ 0x0EF, 0x00000010, -+ 0x036, 0x00005B8B, -+ 0x036, 0x0000DB8B, -+ 0x036, 0x00015B8B, -+ 0x036, 0x0001DB8B, -+ 0x036, 0x000262DB, -+ 0x036, 0x0002E2DB, -+ 0x036, 0x000362DB, -+ 0x036, 0x0003E2DB, -+ 0x036, 0x0004553B, -+ 0x036, 0x0004D53B, -+ 0x036, 0x0005553B, -+ 0x036, 0x0005D53B, -+ 0xA0000000, 0x00000000, -+ 0x018, 0x0001712A, -+ 0x0EF, 0x00000010, -+ 0x036, 0x00084EB4, -+ 0x036, 0x0008CC35, -+ 0x036, 0x00094C35, -+ 0x036, 0x0009CC35, -+ 0x036, 0x000A4C35, -+ 0x036, 0x000ACC35, -+ 0x036, 0x000B4C35, -+ 0x036, 0x000BCC35, -+ 0x036, 0x000C4C34, -+ 0x036, 0x000CCC35, -+ 0x036, 0x000D4C35, -+ 0x036, 0x000DCC35, -+ 0xB0000000, 0x00000000, -+ 0x0EF, 0x00000000, -+ 0x0EF, 0x00000008, -+ 0x80000008, 0x00000000, 0x40000000, 0x00000000, -+ 0x03C, 0x000002DC, -+ 0x03C, 0x00000524, -+ 0x03C, 0x00000902, -+ 0x90000008, 0x05000000, 0x40000000, 0x00000000, -+ 0x03C, 0x000002DC, -+ 0x03C, 0x00000524, -+ 0x03C, 0x00000902, -+ 0xA0000000, 0x00000000, -+ 0x03C, 0x000002A8, -+ 0x03C, 0x000005A2, -+ 0x03C, 0x00000880, -+ 0xB0000000, 0x00000000, -+ 0x0EF, 0x00000000, -+ 0x018, 0x0001712A, -+ 0x0EF, 0x00000002, -+ 0x0DF, 0x00000080, -+ 0x80000008, 0x00000000, 0x40000000, 0x00000000, -+ 0x061, 0x000EAC43, -+ 0x062, 0x00038F47, -+ 0x063, 0x00031157, -+ 0x064, 0x0001C4AC, -+ 0x065, 0x000931D1, -+ 0x90000008, 0x05000000, 0x40000000, 0x00000000, -+ 0x061, 0x000EAC43, -+ 0x062, 0x00038F47, -+ 0x063, 0x00031157, -+ 0x064, 0x0001C4AC, -+ 0x065, 0x000931D2, -+ 0x90000002, 0x00000000, 0x40000000, 0x00000000, -+ 0x061, 0x000EAC43, -+ 0x062, 0x00038F47, -+ 0x063, 0x00031157, -+ 0x064, 0x0001C4AC, -+ 0x065, 0x000931D1, -+ 0xA0000000, 0x00000000, -+ 0x061, 0x000E5D53, -+ 0x062, 0x00038FCD, -+ 0x063, 0x000114EB, -+ 0x064, 0x000196AC, -+ 0x065, 0x000911D7, -+ 0xB0000000, 0x00000000, -+ 0x008, 0x00008400, -+}; -+ -+RTW_DECL_TABLE_RF_RADIO(rtw8812a_rf_b, B); -+ -+static const struct rtw_txpwr_lmt_cfg_pair rtw8812a_txpwr_lmt[] = { -+ { 0, 0, 0, 0, 1, 36, }, -+ { 2, 0, 0, 0, 1, 32, }, -+ { 1, 0, 0, 0, 1, 32, }, -+ { 0, 0, 0, 0, 2, 36, }, -+ { 2, 0, 0, 0, 2, 32, }, -+ { 1, 0, 0, 0, 2, 32, }, -+ { 0, 0, 0, 0, 3, 36, }, -+ { 2, 0, 0, 0, 3, 32, }, -+ { 1, 0, 0, 0, 3, 32, }, -+ { 0, 0, 0, 0, 4, 36, }, -+ { 2, 0, 0, 0, 4, 32, }, -+ { 1, 0, 0, 0, 4, 32, }, -+ { 0, 0, 0, 0, 5, 36, }, -+ { 2, 0, 0, 0, 5, 32, }, -+ { 1, 0, 0, 0, 5, 32, }, -+ { 0, 0, 0, 0, 6, 36, }, -+ { 2, 0, 0, 0, 6, 32, }, -+ { 1, 0, 0, 0, 6, 32, }, -+ { 0, 0, 0, 0, 7, 36, }, -+ { 2, 0, 0, 0, 7, 32, }, -+ { 1, 0, 0, 0, 7, 32, }, -+ { 0, 0, 0, 0, 8, 36, }, -+ { 2, 0, 0, 0, 8, 32, }, -+ { 1, 0, 0, 0, 8, 32, }, -+ { 0, 0, 0, 0, 9, 36, }, -+ { 2, 0, 0, 0, 9, 32, }, -+ { 1, 0, 0, 0, 9, 32, }, -+ { 0, 0, 0, 0, 10, 36, }, -+ { 2, 0, 0, 0, 10, 32, }, -+ { 1, 0, 0, 0, 10, 32, }, -+ { 0, 0, 0, 0, 11, 36, }, -+ { 2, 0, 0, 0, 11, 32, }, -+ { 1, 0, 0, 0, 11, 32, }, -+ { 0, 0, 0, 0, 12, 63, }, -+ { 2, 0, 0, 0, 12, 32, }, -+ { 1, 0, 0, 0, 12, 32, }, -+ { 0, 0, 0, 0, 13, 63, }, -+ { 2, 0, 0, 0, 13, 32, }, -+ { 1, 0, 0, 0, 13, 32, }, -+ { 0, 0, 0, 0, 14, 63, }, -+ { 2, 0, 0, 0, 14, 63, }, -+ { 1, 0, 0, 0, 14, 32, }, -+ { 0, 0, 0, 1, 1, 34, }, -+ { 2, 0, 0, 1, 1, 32, }, -+ { 1, 0, 0, 1, 1, 32, }, -+ { 0, 0, 0, 1, 2, 36, }, -+ { 2, 0, 0, 1, 2, 32, }, -+ { 1, 0, 0, 1, 2, 32, }, -+ { 0, 0, 0, 1, 3, 36, }, -+ { 2, 0, 0, 1, 3, 32, }, -+ { 1, 0, 0, 1, 3, 32, }, -+ { 0, 0, 0, 1, 4, 36, }, -+ { 2, 0, 0, 1, 4, 32, }, -+ { 1, 0, 0, 1, 4, 32, }, -+ { 0, 0, 0, 1, 5, 36, }, -+ { 2, 0, 0, 1, 5, 32, }, -+ { 1, 0, 0, 1, 5, 32, }, -+ { 0, 0, 0, 1, 6, 36, }, -+ { 2, 0, 0, 1, 6, 32, }, -+ { 1, 0, 0, 1, 6, 32, }, -+ { 0, 0, 0, 1, 7, 36, }, -+ { 2, 0, 0, 1, 7, 32, }, -+ { 1, 0, 0, 1, 7, 32, }, -+ { 0, 0, 0, 1, 8, 36, }, -+ { 2, 0, 0, 1, 8, 32, }, -+ { 1, 0, 0, 1, 8, 32, }, -+ { 0, 0, 0, 1, 9, 36, }, -+ { 2, 0, 0, 1, 9, 32, }, -+ { 1, 0, 0, 1, 9, 32, }, -+ { 0, 0, 0, 1, 10, 36, }, -+ { 2, 0, 0, 1, 10, 32, }, -+ { 1, 0, 0, 1, 10, 32, }, -+ { 0, 0, 0, 1, 11, 32, }, -+ { 2, 0, 0, 1, 11, 32, }, -+ { 1, 0, 0, 1, 11, 32, }, -+ { 0, 0, 0, 1, 12, 63, }, -+ { 2, 0, 0, 1, 12, 32, }, -+ { 1, 0, 0, 1, 12, 32, }, -+ { 0, 0, 0, 1, 13, 63, }, -+ { 2, 0, 0, 1, 13, 32, }, -+ { 1, 0, 0, 1, 13, 32, }, -+ { 0, 0, 0, 1, 14, 63, }, -+ { 2, 0, 0, 1, 14, 63, }, -+ { 1, 0, 0, 1, 14, 63, }, -+ { 0, 0, 0, 2, 1, 34, }, -+ { 2, 0, 0, 2, 1, 32, }, -+ { 1, 0, 0, 2, 1, 32, }, -+ { 0, 0, 0, 2, 2, 36, }, -+ { 2, 0, 0, 2, 2, 32, }, -+ { 1, 0, 0, 2, 2, 32, }, -+ { 0, 0, 0, 2, 3, 36, }, -+ { 2, 0, 0, 2, 3, 32, }, -+ { 1, 0, 0, 2, 3, 32, }, -+ { 0, 0, 0, 2, 4, 36, }, -+ { 2, 0, 0, 2, 4, 32, }, -+ { 1, 0, 0, 2, 4, 32, }, -+ { 0, 0, 0, 2, 5, 36, }, -+ { 2, 0, 0, 2, 5, 32, }, -+ { 1, 0, 0, 2, 5, 32, }, -+ { 0, 0, 0, 2, 6, 36, }, -+ { 2, 0, 0, 2, 6, 32, }, -+ { 1, 0, 0, 2, 6, 32, }, -+ { 0, 0, 0, 2, 7, 36, }, -+ { 2, 0, 0, 2, 7, 32, }, -+ { 1, 0, 0, 2, 7, 32, }, -+ { 0, 0, 0, 2, 8, 36, }, -+ { 2, 0, 0, 2, 8, 32, }, -+ { 1, 0, 0, 2, 8, 32, }, -+ { 0, 0, 0, 2, 9, 36, }, -+ { 2, 0, 0, 2, 9, 32, }, -+ { 1, 0, 0, 2, 9, 32, }, -+ { 0, 0, 0, 2, 10, 36, }, -+ { 2, 0, 0, 2, 10, 32, }, -+ { 1, 0, 0, 2, 10, 32, }, -+ { 0, 0, 0, 2, 11, 32, }, -+ { 2, 0, 0, 2, 11, 32, }, -+ { 1, 0, 0, 2, 11, 32, }, -+ { 0, 0, 0, 2, 12, 63, }, -+ { 2, 0, 0, 2, 12, 32, }, -+ { 1, 0, 0, 2, 12, 32, }, -+ { 0, 0, 0, 2, 13, 63, }, -+ { 2, 0, 0, 2, 13, 32, }, -+ { 1, 0, 0, 2, 13, 32, }, -+ { 0, 0, 0, 2, 14, 63, }, -+ { 2, 0, 0, 2, 14, 63, }, -+ { 1, 0, 0, 2, 14, 63, }, -+ { 0, 0, 0, 3, 1, 32, }, -+ { 2, 0, 0, 3, 1, 32, }, -+ { 1, 0, 0, 3, 1, 32, }, -+ { 0, 0, 0, 3, 2, 34, }, -+ { 2, 0, 0, 3, 2, 32, }, -+ { 1, 0, 0, 3, 2, 32, }, -+ { 0, 0, 0, 3, 3, 34, }, -+ { 2, 0, 0, 3, 3, 32, }, -+ { 1, 0, 0, 3, 3, 32, }, -+ { 0, 0, 0, 3, 4, 34, }, -+ { 2, 0, 0, 3, 4, 32, }, -+ { 1, 0, 0, 3, 4, 32, }, -+ { 0, 0, 0, 3, 5, 34, }, -+ { 2, 0, 0, 3, 5, 32, }, -+ { 1, 0, 0, 3, 5, 32, }, -+ { 0, 0, 0, 3, 6, 34, }, -+ { 2, 0, 0, 3, 6, 32, }, -+ { 1, 0, 0, 3, 6, 32, }, -+ { 0, 0, 0, 3, 7, 34, }, -+ { 2, 0, 0, 3, 7, 32, }, -+ { 1, 0, 0, 3, 7, 32, }, -+ { 0, 0, 0, 3, 8, 34, }, -+ { 2, 0, 0, 3, 8, 32, }, -+ { 1, 0, 0, 3, 8, 32, }, -+ { 0, 0, 0, 3, 9, 34, }, -+ { 2, 0, 0, 3, 9, 32, }, -+ { 1, 0, 0, 3, 9, 32, }, -+ { 0, 0, 0, 3, 10, 34, }, -+ { 2, 0, 0, 3, 10, 32, }, -+ { 1, 0, 0, 3, 10, 32, }, -+ { 0, 0, 0, 3, 11, 30, }, -+ { 2, 0, 0, 3, 11, 32, }, -+ { 1, 0, 0, 3, 11, 32, }, -+ { 0, 0, 0, 3, 12, 63, }, -+ { 2, 0, 0, 3, 12, 32, }, -+ { 1, 0, 0, 3, 12, 32, }, -+ { 0, 0, 0, 3, 13, 63, }, -+ { 2, 0, 0, 3, 13, 32, }, -+ { 1, 0, 0, 3, 13, 32, }, -+ { 0, 0, 0, 3, 14, 63, }, -+ { 2, 0, 0, 3, 14, 63, }, -+ { 1, 0, 0, 3, 14, 63, }, -+ { 0, 0, 1, 2, 1, 63, }, -+ { 2, 0, 1, 2, 1, 63, }, -+ { 1, 0, 1, 2, 1, 63, }, -+ { 0, 0, 1, 2, 2, 63, }, -+ { 2, 0, 1, 2, 2, 63, }, -+ { 1, 0, 1, 2, 2, 63, }, -+ { 0, 0, 1, 2, 3, 32, }, -+ { 2, 0, 1, 2, 3, 32, }, -+ { 1, 0, 1, 2, 3, 32, }, -+ { 0, 0, 1, 2, 4, 36, }, -+ { 2, 0, 1, 2, 4, 32, }, -+ { 1, 0, 1, 2, 4, 32, }, -+ { 0, 0, 1, 2, 5, 36, }, -+ { 2, 0, 1, 2, 5, 32, }, -+ { 1, 0, 1, 2, 5, 32, }, -+ { 0, 0, 1, 2, 6, 36, }, -+ { 2, 0, 1, 2, 6, 32, }, -+ { 1, 0, 1, 2, 6, 32, }, -+ { 0, 0, 1, 2, 7, 36, }, -+ { 2, 0, 1, 2, 7, 32, }, -+ { 1, 0, 1, 2, 7, 32, }, -+ { 0, 0, 1, 2, 8, 36, }, -+ { 2, 0, 1, 2, 8, 32, }, -+ { 1, 0, 1, 2, 8, 32, }, -+ { 0, 0, 1, 2, 9, 36, }, -+ { 2, 0, 1, 2, 9, 32, }, -+ { 1, 0, 1, 2, 9, 32, }, -+ { 0, 0, 1, 2, 10, 36, }, -+ { 2, 0, 1, 2, 10, 32, }, -+ { 1, 0, 1, 2, 10, 32, }, -+ { 0, 0, 1, 2, 11, 32, }, -+ { 2, 0, 1, 2, 11, 32, }, -+ { 1, 0, 1, 2, 11, 32, }, -+ { 0, 0, 1, 2, 12, 63, }, -+ { 2, 0, 1, 2, 12, 32, }, -+ { 1, 0, 1, 2, 12, 32, }, -+ { 0, 0, 1, 2, 13, 63, }, -+ { 2, 0, 1, 2, 13, 32, }, -+ { 1, 0, 1, 2, 13, 32, }, -+ { 0, 0, 1, 2, 14, 63, }, -+ { 2, 0, 1, 2, 14, 63, }, -+ { 1, 0, 1, 2, 14, 63, }, -+ { 0, 0, 1, 3, 1, 63, }, -+ { 2, 0, 1, 3, 1, 63, }, -+ { 1, 0, 1, 3, 1, 63, }, -+ { 0, 0, 1, 3, 2, 63, }, -+ { 2, 0, 1, 3, 2, 63, }, -+ { 1, 0, 1, 3, 2, 63, }, -+ { 0, 0, 1, 3, 3, 30, }, -+ { 2, 0, 1, 3, 3, 30, }, -+ { 1, 0, 1, 3, 3, 30, }, -+ { 0, 0, 1, 3, 4, 34, }, -+ { 2, 0, 1, 3, 4, 30, }, -+ { 1, 0, 1, 3, 4, 30, }, -+ { 0, 0, 1, 3, 5, 34, }, -+ { 2, 0, 1, 3, 5, 30, }, -+ { 1, 0, 1, 3, 5, 30, }, -+ { 0, 0, 1, 3, 6, 34, }, -+ { 2, 0, 1, 3, 6, 30, }, -+ { 1, 0, 1, 3, 6, 30, }, -+ { 0, 0, 1, 3, 7, 34, }, -+ { 2, 0, 1, 3, 7, 30, }, -+ { 1, 0, 1, 3, 7, 30, }, -+ { 0, 0, 1, 3, 8, 34, }, -+ { 2, 0, 1, 3, 8, 30, }, -+ { 1, 0, 1, 3, 8, 30, }, -+ { 0, 0, 1, 3, 9, 34, }, -+ { 2, 0, 1, 3, 9, 30, }, -+ { 1, 0, 1, 3, 9, 30, }, -+ { 0, 0, 1, 3, 10, 34, }, -+ { 2, 0, 1, 3, 10, 30, }, -+ { 1, 0, 1, 3, 10, 30, }, -+ { 0, 0, 1, 3, 11, 30, }, -+ { 2, 0, 1, 3, 11, 30, }, -+ { 1, 0, 1, 3, 11, 30, }, -+ { 0, 0, 1, 3, 12, 63, }, -+ { 2, 0, 1, 3, 12, 32, }, -+ { 1, 0, 1, 3, 12, 32, }, -+ { 0, 0, 1, 3, 13, 63, }, -+ { 2, 0, 1, 3, 13, 32, }, -+ { 1, 0, 1, 3, 13, 32, }, -+ { 0, 0, 1, 3, 14, 63, }, -+ { 2, 0, 1, 3, 14, 63, }, -+ { 1, 0, 1, 3, 14, 63, }, -+ { 0, 1, 0, 1, 36, 30, }, -+ { 2, 1, 0, 1, 36, 32, }, -+ { 1, 1, 0, 1, 36, 32, }, -+ { 0, 1, 0, 1, 40, 30, }, -+ { 2, 1, 0, 1, 40, 32, }, -+ { 1, 1, 0, 1, 40, 32, }, -+ { 0, 1, 0, 1, 44, 30, }, -+ { 2, 1, 0, 1, 44, 32, }, -+ { 1, 1, 0, 1, 44, 32, }, -+ { 0, 1, 0, 1, 48, 30, }, -+ { 2, 1, 0, 1, 48, 32, }, -+ { 1, 1, 0, 1, 48, 32, }, -+ { 0, 1, 0, 1, 52, 36, }, -+ { 2, 1, 0, 1, 52, 32, }, -+ { 1, 1, 0, 1, 52, 32, }, -+ { 0, 1, 0, 1, 56, 34, }, -+ { 2, 1, 0, 1, 56, 32, }, -+ { 1, 1, 0, 1, 56, 32, }, -+ { 0, 1, 0, 1, 60, 32, }, -+ { 2, 1, 0, 1, 60, 32, }, -+ { 1, 1, 0, 1, 60, 32, }, -+ { 0, 1, 0, 1, 64, 28, }, -+ { 2, 1, 0, 1, 64, 32, }, -+ { 1, 1, 0, 1, 64, 32, }, -+ { 0, 1, 0, 1, 100, 30, }, -+ { 2, 1, 0, 1, 100, 32, }, -+ { 1, 1, 0, 1, 100, 32, }, -+ { 0, 1, 0, 1, 104, 30, }, -+ { 2, 1, 0, 1, 104, 32, }, -+ { 1, 1, 0, 1, 104, 32, }, -+ { 0, 1, 0, 1, 108, 32, }, -+ { 2, 1, 0, 1, 108, 32, }, -+ { 1, 1, 0, 1, 108, 32, }, -+ { 0, 1, 0, 1, 112, 34, }, -+ { 2, 1, 0, 1, 112, 32, }, -+ { 1, 1, 0, 1, 112, 32, }, -+ { 0, 1, 0, 1, 116, 34, }, -+ { 2, 1, 0, 1, 116, 32, }, -+ { 1, 1, 0, 1, 116, 32, }, -+ { 0, 1, 0, 1, 120, 36, }, -+ { 2, 1, 0, 1, 120, 32, }, -+ { 1, 1, 0, 1, 120, 32, }, -+ { 0, 1, 0, 1, 124, 34, }, -+ { 2, 1, 0, 1, 124, 32, }, -+ { 1, 1, 0, 1, 124, 32, }, -+ { 0, 1, 0, 1, 128, 32, }, -+ { 2, 1, 0, 1, 128, 32, }, -+ { 1, 1, 0, 1, 128, 32, }, -+ { 0, 1, 0, 1, 132, 30, }, -+ { 2, 1, 0, 1, 132, 32, }, -+ { 1, 1, 0, 1, 132, 32, }, -+ { 0, 1, 0, 1, 136, 30, }, -+ { 2, 1, 0, 1, 136, 32, }, -+ { 1, 1, 0, 1, 136, 32, }, -+ { 0, 1, 0, 1, 140, 28, }, -+ { 2, 1, 0, 1, 140, 32, }, -+ { 1, 1, 0, 1, 140, 32, }, -+ { 0, 1, 0, 1, 149, 36, }, -+ { 2, 1, 0, 1, 149, 32, }, -+ { 1, 1, 0, 1, 149, 63, }, -+ { 0, 1, 0, 1, 153, 36, }, -+ { 2, 1, 0, 1, 153, 32, }, -+ { 1, 1, 0, 1, 153, 63, }, -+ { 0, 1, 0, 1, 157, 36, }, -+ { 2, 1, 0, 1, 157, 32, }, -+ { 1, 1, 0, 1, 157, 63, }, -+ { 0, 1, 0, 1, 161, 36, }, -+ { 2, 1, 0, 1, 161, 32, }, -+ { 1, 1, 0, 1, 161, 63, }, -+ { 0, 1, 0, 1, 165, 36, }, -+ { 2, 1, 0, 1, 165, 32, }, -+ { 1, 1, 0, 1, 165, 63, }, -+ { 0, 1, 0, 2, 36, 30, }, -+ { 2, 1, 0, 2, 36, 32, }, -+ { 1, 1, 0, 2, 36, 32, }, -+ { 0, 1, 0, 2, 40, 30, }, -+ { 2, 1, 0, 2, 40, 32, }, -+ { 1, 1, 0, 2, 40, 32, }, -+ { 0, 1, 0, 2, 44, 30, }, -+ { 2, 1, 0, 2, 44, 32, }, -+ { 1, 1, 0, 2, 44, 32, }, -+ { 0, 1, 0, 2, 48, 30, }, -+ { 2, 1, 0, 2, 48, 32, }, -+ { 1, 1, 0, 2, 48, 32, }, -+ { 0, 1, 0, 2, 52, 36, }, -+ { 2, 1, 0, 2, 52, 32, }, -+ { 1, 1, 0, 2, 52, 32, }, -+ { 0, 1, 0, 2, 56, 34, }, -+ { 2, 1, 0, 2, 56, 32, }, -+ { 1, 1, 0, 2, 56, 32, }, -+ { 0, 1, 0, 2, 60, 32, }, -+ { 2, 1, 0, 2, 60, 32, }, -+ { 1, 1, 0, 2, 60, 32, }, -+ { 0, 1, 0, 2, 64, 28, }, -+ { 2, 1, 0, 2, 64, 32, }, -+ { 1, 1, 0, 2, 64, 32, }, -+ { 0, 1, 0, 2, 100, 30, }, -+ { 2, 1, 0, 2, 100, 32, }, -+ { 1, 1, 0, 2, 100, 32, }, -+ { 0, 1, 0, 2, 104, 30, }, -+ { 2, 1, 0, 2, 104, 32, }, -+ { 1, 1, 0, 2, 104, 32, }, -+ { 0, 1, 0, 2, 108, 32, }, -+ { 2, 1, 0, 2, 108, 32, }, -+ { 1, 1, 0, 2, 108, 32, }, -+ { 0, 1, 0, 2, 112, 34, }, -+ { 2, 1, 0, 2, 112, 32, }, -+ { 1, 1, 0, 2, 112, 32, }, -+ { 0, 1, 0, 2, 116, 34, }, -+ { 2, 1, 0, 2, 116, 32, }, -+ { 1, 1, 0, 2, 116, 32, }, -+ { 0, 1, 0, 2, 120, 36, }, -+ { 2, 1, 0, 2, 120, 32, }, -+ { 1, 1, 0, 2, 120, 32, }, -+ { 0, 1, 0, 2, 124, 34, }, -+ { 2, 1, 0, 2, 124, 32, }, -+ { 1, 1, 0, 2, 124, 32, }, -+ { 0, 1, 0, 2, 128, 32, }, -+ { 2, 1, 0, 2, 128, 32, }, -+ { 1, 1, 0, 2, 128, 32, }, -+ { 0, 1, 0, 2, 132, 30, }, -+ { 2, 1, 0, 2, 132, 32, }, -+ { 1, 1, 0, 2, 132, 32, }, -+ { 0, 1, 0, 2, 136, 30, }, -+ { 2, 1, 0, 2, 136, 32, }, -+ { 1, 1, 0, 2, 136, 32, }, -+ { 0, 1, 0, 2, 140, 28, }, -+ { 2, 1, 0, 2, 140, 32, }, -+ { 1, 1, 0, 2, 140, 32, }, -+ { 0, 1, 0, 2, 149, 36, }, -+ { 2, 1, 0, 2, 149, 32, }, -+ { 1, 1, 0, 2, 149, 63, }, -+ { 0, 1, 0, 2, 153, 36, }, -+ { 2, 1, 0, 2, 153, 32, }, -+ { 1, 1, 0, 2, 153, 63, }, -+ { 0, 1, 0, 2, 157, 36, }, -+ { 2, 1, 0, 2, 157, 32, }, -+ { 1, 1, 0, 2, 157, 63, }, -+ { 0, 1, 0, 2, 161, 36, }, -+ { 2, 1, 0, 2, 161, 32, }, -+ { 1, 1, 0, 2, 161, 63, }, -+ { 0, 1, 0, 2, 165, 36, }, -+ { 2, 1, 0, 2, 165, 32, }, -+ { 1, 1, 0, 2, 165, 63, }, -+ { 0, 1, 0, 3, 36, 28, }, -+ { 2, 1, 0, 3, 36, 30, }, -+ { 1, 1, 0, 3, 36, 30, }, -+ { 0, 1, 0, 3, 40, 28, }, -+ { 2, 1, 0, 3, 40, 30, }, -+ { 1, 1, 0, 3, 40, 30, }, -+ { 0, 1, 0, 3, 44, 28, }, -+ { 2, 1, 0, 3, 44, 30, }, -+ { 1, 1, 0, 3, 44, 30, }, -+ { 0, 1, 0, 3, 48, 28, }, -+ { 2, 1, 0, 3, 48, 30, }, -+ { 1, 1, 0, 3, 48, 30, }, -+ { 0, 1, 0, 3, 52, 34, }, -+ { 2, 1, 0, 3, 52, 30, }, -+ { 1, 1, 0, 3, 52, 30, }, -+ { 0, 1, 0, 3, 56, 32, }, -+ { 2, 1, 0, 3, 56, 30, }, -+ { 1, 1, 0, 3, 56, 30, }, -+ { 0, 1, 0, 3, 60, 30, }, -+ { 2, 1, 0, 3, 60, 30, }, -+ { 1, 1, 0, 3, 60, 30, }, -+ { 0, 1, 0, 3, 64, 26, }, -+ { 2, 1, 0, 3, 64, 30, }, -+ { 1, 1, 0, 3, 64, 30, }, -+ { 0, 1, 0, 3, 100, 28, }, -+ { 2, 1, 0, 3, 100, 30, }, -+ { 1, 1, 0, 3, 100, 30, }, -+ { 0, 1, 0, 3, 104, 28, }, -+ { 2, 1, 0, 3, 104, 30, }, -+ { 1, 1, 0, 3, 104, 30, }, -+ { 0, 1, 0, 3, 108, 30, }, -+ { 2, 1, 0, 3, 108, 30, }, -+ { 1, 1, 0, 3, 108, 30, }, -+ { 0, 1, 0, 3, 112, 32, }, -+ { 2, 1, 0, 3, 112, 30, }, -+ { 1, 1, 0, 3, 112, 30, }, -+ { 0, 1, 0, 3, 116, 32, }, -+ { 2, 1, 0, 3, 116, 30, }, -+ { 1, 1, 0, 3, 116, 30, }, -+ { 0, 1, 0, 3, 120, 34, }, -+ { 2, 1, 0, 3, 120, 30, }, -+ { 1, 1, 0, 3, 120, 30, }, -+ { 0, 1, 0, 3, 124, 32, }, -+ { 2, 1, 0, 3, 124, 30, }, -+ { 1, 1, 0, 3, 124, 30, }, -+ { 0, 1, 0, 3, 128, 30, }, -+ { 2, 1, 0, 3, 128, 30, }, -+ { 1, 1, 0, 3, 128, 30, }, -+ { 0, 1, 0, 3, 132, 28, }, -+ { 2, 1, 0, 3, 132, 30, }, -+ { 1, 1, 0, 3, 132, 30, }, -+ { 0, 1, 0, 3, 136, 28, }, -+ { 2, 1, 0, 3, 136, 30, }, -+ { 1, 1, 0, 3, 136, 30, }, -+ { 0, 1, 0, 3, 140, 26, }, -+ { 2, 1, 0, 3, 140, 30, }, -+ { 1, 1, 0, 3, 140, 30, }, -+ { 0, 1, 0, 3, 149, 34, }, -+ { 2, 1, 0, 3, 149, 30, }, -+ { 1, 1, 0, 3, 149, 63, }, -+ { 0, 1, 0, 3, 153, 34, }, -+ { 2, 1, 0, 3, 153, 30, }, -+ { 1, 1, 0, 3, 153, 63, }, -+ { 0, 1, 0, 3, 157, 34, }, -+ { 2, 1, 0, 3, 157, 30, }, -+ { 1, 1, 0, 3, 157, 63, }, -+ { 0, 1, 0, 3, 161, 34, }, -+ { 2, 1, 0, 3, 161, 30, }, -+ { 1, 1, 0, 3, 161, 63, }, -+ { 0, 1, 0, 3, 165, 34, }, -+ { 2, 1, 0, 3, 165, 30, }, -+ { 1, 1, 0, 3, 165, 63, }, -+ { 0, 1, 1, 2, 38, 30, }, -+ { 2, 1, 1, 2, 38, 32, }, -+ { 1, 1, 1, 2, 38, 32, }, -+ { 0, 1, 1, 2, 46, 30, }, -+ { 2, 1, 1, 2, 46, 32, }, -+ { 1, 1, 1, 2, 46, 32, }, -+ { 0, 1, 1, 2, 54, 32, }, -+ { 2, 1, 1, 2, 54, 32, }, -+ { 1, 1, 1, 2, 54, 32, }, -+ { 0, 1, 1, 2, 62, 32, }, -+ { 2, 1, 1, 2, 62, 32, }, -+ { 1, 1, 1, 2, 62, 32, }, -+ { 0, 1, 1, 2, 102, 28, }, -+ { 2, 1, 1, 2, 102, 32, }, -+ { 1, 1, 1, 2, 102, 32, }, -+ { 0, 1, 1, 2, 110, 32, }, -+ { 2, 1, 1, 2, 110, 32, }, -+ { 1, 1, 1, 2, 110, 32, }, -+ { 0, 1, 1, 2, 118, 36, }, -+ { 2, 1, 1, 2, 118, 32, }, -+ { 1, 1, 1, 2, 118, 32, }, -+ { 0, 1, 1, 2, 126, 34, }, -+ { 2, 1, 1, 2, 126, 32, }, -+ { 1, 1, 1, 2, 126, 32, }, -+ { 0, 1, 1, 2, 134, 32, }, -+ { 2, 1, 1, 2, 134, 32, }, -+ { 1, 1, 1, 2, 134, 32, }, -+ { 0, 1, 1, 2, 151, 36, }, -+ { 2, 1, 1, 2, 151, 32, }, -+ { 1, 1, 1, 2, 151, 63, }, -+ { 0, 1, 1, 2, 159, 36, }, -+ { 2, 1, 1, 2, 159, 32, }, -+ { 1, 1, 1, 2, 159, 63, }, -+ { 0, 1, 1, 3, 38, 28, }, -+ { 2, 1, 1, 3, 38, 30, }, -+ { 1, 1, 1, 3, 38, 30, }, -+ { 0, 1, 1, 3, 46, 28, }, -+ { 2, 1, 1, 3, 46, 30, }, -+ { 1, 1, 1, 3, 46, 30, }, -+ { 0, 1, 1, 3, 54, 30, }, -+ { 2, 1, 1, 3, 54, 30, }, -+ { 1, 1, 1, 3, 54, 30, }, -+ { 0, 1, 1, 3, 62, 30, }, -+ { 2, 1, 1, 3, 62, 30, }, -+ { 1, 1, 1, 3, 62, 30, }, -+ { 0, 1, 1, 3, 102, 26, }, -+ { 2, 1, 1, 3, 102, 30, }, -+ { 1, 1, 1, 3, 102, 30, }, -+ { 0, 1, 1, 3, 110, 30, }, -+ { 2, 1, 1, 3, 110, 30, }, -+ { 1, 1, 1, 3, 110, 30, }, -+ { 0, 1, 1, 3, 118, 34, }, -+ { 2, 1, 1, 3, 118, 30, }, -+ { 1, 1, 1, 3, 118, 30, }, -+ { 0, 1, 1, 3, 126, 32, }, -+ { 2, 1, 1, 3, 126, 30, }, -+ { 1, 1, 1, 3, 126, 30, }, -+ { 0, 1, 1, 3, 134, 30, }, -+ { 2, 1, 1, 3, 134, 30, }, -+ { 1, 1, 1, 3, 134, 30, }, -+ { 0, 1, 1, 3, 151, 34, }, -+ { 2, 1, 1, 3, 151, 30, }, -+ { 1, 1, 1, 3, 151, 63, }, -+ { 0, 1, 1, 3, 159, 34, }, -+ { 2, 1, 1, 3, 159, 30, }, -+ { 1, 1, 1, 3, 159, 63, }, -+ { 0, 1, 2, 4, 42, 30, }, -+ { 2, 1, 2, 4, 42, 32, }, -+ { 1, 1, 2, 4, 42, 32, }, -+ { 0, 1, 2, 4, 58, 28, }, -+ { 2, 1, 2, 4, 58, 32, }, -+ { 1, 1, 2, 4, 58, 32, }, -+ { 0, 1, 2, 4, 106, 30, }, -+ { 2, 1, 2, 4, 106, 32, }, -+ { 1, 1, 2, 4, 106, 32, }, -+ { 0, 1, 2, 4, 122, 34, }, -+ { 2, 1, 2, 4, 122, 32, }, -+ { 1, 1, 2, 4, 122, 32, }, -+ { 0, 1, 2, 4, 155, 36, }, -+ { 2, 1, 2, 4, 155, 32, }, -+ { 1, 1, 2, 4, 155, 63, }, -+ { 0, 1, 2, 5, 42, 28, }, -+ { 2, 1, 2, 5, 42, 30, }, -+ { 1, 1, 2, 5, 42, 30, }, -+ { 0, 1, 2, 5, 58, 26, }, -+ { 2, 1, 2, 5, 58, 30, }, -+ { 1, 1, 2, 5, 58, 30, }, -+ { 0, 1, 2, 5, 106, 28, }, -+ { 2, 1, 2, 5, 106, 30, }, -+ { 1, 1, 2, 5, 106, 30, }, -+ { 0, 1, 2, 5, 122, 32, }, -+ { 2, 1, 2, 5, 122, 30, }, -+ { 1, 1, 2, 5, 122, 30, }, -+ { 0, 1, 2, 5, 155, 34, }, -+ { 2, 1, 2, 5, 155, 30, }, -+ { 1, 1, 2, 5, 155, 63, }, -+}; -+ -+RTW_DECL_TABLE_TXPWR_LMT(rtw8812a_txpwr_lmt); -+ -+static const struct rtw_pwr_seq_cmd trans_carddis_to_cardemu_8812a[] = { -+ {0x0012, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(0), BIT(0)}, -+ {0x0014, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0x80, 0}, -+ {0x0015, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0x01, 0}, -+ {0x0023, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0x10, 0}, -+ {0x0046, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0xFF, 0x00}, -+ {0x0043, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0xFF, 0x00}, -+ {0x0005, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_PCI_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(2), 0}, -+ {0x0005, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(3), 0}, -+ {0x0003, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(2), BIT(2)}, -+ {0x0301, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_PCI_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0xFF, 0}, -+ {0x0024, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_USB_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(1), BIT(1)}, -+ {0x0028, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_USB_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(3), BIT(3)}, -+ {0xFFFF, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ 0, -+ RTW_PWR_CMD_END, 0, 0}, -+}; -+ -+static const struct rtw_pwr_seq_cmd trans_cardemu_to_act_8812a[] = { -+ {0x0005, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(2), 0}, -+ {0x0006, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_POLLING, BIT(1), BIT(1)}, -+ {0x0005, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_PCI_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(7), 0}, -+ {0x0005, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(3), 0}, -+ {0x0005, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(0), BIT(0)}, -+ {0x0005, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_POLLING, BIT(0), 0}, -+ {0x0024, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_USB_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(1), 0}, -+ {0x0028, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_USB_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(3), 0}, -+ {0xFFFF, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ 0, -+ RTW_PWR_CMD_END, 0, 0}, -+}; -+ -+static const struct rtw_pwr_seq_cmd trans_act_to_lps_8812a[] = { -+ {0x0301, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_PCI_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0xFF, 0xFF}, -+ {0x0522, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0xFF, 0x7F}, -+ {0x05F8, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_POLLING, 0xFF, 0}, -+ {0x05F9, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_POLLING, 0xFF, 0}, -+ {0x05FA, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_POLLING, 0xFF, 0}, -+ {0x05FB, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_POLLING, 0xFF, 0}, -+ {0x0c00, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0xFF, 0x04}, -+ {0x0e00, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0xFF, 0x04}, -+ {0x0002, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(0), 0}, -+ {0x0002, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_DELAY, 0, RTW_PWR_DELAY_US}, -+ {0x0002, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_USB_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(1), 0}, -+ {0x0100, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0xFF, 0x03}, -+ {0x0101, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(1), 0}, -+ {0x0553, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(5), BIT(5)}, -+ {0xFFFF, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ 0, -+ RTW_PWR_CMD_END, 0, 0}, -+}; -+ -+static const struct rtw_pwr_seq_cmd trans_act_to_cardemu_8812a[] = { -+ {0x0c00, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0xFF, 0x04}, -+ {0x0e00, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0xFF, 0x04}, -+ {0x0002, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(0), 0}, -+ {0x0002, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_DELAY, 0, RTW_PWR_DELAY_US}, -+ {0x0002, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_PCI_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(1), 0}, -+ {0x0007, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0xFF, 0x2A}, -+ {0x0008, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_USB_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0x02, 0}, -+ {0x0005, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(1), BIT(1)}, -+ {0x0005, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_POLLING, BIT(1), 0}, -+ {0xFFFF, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ 0, -+ RTW_PWR_CMD_END, 0, 0}, -+}; -+ -+static const struct rtw_pwr_seq_cmd trans_cardemu_to_carddis_8812a[] = { -+ {0x0003, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(2), 0}, -+ {0x0080, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0xFF, 0x05}, -+ {0x0042, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_USB_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0xF0, 0xcc}, -+ {0x0042, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_PCI_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0xF0, 0xEC}, -+ {0x0043, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0xFF, 0x07}, -+ {0x0045, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0xFF, 0x00}, -+ {0x0046, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0xFF, 0xff}, -+ {0x0047, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0xFF, 0}, -+ {0x0014, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0x80, BIT(7)}, -+ {0x0015, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0x01, BIT(0)}, -+ {0x0012, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0x01, 0}, -+ {0x0023, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0x10, BIT(4)}, -+ {0x0008, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_USB_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0x02, 0}, -+ {0x0007, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_USB_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0xFF, 0x20}, -+ {0x001f, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_USB_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(1), 0}, -+ {0x0076, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_USB_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(1), 0}, -+ {0x0005, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(3), BIT(3)}, -+ {0xFFFF, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ 0, -+ RTW_PWR_CMD_END, 0, 0}, -+}; -+ -+const struct rtw_pwr_seq_cmd * const card_enable_flow_8812a[] = { -+ trans_carddis_to_cardemu_8812a, -+ trans_cardemu_to_act_8812a, -+ NULL -+}; -+ -+const struct rtw_pwr_seq_cmd * const enter_lps_flow_8812a[] = { -+ trans_act_to_lps_8812a, -+ NULL -+}; -+ -+const struct rtw_pwr_seq_cmd * const card_disable_flow_8812a[] = { -+ trans_act_to_cardemu_8812a, -+ trans_cardemu_to_carddis_8812a, -+ NULL -+}; -+ -+static const u8 rtw8812a_pwrtrk_5gb_n[][RTW_PWR_TRK_TBL_SZ] = { -+ {0, 1, 1, 2, 2, 3, 4, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, -+ 12, 13, 13, 14, 14, 14, 14, 14, 14}, -+ {0, 1, 1, 2, 2, 3, 4, 4, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, -+ 12, 13, 13, 14, 14, 14, 14, 14, 14}, -+ {0, 1, 1, 2, 2, 3, 4, 5, 6, 6, 7, 8, 8, 9, 10, 10, 11, 11, 12, 12, 13, -+ 13, 14, 14, 15, 16, 16, 16, 16, 16}, -+}; -+ -+static const u8 rtw8812a_pwrtrk_5gb_p[][RTW_PWR_TRK_TBL_SZ] = { -+ {0, 1, 1, 2, 2, 3, 3, 4, 5, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 11, -+ 11, 11, 11, 11, 11, 11, 11, 11, 11}, -+ {0, 1, 1, 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 11, -+ 11, 11, 11, 11, 11, 11, 11, 11, 11}, -+ {0, 1, 1, 2, 3, 3, 4, 5, 6, 7, 7, 8, 8, 9, 9, 10, 11, 11, 11, 11, 11, -+ 11, 11, 11, 11, 11, 11, 11, 11, 11}, -+}; -+ -+static const u8 rtw8812a_pwrtrk_5ga_n[][RTW_PWR_TRK_TBL_SZ] = { -+ {0, 1, 1, 2, 2, 3, 4, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, -+ 12, 13, 13, 14, 15, 15, 15, 15, 15}, -+ {0, 1, 1, 2, 2, 3, 4, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, -+ 12, 13, 13, 14, 15, 15, 15, 15, 15}, -+ {0, 1, 1, 2, 2, 3, 4, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, -+ 12, 13, 13, 14, 15, 15, 15, 15, 15}, -+}; -+ -+static const u8 rtw8812a_pwrtrk_5ga_p[][RTW_PWR_TRK_TBL_SZ] = { -+ {0, 1, 1, 2, 2, 3, 4, 5, 6, 7, 7, 8, 8, 9, 10, 11, 11, 11, 11, 11, 11, -+ 11, 11, 11, 11, 11, 11, 11, 11, 11}, -+ {0, 1, 1, 2, 3, 3, 4, 5, 6, 7, 7, 8, 8, 9, 10, 11, 11, 11, 11, 11, 11, -+ 11, 11, 11, 11, 11, 11, 11, 11, 11}, -+ {0, 1, 1, 2, 3, 3, 4, 5, 6, 7, 7, 8, 8, 9, 10, 11, 11, 12, 12, 11, 11, -+ 11, 11, 11, 11, 11, 11, 11, 11, 11}, -+}; -+ -+static const u8 rtw8812a_pwrtrk_2gb_n[] = { -+ 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, -+ 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 11, 11, 11, 11 -+}; -+ -+static const u8 rtw8812a_pwrtrk_2gb_p[] = { -+ 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, -+ 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 -+}; -+ -+static const u8 rtw8812a_pwrtrk_2ga_n[] = { -+ 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, -+ 6, 6, 7, 7, 7, 8, 8, 9, 10, 10, 10, 10, 10, 10 -+}; -+ -+static const u8 rtw8812a_pwrtrk_2ga_p[] = { -+ 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, -+ 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 -+}; -+ -+static const u8 rtw8812a_pwrtrk_2g_cck_b_n[] = { -+ 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, 6, -+ 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 11, 11, 11, 11 -+}; -+ -+static const u8 rtw8812a_pwrtrk_2g_cck_b_p[] = { -+ 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, -+ 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 -+}; -+ -+static const u8 rtw8812a_pwrtrk_2g_cck_a_n[] = { -+ 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, -+ 6, 6, 7, 7, 7, 8, 8, 9, 10, 10, 10, 10, 10, 10 -+}; -+ -+static const u8 rtw8812a_pwrtrk_2g_cck_a_p[] = { -+ 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, -+ 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7 -+}; -+ -+const struct rtw_pwr_track_tbl rtw8812a_rtw_pwr_track_tbl = { -+ .pwrtrk_5gb_n[0] = rtw8812a_pwrtrk_5gb_n[0], -+ .pwrtrk_5gb_n[1] = rtw8812a_pwrtrk_5gb_n[1], -+ .pwrtrk_5gb_n[2] = rtw8812a_pwrtrk_5gb_n[2], -+ .pwrtrk_5gb_p[0] = rtw8812a_pwrtrk_5gb_p[0], -+ .pwrtrk_5gb_p[1] = rtw8812a_pwrtrk_5gb_p[1], -+ .pwrtrk_5gb_p[2] = rtw8812a_pwrtrk_5gb_p[2], -+ .pwrtrk_5ga_n[0] = rtw8812a_pwrtrk_5ga_n[0], -+ .pwrtrk_5ga_n[1] = rtw8812a_pwrtrk_5ga_n[1], -+ .pwrtrk_5ga_n[2] = rtw8812a_pwrtrk_5ga_n[2], -+ .pwrtrk_5ga_p[0] = rtw8812a_pwrtrk_5ga_p[0], -+ .pwrtrk_5ga_p[1] = rtw8812a_pwrtrk_5ga_p[1], -+ .pwrtrk_5ga_p[2] = rtw8812a_pwrtrk_5ga_p[2], -+ .pwrtrk_2gb_n = rtw8812a_pwrtrk_2gb_n, -+ .pwrtrk_2gb_p = rtw8812a_pwrtrk_2gb_p, -+ .pwrtrk_2ga_n = rtw8812a_pwrtrk_2ga_n, -+ .pwrtrk_2ga_p = rtw8812a_pwrtrk_2ga_p, -+ .pwrtrk_2g_cckb_n = rtw8812a_pwrtrk_2g_cck_b_n, -+ .pwrtrk_2g_cckb_p = rtw8812a_pwrtrk_2g_cck_b_p, -+ .pwrtrk_2g_ccka_n = rtw8812a_pwrtrk_2g_cck_a_n, -+ .pwrtrk_2g_ccka_p = rtw8812a_pwrtrk_2g_cck_a_p, -+}; -+ -+static const u8 rtw8812a_pwrtrk_rfe3_5gb_n[][RTW_PWR_TRK_TBL_SZ] = { -+ {0, 1, 1, 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 12, 13, -+ 13, 14, 15, 16, 16, 17, 17, 18, 18}, -+ {0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 11, -+ 12, 14, 13, 13, 14, 14, 14, 15, 15}, -+ {0, 1, 1, 2, 2, 3, 4, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, -+ 12, 13, 13, 14, 14, 15, 15, 16, 16}, -+}; -+ -+static const u8 rtw8812a_pwrtrk_rfe3_5gb_p[][RTW_PWR_TRK_TBL_SZ] = { -+ {0, 1, 1, 2, 3, 3, 4, 5, 6, 7, 7, 8, 9, 9, 10, 10, 11, 11, 11, 11, 11, -+ 11, 11, 11, 11, 11, 11, 11, 11, 11}, -+ {0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 11, -+ 11, 11, 11, 11, 11, 11, 11, 11, 11}, -+ {0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 6, 6, 7, 7, 8, 9, 10, 10, 11, 11, 11, -+ 11, 11, 11, 11, 11, 11, 11, 11, 11}, -+}; -+ -+static const u8 rtw8812a_pwrtrk_rfe3_5ga_n[][RTW_PWR_TRK_TBL_SZ] = { -+ {0, 1, 1, 2, 3, 3, 4, 5, 5, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, -+ 13, 14, 15, 16, 16, 17, 17, 18, 18}, -+ {0, 1, 1, 2, 3, 3, 4, 4, 5, 6, 6, 7, 7, 8, 9, 9, 10, 10, 11, 11, 12, -+ 12, 13, 13, 14, 15, 16, 16, 17, 17}, -+ {0, 1, 1, 2, 3, 3, 4, 4, 5, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 12, 13, -+ 13, 14, 14, 15, 15, 16, 17, 18, 18}, -+}; -+ -+static const u8 rtw8812a_pwrtrk_rfe3_5ga_p[][RTW_PWR_TRK_TBL_SZ] = { -+ {0, 1, 1, 2, 2, 3, 4, 5, 6, 7, 7, 8, 9, 9, 10, 10, 11, 11, 11, 11, 11, -+ 11, 11, 11, 11, 11, 11, 11, 11, 11}, -+ {0, 1, 2, 3, 4, 4, 5, 5, 6, 7, 7, 8, 9, 9, 10, 11, 11, 11, 11, 11, 11, -+ 11, 11, 11, 11, 11, 11, 11, 11, 11}, -+ {0, 1, 2, 3, 4, 4, 5, 5, 6, 7, 7, 8, 9, 9, 10, 11, 11, 11, 11, 11, 11, -+ 11, 11, 11, 11, 11, 11, 11, 11, 11}, -+}; -+ -+static const u8 rtw8812a_pwrtrk_rfe3_2gb_n[] = { -+ 0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 6, 7, -+ 7, 7, 8, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15 -+}; -+ -+static const u8 rtw8812a_pwrtrk_rfe3_2gb_p[] = { -+ 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, -+ 6, 7, 7, 8, 9, 10, 10, 10, 10, 11, 11, 11, 11, 11 -+}; -+ -+static const u8 rtw8812a_pwrtrk_rfe3_2ga_n[] = { -+ 0, 1, 1, 2, 2, 3, 4, 5, 6, 6, 6, 7, 7, 8, 8, 9, -+ 10, 10, 11, 11, 12, 12, 13, 13, 13, 13, 14, 14, 15, 15 -+}; -+ -+static const u8 rtw8812a_pwrtrk_rfe3_2ga_p[] = { -+ 0, 0, 1, 1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5, 6, -+ 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 11, 11, 11 -+}; -+ -+static const u8 rtw8812a_pwrtrk_rfe3_2g_cck_b_n[] = { -+ 0, 1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 6, 6, 6, 7, -+ 7, 7, 8, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, 15 -+}; -+ -+static const u8 rtw8812a_pwrtrk_rfe3_2g_cck_b_p[] = { -+ 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 4, 4, 5, 5, 5, 6, -+ 6, 7, 7, 8, 9, 10, 10, 10, 10, 11, 11, 11, 11, 11 -+}; -+ -+static const u8 rtw8812a_pwrtrk_rfe3_2g_cck_a_n[] = { -+ 0, 1, 1, 2, 2, 3, 4, 5, 6, 6, 6, 7, 7, 8, 8, 9, -+ 10, 10, 11, 11, 12, 12, 13, 13, 13, 13, 14, 14, 15, 15 -+}; -+ -+static const u8 rtw8812a_pwrtrk_rfe3_2g_cck_a_p[] = { -+ 0, 0, 1, 1, 1, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5, 6, -+ 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 11, 11, 11 -+}; -+ -+const struct rtw_pwr_track_tbl rtw8812a_rtw_pwr_track_rfe3_tbl = { -+ .pwrtrk_5gb_n[0] = rtw8812a_pwrtrk_rfe3_5gb_n[0], -+ .pwrtrk_5gb_n[1] = rtw8812a_pwrtrk_rfe3_5gb_n[1], -+ .pwrtrk_5gb_n[2] = rtw8812a_pwrtrk_rfe3_5gb_n[2], -+ .pwrtrk_5gb_p[0] = rtw8812a_pwrtrk_rfe3_5gb_p[0], -+ .pwrtrk_5gb_p[1] = rtw8812a_pwrtrk_rfe3_5gb_p[1], -+ .pwrtrk_5gb_p[2] = rtw8812a_pwrtrk_rfe3_5gb_p[2], -+ .pwrtrk_5ga_n[0] = rtw8812a_pwrtrk_rfe3_5ga_n[0], -+ .pwrtrk_5ga_n[1] = rtw8812a_pwrtrk_rfe3_5ga_n[1], -+ .pwrtrk_5ga_n[2] = rtw8812a_pwrtrk_rfe3_5ga_n[2], -+ .pwrtrk_5ga_p[0] = rtw8812a_pwrtrk_rfe3_5ga_p[0], -+ .pwrtrk_5ga_p[1] = rtw8812a_pwrtrk_rfe3_5ga_p[1], -+ .pwrtrk_5ga_p[2] = rtw8812a_pwrtrk_rfe3_5ga_p[2], -+ .pwrtrk_2gb_n = rtw8812a_pwrtrk_rfe3_2gb_n, -+ .pwrtrk_2gb_p = rtw8812a_pwrtrk_rfe3_2gb_p, -+ .pwrtrk_2ga_n = rtw8812a_pwrtrk_rfe3_2ga_n, -+ .pwrtrk_2ga_p = rtw8812a_pwrtrk_rfe3_2ga_p, -+ .pwrtrk_2g_cckb_n = rtw8812a_pwrtrk_rfe3_2g_cck_b_n, -+ .pwrtrk_2g_cckb_p = rtw8812a_pwrtrk_rfe3_2g_cck_b_p, -+ .pwrtrk_2g_ccka_n = rtw8812a_pwrtrk_rfe3_2g_cck_a_n, -+ .pwrtrk_2g_ccka_p = rtw8812a_pwrtrk_rfe3_2g_cck_a_p, -+}; ---- /dev/null -+++ b/drivers/net/wireless/realtek/rtw88/rtw8812a_table.h -@@ -0,0 +1,26 @@ -+/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ -+/* Copyright(c) 2024 Realtek Corporation -+ */ -+ -+#ifndef __RTW8812A_TABLE_H__ -+#define __RTW8812A_TABLE_H__ -+ -+extern const struct rtw_table rtw8812a_mac_tbl; -+extern const struct rtw_table rtw8812a_agc_tbl; -+extern const struct rtw_table rtw8812a_agc_diff_lb_tbl; -+extern const struct rtw_table rtw8812a_agc_diff_hb_tbl; -+extern const struct rtw_table rtw8812a_bb_tbl; -+extern const struct rtw_table rtw8812a_bb_pg_tbl; -+extern const struct rtw_table rtw8812a_bb_pg_rfe3_tbl; -+extern const struct rtw_table rtw8812a_rf_a_tbl; -+extern const struct rtw_table rtw8812a_rf_b_tbl; -+extern const struct rtw_table rtw8812a_txpwr_lmt_tbl; -+ -+extern const struct rtw_pwr_seq_cmd * const card_enable_flow_8812a[]; -+extern const struct rtw_pwr_seq_cmd * const enter_lps_flow_8812a[]; -+extern const struct rtw_pwr_seq_cmd * const card_disable_flow_8812a[]; -+ -+extern const struct rtw_pwr_track_tbl rtw8812a_rtw_pwr_track_tbl; -+extern const struct rtw_pwr_track_tbl rtw8812a_rtw_pwr_track_rfe3_tbl; -+ -+#endif diff --git a/package/kernel/mac80211/patches/rtl/040-v6.13-wifi-rtw88-Add-rtw8821a_table.-c-h.patch b/package/kernel/mac80211/patches/rtl/040-v6.13-wifi-rtw88-Add-rtw8821a_table.-c-h.patch deleted file mode 100644 index e8ceaba61ea..00000000000 --- a/package/kernel/mac80211/patches/rtl/040-v6.13-wifi-rtw88-Add-rtw8821a_table.-c-h.patch +++ /dev/null @@ -1,2395 +0,0 @@ -From 4b81da5cd2b4c7231272216639bacecc818d8b51 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Wed, 30 Oct 2024 20:25:16 +0200 -Subject: [PATCH] wifi: rtw88: Add rtw8821a_table.{c,h} - -These contain various arrays for initialising RTL8821AU. Also TX power -limits. - -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/087c7260-fcc3-4e22-886b-ac477cad9198@gmail.com ---- - .../wireless/realtek/rtw88/rtw8821a_table.c | 2350 +++++++++++++++++ - .../wireless/realtek/rtw88/rtw8821a_table.h | 21 + - 2 files changed, 2371 insertions(+) - create mode 100644 drivers/net/wireless/realtek/rtw88/rtw8821a_table.c - create mode 100644 drivers/net/wireless/realtek/rtw88/rtw8821a_table.h - ---- /dev/null -+++ b/drivers/net/wireless/realtek/rtw88/rtw8821a_table.c -@@ -0,0 +1,2350 @@ -+// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause -+/* Copyright(c) 2024 Realtek Corporation -+ */ -+ -+#include "main.h" -+#include "phy.h" -+#include "rtw8821a_table.h" -+ -+static const u32 rtw8821a_mac[] = { -+ 0x421, 0x0000000F, -+ 0x428, 0x0000000A, -+ 0x429, 0x00000010, -+ 0x430, 0x00000000, -+ 0x431, 0x00000000, -+ 0x432, 0x00000000, -+ 0x433, 0x00000001, -+ 0x434, 0x00000004, -+ 0x435, 0x00000005, -+ 0x436, 0x00000007, -+ 0x437, 0x00000008, -+ 0x43C, 0x00000004, -+ 0x43D, 0x00000005, -+ 0x43E, 0x00000007, -+ 0x43F, 0x00000008, -+ 0x440, 0x0000005D, -+ 0x441, 0x00000001, -+ 0x442, 0x00000000, -+ 0x444, 0x00000010, -+ 0x445, 0x00000000, -+ 0x446, 0x00000000, -+ 0x447, 0x00000000, -+ 0x448, 0x00000000, -+ 0x449, 0x000000F0, -+ 0x44A, 0x0000000F, -+ 0x44B, 0x0000003E, -+ 0x44C, 0x00000010, -+ 0x44D, 0x00000000, -+ 0x44E, 0x00000000, -+ 0x44F, 0x00000000, -+ 0x450, 0x00000000, -+ 0x451, 0x000000F0, -+ 0x452, 0x0000000F, -+ 0x453, 0x00000000, -+ 0x456, 0x0000005E, -+ 0x460, 0x00000066, -+ 0x461, 0x00000066, -+ 0x4C8, 0x0000003F, -+ 0x4C9, 0x000000FF, -+ 0x4CC, 0x000000FF, -+ 0x4CD, 0x000000FF, -+ 0x4CE, 0x00000001, -+ 0x500, 0x00000026, -+ 0x501, 0x000000A2, -+ 0x502, 0x0000002F, -+ 0x503, 0x00000000, -+ 0x504, 0x00000028, -+ 0x505, 0x000000A3, -+ 0x506, 0x0000005E, -+ 0x507, 0x00000000, -+ 0x508, 0x0000002B, -+ 0x509, 0x000000A4, -+ 0x50A, 0x0000005E, -+ 0x50B, 0x00000000, -+ 0x50C, 0x0000004F, -+ 0x50D, 0x000000A4, -+ 0x50E, 0x00000000, -+ 0x50F, 0x00000000, -+ 0x512, 0x0000001C, -+ 0x514, 0x0000000A, -+ 0x516, 0x0000000A, -+ 0x525, 0x0000004F, -+ 0x550, 0x00000010, -+ 0x551, 0x00000010, -+ 0x559, 0x00000002, -+ 0x55C, 0x00000050, -+ 0x55D, 0x000000FF, -+ 0x605, 0x00000030, -+ 0x607, 0x00000007, -+ 0x608, 0x0000000E, -+ 0x609, 0x0000002A, -+ 0x620, 0x000000FF, -+ 0x621, 0x000000FF, -+ 0x622, 0x000000FF, -+ 0x623, 0x000000FF, -+ 0x624, 0x000000FF, -+ 0x625, 0x000000FF, -+ 0x626, 0x000000FF, -+ 0x627, 0x000000FF, -+ 0x638, 0x00000050, -+ 0x63C, 0x0000000A, -+ 0x63D, 0x0000000A, -+ 0x63E, 0x0000000E, -+ 0x63F, 0x0000000E, -+ 0x640, 0x00000040, -+ 0x642, 0x00000040, -+ 0x643, 0x00000000, -+ 0x652, 0x000000C8, -+ 0x66E, 0x00000005, -+ 0x700, 0x00000021, -+ 0x701, 0x00000043, -+ 0x702, 0x00000065, -+ 0x703, 0x00000087, -+ 0x708, 0x00000021, -+ 0x709, 0x00000043, -+ 0x70A, 0x00000065, -+ 0x70B, 0x00000087, -+ 0x718, 0x00000040, -+}; -+ -+RTW_DECL_TABLE_PHY_COND(rtw8821a_mac, rtw_phy_cfg_mac); -+ -+static const u32 rtw8821a_agc[] = { -+ 0x81C, 0xBF000001, -+ 0x81C, 0xBF020001, -+ 0x81C, 0xBF040001, -+ 0x81C, 0xBF060001, -+ 0x81C, 0xBE080001, -+ 0x81C, 0xBD0A0001, -+ 0x81C, 0xBC0C0001, -+ 0x81C, 0xBA0E0001, -+ 0x81C, 0xB9100001, -+ 0x81C, 0xB8120001, -+ 0x81C, 0xB7140001, -+ 0x81C, 0xB6160001, -+ 0x81C, 0xB5180001, -+ 0x81C, 0xB41A0001, -+ 0x81C, 0xB31C0001, -+ 0x81C, 0xB21E0001, -+ 0x81C, 0xB1200001, -+ 0x81C, 0xB0220001, -+ 0x81C, 0xAF240001, -+ 0x81C, 0xAE260001, -+ 0x81C, 0xAD280001, -+ 0x81C, 0xAC2A0001, -+ 0x81C, 0xAB2C0001, -+ 0x81C, 0xAA2E0001, -+ 0x81C, 0xA9300001, -+ 0x81C, 0xA8320001, -+ 0x81C, 0xA7340001, -+ 0x81C, 0xA6360001, -+ 0x81C, 0xA5380001, -+ 0x81C, 0xA43A0001, -+ 0x81C, 0x683C0001, -+ 0x81C, 0x673E0001, -+ 0x81C, 0x66400001, -+ 0x81C, 0x65420001, -+ 0x81C, 0x64440001, -+ 0x81C, 0x63460001, -+ 0x81C, 0x62480001, -+ 0x81C, 0x614A0001, -+ 0x81C, 0x474C0001, -+ 0x81C, 0x464E0001, -+ 0x81C, 0x45500001, -+ 0x81C, 0x44520001, -+ 0x81C, 0x43540001, -+ 0x81C, 0x42560001, -+ 0x81C, 0x41580001, -+ 0x81C, 0x285A0001, -+ 0x81C, 0x275C0001, -+ 0x81C, 0x265E0001, -+ 0x81C, 0x25600001, -+ 0x81C, 0x24620001, -+ 0x81C, 0x0A640001, -+ 0x81C, 0x09660001, -+ 0x81C, 0x08680001, -+ 0x81C, 0x076A0001, -+ 0x81C, 0x066C0001, -+ 0x81C, 0x056E0001, -+ 0x81C, 0x04700001, -+ 0x81C, 0x03720001, -+ 0x81C, 0x02740001, -+ 0x81C, 0x01760001, -+ 0x81C, 0x01780001, -+ 0x81C, 0x017A0001, -+ 0x81C, 0x017C0001, -+ 0x81C, 0x017E0001, -+ 0x8000020c, 0x00000000, 0x40000000, 0x00000000, -+ 0x81C, 0xFB000101, -+ 0x81C, 0xFA020101, -+ 0x81C, 0xF9040101, -+ 0x81C, 0xF8060101, -+ 0x81C, 0xF7080101, -+ 0x81C, 0xF60A0101, -+ 0x81C, 0xF50C0101, -+ 0x81C, 0xF40E0101, -+ 0x81C, 0xF3100101, -+ 0x81C, 0xF2120101, -+ 0x81C, 0xF1140101, -+ 0x81C, 0xF0160101, -+ 0x81C, 0xEF180101, -+ 0x81C, 0xEE1A0101, -+ 0x81C, 0xED1C0101, -+ 0x81C, 0xEC1E0101, -+ 0x81C, 0xEB200101, -+ 0x81C, 0xEA220101, -+ 0x81C, 0xE9240101, -+ 0x81C, 0xE8260101, -+ 0x81C, 0xE7280101, -+ 0x81C, 0xE62A0101, -+ 0x81C, 0xE52C0101, -+ 0x81C, 0xE42E0101, -+ 0x81C, 0xE3300101, -+ 0x81C, 0xA5320101, -+ 0x81C, 0xA4340101, -+ 0x81C, 0xA3360101, -+ 0x81C, 0x87380101, -+ 0x81C, 0x863A0101, -+ 0x81C, 0x853C0101, -+ 0x81C, 0x843E0101, -+ 0x81C, 0x69400101, -+ 0x81C, 0x68420101, -+ 0x81C, 0x67440101, -+ 0x81C, 0x66460101, -+ 0x81C, 0x49480101, -+ 0x81C, 0x484A0101, -+ 0x81C, 0x474C0101, -+ 0x81C, 0x2A4E0101, -+ 0x81C, 0x29500101, -+ 0x81C, 0x28520101, -+ 0x81C, 0x27540101, -+ 0x81C, 0x26560101, -+ 0x81C, 0x25580101, -+ 0x81C, 0x245A0101, -+ 0x81C, 0x235C0101, -+ 0x81C, 0x055E0101, -+ 0x81C, 0x04600101, -+ 0x81C, 0x03620101, -+ 0x81C, 0x02640101, -+ 0x81C, 0x01660101, -+ 0x81C, 0x01680101, -+ 0x81C, 0x016A0101, -+ 0x81C, 0x016C0101, -+ 0x81C, 0x016E0101, -+ 0x81C, 0x01700101, -+ 0x81C, 0x01720101, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, -+ 0x81C, 0xFB000101, -+ 0x81C, 0xFA020101, -+ 0x81C, 0xF9040101, -+ 0x81C, 0xF8060101, -+ 0x81C, 0xF7080101, -+ 0x81C, 0xF60A0101, -+ 0x81C, 0xF50C0101, -+ 0x81C, 0xF40E0101, -+ 0x81C, 0xF3100101, -+ 0x81C, 0xF2120101, -+ 0x81C, 0xF1140101, -+ 0x81C, 0xF0160101, -+ 0x81C, 0xEF180101, -+ 0x81C, 0xEE1A0101, -+ 0x81C, 0xED1C0101, -+ 0x81C, 0xEC1E0101, -+ 0x81C, 0xEB200101, -+ 0x81C, 0xEA220101, -+ 0x81C, 0xE9240101, -+ 0x81C, 0xE8260101, -+ 0x81C, 0xE7280101, -+ 0x81C, 0xE62A0101, -+ 0x81C, 0xE52C0101, -+ 0x81C, 0xE42E0101, -+ 0x81C, 0xE3300101, -+ 0x81C, 0xA5320101, -+ 0x81C, 0xA4340101, -+ 0x81C, 0xA3360101, -+ 0x81C, 0x87380101, -+ 0x81C, 0x863A0101, -+ 0x81C, 0x853C0101, -+ 0x81C, 0x843E0101, -+ 0x81C, 0x69400101, -+ 0x81C, 0x68420101, -+ 0x81C, 0x67440101, -+ 0x81C, 0x66460101, -+ 0x81C, 0x49480101, -+ 0x81C, 0x484A0101, -+ 0x81C, 0x474C0101, -+ 0x81C, 0x2A4E0101, -+ 0x81C, 0x29500101, -+ 0x81C, 0x28520101, -+ 0x81C, 0x27540101, -+ 0x81C, 0x26560101, -+ 0x81C, 0x25580101, -+ 0x81C, 0x245A0101, -+ 0x81C, 0x235C0101, -+ 0x81C, 0x055E0101, -+ 0x81C, 0x04600101, -+ 0x81C, 0x03620101, -+ 0x81C, 0x02640101, -+ 0x81C, 0x01660101, -+ 0x81C, 0x01680101, -+ 0x81C, 0x016A0101, -+ 0x81C, 0x016C0101, -+ 0x81C, 0x016E0101, -+ 0x81C, 0x01700101, -+ 0x81C, 0x01720101, -+ 0xA0000000, 0x00000000, -+ 0x81C, 0xFF000101, -+ 0x81C, 0xFF020101, -+ 0x81C, 0xFE040101, -+ 0x81C, 0xFD060101, -+ 0x81C, 0xFC080101, -+ 0x81C, 0xFD0A0101, -+ 0x81C, 0xFC0C0101, -+ 0x81C, 0xFB0E0101, -+ 0x81C, 0xFA100101, -+ 0x81C, 0xF9120101, -+ 0x81C, 0xF8140101, -+ 0x81C, 0xF7160101, -+ 0x81C, 0xF6180101, -+ 0x81C, 0xF51A0101, -+ 0x81C, 0xF41C0101, -+ 0x81C, 0xF31E0101, -+ 0x81C, 0xF2200101, -+ 0x81C, 0xF1220101, -+ 0x81C, 0xF0240101, -+ 0x81C, 0xEF260101, -+ 0x81C, 0xEE280101, -+ 0x81C, 0xED2A0101, -+ 0x81C, 0xEC2C0101, -+ 0x81C, 0xEB2E0101, -+ 0x81C, 0xEA300101, -+ 0x81C, 0xE9320101, -+ 0x81C, 0xE8340101, -+ 0x81C, 0xE7360101, -+ 0x81C, 0xE6380101, -+ 0x81C, 0xE53A0101, -+ 0x81C, 0xE43C0101, -+ 0x81C, 0xE33E0101, -+ 0x81C, 0xA5400101, -+ 0x81C, 0xA4420101, -+ 0x81C, 0xA3440101, -+ 0x81C, 0x87460101, -+ 0x81C, 0x86480101, -+ 0x81C, 0x854A0101, -+ 0x81C, 0x844C0101, -+ 0x81C, 0x694E0101, -+ 0x81C, 0x68500101, -+ 0x81C, 0x67520101, -+ 0x81C, 0x66540101, -+ 0x81C, 0x49560101, -+ 0x81C, 0x48580101, -+ 0x81C, 0x475A0101, -+ 0x81C, 0x2A5C0101, -+ 0x81C, 0x295E0101, -+ 0x81C, 0x28600101, -+ 0x81C, 0x27620101, -+ 0x81C, 0x26640101, -+ 0x81C, 0x25660101, -+ 0x81C, 0x24680101, -+ 0x81C, 0x236A0101, -+ 0x81C, 0x056C0101, -+ 0x81C, 0x046E0101, -+ 0x81C, 0x03700101, -+ 0x81C, 0x02720101, -+ 0xB0000000, 0x00000000, -+ 0x81C, 0x01740101, -+ 0x81C, 0x01760101, -+ 0x81C, 0x01780101, -+ 0x81C, 0x017A0101, -+ 0x81C, 0x017C0101, -+ 0x81C, 0x017E0101, -+ 0xC50, 0x00000022, -+ 0xC50, 0x00000020, -+}; -+ -+RTW_DECL_TABLE_PHY_COND(rtw8821a_agc, rtw_phy_cfg_agc); -+ -+static const u32 rtw8821a_bb[] = { -+ 0x800, 0x0020D090, -+ 0x804, 0x080112E0, -+ 0x808, 0x0E028211, -+ 0x80C, 0x92131111, -+ 0x810, 0x20101261, -+ 0x814, 0x020C3D10, -+ 0x818, 0x03A00385, -+ 0x820, 0x00000000, -+ 0x824, 0x00030FE0, -+ 0x828, 0x00000000, -+ 0x82C, 0x002081DD, -+ 0x830, 0x2AAAEEC8, -+ 0x834, 0x0037A706, -+ 0x838, 0x06489B44, -+ 0x83C, 0x0000095B, -+ 0x840, 0xC0000001, -+ 0x844, 0x40003CDE, -+ 0x848, 0x62103F8B, -+ 0x84C, 0x6CFDFFB8, -+ 0x850, 0x28874706, -+ 0x854, 0x0001520C, -+ 0x858, 0x8060E000, -+ 0x85C, 0x74210168, -+ 0x860, 0x6929C321, -+ 0x864, 0x79727432, -+ 0x868, 0x8CA7A314, -+ 0x86C, 0x888C2878, -+ 0x870, 0x08888888, -+ 0x874, 0x31612C2E, -+ 0x878, 0x00000152, -+ 0x87C, 0x000FD000, -+ 0x8A0, 0x00000013, -+ 0x8A4, 0x7F7F7F7F, -+ 0x8A8, 0xA2000338, -+ 0x8AC, 0x0FF0FA0A, -+ 0x8B4, 0x000FC080, -+ 0x8B8, 0x6C10D7FF, -+ 0x8BC, 0x0CA52090, -+ 0x8C0, 0x1BF00020, -+ 0x8C4, 0x00000000, -+ 0x8C8, 0x00013169, -+ 0x8CC, 0x08248492, -+ 0x8D4, 0x940008A0, -+ 0x8D8, 0x290B5612, -+ 0x8F8, 0x400002C0, -+ 0x8FC, 0x00000000, -+ 0x900, 0x00000700, -+ 0x90C, 0x00000000, -+ 0x910, 0x0000FC00, -+ 0x914, 0x00000404, -+ 0x918, 0x1C1028C0, -+ 0x91C, 0x64B11A1C, -+ 0x920, 0xE0767233, -+ 0x924, 0x055AA500, -+ 0x928, 0x00000004, -+ 0x92C, 0xFFFE0000, -+ 0x930, 0xFFFFFFFE, -+ 0x934, 0x001FFFFF, -+ 0x960, 0x00000000, -+ 0x964, 0x00000000, -+ 0x968, 0x00000000, -+ 0x96C, 0x00000000, -+ 0x970, 0x801FFFFF, -+ 0x974, 0x000003FF, -+ 0x978, 0x00000000, -+ 0x97C, 0x00000000, -+ 0x980, 0x00000000, -+ 0x984, 0x00000000, -+ 0x988, 0x00000000, -+ 0x990, 0x27100000, -+ 0x994, 0xFFFF0100, -+ 0x998, 0xFFFFFF5C, -+ 0x99C, 0xFFFFFFFF, -+ 0x9A0, 0x000000FF, -+ 0x9A4, 0x00480080, -+ 0x9A8, 0x00000000, -+ 0x9AC, 0x00000000, -+ 0x9B0, 0x81081008, -+ 0x9B4, 0x01081008, -+ 0x9B8, 0x01081008, -+ 0x9BC, 0x01081008, -+ 0x9D0, 0x00000000, -+ 0x9D4, 0x00000000, -+ 0x9D8, 0x00000000, -+ 0x9DC, 0x00000000, -+ 0x9E0, 0x00005D00, -+ 0x9E4, 0x00000003, -+ 0x9E8, 0x00000001, -+ 0xA00, 0x00D047C8, -+ 0xA04, 0x01FF800C, -+ 0xA08, 0x8C8A8300, -+ 0xA0C, 0x2E68000F, -+ 0xA10, 0x9500BB78, -+ 0xA14, 0x11144028, -+ 0xA18, 0x00881117, -+ 0xA1C, 0x89140F00, -+ 0xA20, 0x1A1B0000, -+ 0xA24, 0x090E1317, -+ 0xA28, 0x00000204, -+ 0xA2C, 0x00900000, -+ 0xA70, 0x101FFF00, -+ 0xA74, 0x00000008, -+ 0xA78, 0x00000900, -+ 0xA7C, 0x225B0606, -+ 0xA80, 0x21805490, -+ 0xA84, 0x001F0000, -+ 0XB00, 0x03100040, -+ 0XB04, 0x0000B000, -+ 0XB08, 0xAE0201EB, -+ 0XB0C, 0x01003207, -+ 0XB10, 0x00009807, -+ 0XB14, 0x01000000, -+ 0XB18, 0x00000002, -+ 0XB1C, 0x00000002, -+ 0XB20, 0x0000001F, -+ 0XB24, 0x03020100, -+ 0XB28, 0x07060504, -+ 0XB2C, 0x0B0A0908, -+ 0XB30, 0x0F0E0D0C, -+ 0XB34, 0x13121110, -+ 0XB38, 0x17161514, -+ 0XB3C, 0x0000003A, -+ 0XB40, 0x00000000, -+ 0XB44, 0x00000000, -+ 0XB48, 0x13000032, -+ 0XB4C, 0x48080000, -+ 0XB50, 0x00000000, -+ 0XB54, 0x00000000, -+ 0XB58, 0x00000000, -+ 0XB5C, 0x00000000, -+ 0xC00, 0x00000007, -+ 0xC04, 0x00042020, -+ 0xC08, 0x80410231, -+ 0xC0C, 0x00000000, -+ 0xC10, 0x00000100, -+ 0xC14, 0x01000000, -+ 0xC1C, 0x40000003, -+ 0xC20, 0x2C2C2C2C, -+ 0xC24, 0x30303030, -+ 0xC28, 0x30303030, -+ 0xC2C, 0x2C2C2C2C, -+ 0xC30, 0x2C2C2C2C, -+ 0xC34, 0x2C2C2C2C, -+ 0xC38, 0x2C2C2C2C, -+ 0xC3C, 0x2A2A2A2A, -+ 0xC40, 0x2A2A2A2A, -+ 0xC44, 0x2A2A2A2A, -+ 0xC48, 0x2A2A2A2A, -+ 0xC4C, 0x2A2A2A2A, -+ 0xC50, 0x00000020, -+ 0xC54, 0x001C1208, -+ 0xC58, 0x30000C1C, -+ 0xC5C, 0x00000058, -+ 0xC60, 0x34344443, -+ 0xC64, 0x07003333, -+ 0xC68, 0x19791979, -+ 0xC6C, 0x19791979, -+ 0xC70, 0x19791979, -+ 0xC74, 0x19791979, -+ 0xC78, 0x19791979, -+ 0xC7C, 0x19791979, -+ 0xC80, 0x19791979, -+ 0xC84, 0x19791979, -+ 0xC94, 0x0100005C, -+ 0xC98, 0x00000000, -+ 0xC9C, 0x00000000, -+ 0xCA0, 0x00000029, -+ 0xCA4, 0x08040201, -+ 0xCA8, 0x80402010, -+ 0xCB0, 0x77775747, -+ 0xCB4, 0x10000077, -+ 0xCB8, 0x00508240, -+}; -+ -+RTW_DECL_TABLE_PHY_COND(rtw8821a_bb, rtw_phy_cfg_bb); -+ -+static const struct rtw_phy_pg_cfg_pair rtw8821a_bb_pg[] = { -+ { 0, 0, 0, 0x00000c20, 0xffffffff, 0x32343638, }, -+ { 0, 0, 0, 0x00000c24, 0xffffffff, 0x36363838, }, -+ { 0, 0, 0, 0x00000c28, 0xffffffff, 0x28303234, }, -+ { 0, 0, 0, 0x00000c2c, 0xffffffff, 0x34363838, }, -+ { 0, 0, 0, 0x00000c30, 0xffffffff, 0x26283032, }, -+ { 0, 0, 0, 0x00000c3c, 0xffffffff, 0x32343636, }, -+ { 0, 0, 0, 0x00000c40, 0xffffffff, 0x24262830, }, -+ { 0, 0, 0, 0x00000c44, 0x0000ffff, 0x00002022, }, -+ { 1, 0, 0, 0x00000c24, 0xffffffff, 0x34343636, }, -+ { 1, 0, 0, 0x00000c28, 0xffffffff, 0x26283032, }, -+ { 1, 0, 0, 0x00000c2c, 0xffffffff, 0x32343636, }, -+ { 1, 0, 0, 0x00000c30, 0xffffffff, 0x24262830, }, -+ { 1, 0, 0, 0x00000c3c, 0xffffffff, 0x32343636, }, -+ { 1, 0, 0, 0x00000c40, 0xffffffff, 0x24262830, }, -+ { 1, 0, 0, 0x00000c44, 0x0000ffff, 0x00002022, }, -+}; -+ -+RTW_DECL_TABLE_BB_PG(rtw8821a_bb_pg); -+ -+static const u32 rtw8821a_rf_a[] = { -+ 0x018, 0x0001712A, -+ 0x056, 0x00051CF2, -+ 0x066, 0x00040000, -+ 0x000, 0x00010000, -+ 0x01E, 0x00080000, -+ 0x082, 0x00000830, -+ 0x083, 0x00021800, -+ 0x084, 0x00028000, -+ 0x085, 0x00048000, -+ 0x80000111, 0x00000000, 0x40000000, 0x00000000, -+ 0x086, 0x0009483A, -+ 0xA0000000, 0x00000000, -+ 0x086, 0x00094838, -+ 0xB0000000, 0x00000000, -+ 0x087, 0x00044980, -+ 0x088, 0x00048000, -+ 0x089, 0x0000D480, -+ 0x08A, 0x00042240, -+ 0x08B, 0x000F0380, -+ 0x08C, 0x00090000, -+ 0x08D, 0x00022852, -+ 0x08E, 0x00065540, -+ 0x08F, 0x00088001, -+ 0x0EF, 0x00020000, -+ 0x03E, 0x00000380, -+ 0x03F, 0x00090018, -+ 0x03E, 0x00020380, -+ 0x03F, 0x000A0018, -+ 0x03E, 0x00040308, -+ 0x03F, 0x000A0018, -+ 0x03E, 0x00060018, -+ 0x03F, 0x000A0018, -+ 0x0EF, 0x00000000, -+ 0x018, 0x0001712A, -+ 0x089, 0x00000080, -+ 0x08B, 0x00080180, -+ 0x0EF, 0x00001000, -+ 0x03A, 0x00000244, -+ 0x03B, 0x00038027, -+ 0x03C, 0x00082000, -+ 0x03A, 0x00000244, -+ 0x03B, 0x00030113, -+ 0x03C, 0x00082000, -+ 0x03A, 0x0000014C, -+ 0x03B, 0x00028027, -+ 0x03C, 0x00082000, -+ 0x03A, 0x000000CC, -+ 0x03B, 0x00027027, -+ 0x03C, 0x00042000, -+ 0x03A, 0x0000014C, -+ 0x03B, 0x0001F913, -+ 0x03C, 0x00042000, -+ 0x03A, 0x0000010C, -+ 0x03B, 0x00017F10, -+ 0x03C, 0x00012000, -+ 0x03A, 0x000000D0, -+ 0x03B, 0x00008027, -+ 0x03C, 0x000CA000, -+ 0x03A, 0x00000244, -+ 0x03B, 0x00078027, -+ 0x03C, 0x00082000, -+ 0x03A, 0x00000244, -+ 0x03B, 0x00070113, -+ 0x03C, 0x00082000, -+ 0x03A, 0x0000014C, -+ 0x03B, 0x00068027, -+ 0x03C, 0x00082000, -+ 0x03A, 0x000000CC, -+ 0x03B, 0x00067027, -+ 0x03C, 0x00042000, -+ 0x03A, 0x0000014C, -+ 0x03B, 0x0005F913, -+ 0x03C, 0x00042000, -+ 0x03A, 0x0000010C, -+ 0x03B, 0x00057F10, -+ 0x03C, 0x00012000, -+ 0x03A, 0x000000D0, -+ 0x03B, 0x00048027, -+ 0x03C, 0x000CA000, -+ 0x03A, 0x00000244, -+ 0x03B, 0x000B8027, -+ 0x03C, 0x00082000, -+ 0x03A, 0x00000244, -+ 0x03B, 0x000B0113, -+ 0x03C, 0x00082000, -+ 0x03A, 0x0000014C, -+ 0x03B, 0x000A8027, -+ 0x03C, 0x00082000, -+ 0x03A, 0x000000CC, -+ 0x03B, 0x000A7027, -+ 0x03C, 0x00042000, -+ 0x03A, 0x0000014C, -+ 0x03B, 0x0009F913, -+ 0x03C, 0x00042000, -+ 0x03A, 0x0000010C, -+ 0x03B, 0x00097F10, -+ 0x03C, 0x00012000, -+ 0x03A, 0x000000D0, -+ 0x03B, 0x00088027, -+ 0x03C, 0x000CA000, -+ 0x0EF, 0x00000000, -+ 0x0EF, 0x00001100, -+ 0x80000111, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x0004ADF3, -+ 0x034, 0x00049DF0, -+ 0x90000110, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x0004ADF3, -+ 0x034, 0x00049DF0, -+ 0x90000210, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x0004ADF5, -+ 0x034, 0x00049DF2, -+ 0x9000020c, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x0004A0F3, -+ 0x034, 0x000490B1, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x0004A0F3, -+ 0x034, 0x000490B1, -+ 0x90000200, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x0004ADF5, -+ 0x034, 0x00049DF2, -+ 0x90000410, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x0004ADF3, -+ 0x034, 0x00049DF0, -+ 0xA0000000, 0x00000000, -+ 0x034, 0x0004ADF7, -+ 0x034, 0x00049DF3, -+ 0xB0000000, 0x00000000, -+ 0x80000111, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x00048DED, -+ 0x034, 0x00047DEA, -+ 0x034, 0x00046DE7, -+ 0x034, 0x00045CE9, -+ 0x034, 0x00044CE6, -+ 0x034, 0x000438C6, -+ 0x034, 0x00042886, -+ 0x034, 0x00041486, -+ 0x034, 0x00040447, -+ 0x90000110, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x00048DED, -+ 0x034, 0x00047DEA, -+ 0x034, 0x00046DE7, -+ 0x034, 0x00045CE9, -+ 0x034, 0x00044CE6, -+ 0x034, 0x000438C6, -+ 0x034, 0x00042886, -+ 0x034, 0x00041486, -+ 0x034, 0x00040447, -+ 0x9000020c, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x000480AE, -+ 0x034, 0x000470AB, -+ 0x034, 0x0004608B, -+ 0x034, 0x00045069, -+ 0x034, 0x00044048, -+ 0x034, 0x00043045, -+ 0x034, 0x00042026, -+ 0x034, 0x00041023, -+ 0x034, 0x00040002, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x000480AE, -+ 0x034, 0x000470AB, -+ 0x034, 0x0004608B, -+ 0x034, 0x00045069, -+ 0x034, 0x00044048, -+ 0x034, 0x00043045, -+ 0x034, 0x00042026, -+ 0x034, 0x00041023, -+ 0x034, 0x00040002, -+ 0x90000410, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x00048DED, -+ 0x034, 0x00047DEA, -+ 0x034, 0x00046DE7, -+ 0x034, 0x00045CE9, -+ 0x034, 0x00044CE6, -+ 0x034, 0x000438C6, -+ 0x034, 0x00042886, -+ 0x034, 0x00041486, -+ 0x034, 0x00040447, -+ 0xA0000000, 0x00000000, -+ 0x034, 0x00048DEF, -+ 0x034, 0x00047DEC, -+ 0x034, 0x00046DE9, -+ 0x034, 0x00045CCB, -+ 0x034, 0x0004488D, -+ 0x034, 0x0004348D, -+ 0x034, 0x0004248A, -+ 0x034, 0x0004108D, -+ 0x034, 0x0004008A, -+ 0xB0000000, 0x00000000, -+ 0x80000210, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x0002ADF4, -+ 0x9000020c, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x0002A0F3, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x0002A0F3, -+ 0x90000200, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x0002ADF4, -+ 0xA0000000, 0x00000000, -+ 0x034, 0x0002ADF7, -+ 0xB0000000, 0x00000000, -+ 0x80000111, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x00029DF4, -+ 0x90000110, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x00029DF4, -+ 0x90000210, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x00029DF1, -+ 0x9000020c, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x000290F0, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x000290F0, -+ 0x90000200, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x00029DF1, -+ 0x90000410, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x00029DF4, -+ 0xA0000000, 0x00000000, -+ 0x034, 0x00029DF2, -+ 0xB0000000, 0x00000000, -+ 0x80000111, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x00028DF1, -+ 0x034, 0x00027DEE, -+ 0x034, 0x00026DEB, -+ 0x034, 0x00025CEC, -+ 0x034, 0x00024CE9, -+ 0x034, 0x000238CA, -+ 0x034, 0x00022889, -+ 0x034, 0x00021489, -+ 0x034, 0x0002044A, -+ 0x90000110, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x00028DF1, -+ 0x034, 0x00027DEE, -+ 0x034, 0x00026DEB, -+ 0x034, 0x00025CEC, -+ 0x034, 0x00024CE9, -+ 0x034, 0x000238CA, -+ 0x034, 0x00022889, -+ 0x034, 0x00021489, -+ 0x034, 0x0002044A, -+ 0x9000020c, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x000280AF, -+ 0x034, 0x000270AC, -+ 0x034, 0x0002608B, -+ 0x034, 0x00025069, -+ 0x034, 0x00024048, -+ 0x034, 0x00023045, -+ 0x034, 0x00022026, -+ 0x034, 0x00021023, -+ 0x034, 0x00020002, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x000280AF, -+ 0x034, 0x000270AC, -+ 0x034, 0x0002608B, -+ 0x034, 0x00025069, -+ 0x034, 0x00024048, -+ 0x034, 0x00023045, -+ 0x034, 0x00022026, -+ 0x034, 0x00021023, -+ 0x034, 0x00020002, -+ 0x90000410, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x00028DF1, -+ 0x034, 0x00027DEE, -+ 0x034, 0x00026DEB, -+ 0x034, 0x00025CEC, -+ 0x034, 0x00024CE9, -+ 0x034, 0x000238CA, -+ 0x034, 0x00022889, -+ 0x034, 0x00021489, -+ 0x034, 0x0002044A, -+ 0xA0000000, 0x00000000, -+ 0x034, 0x00028DEE, -+ 0x034, 0x00027DEB, -+ 0x034, 0x00026CCD, -+ 0x034, 0x00025CCA, -+ 0x034, 0x0002488C, -+ 0x034, 0x0002384C, -+ 0x034, 0x00022849, -+ 0x034, 0x00021449, -+ 0x034, 0x0002004D, -+ 0xB0000000, 0x00000000, -+ 0x8000020c, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x0000A0D7, -+ 0x034, 0x000090D3, -+ 0x034, 0x000080B1, -+ 0x034, 0x000070AE, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x0000A0D7, -+ 0x034, 0x000090D3, -+ 0x034, 0x000080B1, -+ 0x034, 0x000070AE, -+ 0xA0000000, 0x00000000, -+ 0x034, 0x0000ADF7, -+ 0x034, 0x00009DF4, -+ 0x034, 0x00008DF1, -+ 0x034, 0x00007DEE, -+ 0xB0000000, 0x00000000, -+ 0x80000111, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x00006DEB, -+ 0x034, 0x00005CEC, -+ 0x034, 0x00004CE9, -+ 0x034, 0x000038CA, -+ 0x034, 0x00002889, -+ 0x034, 0x00001489, -+ 0x034, 0x0000044A, -+ 0x90000110, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x00006DEB, -+ 0x034, 0x00005CEC, -+ 0x034, 0x00004CE9, -+ 0x034, 0x000038CA, -+ 0x034, 0x00002889, -+ 0x034, 0x00001489, -+ 0x034, 0x0000044A, -+ 0x9000020c, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x0000608D, -+ 0x034, 0x0000506B, -+ 0x034, 0x0000404A, -+ 0x034, 0x00003047, -+ 0x034, 0x00002044, -+ 0x034, 0x00001025, -+ 0x034, 0x00000004, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x0000608D, -+ 0x034, 0x0000506B, -+ 0x034, 0x0000404A, -+ 0x034, 0x00003047, -+ 0x034, 0x00002044, -+ 0x034, 0x00001025, -+ 0x034, 0x00000004, -+ 0x90000410, 0x00000000, 0x40000000, 0x00000000, -+ 0x034, 0x00006DEB, -+ 0x034, 0x00005CEC, -+ 0x034, 0x00004CE9, -+ 0x034, 0x000038CA, -+ 0x034, 0x00002889, -+ 0x034, 0x00001489, -+ 0x034, 0x0000044A, -+ 0xA0000000, 0x00000000, -+ 0x034, 0x00006DCD, -+ 0x034, 0x00005CCD, -+ 0x034, 0x00004CCA, -+ 0x034, 0x0000388C, -+ 0x034, 0x00002888, -+ 0x034, 0x00001488, -+ 0x034, 0x00000486, -+ 0xB0000000, 0x00000000, -+ 0x0EF, 0x00000000, -+ 0x018, 0x0001712A, -+ 0x0EF, 0x00000040, -+ 0x80000111, 0x00000000, 0x40000000, 0x00000000, -+ 0x035, 0x00000187, -+ 0x035, 0x00008187, -+ 0x035, 0x00010187, -+ 0x035, 0x00020188, -+ 0x035, 0x00028188, -+ 0x035, 0x00030188, -+ 0x035, 0x00040188, -+ 0x035, 0x00048188, -+ 0x035, 0x00050188, -+ 0x90000110, 0x00000000, 0x40000000, 0x00000000, -+ 0x035, 0x00000187, -+ 0x035, 0x00008187, -+ 0x035, 0x00010187, -+ 0x035, 0x00020188, -+ 0x035, 0x00028188, -+ 0x035, 0x00030188, -+ 0x035, 0x00040188, -+ 0x035, 0x00048188, -+ 0x035, 0x00050188, -+ 0x90000210, 0x00000000, 0x40000000, 0x00000000, -+ 0x035, 0x00000128, -+ 0x035, 0x00008128, -+ 0x035, 0x00010128, -+ 0x035, 0x000201C8, -+ 0x035, 0x000281C8, -+ 0x035, 0x000301C8, -+ 0x035, 0x000401C8, -+ 0x035, 0x000481C8, -+ 0x035, 0x000501C8, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, -+ 0x035, 0x00000145, -+ 0x035, 0x00008145, -+ 0x035, 0x00010145, -+ 0x035, 0x00020196, -+ 0x035, 0x00028196, -+ 0x035, 0x00030196, -+ 0x035, 0x000401C7, -+ 0x035, 0x000481C7, -+ 0x035, 0x000501C7, -+ 0x90000200, 0x00000000, 0x40000000, 0x00000000, -+ 0x035, 0x00000128, -+ 0x035, 0x00008128, -+ 0x035, 0x00010128, -+ 0x035, 0x000201C8, -+ 0x035, 0x000281C8, -+ 0x035, 0x000301C8, -+ 0x035, 0x000401C8, -+ 0x035, 0x000481C8, -+ 0x035, 0x000501C8, -+ 0x90000410, 0x00000000, 0x40000000, 0x00000000, -+ 0x035, 0x00000187, -+ 0x035, 0x00008187, -+ 0x035, 0x00010187, -+ 0x035, 0x00020188, -+ 0x035, 0x00028188, -+ 0x035, 0x00030188, -+ 0x035, 0x00040188, -+ 0x035, 0x00048188, -+ 0x035, 0x00050188, -+ 0xA0000000, 0x00000000, -+ 0x035, 0x00000145, -+ 0x035, 0x00008145, -+ 0x035, 0x00010145, -+ 0x035, 0x00020196, -+ 0x035, 0x00028196, -+ 0x035, 0x00030196, -+ 0x035, 0x000401C7, -+ 0x035, 0x000481C7, -+ 0x035, 0x000501C7, -+ 0xB0000000, 0x00000000, -+ 0x0EF, 0x00000000, -+ 0x018, 0x0001712A, -+ 0x0EF, 0x00000010, -+ 0x80000111, 0x00000000, 0x40000000, 0x00000000, -+ 0x036, 0x00085733, -+ 0x036, 0x0008D733, -+ 0x036, 0x00095733, -+ 0x036, 0x0009D733, -+ 0x036, 0x000A64B4, -+ 0x036, 0x000AE4B4, -+ 0x036, 0x000B64B4, -+ 0x036, 0x000BE4B4, -+ 0x036, 0x000C64B4, -+ 0x036, 0x000CE4B4, -+ 0x036, 0x000D64B4, -+ 0x036, 0x000DE4B4, -+ 0x90000110, 0x00000000, 0x40000000, 0x00000000, -+ 0x036, 0x00085733, -+ 0x036, 0x0008D733, -+ 0x036, 0x00095733, -+ 0x036, 0x0009D733, -+ 0x036, 0x000A64B4, -+ 0x036, 0x000AE4B4, -+ 0x036, 0x000B64B4, -+ 0x036, 0x000BE4B4, -+ 0x036, 0x000C64B4, -+ 0x036, 0x000CE4B4, -+ 0x036, 0x000D64B4, -+ 0x036, 0x000DE4B4, -+ 0x90000210, 0x00000000, 0x40000000, 0x00000000, -+ 0x036, 0x000063B5, -+ 0x036, 0x0000E3B5, -+ 0x036, 0x000163B5, -+ 0x036, 0x0001E3B5, -+ 0x036, 0x000263B5, -+ 0x036, 0x0002E3B5, -+ 0x036, 0x000363B5, -+ 0x036, 0x0003E3B5, -+ 0x036, 0x000463B5, -+ 0x036, 0x0004E3B5, -+ 0x036, 0x000563B5, -+ 0x036, 0x0005E3B5, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, -+ 0x036, 0x000056B3, -+ 0x036, 0x0000D6B3, -+ 0x036, 0x000156B3, -+ 0x036, 0x0001D6B3, -+ 0x036, 0x00026634, -+ 0x036, 0x0002E634, -+ 0x036, 0x00036634, -+ 0x036, 0x0003E634, -+ 0x036, 0x000467B4, -+ 0x036, 0x0004E7B4, -+ 0x036, 0x000567B4, -+ 0x036, 0x0005E7B4, -+ 0x90000200, 0x00000000, 0x40000000, 0x00000000, -+ 0x036, 0x000063B5, -+ 0x036, 0x0000E3B5, -+ 0x036, 0x000163B5, -+ 0x036, 0x0001E3B5, -+ 0x036, 0x000263B5, -+ 0x036, 0x0002E3B5, -+ 0x036, 0x000363B5, -+ 0x036, 0x0003E3B5, -+ 0x036, 0x000463B5, -+ 0x036, 0x0004E3B5, -+ 0x036, 0x000563B5, -+ 0x036, 0x0005E3B5, -+ 0x90000410, 0x00000000, 0x40000000, 0x00000000, -+ 0x036, 0x00085733, -+ 0x036, 0x0008D733, -+ 0x036, 0x00095733, -+ 0x036, 0x0009D733, -+ 0x036, 0x000A64B4, -+ 0x036, 0x000AE4B4, -+ 0x036, 0x000B64B4, -+ 0x036, 0x000BE4B4, -+ 0x036, 0x000C64B4, -+ 0x036, 0x000CE4B4, -+ 0x036, 0x000D64B4, -+ 0x036, 0x000DE4B4, -+ 0xA0000000, 0x00000000, -+ 0x036, 0x000056B3, -+ 0x036, 0x0000D6B3, -+ 0x036, 0x000156B3, -+ 0x036, 0x0001D6B3, -+ 0x036, 0x00026634, -+ 0x036, 0x0002E634, -+ 0x036, 0x00036634, -+ 0x036, 0x0003E634, -+ 0x036, 0x000467B4, -+ 0x036, 0x0004E7B4, -+ 0x036, 0x000567B4, -+ 0x036, 0x0005E7B4, -+ 0xB0000000, 0x00000000, -+ 0x0EF, 0x00000000, -+ 0x0EF, 0x00000008, -+ 0x80000111, 0x00000000, 0x40000000, 0x00000000, -+ 0x03C, 0x000001C8, -+ 0x03C, 0x00000492, -+ 0x90000110, 0x00000000, 0x40000000, 0x00000000, -+ 0x03C, 0x000001C8, -+ 0x03C, 0x00000492, -+ 0x90000210, 0x00000000, 0x40000000, 0x00000000, -+ 0x03C, 0x000001B6, -+ 0x03C, 0x00000492, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, -+ 0x03C, 0x0000022A, -+ 0x03C, 0x00000594, -+ 0x90000200, 0x00000000, 0x40000000, 0x00000000, -+ 0x03C, 0x000001B6, -+ 0x03C, 0x00000492, -+ 0x90000410, 0x00000000, 0x40000000, 0x00000000, -+ 0x03C, 0x000001C8, -+ 0x03C, 0x00000492, -+ 0xA0000000, 0x00000000, -+ 0x03C, 0x0000022A, -+ 0x03C, 0x00000594, -+ 0xB0000000, 0x00000000, -+ 0x80000111, 0x00000000, 0x40000000, 0x00000000, -+ 0x03C, 0x00000800, -+ 0x90000110, 0x00000000, 0x40000000, 0x00000000, -+ 0x03C, 0x00000800, -+ 0x90000210, 0x00000000, 0x40000000, 0x00000000, -+ 0x03C, 0x00000800, -+ 0x9000020c, 0x00000000, 0x40000000, 0x00000000, -+ 0x03C, 0x00000820, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, -+ 0x03C, 0x00000820, -+ 0x90000200, 0x00000000, 0x40000000, 0x00000000, -+ 0x03C, 0x00000800, -+ 0x90000410, 0x00000000, 0x40000000, 0x00000000, -+ 0x03C, 0x00000800, -+ 0xA0000000, 0x00000000, -+ 0x03C, 0x00000900, -+ 0xB0000000, 0x00000000, -+ 0x0EF, 0x00000000, -+ 0x018, 0x0001712A, -+ 0x0EF, 0x00000002, -+ 0x80000111, 0x00000000, 0x40000000, 0x00000000, -+ 0x008, 0x0004E400, -+ 0x90000110, 0x00000000, 0x40000000, 0x00000000, -+ 0x008, 0x0004E400, -+ 0x90000210, 0x00000000, 0x40000000, 0x00000000, -+ 0x008, 0x00002000, -+ 0x9000020c, 0x00000000, 0x40000000, 0x00000000, -+ 0x008, 0x00002000, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, -+ 0x008, 0x00002000, -+ 0x90000200, 0x00000000, 0x40000000, 0x00000000, -+ 0x008, 0x00002000, -+ 0x90000410, 0x00000000, 0x40000000, 0x00000000, -+ 0x008, 0x0004E400, -+ 0xA0000000, 0x00000000, -+ 0x008, 0x00002000, -+ 0xB0000000, 0x00000000, -+ 0x0EF, 0x00000000, -+ 0x0DF, 0x000000C0, -+ 0x01F, 0x00000064, -+ 0x80000111, 0x00000000, 0x40000000, 0x00000000, -+ 0x058, 0x000A7284, -+ 0x059, 0x000600EC, -+ 0x90000110, 0x00000000, 0x40000000, 0x00000000, -+ 0x058, 0x000A7284, -+ 0x059, 0x000600EC, -+ 0x9000020c, 0x00000000, 0x40000000, 0x00000000, -+ 0x058, 0x00081184, -+ 0x059, 0x0006016C, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, -+ 0x058, 0x00081184, -+ 0x059, 0x0006016C, -+ 0x90000200, 0x00000000, 0x40000000, 0x00000000, -+ 0x058, 0x00081184, -+ 0x059, 0x0006016C, -+ 0x90000410, 0x00000000, 0x40000000, 0x00000000, -+ 0x058, 0x000A7284, -+ 0x059, 0x000600EC, -+ 0xA0000000, 0x00000000, -+ 0x058, 0x00081184, -+ 0x059, 0x0006016C, -+ 0xB0000000, 0x00000000, -+ 0x80000111, 0x00000000, 0x40000000, 0x00000000, -+ 0x061, 0x000E8D73, -+ 0x062, 0x00093FC5, -+ 0x90000110, 0x00000000, 0x40000000, 0x00000000, -+ 0x061, 0x000E8D73, -+ 0x062, 0x00093FC5, -+ 0x90000210, 0x00000000, 0x40000000, 0x00000000, -+ 0x061, 0x000EFD83, -+ 0x062, 0x00093FCC, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, -+ 0x061, 0x000EAD53, -+ 0x062, 0x00093BC4, -+ 0x90000200, 0x00000000, 0x40000000, 0x00000000, -+ 0x061, 0x000EFD83, -+ 0x062, 0x00093FCC, -+ 0x90000410, 0x00000000, 0x40000000, 0x00000000, -+ 0x061, 0x000E8D73, -+ 0x062, 0x00093FC5, -+ 0xA0000000, 0x00000000, -+ 0x061, 0x000EAD53, -+ 0x062, 0x00093BC4, -+ 0xB0000000, 0x00000000, -+ 0x80000111, 0x00000000, 0x40000000, 0x00000000, -+ 0x063, 0x000110E9, -+ 0x90000110, 0x00000000, 0x40000000, 0x00000000, -+ 0x063, 0x000110E9, -+ 0x90000210, 0x00000000, 0x40000000, 0x00000000, -+ 0x063, 0x000110EB, -+ 0x9000020c, 0x00000000, 0x40000000, 0x00000000, -+ 0x063, 0x000110E9, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, -+ 0x063, 0x000110E9, -+ 0x90000200, 0x00000000, 0x40000000, 0x00000000, -+ 0x063, 0x000110EB, -+ 0x90000410, 0x00000000, 0x40000000, 0x00000000, -+ 0x063, 0x000110E9, -+ 0xA0000000, 0x00000000, -+ 0x063, 0x000714E9, -+ 0xB0000000, 0x00000000, -+ 0x80000111, 0x00000000, 0x40000000, 0x00000000, -+ 0x064, 0x0001C27C, -+ 0x90000110, 0x00000000, 0x40000000, 0x00000000, -+ 0x064, 0x0001C27C, -+ 0x90000210, 0x00000000, 0x40000000, 0x00000000, -+ 0x064, 0x0001C27C, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, -+ 0x064, 0x0001C67C, -+ 0x90000200, 0x00000000, 0x40000000, 0x00000000, -+ 0x064, 0x0001C27C, -+ 0x90000410, 0x00000000, 0x40000000, 0x00000000, -+ 0x064, 0x0001C27C, -+ 0xA0000000, 0x00000000, -+ 0x064, 0x0001C67C, -+ 0xB0000000, 0x00000000, -+ 0x80000111, 0x00000000, 0x40000000, 0x00000000, -+ 0x065, 0x00091016, -+ 0x90000110, 0x00000000, 0x40000000, 0x00000000, -+ 0x065, 0x00091016, -+ 0x90000210, 0x00000000, 0x40000000, 0x00000000, -+ 0x065, 0x00093016, -+ 0x9000020c, 0x00000000, 0x40000000, 0x00000000, -+ 0x065, 0x00093015, -+ 0x9000040c, 0x00000000, 0x40000000, 0x00000000, -+ 0x065, 0x00093015, -+ 0x90000200, 0x00000000, 0x40000000, 0x00000000, -+ 0x065, 0x00093016, -+ 0xA0000000, 0x00000000, -+ 0x065, 0x00091016, -+ 0xB0000000, 0x00000000, -+ 0x018, 0x00000006, -+ 0x0EF, 0x00002000, -+ 0x03B, 0x0003824B, -+ 0x03B, 0x0003024B, -+ 0x03B, 0x0002844B, -+ 0x03B, 0x00020F4B, -+ 0x03B, 0x00018F4B, -+ 0x03B, 0x000104B2, -+ 0x03B, 0x00008049, -+ 0x03B, 0x00000148, -+ 0x03B, 0x0007824B, -+ 0x03B, 0x0007024B, -+ 0x03B, 0x0006824B, -+ 0x03B, 0x00060F4B, -+ 0x03B, 0x00058F4B, -+ 0x03B, 0x000504B2, -+ 0x03B, 0x00048049, -+ 0x03B, 0x00040148, -+ 0x0EF, 0x00000000, -+ 0x0EF, 0x00000100, -+ 0x034, 0x0000ADF3, -+ 0x034, 0x00009DF0, -+ 0x034, 0x00008D70, -+ 0x034, 0x00007D6D, -+ 0x034, 0x00006CEE, -+ 0x034, 0x00005CCC, -+ 0x034, 0x000044EC, -+ 0x034, 0x000034AC, -+ 0x034, 0x0000246D, -+ 0x034, 0x0000106F, -+ 0x034, 0x0000006C, -+ 0x0EF, 0x00000000, -+ 0x0ED, 0x00000010, -+ 0x044, 0x0000ADF2, -+ 0x044, 0x00009DEF, -+ 0x044, 0x00008DEC, -+ 0x044, 0x00007DE9, -+ 0x044, 0x00006CEC, -+ 0x044, 0x00005CE9, -+ 0x044, 0x000044EC, -+ 0x044, 0x000034E9, -+ 0x044, 0x0000246C, -+ 0x044, 0x00001469, -+ 0x044, 0x0000006C, -+ 0x0ED, 0x00000000, -+ 0x0ED, 0x00000001, -+ 0x040, 0x00038DA7, -+ 0x040, 0x000300C2, -+ 0x040, 0x000288E2, -+ 0x040, 0x000200B8, -+ 0x040, 0x000188A5, -+ 0x040, 0x00010FBC, -+ 0x040, 0x00008F71, -+ 0x040, 0x00000240, -+ 0x0ED, 0x00000000, -+ 0x0EF, 0x000020A2, -+ 0x0DF, 0x00000080, -+ 0x035, 0x00000120, -+ 0x035, 0x00008120, -+ 0x035, 0x00010120, -+ 0x036, 0x00000085, -+ 0x036, 0x00008085, -+ 0x036, 0x00010085, -+ 0x036, 0x00018085, -+ 0x0EF, 0x00000000, -+ 0x051, 0x00000C31, -+ 0x052, 0x00000622, -+ 0x053, 0x000FC70B, -+ 0x054, 0x0000017E, -+ 0x056, 0x00051DF3, -+ 0x051, 0x00000C01, -+ 0x052, 0x000006D6, -+ 0x053, 0x000FC649, -+ 0x070, 0x00049661, -+ 0x071, 0x0007843E, -+ 0x072, 0x00000382, -+ 0x074, 0x00051400, -+ 0x035, 0x00000160, -+ 0x035, 0x00008160, -+ 0x035, 0x00010160, -+ 0x036, 0x00000124, -+ 0x036, 0x00008124, -+ 0x036, 0x00010124, -+ 0x036, 0x00018124, -+ 0x0ED, 0x0000000C, -+ 0x045, 0x00000140, -+ 0x045, 0x00008140, -+ 0x045, 0x00010140, -+ 0x046, 0x00000124, -+ 0x046, 0x00008124, -+ 0x046, 0x00010124, -+ 0x046, 0x00018124, -+ 0x0DF, 0x00000088, -+ 0x0B3, 0x000F0E18, -+ 0x0B4, 0x0001214C, -+ 0x0B7, 0x0003000C, -+ 0x01C, 0x000539D2, -+ 0x0C4, 0x000AFE00, -+ 0x018, 0x0001F12A, -+ 0xFFE, 0x00000000, -+ 0xFFE, 0x00000000, -+ 0x018, 0x0001712A, -+}; -+ -+RTW_DECL_TABLE_RF_RADIO(rtw8821a_rf_a, A); -+ -+static const struct rtw_txpwr_lmt_cfg_pair rtw8821a_txpwr_lmt[] = { -+ { 0, 0, 0, 0, 1, 32, }, -+ { 2, 0, 0, 0, 1, 28, }, -+ { 1, 0, 0, 0, 1, 32, }, -+ { 0, 0, 0, 0, 2, 32, }, -+ { 2, 0, 0, 0, 2, 28, }, -+ { 1, 0, 0, 0, 2, 32, }, -+ { 0, 0, 0, 0, 3, 36, }, -+ { 2, 0, 0, 0, 3, 28, }, -+ { 1, 0, 0, 0, 3, 32, }, -+ { 0, 0, 0, 0, 4, 36, }, -+ { 2, 0, 0, 0, 4, 28, }, -+ { 1, 0, 0, 0, 4, 32, }, -+ { 0, 0, 0, 0, 5, 36, }, -+ { 2, 0, 0, 0, 5, 28, }, -+ { 1, 0, 0, 0, 5, 32, }, -+ { 0, 0, 0, 0, 6, 36, }, -+ { 2, 0, 0, 0, 6, 28, }, -+ { 1, 0, 0, 0, 6, 32, }, -+ { 0, 0, 0, 0, 7, 36, }, -+ { 2, 0, 0, 0, 7, 28, }, -+ { 1, 0, 0, 0, 7, 32, }, -+ { 0, 0, 0, 0, 8, 36, }, -+ { 2, 0, 0, 0, 8, 28, }, -+ { 1, 0, 0, 0, 8, 32, }, -+ { 0, 0, 0, 0, 9, 32, }, -+ { 2, 0, 0, 0, 9, 28, }, -+ { 1, 0, 0, 0, 9, 32, }, -+ { 0, 0, 0, 0, 10, 32, }, -+ { 2, 0, 0, 0, 10, 28, }, -+ { 1, 0, 0, 0, 10, 32, }, -+ { 0, 0, 0, 0, 11, 32, }, -+ { 2, 0, 0, 0, 11, 28, }, -+ { 1, 0, 0, 0, 11, 32, }, -+ { 0, 0, 0, 0, 12, 28, }, -+ { 2, 0, 0, 0, 12, 28, }, -+ { 1, 0, 0, 0, 12, 32, }, -+ { 0, 0, 0, 0, 13, 26, }, -+ { 2, 0, 0, 0, 13, 28, }, -+ { 1, 0, 0, 0, 13, 32, }, -+ { 0, 0, 0, 0, 14, 63, }, -+ { 2, 0, 0, 0, 14, 63, }, -+ { 1, 0, 0, 0, 14, 32, }, -+ { 0, 0, 0, 1, 1, 30, }, -+ { 2, 0, 0, 1, 1, 30, }, -+ { 1, 0, 0, 1, 1, 32, }, -+ { 0, 0, 0, 1, 2, 30, }, -+ { 2, 0, 0, 1, 2, 32, }, -+ { 1, 0, 0, 1, 2, 32, }, -+ { 0, 0, 0, 1, 3, 32, }, -+ { 2, 0, 0, 1, 3, 32, }, -+ { 1, 0, 0, 1, 3, 32, }, -+ { 0, 0, 0, 1, 4, 32, }, -+ { 2, 0, 0, 1, 4, 32, }, -+ { 1, 0, 0, 1, 4, 32, }, -+ { 0, 0, 0, 1, 5, 32, }, -+ { 2, 0, 0, 1, 5, 32, }, -+ { 1, 0, 0, 1, 5, 32, }, -+ { 0, 0, 0, 1, 6, 32, }, -+ { 2, 0, 0, 1, 6, 32, }, -+ { 1, 0, 0, 1, 6, 32, }, -+ { 0, 0, 0, 1, 7, 32, }, -+ { 2, 0, 0, 1, 7, 32, }, -+ { 1, 0, 0, 1, 7, 32, }, -+ { 0, 0, 0, 1, 8, 32, }, -+ { 2, 0, 0, 1, 8, 32, }, -+ { 1, 0, 0, 1, 8, 32, }, -+ { 0, 0, 0, 1, 9, 30, }, -+ { 2, 0, 0, 1, 9, 32, }, -+ { 1, 0, 0, 1, 9, 32, }, -+ { 0, 0, 0, 1, 10, 30, }, -+ { 2, 0, 0, 1, 10, 32, }, -+ { 1, 0, 0, 1, 10, 32, }, -+ { 0, 0, 0, 1, 11, 30, }, -+ { 2, 0, 0, 1, 11, 32, }, -+ { 1, 0, 0, 1, 11, 32, }, -+ { 0, 0, 0, 1, 12, 26, }, -+ { 2, 0, 0, 1, 12, 32, }, -+ { 1, 0, 0, 1, 12, 32, }, -+ { 0, 0, 0, 1, 13, 24, }, -+ { 2, 0, 0, 1, 13, 30, }, -+ { 1, 0, 0, 1, 13, 32, }, -+ { 0, 0, 0, 1, 14, 63, }, -+ { 2, 0, 0, 1, 14, 63, }, -+ { 1, 0, 0, 1, 14, 63, }, -+ { 0, 0, 0, 2, 1, 26, }, -+ { 2, 0, 0, 2, 1, 26, }, -+ { 1, 0, 0, 2, 1, 32, }, -+ { 0, 0, 0, 2, 2, 26, }, -+ { 2, 0, 0, 2, 2, 32, }, -+ { 1, 0, 0, 2, 2, 32, }, -+ { 0, 0, 0, 2, 3, 32, }, -+ { 2, 0, 0, 2, 3, 32, }, -+ { 1, 0, 0, 2, 3, 32, }, -+ { 0, 0, 0, 2, 4, 32, }, -+ { 2, 0, 0, 2, 4, 32, }, -+ { 1, 0, 0, 2, 4, 32, }, -+ { 0, 0, 0, 2, 5, 32, }, -+ { 2, 0, 0, 2, 5, 32, }, -+ { 1, 0, 0, 2, 5, 32, }, -+ { 0, 0, 0, 2, 6, 32, }, -+ { 2, 0, 0, 2, 6, 32, }, -+ { 1, 0, 0, 2, 6, 32, }, -+ { 0, 0, 0, 2, 7, 32, }, -+ { 2, 0, 0, 2, 7, 32, }, -+ { 1, 0, 0, 2, 7, 32, }, -+ { 0, 0, 0, 2, 8, 32, }, -+ { 2, 0, 0, 2, 8, 32, }, -+ { 1, 0, 0, 2, 8, 32, }, -+ { 0, 0, 0, 2, 9, 26, }, -+ { 2, 0, 0, 2, 9, 32, }, -+ { 1, 0, 0, 2, 9, 32, }, -+ { 0, 0, 0, 2, 10, 26, }, -+ { 2, 0, 0, 2, 10, 32, }, -+ { 1, 0, 0, 2, 10, 32, }, -+ { 0, 0, 0, 2, 11, 26, }, -+ { 2, 0, 0, 2, 11, 32, }, -+ { 1, 0, 0, 2, 11, 32, }, -+ { 0, 0, 0, 2, 12, 26, }, -+ { 2, 0, 0, 2, 12, 32, }, -+ { 1, 0, 0, 2, 12, 32, }, -+ { 0, 0, 0, 2, 13, 24, }, -+ { 2, 0, 0, 2, 13, 26, }, -+ { 1, 0, 0, 2, 13, 32, }, -+ { 0, 0, 0, 2, 14, 63, }, -+ { 2, 0, 0, 2, 14, 63, }, -+ { 1, 0, 0, 2, 14, 63, }, -+ { 0, 0, 0, 3, 1, 30, }, -+ { 2, 0, 0, 3, 1, 32, }, -+ { 1, 0, 0, 3, 1, 32, }, -+ { 0, 0, 0, 3, 2, 32, }, -+ { 2, 0, 0, 3, 2, 32, }, -+ { 1, 0, 0, 3, 2, 32, }, -+ { 0, 0, 0, 3, 3, 32, }, -+ { 2, 0, 0, 3, 3, 32, }, -+ { 1, 0, 0, 3, 3, 32, }, -+ { 0, 0, 0, 3, 4, 32, }, -+ { 2, 0, 0, 3, 4, 32, }, -+ { 1, 0, 0, 3, 4, 32, }, -+ { 0, 0, 0, 3, 5, 32, }, -+ { 2, 0, 0, 3, 5, 32, }, -+ { 1, 0, 0, 3, 5, 32, }, -+ { 0, 0, 0, 3, 6, 32, }, -+ { 2, 0, 0, 3, 6, 32, }, -+ { 1, 0, 0, 3, 6, 32, }, -+ { 0, 0, 0, 3, 7, 32, }, -+ { 2, 0, 0, 3, 7, 32, }, -+ { 1, 0, 0, 3, 7, 32, }, -+ { 0, 0, 0, 3, 8, 32, }, -+ { 2, 0, 0, 3, 8, 32, }, -+ { 1, 0, 0, 3, 8, 32, }, -+ { 0, 0, 0, 3, 9, 32, }, -+ { 2, 0, 0, 3, 9, 32, }, -+ { 1, 0, 0, 3, 9, 32, }, -+ { 0, 0, 0, 3, 10, 32, }, -+ { 2, 0, 0, 3, 10, 32, }, -+ { 1, 0, 0, 3, 10, 32, }, -+ { 0, 0, 0, 3, 11, 30, }, -+ { 2, 0, 0, 3, 11, 32, }, -+ { 1, 0, 0, 3, 11, 32, }, -+ { 0, 0, 0, 3, 12, 63, }, -+ { 2, 0, 0, 3, 12, 32, }, -+ { 1, 0, 0, 3, 12, 32, }, -+ { 0, 0, 0, 3, 13, 63, }, -+ { 2, 0, 0, 3, 13, 32, }, -+ { 1, 0, 0, 3, 13, 32, }, -+ { 0, 0, 0, 3, 14, 63, }, -+ { 2, 0, 0, 3, 14, 63, }, -+ { 1, 0, 0, 3, 14, 63, }, -+ { 0, 0, 1, 2, 1, 63, }, -+ { 2, 0, 1, 2, 1, 63, }, -+ { 1, 0, 1, 2, 1, 63, }, -+ { 0, 0, 1, 2, 2, 63, }, -+ { 2, 0, 1, 2, 2, 63, }, -+ { 1, 0, 1, 2, 2, 63, }, -+ { 0, 0, 1, 2, 3, 26, }, -+ { 2, 0, 1, 2, 3, 26, }, -+ { 1, 0, 1, 2, 3, 32, }, -+ { 0, 0, 1, 2, 4, 26, }, -+ { 2, 0, 1, 2, 4, 32, }, -+ { 1, 0, 1, 2, 4, 32, }, -+ { 0, 0, 1, 2, 5, 26, }, -+ { 2, 0, 1, 2, 5, 32, }, -+ { 1, 0, 1, 2, 5, 32, }, -+ { 0, 0, 1, 2, 6, 32, }, -+ { 2, 0, 1, 2, 6, 32, }, -+ { 1, 0, 1, 2, 6, 32, }, -+ { 0, 0, 1, 2, 7, 32, }, -+ { 2, 0, 1, 2, 7, 32, }, -+ { 1, 0, 1, 2, 7, 32, }, -+ { 0, 0, 1, 2, 8, 32, }, -+ { 2, 0, 1, 2, 8, 32, }, -+ { 1, 0, 1, 2, 8, 32, }, -+ { 0, 0, 1, 2, 9, 26, }, -+ { 2, 0, 1, 2, 9, 32, }, -+ { 1, 0, 1, 2, 9, 32, }, -+ { 0, 0, 1, 2, 10, 24, }, -+ { 2, 0, 1, 2, 10, 32, }, -+ { 1, 0, 1, 2, 10, 32, }, -+ { 0, 0, 1, 2, 11, 22, }, -+ { 2, 0, 1, 2, 11, 26, }, -+ { 1, 0, 1, 2, 11, 32, }, -+ { 0, 0, 1, 2, 12, 63, }, -+ { 2, 0, 1, 2, 12, 63, }, -+ { 1, 0, 1, 2, 12, 63, }, -+ { 0, 0, 1, 2, 13, 63, }, -+ { 2, 0, 1, 2, 13, 63, }, -+ { 1, 0, 1, 2, 13, 63, }, -+ { 0, 0, 1, 2, 14, 63, }, -+ { 2, 0, 1, 2, 14, 63, }, -+ { 1, 0, 1, 2, 14, 63, }, -+ { 0, 0, 1, 3, 1, 63, }, -+ { 2, 0, 1, 3, 1, 63, }, -+ { 1, 0, 1, 3, 1, 63, }, -+ { 0, 0, 1, 3, 2, 63, }, -+ { 2, 0, 1, 3, 2, 63, }, -+ { 1, 0, 1, 3, 2, 63, }, -+ { 0, 0, 1, 3, 3, 30, }, -+ { 2, 0, 1, 3, 3, 30, }, -+ { 1, 0, 1, 3, 3, 30, }, -+ { 0, 0, 1, 3, 4, 32, }, -+ { 2, 0, 1, 3, 4, 30, }, -+ { 1, 0, 1, 3, 4, 30, }, -+ { 0, 0, 1, 3, 5, 32, }, -+ { 2, 0, 1, 3, 5, 30, }, -+ { 1, 0, 1, 3, 5, 30, }, -+ { 0, 0, 1, 3, 6, 32, }, -+ { 2, 0, 1, 3, 6, 30, }, -+ { 1, 0, 1, 3, 6, 30, }, -+ { 0, 0, 1, 3, 7, 32, }, -+ { 2, 0, 1, 3, 7, 30, }, -+ { 1, 0, 1, 3, 7, 30, }, -+ { 0, 0, 1, 3, 8, 32, }, -+ { 2, 0, 1, 3, 8, 30, }, -+ { 1, 0, 1, 3, 8, 30, }, -+ { 0, 0, 1, 3, 9, 32, }, -+ { 2, 0, 1, 3, 9, 30, }, -+ { 1, 0, 1, 3, 9, 30, }, -+ { 0, 0, 1, 3, 10, 32, }, -+ { 2, 0, 1, 3, 10, 30, }, -+ { 1, 0, 1, 3, 10, 30, }, -+ { 0, 0, 1, 3, 11, 30, }, -+ { 2, 0, 1, 3, 11, 30, }, -+ { 1, 0, 1, 3, 11, 30, }, -+ { 0, 0, 1, 3, 12, 63, }, -+ { 2, 0, 1, 3, 12, 32, }, -+ { 1, 0, 1, 3, 12, 32, }, -+ { 0, 0, 1, 3, 13, 63, }, -+ { 2, 0, 1, 3, 13, 32, }, -+ { 1, 0, 1, 3, 13, 32, }, -+ { 0, 0, 1, 3, 14, 63, }, -+ { 2, 0, 1, 3, 14, 63, }, -+ { 1, 0, 1, 3, 14, 63, }, -+ { 0, 1, 0, 1, 36, 32, }, -+ { 2, 1, 0, 1, 36, 30, }, -+ { 1, 1, 0, 1, 36, 30, }, -+ { 0, 1, 0, 1, 40, 32, }, -+ { 2, 1, 0, 1, 40, 30, }, -+ { 1, 1, 0, 1, 40, 30, }, -+ { 0, 1, 0, 1, 44, 32, }, -+ { 2, 1, 0, 1, 44, 30, }, -+ { 1, 1, 0, 1, 44, 30, }, -+ { 0, 1, 0, 1, 48, 32, }, -+ { 2, 1, 0, 1, 48, 30, }, -+ { 1, 1, 0, 1, 48, 30, }, -+ { 0, 1, 0, 1, 52, 32, }, -+ { 2, 1, 0, 1, 52, 30, }, -+ { 1, 1, 0, 1, 52, 30, }, -+ { 0, 1, 0, 1, 56, 32, }, -+ { 2, 1, 0, 1, 56, 30, }, -+ { 1, 1, 0, 1, 56, 30, }, -+ { 0, 1, 0, 1, 60, 32, }, -+ { 2, 1, 0, 1, 60, 30, }, -+ { 1, 1, 0, 1, 60, 30, }, -+ { 0, 1, 0, 1, 64, 32, }, -+ { 2, 1, 0, 1, 64, 30, }, -+ { 1, 1, 0, 1, 64, 30, }, -+ { 0, 1, 0, 1, 100, 32, }, -+ { 2, 1, 0, 1, 100, 30, }, -+ { 1, 1, 0, 1, 100, 30, }, -+ { 0, 1, 0, 1, 104, 32, }, -+ { 2, 1, 0, 1, 104, 30, }, -+ { 1, 1, 0, 1, 104, 30, }, -+ { 0, 1, 0, 1, 108, 32, }, -+ { 2, 1, 0, 1, 108, 30, }, -+ { 1, 1, 0, 1, 108, 30, }, -+ { 0, 1, 0, 1, 112, 32, }, -+ { 2, 1, 0, 1, 112, 30, }, -+ { 1, 1, 0, 1, 112, 30, }, -+ { 0, 1, 0, 1, 116, 32, }, -+ { 2, 1, 0, 1, 116, 30, }, -+ { 1, 1, 0, 1, 116, 30, }, -+ { 0, 1, 0, 1, 120, 32, }, -+ { 2, 1, 0, 1, 120, 30, }, -+ { 1, 1, 0, 1, 120, 30, }, -+ { 0, 1, 0, 1, 124, 32, }, -+ { 2, 1, 0, 1, 124, 30, }, -+ { 1, 1, 0, 1, 124, 30, }, -+ { 0, 1, 0, 1, 128, 32, }, -+ { 2, 1, 0, 1, 128, 30, }, -+ { 1, 1, 0, 1, 128, 30, }, -+ { 0, 1, 0, 1, 132, 32, }, -+ { 2, 1, 0, 1, 132, 30, }, -+ { 1, 1, 0, 1, 132, 30, }, -+ { 0, 1, 0, 1, 136, 32, }, -+ { 2, 1, 0, 1, 136, 30, }, -+ { 1, 1, 0, 1, 136, 30, }, -+ { 0, 1, 0, 1, 140, 32, }, -+ { 2, 1, 0, 1, 140, 30, }, -+ { 1, 1, 0, 1, 140, 30, }, -+ { 0, 1, 0, 1, 149, 32, }, -+ { 2, 1, 0, 1, 149, 30, }, -+ { 1, 1, 0, 1, 149, 63, }, -+ { 0, 1, 0, 1, 153, 32, }, -+ { 2, 1, 0, 1, 153, 30, }, -+ { 1, 1, 0, 1, 153, 63, }, -+ { 0, 1, 0, 1, 157, 32, }, -+ { 2, 1, 0, 1, 157, 30, }, -+ { 1, 1, 0, 1, 157, 63, }, -+ { 0, 1, 0, 1, 161, 32, }, -+ { 2, 1, 0, 1, 161, 30, }, -+ { 1, 1, 0, 1, 161, 63, }, -+ { 0, 1, 0, 1, 165, 32, }, -+ { 2, 1, 0, 1, 165, 30, }, -+ { 1, 1, 0, 1, 165, 63, }, -+ { 0, 1, 0, 2, 36, 32, }, -+ { 2, 1, 0, 2, 36, 30, }, -+ { 1, 1, 0, 2, 36, 30, }, -+ { 0, 1, 0, 2, 40, 32, }, -+ { 2, 1, 0, 2, 40, 30, }, -+ { 1, 1, 0, 2, 40, 30, }, -+ { 0, 1, 0, 2, 44, 32, }, -+ { 2, 1, 0, 2, 44, 30, }, -+ { 1, 1, 0, 2, 44, 30, }, -+ { 0, 1, 0, 2, 48, 32, }, -+ { 2, 1, 0, 2, 48, 30, }, -+ { 1, 1, 0, 2, 48, 30, }, -+ { 0, 1, 0, 2, 52, 32, }, -+ { 2, 1, 0, 2, 52, 30, }, -+ { 1, 1, 0, 2, 52, 30, }, -+ { 0, 1, 0, 2, 56, 32, }, -+ { 2, 1, 0, 2, 56, 30, }, -+ { 1, 1, 0, 2, 56, 30, }, -+ { 0, 1, 0, 2, 60, 32, }, -+ { 2, 1, 0, 2, 60, 30, }, -+ { 1, 1, 0, 2, 60, 30, }, -+ { 0, 1, 0, 2, 64, 32, }, -+ { 2, 1, 0, 2, 64, 30, }, -+ { 1, 1, 0, 2, 64, 30, }, -+ { 0, 1, 0, 2, 100, 32, }, -+ { 2, 1, 0, 2, 100, 30, }, -+ { 1, 1, 0, 2, 100, 30, }, -+ { 0, 1, 0, 2, 104, 32, }, -+ { 2, 1, 0, 2, 104, 30, }, -+ { 1, 1, 0, 2, 104, 30, }, -+ { 0, 1, 0, 2, 108, 32, }, -+ { 2, 1, 0, 2, 108, 30, }, -+ { 1, 1, 0, 2, 108, 30, }, -+ { 0, 1, 0, 2, 112, 32, }, -+ { 2, 1, 0, 2, 112, 30, }, -+ { 1, 1, 0, 2, 112, 30, }, -+ { 0, 1, 0, 2, 116, 32, }, -+ { 2, 1, 0, 2, 116, 30, }, -+ { 1, 1, 0, 2, 116, 30, }, -+ { 0, 1, 0, 2, 120, 32, }, -+ { 2, 1, 0, 2, 120, 30, }, -+ { 1, 1, 0, 2, 120, 30, }, -+ { 0, 1, 0, 2, 124, 32, }, -+ { 2, 1, 0, 2, 124, 30, }, -+ { 1, 1, 0, 2, 124, 30, }, -+ { 0, 1, 0, 2, 128, 32, }, -+ { 2, 1, 0, 2, 128, 30, }, -+ { 1, 1, 0, 2, 128, 30, }, -+ { 0, 1, 0, 2, 132, 32, }, -+ { 2, 1, 0, 2, 132, 30, }, -+ { 1, 1, 0, 2, 132, 30, }, -+ { 0, 1, 0, 2, 136, 32, }, -+ { 2, 1, 0, 2, 136, 30, }, -+ { 1, 1, 0, 2, 136, 30, }, -+ { 0, 1, 0, 2, 140, 32, }, -+ { 2, 1, 0, 2, 140, 30, }, -+ { 1, 1, 0, 2, 140, 30, }, -+ { 0, 1, 0, 2, 149, 32, }, -+ { 2, 1, 0, 2, 149, 30, }, -+ { 1, 1, 0, 2, 149, 63, }, -+ { 0, 1, 0, 2, 153, 32, }, -+ { 2, 1, 0, 2, 153, 30, }, -+ { 1, 1, 0, 2, 153, 63, }, -+ { 0, 1, 0, 2, 157, 32, }, -+ { 2, 1, 0, 2, 157, 30, }, -+ { 1, 1, 0, 2, 157, 63, }, -+ { 0, 1, 0, 2, 161, 32, }, -+ { 2, 1, 0, 2, 161, 30, }, -+ { 1, 1, 0, 2, 161, 63, }, -+ { 0, 1, 0, 2, 165, 32, }, -+ { 2, 1, 0, 2, 165, 30, }, -+ { 1, 1, 0, 2, 165, 63, }, -+ { 0, 1, 0, 3, 36, 28, }, -+ { 2, 1, 0, 3, 36, 30, }, -+ { 1, 1, 0, 3, 36, 30, }, -+ { 0, 1, 0, 3, 40, 28, }, -+ { 2, 1, 0, 3, 40, 30, }, -+ { 1, 1, 0, 3, 40, 30, }, -+ { 0, 1, 0, 3, 44, 28, }, -+ { 2, 1, 0, 3, 44, 30, }, -+ { 1, 1, 0, 3, 44, 30, }, -+ { 0, 1, 0, 3, 48, 28, }, -+ { 2, 1, 0, 3, 48, 30, }, -+ { 1, 1, 0, 3, 48, 30, }, -+ { 0, 1, 0, 3, 52, 34, }, -+ { 2, 1, 0, 3, 52, 30, }, -+ { 1, 1, 0, 3, 52, 30, }, -+ { 0, 1, 0, 3, 56, 32, }, -+ { 2, 1, 0, 3, 56, 30, }, -+ { 1, 1, 0, 3, 56, 30, }, -+ { 0, 1, 0, 3, 60, 30, }, -+ { 2, 1, 0, 3, 60, 30, }, -+ { 1, 1, 0, 3, 60, 30, }, -+ { 0, 1, 0, 3, 64, 26, }, -+ { 2, 1, 0, 3, 64, 30, }, -+ { 1, 1, 0, 3, 64, 30, }, -+ { 0, 1, 0, 3, 100, 28, }, -+ { 2, 1, 0, 3, 100, 30, }, -+ { 1, 1, 0, 3, 100, 30, }, -+ { 0, 1, 0, 3, 104, 28, }, -+ { 2, 1, 0, 3, 104, 30, }, -+ { 1, 1, 0, 3, 104, 30, }, -+ { 0, 1, 0, 3, 108, 30, }, -+ { 2, 1, 0, 3, 108, 30, }, -+ { 1, 1, 0, 3, 108, 30, }, -+ { 0, 1, 0, 3, 112, 32, }, -+ { 2, 1, 0, 3, 112, 30, }, -+ { 1, 1, 0, 3, 112, 30, }, -+ { 0, 1, 0, 3, 116, 32, }, -+ { 2, 1, 0, 3, 116, 30, }, -+ { 1, 1, 0, 3, 116, 30, }, -+ { 0, 1, 0, 3, 120, 34, }, -+ { 2, 1, 0, 3, 120, 30, }, -+ { 1, 1, 0, 3, 120, 30, }, -+ { 0, 1, 0, 3, 124, 32, }, -+ { 2, 1, 0, 3, 124, 30, }, -+ { 1, 1, 0, 3, 124, 30, }, -+ { 0, 1, 0, 3, 128, 30, }, -+ { 2, 1, 0, 3, 128, 30, }, -+ { 1, 1, 0, 3, 128, 30, }, -+ { 0, 1, 0, 3, 132, 28, }, -+ { 2, 1, 0, 3, 132, 30, }, -+ { 1, 1, 0, 3, 132, 30, }, -+ { 0, 1, 0, 3, 136, 28, }, -+ { 2, 1, 0, 3, 136, 30, }, -+ { 1, 1, 0, 3, 136, 30, }, -+ { 0, 1, 0, 3, 140, 26, }, -+ { 2, 1, 0, 3, 140, 30, }, -+ { 1, 1, 0, 3, 140, 30, }, -+ { 0, 1, 0, 3, 149, 34, }, -+ { 2, 1, 0, 3, 149, 30, }, -+ { 1, 1, 0, 3, 149, 63, }, -+ { 0, 1, 0, 3, 153, 34, }, -+ { 2, 1, 0, 3, 153, 30, }, -+ { 1, 1, 0, 3, 153, 63, }, -+ { 0, 1, 0, 3, 157, 34, }, -+ { 2, 1, 0, 3, 157, 30, }, -+ { 1, 1, 0, 3, 157, 63, }, -+ { 0, 1, 0, 3, 161, 34, }, -+ { 2, 1, 0, 3, 161, 30, }, -+ { 1, 1, 0, 3, 161, 63, }, -+ { 0, 1, 0, 3, 165, 34, }, -+ { 2, 1, 0, 3, 165, 30, }, -+ { 1, 1, 0, 3, 165, 63, }, -+ { 0, 1, 1, 2, 38, 26, }, -+ { 2, 1, 1, 2, 38, 30, }, -+ { 1, 1, 1, 2, 38, 30, }, -+ { 0, 1, 1, 2, 46, 32, }, -+ { 2, 1, 1, 2, 46, 30, }, -+ { 1, 1, 1, 2, 46, 30, }, -+ { 0, 1, 1, 2, 54, 32, }, -+ { 2, 1, 1, 2, 54, 30, }, -+ { 1, 1, 1, 2, 54, 30, }, -+ { 0, 1, 1, 2, 62, 24, }, -+ { 2, 1, 1, 2, 62, 30, }, -+ { 1, 1, 1, 2, 62, 30, }, -+ { 0, 1, 1, 2, 102, 24, }, -+ { 2, 1, 1, 2, 102, 30, }, -+ { 1, 1, 1, 2, 102, 30, }, -+ { 0, 1, 1, 2, 110, 32, }, -+ { 2, 1, 1, 2, 110, 30, }, -+ { 1, 1, 1, 2, 110, 30, }, -+ { 0, 1, 1, 2, 118, 32, }, -+ { 2, 1, 1, 2, 118, 30, }, -+ { 1, 1, 1, 2, 118, 30, }, -+ { 0, 1, 1, 2, 126, 32, }, -+ { 2, 1, 1, 2, 126, 30, }, -+ { 1, 1, 1, 2, 126, 30, }, -+ { 0, 1, 1, 2, 134, 32, }, -+ { 2, 1, 1, 2, 134, 30, }, -+ { 1, 1, 1, 2, 134, 30, }, -+ { 0, 1, 1, 2, 151, 30, }, -+ { 2, 1, 1, 2, 151, 30, }, -+ { 1, 1, 1, 2, 151, 63, }, -+ { 0, 1, 1, 2, 159, 32, }, -+ { 2, 1, 1, 2, 159, 30, }, -+ { 1, 1, 1, 2, 159, 63, }, -+ { 0, 1, 1, 3, 38, 28, }, -+ { 2, 1, 1, 3, 38, 30, }, -+ { 1, 1, 1, 3, 38, 30, }, -+ { 0, 1, 1, 3, 46, 28, }, -+ { 2, 1, 1, 3, 46, 30, }, -+ { 1, 1, 1, 3, 46, 30, }, -+ { 0, 1, 1, 3, 54, 30, }, -+ { 2, 1, 1, 3, 54, 30, }, -+ { 1, 1, 1, 3, 54, 30, }, -+ { 0, 1, 1, 3, 62, 30, }, -+ { 2, 1, 1, 3, 62, 30, }, -+ { 1, 1, 1, 3, 62, 30, }, -+ { 0, 1, 1, 3, 102, 26, }, -+ { 2, 1, 1, 3, 102, 30, }, -+ { 1, 1, 1, 3, 102, 30, }, -+ { 0, 1, 1, 3, 110, 30, }, -+ { 2, 1, 1, 3, 110, 30, }, -+ { 1, 1, 1, 3, 110, 30, }, -+ { 0, 1, 1, 3, 118, 34, }, -+ { 2, 1, 1, 3, 118, 30, }, -+ { 1, 1, 1, 3, 118, 30, }, -+ { 0, 1, 1, 3, 126, 32, }, -+ { 2, 1, 1, 3, 126, 30, }, -+ { 1, 1, 1, 3, 126, 30, }, -+ { 0, 1, 1, 3, 134, 30, }, -+ { 2, 1, 1, 3, 134, 30, }, -+ { 1, 1, 1, 3, 134, 30, }, -+ { 0, 1, 1, 3, 151, 34, }, -+ { 2, 1, 1, 3, 151, 30, }, -+ { 1, 1, 1, 3, 151, 63, }, -+ { 0, 1, 1, 3, 159, 34, }, -+ { 2, 1, 1, 3, 159, 30, }, -+ { 1, 1, 1, 3, 159, 63, }, -+ { 0, 1, 2, 4, 42, 22, }, -+ { 2, 1, 2, 4, 42, 30, }, -+ { 1, 1, 2, 4, 42, 30, }, -+ { 0, 1, 2, 4, 58, 20, }, -+ { 2, 1, 2, 4, 58, 30, }, -+ { 1, 1, 2, 4, 58, 30, }, -+ { 0, 1, 2, 4, 106, 20, }, -+ { 2, 1, 2, 4, 106, 30, }, -+ { 1, 1, 2, 4, 106, 30, }, -+ { 0, 1, 2, 4, 122, 20, }, -+ { 2, 1, 2, 4, 122, 30, }, -+ { 1, 1, 2, 4, 122, 30, }, -+ { 0, 1, 2, 4, 155, 28, }, -+ { 2, 1, 2, 4, 155, 30, }, -+ { 1, 1, 2, 4, 155, 63, }, -+ { 0, 1, 2, 5, 42, 28, }, -+ { 2, 1, 2, 5, 42, 30, }, -+ { 1, 1, 2, 5, 42, 30, }, -+ { 0, 1, 2, 5, 58, 26, }, -+ { 2, 1, 2, 5, 58, 30, }, -+ { 1, 1, 2, 5, 58, 30, }, -+ { 0, 1, 2, 5, 106, 28, }, -+ { 2, 1, 2, 5, 106, 30, }, -+ { 1, 1, 2, 5, 106, 30, }, -+ { 0, 1, 2, 5, 122, 32, }, -+ { 2, 1, 2, 5, 122, 30, }, -+ { 1, 1, 2, 5, 122, 30, }, -+ { 0, 1, 2, 5, 155, 34, }, -+ { 2, 1, 2, 5, 155, 30, }, -+ { 1, 1, 2, 5, 155, 63, }, -+}; -+ -+RTW_DECL_TABLE_TXPWR_LMT(rtw8821a_txpwr_lmt); -+ -+static const struct rtw_pwr_seq_cmd trans_carddis_to_cardemu_8821a[] = { -+ {0x0005, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(3) | BIT(7), 0}, -+ {0x0086, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_SDIO_MSK, -+ RTW_PWR_ADDR_SDIO, -+ RTW_PWR_CMD_WRITE, BIT(0), 0}, -+ {0x0086, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_SDIO_MSK, -+ RTW_PWR_ADDR_SDIO, -+ RTW_PWR_CMD_POLLING, BIT(1), BIT(1)}, -+ {0x004A, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_USB_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(0), 0}, -+ {0x0005, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(3) | BIT(4), 0}, -+ {0x0023, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_SDIO_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(4), 0}, -+ {0x0301, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_PCI_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0xFF, 0}, -+ {0xFFFF, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ 0, -+ RTW_PWR_CMD_END, 0, 0}, -+}; -+ -+static const struct rtw_pwr_seq_cmd trans_cardemu_to_act_8821a[] = { -+ {0x0020, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_USB_MSK | RTW_PWR_INTF_SDIO_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(0), BIT(0)}, -+ {0x0067, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_USB_MSK | RTW_PWR_INTF_SDIO_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(4), 0}, -+ {0x0001, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_USB_MSK | RTW_PWR_INTF_SDIO_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_DELAY, 1, RTW_PWR_DELAY_MS}, -+ {0x0000, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_USB_MSK | RTW_PWR_INTF_SDIO_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(5), 0}, -+ {0x0005, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(4) | BIT(3) | BIT(2), 0}, -+ {0x0075, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_PCI_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(0), BIT(0)}, -+ {0x0006, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_POLLING, BIT(1), BIT(1)}, -+ {0x0075, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_PCI_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(0), 0}, -+ {0x0006, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(0), BIT(0)}, -+ {0x0005, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(7), 0}, -+ {0x0005, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(4) | BIT(3), 0}, -+ {0x0005, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(0), BIT(0)}, -+ {0x0005, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_POLLING, BIT(0), 0}, -+ {0x004F, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(0), BIT(0)}, -+ {0x0067, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(5) | BIT(4), BIT(5) | BIT(4)}, -+ {0x0025, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(6), 0}, -+ {0x0049, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(1), BIT(1)}, -+ {0x0063, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(1), BIT(1)}, -+ {0x0062, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(1), 0}, -+ {0x0058, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(0), BIT(0)}, -+ {0x005A, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(1), BIT(1)}, -+ {0x002E, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0xFF, 0x82}, -+ {0x0010, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(6), BIT(6)}, -+ {0xFFFF, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ 0, -+ RTW_PWR_CMD_END, 0, 0}, -+}; -+ -+static const struct rtw_pwr_seq_cmd trans_act_to_lps_8821a[] = { -+ {0x0301, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_PCI_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0xFF, 0xFF}, -+ {0x0522, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0xFF, 0xFF}, -+ {0x05F8, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_POLLING, 0xFF, 0}, -+ {0x05F9, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_POLLING, 0xFF, 0}, -+ {0x05FA, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_POLLING, 0xFF, 0}, -+ {0x05FB, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_POLLING, 0xFF, 0}, -+ {0x0002, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(0), 0}, -+ {0x0002, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_DELAY, 0, RTW_PWR_DELAY_US}, -+ {0x0002, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(1), 0}, -+ {0x0100, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0xFF, 0x03}, -+ {0x0101, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(1), 0}, -+ {0x0093, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_SDIO_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0xFF, 0x00}, -+ {0x0553, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(5), BIT(5)}, -+ {0xFFFF, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ 0, -+ RTW_PWR_CMD_END, 0, 0}, -+}; -+ -+static const struct rtw_pwr_seq_cmd trans_act_to_cardemu_8821a[] = { -+ {0x001F, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0xFF, 0}, -+ {0x004F, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(0), 0}, -+ {0x0049, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(1), 0}, -+ {0x0006, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_USB_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(0), BIT(0)}, -+ {0x0005, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(1), BIT(1)}, -+ {0x0005, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_POLLING, BIT(1), 0}, -+ {0x0000, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_USB_MSK | RTW_PWR_INTF_SDIO_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(5), BIT(5)}, -+ {0x0020, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_USB_MSK | RTW_PWR_INTF_SDIO_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(0), 0}, -+ {0xFFFF, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ 0, -+ RTW_PWR_CMD_END, 0, 0}, -+}; -+ -+static const struct rtw_pwr_seq_cmd trans_cardemu_to_carddis_8821a[] = { -+ {0x0007, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_SDIO_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, 0xFF, 0x20}, -+ {0x0005, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_USB_MSK | RTW_PWR_INTF_SDIO_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(3) | BIT(4), BIT(3)}, -+ {0x0005, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_PCI_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(2), BIT(2)}, -+ {0x004A, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_USB_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(0), 1}, -+ {0x0023, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_SDIO_MSK, -+ RTW_PWR_ADDR_MAC, -+ RTW_PWR_CMD_WRITE, BIT(4), BIT(4)}, -+ {0x0086, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_SDIO_MSK, -+ RTW_PWR_ADDR_SDIO, -+ RTW_PWR_CMD_WRITE, BIT(0), BIT(0)}, -+ {0x0086, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_SDIO_MSK, -+ RTW_PWR_ADDR_SDIO, -+ RTW_PWR_CMD_POLLING, BIT(1), 0}, -+ {0xFFFF, -+ RTW_PWR_CUT_ALL_MSK, -+ RTW_PWR_INTF_ALL_MSK, -+ 0, -+ RTW_PWR_CMD_END, 0, 0}, -+}; -+ -+const struct rtw_pwr_seq_cmd * const card_enable_flow_8821a[] = { -+ trans_carddis_to_cardemu_8821a, -+ trans_cardemu_to_act_8821a, -+ NULL -+}; -+ -+const struct rtw_pwr_seq_cmd * const enter_lps_flow_8821a[] = { -+ trans_act_to_lps_8821a, -+ NULL -+}; -+ -+const struct rtw_pwr_seq_cmd * const card_disable_flow_8821a[] = { -+ trans_act_to_cardemu_8821a, -+ trans_cardemu_to_carddis_8821a, -+ NULL -+}; -+ -+static const u8 rtw8821a_pwrtrk_5gb_n[][RTW_PWR_TRK_TBL_SZ] = { -+ {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, -+ 15, 16, 16, 16, 16, 16, 16, 16, 16}, -+ {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, -+ 15, 16, 16, 16, 16, 16, 16, 16, 16}, -+ {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, -+ 15, 16, 16, 16, 16, 16, 16, 16, 16}, -+}; -+ -+static const u8 rtw8821a_pwrtrk_5gb_p[][RTW_PWR_TRK_TBL_SZ] = { -+ {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, -+ 15, 16, 16, 16, 16, 16, 16, 16, 16}, -+ {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, -+ 15, 16, 16, 16, 16, 16, 16, 16, 16}, -+ {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, -+ 15, 16, 16, 16, 16, 16, 16, 16, 16}, -+}; -+ -+static const u8 rtw8821a_pwrtrk_5ga_n[][RTW_PWR_TRK_TBL_SZ] = { -+ {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, -+ 15, 16, 16, 16, 16, 16, 16, 16, 16}, -+ {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, -+ 15, 16, 16, 16, 16, 16, 16, 16, 16}, -+ {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, -+ 15, 16, 16, 16, 16, 16, 16, 16, 16}, -+}; -+ -+static const u8 rtw8821a_pwrtrk_5ga_p[][RTW_PWR_TRK_TBL_SZ] = { -+ {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, -+ 15, 16, 16, 16, 16, 16, 16, 16, 16}, -+ {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, -+ 15, 16, 16, 16, 16, 16, 16, 16, 16}, -+ {0, 0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9, 9, 10, 11, 12, 12, 13, 14, 15, -+ 15, 16, 16, 16, 16, 16, 16, 16, 16}, -+}; -+ -+static const u8 rtw8821a_pwrtrk_2gb_n[] = { -+ 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, -+ 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10 -+}; -+ -+static const u8 rtw8821a_pwrtrk_2gb_p[] = { -+ 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, -+ 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 12, 12 -+}; -+ -+static const u8 rtw8821a_pwrtrk_2ga_n[] = { -+ 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, -+ 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10 -+}; -+ -+static const u8 rtw8821a_pwrtrk_2ga_p[] = { -+ 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, -+ 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 12, 12 -+}; -+ -+static const u8 rtw8821a_pwrtrk_2g_cck_b_n[] = { -+ 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, -+ 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10 -+}; -+ -+static const u8 rtw8821a_pwrtrk_2g_cck_b_p[] = { -+ 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, -+ 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 12, 12 -+}; -+ -+static const u8 rtw8821a_pwrtrk_2g_cck_a_n[] = { -+ 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, -+ 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10 -+}; -+ -+static const u8 rtw8821a_pwrtrk_2g_cck_a_p[] = { -+ 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, -+ 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 12, 12 -+}; -+ -+const struct rtw_pwr_track_tbl rtw8821a_rtw_pwr_track_tbl = { -+ .pwrtrk_5gb_n[0] = rtw8821a_pwrtrk_5gb_n[0], -+ .pwrtrk_5gb_n[1] = rtw8821a_pwrtrk_5gb_n[1], -+ .pwrtrk_5gb_n[2] = rtw8821a_pwrtrk_5gb_n[2], -+ .pwrtrk_5gb_p[0] = rtw8821a_pwrtrk_5gb_p[0], -+ .pwrtrk_5gb_p[1] = rtw8821a_pwrtrk_5gb_p[1], -+ .pwrtrk_5gb_p[2] = rtw8821a_pwrtrk_5gb_p[2], -+ .pwrtrk_5ga_n[0] = rtw8821a_pwrtrk_5ga_n[0], -+ .pwrtrk_5ga_n[1] = rtw8821a_pwrtrk_5ga_n[1], -+ .pwrtrk_5ga_n[2] = rtw8821a_pwrtrk_5ga_n[2], -+ .pwrtrk_5ga_p[0] = rtw8821a_pwrtrk_5ga_p[0], -+ .pwrtrk_5ga_p[1] = rtw8821a_pwrtrk_5ga_p[1], -+ .pwrtrk_5ga_p[2] = rtw8821a_pwrtrk_5ga_p[2], -+ .pwrtrk_2gb_n = rtw8821a_pwrtrk_2gb_n, -+ .pwrtrk_2gb_p = rtw8821a_pwrtrk_2gb_p, -+ .pwrtrk_2ga_n = rtw8821a_pwrtrk_2ga_n, -+ .pwrtrk_2ga_p = rtw8821a_pwrtrk_2ga_p, -+ .pwrtrk_2g_cckb_n = rtw8821a_pwrtrk_2g_cck_b_n, -+ .pwrtrk_2g_cckb_p = rtw8821a_pwrtrk_2g_cck_b_p, -+ .pwrtrk_2g_ccka_n = rtw8821a_pwrtrk_2g_cck_a_n, -+ .pwrtrk_2g_ccka_p = rtw8821a_pwrtrk_2g_cck_a_p, -+}; ---- /dev/null -+++ b/drivers/net/wireless/realtek/rtw88/rtw8821a_table.h -@@ -0,0 +1,21 @@ -+/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ -+/* Copyright(c) 2024 Realtek Corporation -+ */ -+ -+#ifndef __RTW8821A_TABLE_H__ -+#define __RTW8821A_TABLE_H__ -+ -+extern const struct rtw_table rtw8821a_mac_tbl; -+extern const struct rtw_table rtw8821a_agc_tbl; -+extern const struct rtw_table rtw8821a_bb_tbl; -+extern const struct rtw_table rtw8821a_bb_pg_tbl; -+extern const struct rtw_table rtw8821a_rf_a_tbl; -+extern const struct rtw_table rtw8821a_txpwr_lmt_tbl; -+ -+extern const struct rtw_pwr_seq_cmd * const card_enable_flow_8821a[]; -+extern const struct rtw_pwr_seq_cmd * const enter_lps_flow_8821a[]; -+extern const struct rtw_pwr_seq_cmd * const card_disable_flow_8821a[]; -+ -+extern const struct rtw_pwr_track_tbl rtw8821a_rtw_pwr_track_tbl; -+ -+#endif diff --git a/package/kernel/mac80211/patches/rtl/041-v6.13-wifi-rtw88-Add-rtw88xxa.-c-h.patch b/package/kernel/mac80211/patches/rtl/041-v6.13-wifi-rtw88-Add-rtw88xxa.-c-h.patch deleted file mode 100644 index 79e1deebf79..00000000000 --- a/package/kernel/mac80211/patches/rtl/041-v6.13-wifi-rtw88-Add-rtw88xxa.-c-h.patch +++ /dev/null @@ -1,2187 +0,0 @@ -From b870b9d31c9e4e6b20c410e1e017f8c87d4c2ae0 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Wed, 30 Oct 2024 20:27:39 +0200 -Subject: [PATCH] wifi: rtw88: Add rtw88xxa.{c,h} - -These contain code shared by both RTL8821AU and RTL8812AU chips. - -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/b8590382-a954-412d-a96b-63e360b97acc@gmail.com ---- - drivers/net/wireless/realtek/rtw88/rtw88xxa.c | 1989 +++++++++++++++++ - drivers/net/wireless/realtek/rtw88/rtw88xxa.h | 175 ++ - 2 files changed, 2164 insertions(+) - create mode 100644 drivers/net/wireless/realtek/rtw88/rtw88xxa.c - create mode 100644 drivers/net/wireless/realtek/rtw88/rtw88xxa.h - ---- /dev/null -+++ b/drivers/net/wireless/realtek/rtw88/rtw88xxa.c -@@ -0,0 +1,1989 @@ -+// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause -+/* Copyright(c) 2024 Realtek Corporation -+ */ -+ -+#include -+#include "main.h" -+#include "coex.h" -+#include "phy.h" -+#include "rtw88xxa.h" -+#include "mac.h" -+#include "reg.h" -+#include "sec.h" -+#include "debug.h" -+#include "bf.h" -+#include "efuse.h" -+#include "usb.h" -+ -+void rtw88xxa_efuse_grant(struct rtw_dev *rtwdev, bool on) -+{ -+ if (on) { -+ rtw_write8(rtwdev, REG_EFUSE_ACCESS, EFUSE_ACCESS_ON); -+ -+ rtw_write16_set(rtwdev, REG_SYS_FUNC_EN, BIT_FEN_ELDR); -+ rtw_write16_set(rtwdev, REG_SYS_CLKR, -+ BIT_LOADER_CLK_EN | BIT_ANA8M); -+ } else { -+ rtw_write8(rtwdev, REG_EFUSE_ACCESS, EFUSE_ACCESS_OFF); -+ } -+} -+EXPORT_SYMBOL(rtw88xxa_efuse_grant); -+ -+static void rtw8812a_read_amplifier_type(struct rtw_dev *rtwdev) -+{ -+ struct rtw_efuse *efuse = &rtwdev->efuse; -+ -+ efuse->ext_pa_2g = (efuse->pa_type_2g & BIT(5)) && -+ (efuse->pa_type_2g & BIT(4)); -+ efuse->ext_lna_2g = (efuse->lna_type_2g & BIT(7)) && -+ (efuse->lna_type_2g & BIT(3)); -+ -+ efuse->ext_pa_5g = (efuse->pa_type_5g & BIT(1)) && -+ (efuse->pa_type_5g & BIT(0)); -+ efuse->ext_lna_5g = (efuse->lna_type_5g & BIT(7)) && -+ (efuse->lna_type_5g & BIT(3)); -+ -+ /* For rtw_phy_cond2: */ -+ if (efuse->ext_pa_2g) { -+ u8 ext_type_pa_2g_a = u8_get_bits(efuse->lna_type_2g, BIT(2)); -+ u8 ext_type_pa_2g_b = u8_get_bits(efuse->lna_type_2g, BIT(6)); -+ -+ efuse->gpa_type = (ext_type_pa_2g_b << 2) | ext_type_pa_2g_a; -+ } -+ -+ if (efuse->ext_pa_5g) { -+ u8 ext_type_pa_5g_a = u8_get_bits(efuse->lna_type_5g, BIT(2)); -+ u8 ext_type_pa_5g_b = u8_get_bits(efuse->lna_type_5g, BIT(6)); -+ -+ efuse->apa_type = (ext_type_pa_5g_b << 2) | ext_type_pa_5g_a; -+ } -+ -+ if (efuse->ext_lna_2g) { -+ u8 ext_type_lna_2g_a = u8_get_bits(efuse->lna_type_2g, -+ BIT(1) | BIT(0)); -+ u8 ext_type_lna_2g_b = u8_get_bits(efuse->lna_type_2g, -+ BIT(5) | BIT(4)); -+ -+ efuse->glna_type = (ext_type_lna_2g_b << 2) | ext_type_lna_2g_a; -+ } -+ -+ if (efuse->ext_lna_5g) { -+ u8 ext_type_lna_5g_a = u8_get_bits(efuse->lna_type_5g, -+ BIT(1) | BIT(0)); -+ u8 ext_type_lna_5g_b = u8_get_bits(efuse->lna_type_5g, -+ BIT(5) | BIT(4)); -+ -+ efuse->alna_type = (ext_type_lna_5g_b << 2) | ext_type_lna_5g_a; -+ } -+} -+ -+static void rtw8812a_read_rfe_type(struct rtw_dev *rtwdev, -+ struct rtw88xxa_efuse *map) -+{ -+ struct rtw_efuse *efuse = &rtwdev->efuse; -+ -+ if (map->rfe_option == 0xff) { -+ if (rtwdev->hci.type == RTW_HCI_TYPE_USB) -+ efuse->rfe_option = 0; -+ else if (rtwdev->hci.type == RTW_HCI_TYPE_PCIE) -+ efuse->rfe_option = 2; -+ else -+ efuse->rfe_option = 4; -+ } else if (map->rfe_option & BIT(7)) { -+ if (efuse->ext_lna_5g) { -+ if (efuse->ext_pa_5g) { -+ if (efuse->ext_lna_2g && efuse->ext_pa_2g) -+ efuse->rfe_option = 3; -+ else -+ efuse->rfe_option = 0; -+ } else { -+ efuse->rfe_option = 2; -+ } -+ } else { -+ efuse->rfe_option = 4; -+ } -+ } else { -+ efuse->rfe_option = map->rfe_option & 0x3f; -+ -+ /* Due to other customer already use incorrect EFUSE map for -+ * their product. We need to add workaround to prevent to -+ * modify spec and notify all customer to revise the IC 0xca -+ * content. -+ */ -+ if (efuse->rfe_option == 4 && -+ (efuse->ext_pa_5g || efuse->ext_pa_2g || -+ efuse->ext_lna_5g || efuse->ext_lna_2g)) { -+ if (rtwdev->hci.type == RTW_HCI_TYPE_USB) -+ efuse->rfe_option = 0; -+ else if (rtwdev->hci.type == RTW_HCI_TYPE_PCIE) -+ efuse->rfe_option = 2; -+ } -+ } -+} -+ -+static void rtw88xxa_read_usb_type(struct rtw_dev *rtwdev) -+{ -+ struct rtw_efuse *efuse = &rtwdev->efuse; -+ struct rtw_hal *hal = &rtwdev->hal; -+ u8 antenna = 0; -+ u8 wmode = 0; -+ u8 val8, i; -+ -+ efuse->hw_cap.bw = BIT(RTW_CHANNEL_WIDTH_20) | -+ BIT(RTW_CHANNEL_WIDTH_40) | -+ BIT(RTW_CHANNEL_WIDTH_80); -+ efuse->hw_cap.ptcl = EFUSE_HW_CAP_PTCL_VHT; -+ -+ if (rtwdev->chip->id == RTW_CHIP_TYPE_8821A) -+ efuse->hw_cap.nss = 1; -+ else -+ efuse->hw_cap.nss = 2; -+ -+ if (rtwdev->chip->id == RTW_CHIP_TYPE_8821A) -+ goto print_hw_cap; -+ -+ for (i = 0; i < 2; i++) { -+ rtw_read8_physical_efuse(rtwdev, 1019 - i, &val8); -+ -+ antenna = u8_get_bits(val8, GENMASK(7, 5)); -+ if (antenna) -+ break; -+ antenna = u8_get_bits(val8, GENMASK(3, 1)); -+ if (antenna) -+ break; -+ } -+ -+ for (i = 0; i < 2; i++) { -+ rtw_read8_physical_efuse(rtwdev, 1021 - i, &val8); -+ -+ wmode = u8_get_bits(val8, GENMASK(3, 2)); -+ if (wmode) -+ break; -+ } -+ -+ if (antenna == 1) { -+ rtw_info(rtwdev, "This RTL8812AU says it is 1T1R.\n"); -+ -+ efuse->hw_cap.nss = 1; -+ hal->rf_type = RF_1T1R; -+ hal->rf_path_num = 1; -+ hal->rf_phy_num = 1; -+ hal->antenna_tx = BB_PATH_A; -+ hal->antenna_rx = BB_PATH_A; -+ } else { -+ /* Override rtw_chip_parameter_setup(). It detects 8812au as 1T1R. */ -+ efuse->hw_cap.nss = 2; -+ hal->rf_type = RF_2T2R; -+ hal->rf_path_num = 2; -+ hal->rf_phy_num = 2; -+ hal->antenna_tx = BB_PATH_AB; -+ hal->antenna_rx = BB_PATH_AB; -+ -+ if (antenna == 2 && wmode == 2) { -+ rtw_info(rtwdev, "This RTL8812AU says it can't do VHT.\n"); -+ -+ /* Can't be EFUSE_HW_CAP_IGNORE and can't be -+ * EFUSE_HW_CAP_PTCL_VHT, so make it 1. -+ */ -+ efuse->hw_cap.ptcl = 1; -+ efuse->hw_cap.bw &= ~BIT(RTW_CHANNEL_WIDTH_80); -+ } -+ } -+ -+print_hw_cap: -+ rtw_dbg(rtwdev, RTW_DBG_EFUSE, -+ "hw cap: hci=0x%02x, bw=0x%02x, ptcl=0x%02x, ant_num=%d, nss=%d\n", -+ efuse->hw_cap.hci, efuse->hw_cap.bw, efuse->hw_cap.ptcl, -+ efuse->hw_cap.ant_num, efuse->hw_cap.nss); -+} -+ -+int rtw88xxa_read_efuse(struct rtw_dev *rtwdev, u8 *log_map) -+{ -+ const struct rtw_chip_info *chip = rtwdev->chip; -+ struct rtw_efuse *efuse = &rtwdev->efuse; -+ struct rtw88xxa_efuse *map; -+ int i; -+ -+ if (chip->id == RTW_CHIP_TYPE_8812A) -+ rtwdev->hal.cut_version += 1; -+ -+ if (rtw_dbg_is_enabled(rtwdev, RTW_DBG_EFUSE)) -+ print_hex_dump(KERN_INFO, "", DUMP_PREFIX_OFFSET, 16, 1, -+ log_map, chip->log_efuse_size, true); -+ -+ map = (struct rtw88xxa_efuse *)log_map; -+ -+ efuse->rf_board_option = map->rf_board_option; -+ efuse->crystal_cap = map->xtal_k; -+ if (efuse->crystal_cap == 0xff) -+ efuse->crystal_cap = 0x20; -+ efuse->pa_type_2g = map->pa_type; -+ efuse->pa_type_5g = map->pa_type; -+ efuse->lna_type_2g = map->lna_type_2g; -+ efuse->lna_type_5g = map->lna_type_5g; -+ if (chip->id == RTW_CHIP_TYPE_8812A) { -+ rtw8812a_read_amplifier_type(rtwdev); -+ rtw8812a_read_rfe_type(rtwdev, map); -+ -+ efuse->usb_mode_switch = u8_get_bits(map->usb_mode, BIT(1)); -+ } -+ efuse->channel_plan = map->channel_plan; -+ efuse->country_code[0] = map->country_code[0]; -+ efuse->country_code[1] = map->country_code[1]; -+ efuse->bt_setting = map->rf_bt_setting; -+ efuse->regd = map->rf_board_option & 0x7; -+ efuse->thermal_meter[0] = map->thermal_meter; -+ efuse->thermal_meter[1] = map->thermal_meter; -+ efuse->thermal_meter_k = map->thermal_meter; -+ efuse->tx_bb_swing_setting_2g = map->tx_bb_swing_setting_2g; -+ efuse->tx_bb_swing_setting_5g = map->tx_bb_swing_setting_5g; -+ -+ rtw88xxa_read_usb_type(rtwdev); -+ -+ if (chip->id == RTW_CHIP_TYPE_8821A) -+ efuse->btcoex = rtw_read32_mask(rtwdev, REG_WL_BT_PWR_CTRL, -+ BIT_BT_FUNC_EN); -+ else -+ efuse->btcoex = (map->rf_board_option & 0xe0) == 0x20; -+ efuse->share_ant = !!(efuse->bt_setting & BIT(0)); -+ -+ /* No antenna diversity because it's disabled in the vendor driver */ -+ efuse->ant_div_cfg = 0; -+ -+ efuse->ant_div_type = map->rf_antenna_option; -+ if (efuse->ant_div_type == 0xff) -+ efuse->ant_div_type = 0x3; -+ -+ for (i = 0; i < 4; i++) -+ efuse->txpwr_idx_table[i] = map->txpwr_idx_table[i]; -+ -+ switch (rtw_hci_type(rtwdev)) { -+ case RTW_HCI_TYPE_USB: -+ if (chip->id == RTW_CHIP_TYPE_8821A) -+ ether_addr_copy(efuse->addr, map->rtw8821au.mac_addr); -+ else -+ ether_addr_copy(efuse->addr, map->rtw8812au.mac_addr); -+ break; -+ case RTW_HCI_TYPE_PCIE: -+ case RTW_HCI_TYPE_SDIO: -+ default: -+ /* unsupported now */ -+ return -EOPNOTSUPP; -+ } -+ -+ return 0; -+} -+EXPORT_SYMBOL(rtw88xxa_read_efuse); -+ -+static void rtw88xxa_reset_8051(struct rtw_dev *rtwdev) -+{ -+ const struct rtw_chip_info *chip = rtwdev->chip; -+ u8 val8; -+ -+ /* Reset MCU IO Wrapper */ -+ rtw_write8_clr(rtwdev, REG_RSV_CTRL, BIT(1)); -+ if (chip->id == RTW_CHIP_TYPE_8812A) -+ rtw_write8_clr(rtwdev, REG_RSV_CTRL + 1, BIT(3)); -+ else -+ rtw_write8_clr(rtwdev, REG_RSV_CTRL + 1, BIT(0)); -+ -+ val8 = rtw_read8(rtwdev, REG_SYS_FUNC_EN + 1); -+ rtw_write8(rtwdev, REG_SYS_FUNC_EN + 1, val8 & ~BIT(2)); -+ -+ /* Enable MCU IO Wrapper */ -+ rtw_write8_clr(rtwdev, REG_RSV_CTRL, BIT(1)); -+ if (chip->id == RTW_CHIP_TYPE_8812A) -+ rtw_write8_set(rtwdev, REG_RSV_CTRL + 1, BIT(3)); -+ else -+ rtw_write8_set(rtwdev, REG_RSV_CTRL + 1, BIT(0)); -+ -+ rtw_write8(rtwdev, REG_SYS_FUNC_EN + 1, val8 | BIT(2)); -+} -+ -+/* A lightweight deinit function */ -+static void rtw88xxau_hw_reset(struct rtw_dev *rtwdev) -+{ -+ u8 val8; -+ -+ if (!(rtw_read8(rtwdev, REG_MCUFW_CTRL) & BIT_RAM_DL_SEL)) -+ return; -+ -+ rtw88xxa_reset_8051(rtwdev); -+ rtw_write8(rtwdev, REG_MCUFW_CTRL, 0x00); -+ -+ /* before BB reset should do clock gated */ -+ rtw_write32_set(rtwdev, REG_FPGA0_XCD_RF_PARA, BIT(6)); -+ -+ /* reset BB */ -+ rtw_write8_clr(rtwdev, REG_SYS_FUNC_EN, BIT(0) | BIT(1)); -+ -+ /* reset RF */ -+ rtw_write8(rtwdev, REG_RF_CTRL, 0); -+ -+ /* reset TRX path */ -+ rtw_write16(rtwdev, REG_CR, 0); -+ -+ /* reset MAC, reg0x5[1], auto FSM off */ -+ rtw_write8_set(rtwdev, REG_APS_FSMCO + 1, APS_FSMCO_MAC_OFF >> 8); -+ -+ /* check if reg0x5[1] auto cleared */ -+ if (read_poll_timeout_atomic(rtw_read8, val8, -+ !(val8 & (APS_FSMCO_MAC_OFF >> 8)), -+ 1, 5000, false, -+ rtwdev, REG_APS_FSMCO + 1)) -+ rtw_err(rtwdev, "%s: timed out waiting for 0x5[1]\n", __func__); -+ -+ /* reg0x5[0], auto FSM on */ -+ val8 |= APS_FSMCO_MAC_ENABLE >> 8; -+ rtw_write8(rtwdev, REG_APS_FSMCO + 1, val8); -+ -+ rtw_write8_clr(rtwdev, REG_SYS_FUNC_EN + 1, BIT(4) | BIT(7)); -+ rtw_write8_set(rtwdev, REG_SYS_FUNC_EN + 1, BIT(4) | BIT(7)); -+} -+ -+static int rtw88xxau_init_power_on(struct rtw_dev *rtwdev) -+{ -+ const struct rtw_chip_info *chip = rtwdev->chip; -+ u16 val16; -+ int ret; -+ -+ ret = rtw_pwr_seq_parser(rtwdev, chip->pwr_on_seq); -+ if (ret) { -+ rtw_err(rtwdev, "power on flow failed\n"); -+ return ret; -+ } -+ -+ rtw_write16(rtwdev, REG_CR, 0); -+ val16 = BIT_HCI_TXDMA_EN | BIT_HCI_RXDMA_EN | BIT_TXDMA_EN | -+ BIT_RXDMA_EN | BIT_PROTOCOL_EN | BIT_SCHEDULE_EN | -+ BIT_MAC_SEC_EN | BIT_32K_CAL_TMR_EN; -+ rtw_write16_set(rtwdev, REG_CR, val16); -+ -+ if (chip->id == RTW_CHIP_TYPE_8821A) { -+ if (rtw_read8(rtwdev, REG_SYS_CFG1 + 3) & BIT(0)) -+ rtw_write8_set(rtwdev, REG_LDO_SWR_CTRL, BIT(6)); -+ } -+ -+ return ret; -+} -+ -+static int rtw88xxa_llt_write(struct rtw_dev *rtwdev, u32 address, u32 data) -+{ -+ u32 value = BIT_LLT_WRITE_ACCESS | (address << 8) | data; -+ int count = 0; -+ -+ rtw_write32(rtwdev, REG_LLT_INIT, value); -+ -+ do { -+ if (!rtw_read32_mask(rtwdev, REG_LLT_INIT, BIT(31) | BIT(30))) -+ break; -+ -+ if (count > 20) { -+ rtw_err(rtwdev, "Failed to poll write LLT done at %d!\n", -+ address); -+ return -EBUSY; -+ } -+ } while (++count); -+ -+ return 0; -+} -+ -+static int rtw88xxa_llt_init(struct rtw_dev *rtwdev, u32 boundary) -+{ -+ u32 last_entry = 255; -+ int status = 0; -+ u32 i; -+ -+ for (i = 0; i < boundary - 1; i++) { -+ status = rtw88xxa_llt_write(rtwdev, i, i + 1); -+ if (status) -+ return status; -+ } -+ -+ status = rtw88xxa_llt_write(rtwdev, boundary - 1, 0xFF); -+ if (status) -+ return status; -+ -+ for (i = boundary; i < last_entry; i++) { -+ status = rtw88xxa_llt_write(rtwdev, i, i + 1); -+ if (status) -+ return status; -+ } -+ -+ status = rtw88xxa_llt_write(rtwdev, last_entry, boundary); -+ -+ return status; -+} -+ -+static void rtw88xxau_init_queue_reserved_page(struct rtw_dev *rtwdev) -+{ -+ const struct rtw_chip_info *chip = rtwdev->chip; -+ struct rtw_fifo_conf *fifo = &rtwdev->fifo; -+ const struct rtw_page_table *pg_tbl = NULL; -+ u16 pubq_num; -+ u32 val32; -+ -+ switch (rtw_hci_type(rtwdev)) { -+ case RTW_HCI_TYPE_PCIE: -+ pg_tbl = &chip->page_table[1]; -+ break; -+ case RTW_HCI_TYPE_USB: -+ if (rtwdev->hci.bulkout_num == 2) -+ pg_tbl = &chip->page_table[2]; -+ else if (rtwdev->hci.bulkout_num == 3) -+ pg_tbl = &chip->page_table[3]; -+ else if (rtwdev->hci.bulkout_num == 4) -+ pg_tbl = &chip->page_table[4]; -+ break; -+ case RTW_HCI_TYPE_SDIO: -+ pg_tbl = &chip->page_table[0]; -+ break; -+ default: -+ break; -+ } -+ -+ pubq_num = fifo->acq_pg_num - pg_tbl->hq_num - pg_tbl->lq_num - -+ pg_tbl->nq_num - pg_tbl->exq_num - pg_tbl->gapq_num; -+ -+ val32 = BIT_RQPN_NE(pg_tbl->nq_num, pg_tbl->exq_num); -+ rtw_write32(rtwdev, REG_RQPN_NPQ, val32); -+ -+ val32 = BIT_RQPN_HLP(pg_tbl->hq_num, pg_tbl->lq_num, pubq_num); -+ rtw_write32(rtwdev, REG_RQPN, val32); -+} -+ -+static void rtw88xxau_init_tx_buffer_boundary(struct rtw_dev *rtwdev) -+{ -+ struct rtw_fifo_conf *fifo = &rtwdev->fifo; -+ -+ rtw_write8(rtwdev, REG_BCNQ_BDNY, fifo->rsvd_boundary); -+ rtw_write8(rtwdev, REG_MGQ_BDNY, fifo->rsvd_boundary); -+ rtw_write8(rtwdev, REG_WMAC_LBK_BF_HD, fifo->rsvd_boundary); -+ rtw_write8(rtwdev, REG_TRXFF_BNDY, fifo->rsvd_boundary); -+ rtw_write8(rtwdev, REG_DWBCN0_CTRL + 1, fifo->rsvd_boundary); -+} -+ -+static int rtw88xxau_init_queue_priority(struct rtw_dev *rtwdev) -+{ -+ const struct rtw_chip_info *chip = rtwdev->chip; -+ u8 bulkout_num = rtwdev->hci.bulkout_num; -+ const struct rtw_rqpn *rqpn = NULL; -+ u16 txdma_pq_map; -+ -+ switch (rtw_hci_type(rtwdev)) { -+ case RTW_HCI_TYPE_PCIE: -+ rqpn = &chip->rqpn_table[1]; -+ break; -+ case RTW_HCI_TYPE_USB: -+ if (bulkout_num == 2) -+ rqpn = &chip->rqpn_table[2]; -+ else if (bulkout_num == 3) -+ rqpn = &chip->rqpn_table[3]; -+ else if (bulkout_num == 4) -+ rqpn = &chip->rqpn_table[4]; -+ else -+ return -EINVAL; -+ break; -+ case RTW_HCI_TYPE_SDIO: -+ rqpn = &chip->rqpn_table[0]; -+ break; -+ default: -+ return -EINVAL; -+ } -+ -+ rtwdev->fifo.rqpn = rqpn; -+ -+ txdma_pq_map = rtw_read16(rtwdev, REG_TXDMA_PQ_MAP) & 0x7; -+ txdma_pq_map |= BIT_TXDMA_HIQ_MAP(rqpn->dma_map_hi); -+ txdma_pq_map |= BIT_TXDMA_MGQ_MAP(rqpn->dma_map_mg); -+ txdma_pq_map |= BIT_TXDMA_BKQ_MAP(rqpn->dma_map_bk); -+ txdma_pq_map |= BIT_TXDMA_BEQ_MAP(rqpn->dma_map_be); -+ txdma_pq_map |= BIT_TXDMA_VIQ_MAP(rqpn->dma_map_vi); -+ txdma_pq_map |= BIT_TXDMA_VOQ_MAP(rqpn->dma_map_vo); -+ rtw_write16(rtwdev, REG_TXDMA_PQ_MAP, txdma_pq_map); -+ -+ /* Packet in Hi Queue Tx immediately (No constraint for ATIM Period). */ -+ if (rtw_hci_type(rtwdev) == RTW_HCI_TYPE_USB && bulkout_num == 4) -+ rtw_write8(rtwdev, REG_HIQ_NO_LMT_EN, 0xff); -+ -+ return 0; -+} -+ -+static void rtw88xxa_init_wmac_setting(struct rtw_dev *rtwdev) -+{ -+ rtw_write16(rtwdev, REG_RXFLTMAP0, 0xffff); -+ rtw_write16(rtwdev, REG_RXFLTMAP1, 0x0400); -+ rtw_write16(rtwdev, REG_RXFLTMAP2, 0xffff); -+ -+ rtw_write32(rtwdev, REG_MAR, 0xffffffff); -+ rtw_write32(rtwdev, REG_MAR + 4, 0xffffffff); -+} -+ -+static void rtw88xxa_init_adaptive_ctrl(struct rtw_dev *rtwdev) -+{ -+ rtw_write32_mask(rtwdev, REG_RRSR, 0xfffff, 0xffff1); -+ rtw_write16(rtwdev, REG_RETRY_LIMIT, 0x3030); -+} -+ -+static void rtw88xxa_init_edca(struct rtw_dev *rtwdev) -+{ -+ rtw_write16(rtwdev, REG_SPEC_SIFS, 0x100a); -+ rtw_write16(rtwdev, REG_MAC_SPEC_SIFS, 0x100a); -+ -+ rtw_write16(rtwdev, REG_SIFS, 0x100a); -+ rtw_write16(rtwdev, REG_SIFS + 2, 0x100a); -+ -+ rtw_write32(rtwdev, REG_EDCA_BE_PARAM, 0x005EA42B); -+ rtw_write32(rtwdev, REG_EDCA_BK_PARAM, 0x0000A44F); -+ rtw_write32(rtwdev, REG_EDCA_VI_PARAM, 0x005EA324); -+ rtw_write32(rtwdev, REG_EDCA_VO_PARAM, 0x002FA226); -+ -+ rtw_write8(rtwdev, REG_USTIME_TSF, 0x50); -+ rtw_write8(rtwdev, REG_USTIME_EDCA, 0x50); -+} -+ -+static void rtw88xxau_tx_aggregation(struct rtw_dev *rtwdev) -+{ -+ const struct rtw_chip_info *chip = rtwdev->chip; -+ -+ rtw_write32_mask(rtwdev, REG_DWBCN0_CTRL, 0xf0, -+ chip->usb_tx_agg_desc_num); -+ -+ if (chip->id == RTW_CHIP_TYPE_8821A) -+ rtw_write8(rtwdev, REG_DWBCN1_CTRL, -+ chip->usb_tx_agg_desc_num << 1); -+} -+ -+static void rtw88xxa_init_beacon_parameters(struct rtw_dev *rtwdev) -+{ -+ u16 val16; -+ -+ val16 = (BIT_DIS_TSF_UDT << 8) | BIT_DIS_TSF_UDT; -+ if (rtwdev->efuse.btcoex) -+ val16 |= BIT_EN_BCN_FUNCTION; -+ rtw_write16(rtwdev, REG_BCN_CTRL, val16); -+ -+ rtw_write32_mask(rtwdev, REG_TBTT_PROHIBIT, 0xfffff, WLAN_TBTT_TIME); -+ rtw_write8(rtwdev, REG_DRVERLYINT, 0x05); -+ rtw_write8(rtwdev, REG_BCNDMATIM, WLAN_BCN_DMA_TIME); -+ rtw_write16(rtwdev, REG_BCNTCFG, 0x4413); -+} -+ -+static void rtw88xxa_phy_bb_config(struct rtw_dev *rtwdev) -+{ -+ u8 val8, crystal_cap; -+ -+ /* power on BB/RF domain */ -+ val8 = rtw_read8(rtwdev, REG_SYS_FUNC_EN); -+ val8 |= BIT_FEN_USBA; -+ rtw_write8(rtwdev, REG_SYS_FUNC_EN, val8); -+ -+ /* toggle BB reset */ -+ val8 |= BIT_FEN_BB_RSTB | BIT_FEN_BB_GLB_RST; -+ rtw_write8(rtwdev, REG_SYS_FUNC_EN, val8); -+ -+ rtw_write8(rtwdev, REG_RF_CTRL, -+ BIT_RF_EN | BIT_RF_RSTB | BIT_RF_SDM_RSTB); -+ rtw_write8(rtwdev, REG_RF_B_CTRL, -+ BIT_RF_EN | BIT_RF_RSTB | BIT_RF_SDM_RSTB); -+ -+ rtw_load_table(rtwdev, rtwdev->chip->bb_tbl); -+ rtw_load_table(rtwdev, rtwdev->chip->agc_tbl); -+ -+ crystal_cap = rtwdev->efuse.crystal_cap & 0x3F; -+ if (rtwdev->chip->id == RTW_CHIP_TYPE_8812A) -+ rtw_write32_mask(rtwdev, REG_AFE_CTRL3, 0x7FF80000, -+ crystal_cap | (crystal_cap << 6)); -+ else -+ rtw_write32_mask(rtwdev, REG_AFE_CTRL3, 0x00FFF000, -+ crystal_cap | (crystal_cap << 6)); -+} -+ -+static void rtw88xxa_phy_rf_config(struct rtw_dev *rtwdev) -+{ -+ u8 rf_path; -+ -+ for (rf_path = 0; rf_path < rtwdev->hal.rf_path_num; rf_path++) -+ rtw_load_table(rtwdev, rtwdev->chip->rf_tbl[rf_path]); -+} -+ -+static void rtw8812a_config_1t(struct rtw_dev *rtwdev) -+{ -+ /* BB OFDM RX Path_A */ -+ rtw_write32_mask(rtwdev, REG_RXPSEL, 0xff, 0x11); -+ -+ /* BB OFDM TX Path_A */ -+ rtw_write32_mask(rtwdev, REG_TXPSEL, MASKLWORD, 0x1111); -+ -+ /* BB CCK R/Rx Path_A */ -+ rtw_write32_mask(rtwdev, REG_CCK_RX, 0x0c000000, 0x0); -+ -+ /* MCS support */ -+ rtw_write32_mask(rtwdev, REG_RX_MCS_LIMIT, 0xc0000060, 0x4); -+ -+ /* RF Path_B HSSI OFF */ -+ rtw_write32_mask(rtwdev, REG_3WIRE_SWB, 0xf, 0x4); -+ -+ /* RF Path_B Power Down */ -+ rtw_write32_mask(rtwdev, REG_LSSI_WRITE_B, MASKDWORD, 0); -+ -+ /* ADDA Path_B OFF */ -+ rtw_write32_mask(rtwdev, REG_AFE_PWR1_B, MASKDWORD, 0); -+ rtw_write32_mask(rtwdev, REG_AFE_PWR2_B, MASKDWORD, 0); -+} -+ -+static const u32 rtw88xxa_txscale_tbl[] = { -+ 0x081, 0x088, 0x090, 0x099, 0x0a2, 0x0ac, 0x0b6, 0x0c0, 0x0cc, 0x0d8, -+ 0x0e5, 0x0f2, 0x101, 0x110, 0x120, 0x131, 0x143, 0x156, 0x16a, 0x180, -+ 0x197, 0x1af, 0x1c8, 0x1e3, 0x200, 0x21e, 0x23e, 0x261, 0x285, 0x2ab, -+ 0x2d3, 0x2fe, 0x32b, 0x35c, 0x38e, 0x3c4, 0x3fe -+}; -+ -+static u32 rtw88xxa_get_bb_swing(struct rtw_dev *rtwdev, u8 band, u8 path) -+{ -+ static const u32 swing2setting[4] = {0x200, 0x16a, 0x101, 0x0b6}; -+ struct rtw_efuse *efuse = &rtwdev->efuse; -+ u8 tx_bb_swing; -+ -+ if (band == RTW_BAND_2G) -+ tx_bb_swing = efuse->tx_bb_swing_setting_2g; -+ else -+ tx_bb_swing = efuse->tx_bb_swing_setting_5g; -+ -+ if (path == RF_PATH_B) -+ tx_bb_swing >>= 2; -+ tx_bb_swing &= 0x3; -+ -+ return swing2setting[tx_bb_swing]; -+} -+ -+static u8 rtw88xxa_get_swing_index(struct rtw_dev *rtwdev) -+{ -+ u32 swing, table_value; -+ u8 i; -+ -+ swing = rtw88xxa_get_bb_swing(rtwdev, rtwdev->hal.current_band_type, -+ RF_PATH_A); -+ -+ for (i = 0; i < ARRAY_SIZE(rtw88xxa_txscale_tbl); i++) { -+ table_value = rtw88xxa_txscale_tbl[i]; -+ if (swing == table_value) -+ return i; -+ } -+ -+ return 24; -+} -+ -+static void rtw88xxa_pwrtrack_init(struct rtw_dev *rtwdev) -+{ -+ struct rtw_dm_info *dm_info = &rtwdev->dm_info; -+ u8 path; -+ -+ dm_info->default_ofdm_index = rtw88xxa_get_swing_index(rtwdev); -+ -+ if (rtwdev->chip->id == RTW_CHIP_TYPE_8821A) -+ dm_info->default_cck_index = 0; -+ else -+ dm_info->default_cck_index = 24; -+ -+ for (path = RF_PATH_A; path < rtwdev->hal.rf_path_num; path++) { -+ ewma_thermal_init(&dm_info->avg_thermal[path]); -+ dm_info->delta_power_index[path] = 0; -+ dm_info->delta_power_index_last[path] = 0; -+ } -+ -+ dm_info->pwr_trk_triggered = false; -+ dm_info->pwr_trk_init_trigger = true; -+ dm_info->thermal_meter_k = rtwdev->efuse.thermal_meter_k; -+} -+ -+void rtw88xxa_power_off(struct rtw_dev *rtwdev, -+ const struct rtw_pwr_seq_cmd *const *enter_lps_flow) -+{ -+ struct rtw_usb *rtwusb = rtw_get_usb_priv(rtwdev); -+ enum usb_device_speed speed = rtwusb->udev->speed; -+ u16 ori_fsmc0; -+ u8 reg_cr; -+ -+ reg_cr = rtw_read8(rtwdev, REG_CR); -+ -+ /* Already powered off */ -+ if (reg_cr == 0 || reg_cr == 0xEA) -+ return; -+ -+ rtw_hci_stop(rtwdev); -+ -+ if (!rtwdev->efuse.btcoex) -+ rtw_write16_clr(rtwdev, REG_GPIO_MUXCFG, BIT_EN_SIC); -+ -+ /* set Reg 0xf008[3:4] to 2'11 to enable U1/U2 Mode in USB3.0. */ -+ if (speed == USB_SPEED_SUPER) -+ rtw_write8_set(rtwdev, REG_USB_MOD, 0x18); -+ -+ rtw_write32(rtwdev, REG_HISR0, 0xffffffff); -+ rtw_write32(rtwdev, REG_HISR1, 0xffffffff); -+ rtw_write32(rtwdev, REG_HIMR0, 0); -+ rtw_write32(rtwdev, REG_HIMR1, 0); -+ -+ if (rtwdev->efuse.btcoex) -+ rtw_coex_power_off_setting(rtwdev); -+ -+ ori_fsmc0 = rtw_read16(rtwdev, REG_APS_FSMCO); -+ rtw_write16(rtwdev, REG_APS_FSMCO, ori_fsmc0 & ~APS_FSMCO_HW_POWERDOWN); -+ -+ /* Stop Tx Report Timer. */ -+ rtw_write8_clr(rtwdev, REG_TX_RPT_CTRL, BIT(1)); -+ -+ /* Stop Rx */ -+ rtw_write8(rtwdev, REG_CR, 0); -+ -+ rtw_pwr_seq_parser(rtwdev, enter_lps_flow); -+ -+ if (rtw_read8(rtwdev, REG_MCUFW_CTRL) & BIT_RAM_DL_SEL) -+ rtw88xxa_reset_8051(rtwdev); -+ -+ rtw_write8_clr(rtwdev, REG_SYS_FUNC_EN + 1, BIT(2)); -+ rtw_write8(rtwdev, REG_MCUFW_CTRL, 0); -+ -+ rtw_pwr_seq_parser(rtwdev, rtwdev->chip->pwr_off_seq); -+ -+ if (ori_fsmc0 & APS_FSMCO_HW_POWERDOWN) -+ rtw_write16_set(rtwdev, REG_APS_FSMCO, APS_FSMCO_HW_POWERDOWN); -+ -+ clear_bit(RTW_FLAG_POWERON, rtwdev->flags); -+} -+EXPORT_SYMBOL(rtw88xxa_power_off); -+ -+static void rtw88xxa_set_channel_bb_swing(struct rtw_dev *rtwdev, u8 band) -+{ -+ rtw_write32_mask(rtwdev, REG_TXSCALE_A, BB_SWING_MASK, -+ rtw88xxa_get_bb_swing(rtwdev, band, RF_PATH_A)); -+ rtw_write32_mask(rtwdev, REG_TXSCALE_B, BB_SWING_MASK, -+ rtw88xxa_get_bb_swing(rtwdev, band, RF_PATH_B)); -+ rtw88xxa_pwrtrack_init(rtwdev); -+} -+ -+static void rtw8821a_set_ext_band_switch(struct rtw_dev *rtwdev, u8 band) -+{ -+ rtw_write32_mask(rtwdev, REG_LED_CFG, BIT_DPDT_SEL_EN, 0); -+ rtw_write32_mask(rtwdev, REG_LED_CFG, BIT_DPDT_WL_SEL, 1); -+ rtw_write32_mask(rtwdev, REG_RFE_INV_A, 0xf, 7); -+ rtw_write32_mask(rtwdev, REG_RFE_INV_A, 0xf0, 7); -+ -+ if (band == RTW_BAND_2G) -+ rtw_write32_mask(rtwdev, REG_RFE_INV_A, BIT(29) | BIT(28), 1); -+ else -+ rtw_write32_mask(rtwdev, REG_RFE_INV_A, BIT(29) | BIT(28), 2); -+} -+ -+static void rtw8821a_phy_set_rfe_reg_24g(struct rtw_dev *rtwdev) -+{ -+ struct rtw_efuse *efuse = &rtwdev->efuse; -+ -+ /* Turn off RF PA and LNA */ -+ -+ /* 0xCB0[15:12] = 0x7 (LNA_On)*/ -+ rtw_write32_mask(rtwdev, REG_RFE_PINMUX_A, 0xF000, 0x7); -+ /* 0xCB0[7:4] = 0x7 (PAPE_A)*/ -+ rtw_write32_mask(rtwdev, REG_RFE_PINMUX_A, 0xF0, 0x7); -+ -+ if (efuse->ext_lna_2g) { -+ /* Turn on 2.4G External LNA */ -+ rtw_write32_mask(rtwdev, REG_RFE_INV_A, BIT(20), 1); -+ rtw_write32_mask(rtwdev, REG_RFE_INV_A, BIT(22), 0); -+ rtw_write32_mask(rtwdev, REG_RFE_PINMUX_A, GENMASK(2, 0), 0x2); -+ rtw_write32_mask(rtwdev, REG_RFE_PINMUX_A, GENMASK(10, 8), 0x2); -+ } else { -+ /* Bypass 2.4G External LNA */ -+ rtw_write32_mask(rtwdev, REG_RFE_INV_A, BIT(20), 0); -+ rtw_write32_mask(rtwdev, REG_RFE_INV_A, BIT(22), 0); -+ rtw_write32_mask(rtwdev, REG_RFE_PINMUX_A, GENMASK(2, 0), 0x7); -+ rtw_write32_mask(rtwdev, REG_RFE_PINMUX_A, GENMASK(10, 8), 0x7); -+ } -+} -+ -+static void rtw8821a_phy_set_rfe_reg_5g(struct rtw_dev *rtwdev) -+{ -+ /* Turn ON RF PA and LNA */ -+ -+ /* 0xCB0[15:12] = 0x7 (LNA_On)*/ -+ rtw_write32_mask(rtwdev, REG_RFE_PINMUX_A, 0xF000, 0x5); -+ /* 0xCB0[7:4] = 0x7 (PAPE_A)*/ -+ rtw_write32_mask(rtwdev, REG_RFE_PINMUX_A, 0xF0, 0x4); -+ -+ /* Bypass 2.4G External LNA */ -+ rtw_write32_mask(rtwdev, REG_RFE_INV_A, BIT(20), 0); -+ rtw_write32_mask(rtwdev, REG_RFE_INV_A, BIT(22), 0); -+ rtw_write32_mask(rtwdev, REG_RFE_PINMUX_A, GENMASK(2, 0), 0x7); -+ rtw_write32_mask(rtwdev, REG_RFE_PINMUX_A, GENMASK(10, 8), 0x7); -+} -+ -+static void rtw8812a_phy_set_rfe_reg_24g(struct rtw_dev *rtwdev) -+{ -+ switch (rtwdev->efuse.rfe_option) { -+ case 0: -+ case 2: -+ rtw_write32(rtwdev, REG_RFE_PINMUX_A, 0x77777777); -+ rtw_write32(rtwdev, REG_RFE_PINMUX_B, 0x77777777); -+ rtw_write32_mask(rtwdev, REG_RFE_INV_A, RFE_INV_MASK, 0x000); -+ rtw_write32_mask(rtwdev, REG_RFE_INV_B, RFE_INV_MASK, 0x000); -+ break; -+ case 1: -+ if (rtwdev->efuse.btcoex) { -+ rtw_write32_mask(rtwdev, REG_RFE_PINMUX_A, 0xffffff, 0x777777); -+ rtw_write32(rtwdev, REG_RFE_PINMUX_B, 0x77777777); -+ rtw_write32_mask(rtwdev, REG_RFE_INV_A, 0x33f00000, 0x000); -+ rtw_write32_mask(rtwdev, REG_RFE_INV_B, RFE_INV_MASK, 0x000); -+ } else { -+ rtw_write32(rtwdev, REG_RFE_PINMUX_A, 0x77777777); -+ rtw_write32(rtwdev, REG_RFE_PINMUX_B, 0x77777777); -+ rtw_write32_mask(rtwdev, REG_RFE_INV_A, RFE_INV_MASK, 0x000); -+ rtw_write32_mask(rtwdev, REG_RFE_INV_B, RFE_INV_MASK, 0x000); -+ } -+ break; -+ case 3: -+ rtw_write32(rtwdev, REG_RFE_PINMUX_A, 0x54337770); -+ rtw_write32(rtwdev, REG_RFE_PINMUX_B, 0x54337770); -+ rtw_write32_mask(rtwdev, REG_RFE_INV_A, RFE_INV_MASK, 0x010); -+ rtw_write32_mask(rtwdev, REG_RFE_INV_B, RFE_INV_MASK, 0x010); -+ rtw_write32_mask(rtwdev, REG_ANTSEL_SW, 0x00000303, 0x1); -+ break; -+ case 4: -+ rtw_write32(rtwdev, REG_RFE_PINMUX_A, 0x77777777); -+ rtw_write32(rtwdev, REG_RFE_PINMUX_B, 0x77777777); -+ rtw_write32_mask(rtwdev, REG_RFE_INV_A, RFE_INV_MASK, 0x001); -+ rtw_write32_mask(rtwdev, REG_RFE_INV_B, RFE_INV_MASK, 0x001); -+ break; -+ case 5: -+ rtw_write8(rtwdev, REG_RFE_PINMUX_A + 2, 0x77); -+ rtw_write32(rtwdev, REG_RFE_PINMUX_B, 0x77777777); -+ rtw_write8_clr(rtwdev, REG_RFE_INV_A + 3, BIT(0)); -+ rtw_write32_mask(rtwdev, REG_RFE_INV_B, RFE_INV_MASK, 0x000); -+ break; -+ case 6: -+ rtw_write32(rtwdev, REG_RFE_PINMUX_A, 0x07772770); -+ rtw_write32(rtwdev, REG_RFE_PINMUX_B, 0x07772770); -+ rtw_write32(rtwdev, REG_RFE_INV_A, 0x00000077); -+ rtw_write32(rtwdev, REG_RFE_INV_B, 0x00000077); -+ break; -+ default: -+ break; -+ } -+} -+ -+static void rtw8812a_phy_set_rfe_reg_5g(struct rtw_dev *rtwdev) -+{ -+ switch (rtwdev->efuse.rfe_option) { -+ case 0: -+ rtw_write32(rtwdev, REG_RFE_PINMUX_A, 0x77337717); -+ rtw_write32(rtwdev, REG_RFE_PINMUX_B, 0x77337717); -+ rtw_write32_mask(rtwdev, REG_RFE_INV_A, RFE_INV_MASK, 0x010); -+ rtw_write32_mask(rtwdev, REG_RFE_INV_B, RFE_INV_MASK, 0x010); -+ break; -+ case 1: -+ if (rtwdev->efuse.btcoex) { -+ rtw_write32_mask(rtwdev, REG_RFE_PINMUX_A, 0xffffff, 0x337717); -+ rtw_write32(rtwdev, REG_RFE_PINMUX_B, 0x77337717); -+ rtw_write32_mask(rtwdev, REG_RFE_INV_A, 0x33f00000, 0x000); -+ rtw_write32_mask(rtwdev, REG_RFE_INV_B, RFE_INV_MASK, 0x000); -+ } else { -+ rtw_write32(rtwdev, REG_RFE_PINMUX_A, 0x77337717); -+ rtw_write32(rtwdev, REG_RFE_PINMUX_B, 0x77337717); -+ rtw_write32_mask(rtwdev, REG_RFE_INV_A, RFE_INV_MASK, 0x000); -+ rtw_write32_mask(rtwdev, REG_RFE_INV_B, RFE_INV_MASK, 0x000); -+ } -+ break; -+ case 2: -+ case 4: -+ rtw_write32(rtwdev, REG_RFE_PINMUX_A, 0x77337777); -+ rtw_write32(rtwdev, REG_RFE_PINMUX_B, 0x77337777); -+ rtw_write32_mask(rtwdev, REG_RFE_INV_A, RFE_INV_MASK, 0x010); -+ rtw_write32_mask(rtwdev, REG_RFE_INV_B, RFE_INV_MASK, 0x010); -+ break; -+ case 3: -+ rtw_write32(rtwdev, REG_RFE_PINMUX_A, 0x54337717); -+ rtw_write32(rtwdev, REG_RFE_PINMUX_B, 0x54337717); -+ rtw_write32_mask(rtwdev, REG_RFE_INV_A, RFE_INV_MASK, 0x010); -+ rtw_write32_mask(rtwdev, REG_RFE_INV_B, RFE_INV_MASK, 0x010); -+ rtw_write32_mask(rtwdev, REG_ANTSEL_SW, 0x00000303, 0x1); -+ break; -+ case 5: -+ rtw_write8(rtwdev, REG_RFE_PINMUX_A + 2, 0x33); -+ rtw_write32(rtwdev, REG_RFE_PINMUX_B, 0x77337777); -+ rtw_write8_set(rtwdev, REG_RFE_INV_A + 3, BIT(0)); -+ rtw_write32_mask(rtwdev, REG_RFE_INV_B, RFE_INV_MASK, 0x010); -+ break; -+ case 6: -+ rtw_write32(rtwdev, REG_RFE_PINMUX_A, 0x07737717); -+ rtw_write32(rtwdev, REG_RFE_PINMUX_B, 0x07737717); -+ rtw_write32(rtwdev, REG_RFE_INV_A, 0x00000077); -+ rtw_write32(rtwdev, REG_RFE_INV_B, 0x00000077); -+ break; -+ default: -+ break; -+ } -+} -+ -+static void rtw88xxa_switch_band(struct rtw_dev *rtwdev, u8 new_band, u8 bw) -+{ -+ const struct rtw_chip_info *chip = rtwdev->chip; -+ u16 basic_rates, reg_41a; -+ -+ /* 8811au one antenna module doesn't support antenna div, so driver must -+ * control antenna band, otherwise one of the band will have issue -+ */ -+ if (chip->id == RTW_CHIP_TYPE_8821A && !rtwdev->efuse.btcoex && -+ rtwdev->efuse.ant_div_cfg == 0) -+ rtw8821a_set_ext_band_switch(rtwdev, new_band); -+ -+ if (new_band == RTW_BAND_2G) { -+ rtw_write32_set(rtwdev, REG_RXPSEL, BIT_RX_PSEL_RST); -+ -+ if (chip->id == RTW_CHIP_TYPE_8821A) { -+ rtw8821a_phy_set_rfe_reg_24g(rtwdev); -+ -+ rtw_write32_mask(rtwdev, REG_TXSCALE_A, 0xf00, 0); -+ } else { -+ rtw_write32_mask(rtwdev, REG_BWINDICATION, 0x3, 0x1); -+ rtw_write32_mask(rtwdev, REG_PDMFTH, GENMASK(17, 13), 0x17); -+ -+ if (bw == RTW_CHANNEL_WIDTH_20 && -+ rtwdev->hal.rf_type == RF_1T1R && -+ !rtwdev->efuse.ext_lna_2g) -+ rtw_write32_mask(rtwdev, REG_PDMFTH, GENMASK(3, 1), 0x02); -+ else -+ rtw_write32_mask(rtwdev, REG_PDMFTH, GENMASK(3, 1), 0x04); -+ -+ rtw_write32_mask(rtwdev, REG_CCASEL, 0x3, 0); -+ -+ rtw8812a_phy_set_rfe_reg_24g(rtwdev); -+ } -+ -+ rtw_write32_mask(rtwdev, REG_TXPSEL, 0xf0, 0x1); -+ rtw_write32_mask(rtwdev, REG_CCK_RX, 0x0f000000, 0x1); -+ -+ basic_rates = BIT(DESC_RATE1M) | BIT(DESC_RATE2M) | -+ BIT(DESC_RATE5_5M) | BIT(DESC_RATE11M) | -+ BIT(DESC_RATE6M) | BIT(DESC_RATE12M) | -+ BIT(DESC_RATE24M); -+ rtw_write32_mask(rtwdev, REG_RRSR, 0xfffff, basic_rates); -+ -+ rtw_write8_clr(rtwdev, REG_CCK_CHECK, BIT_CHECK_CCK_EN); -+ } else { /* RTW_BAND_5G */ -+ if (chip->id == RTW_CHIP_TYPE_8821A) -+ rtw8821a_phy_set_rfe_reg_5g(rtwdev); -+ -+ rtw_write8_set(rtwdev, REG_CCK_CHECK, BIT_CHECK_CCK_EN); -+ -+ read_poll_timeout_atomic(rtw_read16, reg_41a, (reg_41a & 0x30) == 0x30, -+ 50, 2500, false, rtwdev, REG_TXPKT_EMPTY); -+ -+ rtw_write32_set(rtwdev, REG_RXPSEL, BIT_RX_PSEL_RST); -+ -+ if (chip->id == RTW_CHIP_TYPE_8821A) { -+ rtw_write32_mask(rtwdev, REG_TXSCALE_A, 0xf00, 1); -+ } else { -+ rtw_write32_mask(rtwdev, REG_BWINDICATION, 0x3, 0x2); -+ rtw_write32_mask(rtwdev, REG_PDMFTH, GENMASK(17, 13), 0x15); -+ rtw_write32_mask(rtwdev, REG_PDMFTH, GENMASK(3, 1), 0x04); -+ -+ rtw_write32_mask(rtwdev, REG_CCASEL, 0x3, 1); -+ -+ rtw8812a_phy_set_rfe_reg_5g(rtwdev); -+ } -+ -+ rtw_write32_mask(rtwdev, REG_TXPSEL, 0xf0, 0); -+ rtw_write32_mask(rtwdev, REG_CCK_RX, 0x0f000000, 0xf); -+ -+ basic_rates = BIT(DESC_RATE6M) | BIT(DESC_RATE12M) | -+ BIT(DESC_RATE24M); -+ rtw_write32_mask(rtwdev, REG_RRSR, 0xfffff, basic_rates); -+ } -+ -+ rtw88xxa_set_channel_bb_swing(rtwdev, new_band); -+} -+ -+int rtw88xxa_power_on(struct rtw_dev *rtwdev) -+{ -+ struct rtw_usb *rtwusb = rtw_get_usb_priv(rtwdev); -+ const struct rtw_chip_info *chip = rtwdev->chip; -+ struct rtw_efuse *efuse = &rtwdev->efuse; -+ struct rtw_hal *hal = &rtwdev->hal; -+ int ret; -+ -+ if (test_bit(RTW_FLAG_POWERON, rtwdev->flags)) -+ return 0; -+ -+ /* Override rtw_chip_efuse_info_setup() */ -+ if (chip->id == RTW_CHIP_TYPE_8821A) -+ efuse->btcoex = rtw_read32_mask(rtwdev, REG_WL_BT_PWR_CTRL, -+ BIT_BT_FUNC_EN); -+ -+ /* Override rtw_chip_efuse_info_setup() */ -+ if (chip->id == RTW_CHIP_TYPE_8812A) -+ rtw8812a_read_amplifier_type(rtwdev); -+ -+ ret = rtw_hci_setup(rtwdev); -+ if (ret) { -+ rtw_err(rtwdev, "failed to setup hci\n"); -+ goto err; -+ } -+ -+ /* Revise for U2/U3 switch we can not update RF-A/B reset. -+ * Reset after MAC power on to prevent RF R/W error. -+ * Is it a right method? -+ */ -+ if (chip->id == RTW_CHIP_TYPE_8812A) { -+ rtw_write8(rtwdev, REG_RF_CTRL, 5); -+ rtw_write8(rtwdev, REG_RF_CTRL, 7); -+ rtw_write8(rtwdev, REG_RF_B_CTRL, 5); -+ rtw_write8(rtwdev, REG_RF_B_CTRL, 7); -+ } -+ -+ /* If HW didn't go through a complete de-initial procedure, -+ * it probably occurs some problem for double initial -+ * procedure. -+ */ -+ rtw88xxau_hw_reset(rtwdev); -+ -+ ret = rtw88xxau_init_power_on(rtwdev); -+ if (ret) { -+ rtw_err(rtwdev, "failed to power on\n"); -+ goto err; -+ } -+ -+ ret = rtw_set_trx_fifo_info(rtwdev); -+ if (ret) { -+ rtw_err(rtwdev, "failed to set trx fifo info\n"); -+ goto err; -+ } -+ -+ ret = rtw88xxa_llt_init(rtwdev, rtwdev->fifo.rsvd_boundary); -+ if (ret) { -+ rtw_err(rtwdev, "failed to init llt\n"); -+ goto err; -+ } -+ -+ rtw_write32_set(rtwdev, REG_TXDMA_OFFSET_CHK, BIT_DROP_DATA_EN); -+ -+ ret = rtw_wait_firmware_completion(rtwdev); -+ if (ret) { -+ rtw_err(rtwdev, "failed to wait firmware completion\n"); -+ goto err_off; -+ } -+ -+ ret = rtw_download_firmware(rtwdev, &rtwdev->fw); -+ if (ret) { -+ rtw_err(rtwdev, "failed to download firmware\n"); -+ goto err_off; -+ } -+ -+ rtw_write8(rtwdev, REG_HMETFR, 0xf); -+ -+ rtw_load_table(rtwdev, chip->mac_tbl); -+ -+ rtw88xxau_init_queue_reserved_page(rtwdev); -+ rtw88xxau_init_tx_buffer_boundary(rtwdev); -+ rtw88xxau_init_queue_priority(rtwdev); -+ -+ rtw_write16(rtwdev, REG_TRXFF_BNDY + 2, -+ chip->rxff_size - REPORT_BUF - 1); -+ -+ if (chip->id == RTW_CHIP_TYPE_8812A) -+ rtw_write8(rtwdev, REG_PBP, -+ u8_encode_bits(PBP_512, PBP_TX_MASK) | -+ u8_encode_bits(PBP_64, PBP_RX_MASK)); -+ -+ rtw_write8(rtwdev, REG_RX_DRVINFO_SZ, PHY_STATUS_SIZE); -+ -+ rtw_write32(rtwdev, REG_HIMR0, 0); -+ rtw_write32(rtwdev, REG_HIMR1, 0); -+ -+ rtw_write32_mask(rtwdev, REG_CR, 0x30000, 0x2); -+ -+ rtw88xxa_init_wmac_setting(rtwdev); -+ rtw88xxa_init_adaptive_ctrl(rtwdev); -+ rtw88xxa_init_edca(rtwdev); -+ -+ rtw_write8_set(rtwdev, REG_FWHW_TXQ_CTRL, BIT(7)); -+ rtw_write8(rtwdev, REG_ACKTO, 0x80); -+ -+ rtw88xxau_tx_aggregation(rtwdev); -+ -+ rtw88xxa_init_beacon_parameters(rtwdev); -+ rtw_write8(rtwdev, REG_BCN_MAX_ERR, 0xff); -+ -+ rtw_hci_interface_cfg(rtwdev); -+ -+ /* usb3 rx interval */ -+ rtw_write8(rtwdev, REG_USB3_RXITV, 0x01); -+ -+ /* burst length=4, set 0x3400 for burst length=2 */ -+ rtw_write16(rtwdev, REG_RXDMA_STATUS, 0x7400); -+ rtw_write8(rtwdev, REG_RXDMA_STATUS + 1, 0xf5); -+ -+ /* 0x456 = 0x70, sugguested by Zhilin */ -+ if (chip->id == RTW_CHIP_TYPE_8821A) -+ rtw_write8(rtwdev, REG_AMPDU_MAX_TIME, 0x5e); -+ else -+ rtw_write8(rtwdev, REG_AMPDU_MAX_TIME, 0x70); -+ -+ rtw_write32(rtwdev, REG_AMPDU_MAX_LENGTH, 0xffffffff); -+ rtw_write8(rtwdev, REG_USTIME_TSF, 0x50); -+ rtw_write8(rtwdev, REG_USTIME_EDCA, 0x50); -+ -+ if (rtwusb->udev->speed == USB_SPEED_SUPER) -+ /* Disable U1/U2 Mode to avoid 2.5G spur in USB3.0. */ -+ rtw_write8_clr(rtwdev, REG_USB_MOD, BIT(4) | BIT(3)); -+ -+ rtw_write8_set(rtwdev, REG_SINGLE_AMPDU_CTRL, BIT_EN_SINGLE_APMDU); -+ -+ /* for VHT packet length 11K */ -+ rtw_write8(rtwdev, REG_RX_PKT_LIMIT, 0x18); -+ -+ rtw_write8(rtwdev, REG_PIFS, 0x00); -+ -+ if (chip->id == RTW_CHIP_TYPE_8821A) { -+ /* 0x0a0a too small, it can't pass AC logo. change to 0x1f1f */ -+ rtw_write16(rtwdev, REG_MAX_AGGR_NUM, 0x1f1f); -+ rtw_write8(rtwdev, REG_FWHW_TXQ_CTRL, 0x80); -+ rtw_write32(rtwdev, REG_FAST_EDCA_CTRL, 0x03087777); -+ } else { -+ rtw_write16(rtwdev, REG_MAX_AGGR_NUM, 0x1f1f); -+ rtw_write8_clr(rtwdev, REG_FWHW_TXQ_CTRL, BIT(7)); -+ } -+ -+ /* to prevent mac is reseted by bus. */ -+ rtw_write8_set(rtwdev, REG_RSV_CTRL, BIT(5) | BIT(6)); -+ -+ /* ARFB table 9 for 11ac 5G 2SS */ -+ rtw_write32(rtwdev, REG_ARFR0, 0x00000010); -+ rtw_write32(rtwdev, REG_ARFRH0, 0xfffff000); -+ -+ /* ARFB table 10 for 11ac 5G 1SS */ -+ rtw_write32(rtwdev, REG_ARFR1_V1, 0x00000010); -+ rtw_write32(rtwdev, REG_ARFRH1_V1, 0x003ff000); -+ -+ /* ARFB table 11 for 11ac 24G 1SS */ -+ rtw_write32(rtwdev, REG_ARFR2_V1, 0x00000015); -+ rtw_write32(rtwdev, REG_ARFRH2_V1, 0x003ff000); -+ -+ /* ARFB table 12 for 11ac 24G 2SS */ -+ rtw_write32(rtwdev, REG_ARFR3_V1, 0x00000015); -+ rtw_write32(rtwdev, REG_ARFRH3_V1, 0xffcff000); -+ -+ rtw_write8_set(rtwdev, REG_CR, BIT_MACTXEN | BIT_MACRXEN); -+ -+ rtw88xxa_phy_bb_config(rtwdev); -+ rtw88xxa_phy_rf_config(rtwdev); -+ -+ if (chip->id == RTW_CHIP_TYPE_8812A && hal->rf_path_num == 1) -+ rtw8812a_config_1t(rtwdev); -+ -+ rtw88xxa_switch_band(rtwdev, RTW_BAND_2G, RTW_CHANNEL_WIDTH_20); -+ -+ rtw_write32(rtwdev, RTW_SEC_CMD_REG, BIT(31) | BIT(30)); -+ -+ rtw_write8(rtwdev, REG_HWSEQ_CTRL, 0xff); -+ rtw_write32(rtwdev, REG_BAR_MODE_CTRL, 0x0201ffff); -+ rtw_write8(rtwdev, REG_NAV_CTRL + 2, 0); -+ -+ rtw_write8_clr(rtwdev, REG_GPIO_MUXCFG, BIT(5)); -+ -+ rtw_phy_init(rtwdev); -+ -+ rtw88xxa_pwrtrack_init(rtwdev); -+ -+ /* 0x4c6[3] 1: RTS BW = Data BW -+ * 0: RTS BW depends on CCA / secondary CCA result. -+ */ -+ rtw_write8_clr(rtwdev, REG_QUEUE_CTRL, BIT(3)); -+ -+ /* enable Tx report. */ -+ rtw_write8(rtwdev, REG_FWHW_TXQ_CTRL + 1, 0x0f); -+ -+ /* Pretx_en, for WEP/TKIP SEC */ -+ rtw_write8(rtwdev, REG_EARLY_MODE_CONTROL + 3, 0x01); -+ -+ rtw_write16(rtwdev, REG_TX_RPT_TIME, 0x3df0); -+ -+ /* Reset USB mode switch setting */ -+ rtw_write8(rtwdev, REG_SYS_SDIO_CTRL, 0x0); -+ rtw_write8(rtwdev, REG_ACLK_MON, 0x0); -+ -+ rtw_write8(rtwdev, REG_USB_HRPWM, 0); -+ -+ /* ack for xmit mgmt frames. */ -+ rtw_write32_set(rtwdev, REG_FWHW_TXQ_CTRL, BIT(12)); -+ -+ hal->cck_high_power = rtw_read32_mask(rtwdev, REG_CCK_RPT_FORMAT, -+ BIT_CCK_RPT_FORMAT); -+ -+ ret = rtw_hci_start(rtwdev); -+ if (ret) { -+ rtw_err(rtwdev, "failed to start hci\n"); -+ goto err_off; -+ } -+ -+ if (efuse->btcoex) { -+ rtw_coex_power_on_setting(rtwdev); -+ rtw_coex_init_hw_config(rtwdev, false); -+ } -+ -+ set_bit(RTW_FLAG_POWERON, rtwdev->flags); -+ -+ return 0; -+ -+err_off: -+ chip->ops->power_off(rtwdev); -+ -+err: -+ return ret; -+} -+EXPORT_SYMBOL(rtw88xxa_power_on); -+ -+u32 rtw88xxa_phy_read_rf(struct rtw_dev *rtwdev, -+ enum rtw_rf_path rf_path, u32 addr, u32 mask) -+{ -+ static const u32 pi_addr[2] = { REG_3WIRE_SWA, REG_3WIRE_SWB }; -+ static const u32 read_addr[2][2] = { -+ { REG_SI_READ_A, REG_SI_READ_B }, -+ { REG_PI_READ_A, REG_PI_READ_B } -+ }; -+ const struct rtw_chip_info *chip = rtwdev->chip; -+ const struct rtw_hal *hal = &rtwdev->hal; -+ bool set_cca, pi_mode; -+ u32 val; -+ -+ if (rf_path >= hal->rf_phy_num) { -+ rtw_err(rtwdev, "unsupported rf path (%d)\n", rf_path); -+ return INV_RF_DATA; -+ } -+ -+ /* CCA off to avoid reading the wrong value. -+ * Toggling CCA would affect RF 0x0, skip it. -+ */ -+ set_cca = addr != 0x0 && chip->id == RTW_CHIP_TYPE_8812A && -+ hal->cut_version != RTW_CHIP_VER_CUT_C; -+ -+ if (set_cca) -+ rtw_write32_set(rtwdev, REG_CCA2ND, BIT(3)); -+ -+ addr &= 0xff; -+ -+ pi_mode = rtw_read32_mask(rtwdev, pi_addr[rf_path], 0x4); -+ -+ rtw_write32_mask(rtwdev, REG_HSSI_READ, MASKBYTE0, addr); -+ -+ if (chip->id == RTW_CHIP_TYPE_8821A || -+ hal->cut_version == RTW_CHIP_VER_CUT_C) -+ udelay(20); -+ -+ val = rtw_read32_mask(rtwdev, read_addr[pi_mode][rf_path], mask); -+ -+ /* CCA on */ -+ if (set_cca) -+ rtw_write32_clr(rtwdev, REG_CCA2ND, BIT(3)); -+ -+ return val; -+} -+EXPORT_SYMBOL(rtw88xxa_phy_read_rf); -+ -+static void rtw8812a_phy_fix_spur(struct rtw_dev *rtwdev, u8 channel, u8 bw) -+{ -+ /* C cut Item12 ADC FIFO CLOCK */ -+ if (rtwdev->hal.cut_version == RTW_CHIP_VER_CUT_C) { -+ if (bw == RTW_CHANNEL_WIDTH_40 && channel == 11) -+ rtw_write32_mask(rtwdev, REG_ADCCLK, 0xC00, 0x3); -+ else -+ rtw_write32_mask(rtwdev, REG_ADCCLK, 0xC00, 0x2); -+ -+ /* A workaround to resolve 2480Mhz spur by setting ADC clock -+ * as 160M. -+ */ -+ if (bw == RTW_CHANNEL_WIDTH_20 && (channel == 13 || channel == 14)) { -+ rtw_write32_mask(rtwdev, REG_ADCCLK, 0x300, 0x3); -+ rtw_write32_mask(rtwdev, REG_ADC160, BIT(30), 1); -+ } else if (bw == RTW_CHANNEL_WIDTH_40 && channel == 11) { -+ rtw_write32_mask(rtwdev, REG_ADC160, BIT(30), 1); -+ } else if (bw != RTW_CHANNEL_WIDTH_80) { -+ rtw_write32_mask(rtwdev, REG_ADCCLK, 0x300, 0x2); -+ rtw_write32_mask(rtwdev, REG_ADC160, BIT(30), 0); -+ } -+ } else { -+ /* A workaround to resolve 2480Mhz spur by setting ADC clock -+ * as 160M. -+ */ -+ if (bw == RTW_CHANNEL_WIDTH_20 && (channel == 13 || channel == 14)) -+ rtw_write32_mask(rtwdev, REG_ADCCLK, 0x300, 0x3); -+ else if (channel <= 14) /* 2.4G only */ -+ rtw_write32_mask(rtwdev, REG_ADCCLK, 0x300, 0x2); -+ } -+} -+ -+static void rtw88xxa_switch_channel(struct rtw_dev *rtwdev, u8 channel, u8 bw) -+{ -+ struct rtw_hal *hal = &rtwdev->hal; -+ u32 fc_area, rf_mod_ag; -+ u8 path; -+ -+ switch (channel) { -+ case 36 ... 48: -+ fc_area = 0x494; -+ break; -+ case 50 ... 64: -+ fc_area = 0x453; -+ break; -+ case 100 ... 116: -+ fc_area = 0x452; -+ break; -+ default: -+ if (channel >= 118) -+ fc_area = 0x412; -+ else -+ fc_area = 0x96a; -+ break; -+ } -+ -+ rtw_write32_mask(rtwdev, REG_CLKTRK, 0x1ffe0000, fc_area); -+ -+ for (path = 0; path < hal->rf_path_num; path++) { -+ switch (channel) { -+ case 36 ... 64: -+ rf_mod_ag = 0x101; -+ break; -+ case 100 ... 140: -+ rf_mod_ag = 0x301; -+ break; -+ default: -+ if (channel > 140) -+ rf_mod_ag = 0x501; -+ else -+ rf_mod_ag = 0x000; -+ break; -+ } -+ -+ rtw_write_rf(rtwdev, path, RF_CFGCH, -+ RF18_RFSI_MASK | RF18_BAND_MASK, rf_mod_ag); -+ -+ if (rtwdev->chip->id == RTW_CHIP_TYPE_8812A) -+ rtw8812a_phy_fix_spur(rtwdev, channel, bw); -+ -+ rtw_write_rf(rtwdev, path, RF_CFGCH, RF18_CHANNEL_MASK, channel); -+ } -+} -+ -+static void rtw88xxa_set_reg_bw(struct rtw_dev *rtwdev, u8 bw) -+{ -+ u16 val16 = rtw_read16(rtwdev, REG_WMAC_TRXPTCL_CTL); -+ -+ val16 &= ~BIT_RFMOD; -+ if (bw == RTW_CHANNEL_WIDTH_80) -+ val16 |= BIT_RFMOD_80M; -+ else if (bw == RTW_CHANNEL_WIDTH_40) -+ val16 |= BIT_RFMOD_40M; -+ -+ rtw_write16(rtwdev, REG_WMAC_TRXPTCL_CTL, val16); -+} -+ -+static void rtw88xxa_post_set_bw_mode(struct rtw_dev *rtwdev, u8 channel, -+ u8 bw, u8 primary_chan_idx) -+{ -+ struct rtw_hal *hal = &rtwdev->hal; -+ u8 txsc40 = 0, txsc20, txsc; -+ u8 reg_837, l1pkval; -+ -+ rtw88xxa_set_reg_bw(rtwdev, bw); -+ -+ txsc20 = primary_chan_idx; -+ if (bw == RTW_CHANNEL_WIDTH_80) { -+ if (txsc20 == RTW_SC_20_UPPER || txsc20 == RTW_SC_20_UPMOST) -+ txsc40 = RTW_SC_40_UPPER; -+ else -+ txsc40 = RTW_SC_40_LOWER; -+ } -+ -+ txsc = BIT_TXSC_20M(txsc20) | BIT_TXSC_40M(txsc40); -+ rtw_write8(rtwdev, REG_DATA_SC, txsc); -+ -+ reg_837 = rtw_read8(rtwdev, REG_BWINDICATION + 3); -+ -+ switch (bw) { -+ default: -+ case RTW_CHANNEL_WIDTH_20: -+ rtw_write32_mask(rtwdev, REG_ADCCLK, 0x003003C3, 0x00300200); -+ rtw_write32_mask(rtwdev, REG_ADC160, BIT(30), 0); -+ -+ if (hal->rf_type == RF_2T2R) -+ rtw_write32_mask(rtwdev, REG_L1PKTH, 0x03C00000, 7); -+ else -+ rtw_write32_mask(rtwdev, REG_L1PKTH, 0x03C00000, 8); -+ -+ break; -+ case RTW_CHANNEL_WIDTH_40: -+ rtw_write32_mask(rtwdev, REG_ADCCLK, 0x003003C3, 0x00300201); -+ rtw_write32_mask(rtwdev, REG_ADC160, BIT(30), 0); -+ rtw_write32_mask(rtwdev, REG_ADCCLK, 0x3C, txsc); -+ rtw_write32_mask(rtwdev, REG_CCA2ND, 0xf0000000, txsc); -+ -+ if (reg_837 & BIT(2)) { -+ l1pkval = 6; -+ } else { -+ if (hal->rf_type == RF_2T2R) -+ l1pkval = 7; -+ else -+ l1pkval = 8; -+ } -+ -+ rtw_write32_mask(rtwdev, REG_L1PKTH, 0x03C00000, l1pkval); -+ -+ if (txsc == RTW_SC_20_UPPER) -+ rtw_write32_set(rtwdev, REG_RXSB, BIT(4)); -+ else -+ rtw_write32_clr(rtwdev, REG_RXSB, BIT(4)); -+ -+ break; -+ case RTW_CHANNEL_WIDTH_80: -+ rtw_write32_mask(rtwdev, REG_ADCCLK, 0x003003C3, 0x00300202); -+ rtw_write32_mask(rtwdev, REG_ADC160, BIT(30), 1); -+ rtw_write32_mask(rtwdev, REG_ADCCLK, 0x3C, txsc); -+ rtw_write32_mask(rtwdev, REG_CCA2ND, 0xf0000000, txsc); -+ -+ if (reg_837 & BIT(2)) { -+ l1pkval = 5; -+ } else { -+ if (hal->rf_type == RF_2T2R) -+ l1pkval = 6; -+ else -+ l1pkval = 7; -+ } -+ -+ rtw_write32_mask(rtwdev, REG_L1PKTH, 0x03C00000, l1pkval); -+ -+ break; -+ } -+} -+ -+static void rtw88xxa_set_channel_rf(struct rtw_dev *rtwdev, u8 channel, u8 bw) -+{ -+ u8 path; -+ -+ for (path = RF_PATH_A; path < rtwdev->hal.rf_path_num; path++) { -+ switch (bw) { -+ case RTW_CHANNEL_WIDTH_5: -+ case RTW_CHANNEL_WIDTH_10: -+ case RTW_CHANNEL_WIDTH_20: -+ default: -+ rtw_write_rf(rtwdev, path, RF_CFGCH, RF18_BW_MASK, 3); -+ break; -+ case RTW_CHANNEL_WIDTH_40: -+ rtw_write_rf(rtwdev, path, RF_CFGCH, RF18_BW_MASK, 1); -+ break; -+ case RTW_CHANNEL_WIDTH_80: -+ rtw_write_rf(rtwdev, path, RF_CFGCH, RF18_BW_MASK, 0); -+ break; -+ } -+ } -+} -+ -+void rtw88xxa_set_channel(struct rtw_dev *rtwdev, u8 channel, u8 bw, -+ u8 primary_chan_idx) -+{ -+ u8 old_band, new_band; -+ -+ if (rtw_read8(rtwdev, REG_CCK_CHECK) & BIT_CHECK_CCK_EN) -+ old_band = RTW_BAND_5G; -+ else -+ old_band = RTW_BAND_2G; -+ -+ if (channel > 14) -+ new_band = RTW_BAND_5G; -+ else -+ new_band = RTW_BAND_2G; -+ -+ if (new_band != old_band) -+ rtw88xxa_switch_band(rtwdev, new_band, bw); -+ -+ rtw88xxa_switch_channel(rtwdev, channel, bw); -+ -+ rtw88xxa_post_set_bw_mode(rtwdev, channel, bw, primary_chan_idx); -+ -+ if (rtwdev->chip->id == RTW_CHIP_TYPE_8812A) -+ rtw8812a_phy_fix_spur(rtwdev, channel, bw); -+ -+ rtw88xxa_set_channel_rf(rtwdev, channel, bw); -+} -+EXPORT_SYMBOL(rtw88xxa_set_channel); -+ -+void rtw88xxa_query_phy_status(struct rtw_dev *rtwdev, u8 *phy_status, -+ struct rtw_rx_pkt_stat *pkt_stat, -+ s8 (*cck_rx_pwr)(u8 lna_idx, u8 vga_idx)) -+{ -+ struct rtw_dm_info *dm_info = &rtwdev->dm_info; -+ struct rtw_jaguar_phy_status_rpt *rpt; -+ u8 gain[RTW_RF_PATH_MAX], rssi, i; -+ s8 rx_pwr_db, power_a, power_b; -+ const s8 min_rx_power = -120; -+ u8 lna_idx, vga_idx; -+ -+ rpt = (struct rtw_jaguar_phy_status_rpt *)phy_status; -+ -+ if (pkt_stat->rate <= DESC_RATE11M) { -+ lna_idx = le32_get_bits(rpt->w1, RTW_JGRPHY_W1_AGC_RPT_LNA_IDX); -+ vga_idx = le32_get_bits(rpt->w1, RTW_JGRPHY_W1_AGC_RPT_VGA_IDX); -+ -+ rx_pwr_db = cck_rx_pwr(lna_idx, vga_idx); -+ -+ pkt_stat->rx_power[RF_PATH_A] = rx_pwr_db; -+ pkt_stat->rssi = rtw_phy_rf_power_2_rssi(pkt_stat->rx_power, 1); -+ dm_info->rssi[RF_PATH_A] = pkt_stat->rssi; -+ pkt_stat->bw = RTW_CHANNEL_WIDTH_20; -+ pkt_stat->signal_power = rx_pwr_db; -+ } else { /* OFDM rate */ -+ gain[RF_PATH_A] = le32_get_bits(rpt->w0, RTW_JGRPHY_W0_GAIN_A); -+ gain[RF_PATH_B] = le32_get_bits(rpt->w0, RTW_JGRPHY_W0_GAIN_B); -+ -+ for (i = RF_PATH_A; i < rtwdev->hal.rf_path_num; i++) { -+ pkt_stat->rx_power[i] = gain[i] - 110; -+ rssi = rtw_phy_rf_power_2_rssi(&pkt_stat->rx_power[i], 1); -+ dm_info->rssi[i] = rssi; -+ } -+ -+ pkt_stat->rssi = rtw_phy_rf_power_2_rssi(pkt_stat->rx_power, -+ rtwdev->hal.rf_path_num); -+ -+ power_a = pkt_stat->rx_power[RF_PATH_A]; -+ power_b = pkt_stat->rx_power[RF_PATH_B]; -+ if (rtwdev->hal.rf_path_num == 1) -+ power_b = power_a; -+ -+ pkt_stat->signal_power = max3(power_a, power_b, min_rx_power); -+ } -+} -+EXPORT_SYMBOL(rtw88xxa_query_phy_status); -+ -+static void -+rtw88xxa_set_tx_power_index_by_rate(struct rtw_dev *rtwdev, u8 path, -+ u8 rs, u32 *phy_pwr_idx) -+{ -+ static const u32 offset_txagc[2] = { -+ REG_TX_AGC_A_CCK_11_CCK_1, REG_TX_AGC_B_CCK_11_CCK_1 -+ }; -+ u8 rate, rate_idx, pwr_index, shift; -+ struct rtw_hal *hal = &rtwdev->hal; -+ bool write_1ss_mcs9; -+ u32 mask; -+ int j; -+ -+ for (j = 0; j < rtw_rate_size[rs]; j++) { -+ rate = rtw_rate_section[rs][j]; -+ -+ pwr_index = hal->tx_pwr_tbl[path][rate]; -+ -+ shift = rate & 0x3; -+ *phy_pwr_idx |= ((u32)pwr_index << (shift * 8)); -+ -+ write_1ss_mcs9 = rate == DESC_RATEVHT1SS_MCS9 && -+ hal->rf_path_num == 1; -+ -+ if (write_1ss_mcs9) -+ mask = MASKLWORD; -+ else -+ mask = MASKDWORD; -+ -+ if (shift == 0x3 || write_1ss_mcs9) { -+ rate_idx = rate & 0xfc; -+ if (rate >= DESC_RATEVHT1SS_MCS0) -+ rate_idx -= 0x10; -+ -+ rtw_write32_mask(rtwdev, offset_txagc[path] + rate_idx, -+ mask, *phy_pwr_idx); -+ -+ *phy_pwr_idx = 0; -+ } -+ } -+} -+ -+static void rtw88xxa_tx_power_training(struct rtw_dev *rtwdev, u8 bw, -+ u8 channel, u8 path) -+{ -+ static const u32 write_offset[] = { -+ REG_TX_PWR_TRAINING_A, REG_TX_PWR_TRAINING_B, -+ }; -+ u32 power_level, write_data; -+ u8 i; -+ -+ power_level = rtwdev->hal.tx_pwr_tbl[path][DESC_RATEMCS7]; -+ write_data = 0; -+ -+ for (i = 0; i < 3; i++) { -+ if (i == 0) -+ power_level -= 10; -+ else if (i == 1) -+ power_level -= 8; -+ else -+ power_level -= 6; -+ -+ write_data |= max_t(u32, power_level, 2) << (i * 8); -+ } -+ -+ rtw_write32_mask(rtwdev, write_offset[path], 0xffffff, write_data); -+} -+ -+void rtw88xxa_set_tx_power_index(struct rtw_dev *rtwdev) -+{ -+ struct rtw_hal *hal = &rtwdev->hal; -+ u32 phy_pwr_idx = 0; -+ int rs, path; -+ -+ for (path = 0; path < hal->rf_path_num; path++) { -+ for (rs = 0; rs < RTW_RATE_SECTION_MAX; rs++) { -+ if (hal->rf_path_num == 1 && -+ (rs == RTW_RATE_SECTION_HT_2S || -+ rs == RTW_RATE_SECTION_VHT_2S)) -+ continue; -+ -+ if (test_bit(RTW_FLAG_SCANNING, rtwdev->flags) && -+ rs > RTW_RATE_SECTION_OFDM) -+ continue; -+ -+ if (hal->current_band_type == RTW_BAND_5G && -+ rs == RTW_RATE_SECTION_CCK) -+ continue; -+ -+ rtw88xxa_set_tx_power_index_by_rate(rtwdev, path, rs, -+ &phy_pwr_idx); -+ } -+ -+ rtw88xxa_tx_power_training(rtwdev, hal->current_band_width, -+ hal->current_channel, path); -+ } -+} -+EXPORT_SYMBOL(rtw88xxa_set_tx_power_index); -+ -+void rtw88xxa_false_alarm_statistics(struct rtw_dev *rtwdev) -+{ -+ struct rtw_dm_info *dm_info = &rtwdev->dm_info; -+ u32 cck_fa_cnt, ofdm_fa_cnt; -+ u32 crc32_cnt, cca32_cnt; -+ u32 cck_enable; -+ -+ cck_enable = rtw_read32(rtwdev, REG_RXPSEL) & BIT(28); -+ cck_fa_cnt = rtw_read16(rtwdev, REG_FA_CCK); -+ ofdm_fa_cnt = rtw_read16(rtwdev, REG_FA_OFDM); -+ -+ dm_info->cck_fa_cnt = cck_fa_cnt; -+ dm_info->ofdm_fa_cnt = ofdm_fa_cnt; -+ dm_info->total_fa_cnt = ofdm_fa_cnt; -+ if (cck_enable) -+ dm_info->total_fa_cnt += cck_fa_cnt; -+ -+ crc32_cnt = rtw_read32(rtwdev, REG_CRC_CCK); -+ dm_info->cck_ok_cnt = u32_get_bits(crc32_cnt, MASKLWORD); -+ dm_info->cck_err_cnt = u32_get_bits(crc32_cnt, MASKHWORD); -+ -+ crc32_cnt = rtw_read32(rtwdev, REG_CRC_OFDM); -+ dm_info->ofdm_ok_cnt = u32_get_bits(crc32_cnt, MASKLWORD); -+ dm_info->ofdm_err_cnt = u32_get_bits(crc32_cnt, MASKHWORD); -+ -+ crc32_cnt = rtw_read32(rtwdev, REG_CRC_HT); -+ dm_info->ht_ok_cnt = u32_get_bits(crc32_cnt, MASKLWORD); -+ dm_info->ht_err_cnt = u32_get_bits(crc32_cnt, MASKHWORD); -+ -+ crc32_cnt = rtw_read32(rtwdev, REG_CRC_VHT); -+ dm_info->vht_ok_cnt = u32_get_bits(crc32_cnt, MASKLWORD); -+ dm_info->vht_err_cnt = u32_get_bits(crc32_cnt, MASKHWORD); -+ -+ cca32_cnt = rtw_read32(rtwdev, REG_CCA_OFDM); -+ dm_info->ofdm_cca_cnt = u32_get_bits(cca32_cnt, MASKHWORD); -+ dm_info->total_cca_cnt = dm_info->ofdm_cca_cnt; -+ if (cck_enable) { -+ cca32_cnt = rtw_read32(rtwdev, REG_CCA_CCK); -+ dm_info->cck_cca_cnt = u32_get_bits(cca32_cnt, MASKLWORD); -+ dm_info->total_cca_cnt += dm_info->cck_cca_cnt; -+ } -+ -+ rtw_write32_set(rtwdev, REG_FAS, BIT(17)); -+ rtw_write32_clr(rtwdev, REG_FAS, BIT(17)); -+ rtw_write32_clr(rtwdev, REG_CCK0_FAREPORT, BIT(15)); -+ rtw_write32_set(rtwdev, REG_CCK0_FAREPORT, BIT(15)); -+ rtw_write32_set(rtwdev, REG_CNTRST, BIT(0)); -+ rtw_write32_clr(rtwdev, REG_CNTRST, BIT(0)); -+} -+EXPORT_SYMBOL(rtw88xxa_false_alarm_statistics); -+ -+void rtw88xxa_iqk_backup_mac_bb(struct rtw_dev *rtwdev, -+ u32 *macbb_backup, -+ const u32 *backup_macbb_reg, -+ u32 macbb_num) -+{ -+ u32 i; -+ -+ /* [31] = 0 --> Page C */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x0); -+ -+ /* save MACBB default value */ -+ for (i = 0; i < macbb_num; i++) -+ macbb_backup[i] = rtw_read32(rtwdev, backup_macbb_reg[i]); -+} -+EXPORT_SYMBOL(rtw88xxa_iqk_backup_mac_bb); -+ -+void rtw88xxa_iqk_backup_afe(struct rtw_dev *rtwdev, u32 *afe_backup, -+ const u32 *backup_afe_reg, u32 afe_num) -+{ -+ u32 i; -+ -+ /* [31] = 0 --> Page C */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x0); -+ -+ /* Save AFE Parameters */ -+ for (i = 0; i < afe_num; i++) -+ afe_backup[i] = rtw_read32(rtwdev, backup_afe_reg[i]); -+} -+EXPORT_SYMBOL(rtw88xxa_iqk_backup_afe); -+ -+void rtw88xxa_iqk_restore_mac_bb(struct rtw_dev *rtwdev, -+ u32 *macbb_backup, -+ const u32 *backup_macbb_reg, -+ u32 macbb_num) -+{ -+ u32 i; -+ -+ /* [31] = 0 --> Page C */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x0); -+ -+ /* Reload MacBB Parameters */ -+ for (i = 0; i < macbb_num; i++) -+ rtw_write32(rtwdev, backup_macbb_reg[i], macbb_backup[i]); -+} -+EXPORT_SYMBOL(rtw88xxa_iqk_restore_mac_bb); -+ -+void rtw88xxa_iqk_configure_mac(struct rtw_dev *rtwdev) -+{ -+ /* [31] = 0 --> Page C */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x0); -+ -+ rtw_write8(rtwdev, REG_TXPAUSE, 0x3f); -+ rtw_write32_mask(rtwdev, REG_BCN_CTRL, -+ (BIT_EN_BCN_FUNCTION << 8) | BIT_EN_BCN_FUNCTION, 0x0); -+ -+ /* RX ante off */ -+ rtw_write8(rtwdev, REG_RXPSEL, 0x00); -+ -+ /* CCA off */ -+ rtw_write32_mask(rtwdev, REG_CCA2ND, 0xf, 0xc); -+ -+ /* CCK RX path off */ -+ rtw_write8(rtwdev, REG_CCK_RX + 3, 0xf); -+} -+EXPORT_SYMBOL(rtw88xxa_iqk_configure_mac); -+ -+bool rtw88xxa_iqk_finish(int average, int threshold, -+ int *x_temp, int *y_temp, int *x, int *y, -+ bool break_inner, bool break_outer) -+{ -+ bool finish = false; -+ int i, ii, dx, dy; -+ -+ for (i = 0; i < average; i++) { -+ for (ii = i + 1; ii < average; ii++) { -+ dx = abs_diff(x_temp[i] >> 21, x_temp[ii] >> 21); -+ dy = abs_diff(y_temp[i] >> 21, y_temp[ii] >> 21); -+ -+ if (dx < threshold && dy < threshold) { -+ *x = ((x_temp[i] >> 21) + (x_temp[ii] >> 21)); -+ *y = ((y_temp[i] >> 21) + (y_temp[ii] >> 21)); -+ -+ *x /= 2; -+ *y /= 2; -+ -+ finish = true; -+ -+ if (break_inner) -+ break; -+ } -+ } -+ -+ if (finish && break_outer) -+ break; -+ } -+ -+ return finish; -+} -+EXPORT_SYMBOL(rtw88xxa_iqk_finish); -+ -+static void rtw88xxa_pwrtrack_set(struct rtw_dev *rtwdev, u8 tx_rate, u8 path) -+{ -+ static const u32 reg_txscale[2] = { REG_TXSCALE_A, REG_TXSCALE_B }; -+ struct rtw_dm_info *dm_info = &rtwdev->dm_info; -+ u8 cck_swing_idx, ofdm_swing_idx; -+ u8 pwr_tracking_limit; -+ -+ switch (tx_rate) { -+ case DESC_RATE1M ... DESC_RATE11M: -+ pwr_tracking_limit = 32; -+ break; -+ case DESC_RATE6M ... DESC_RATE48M: -+ case DESC_RATEMCS3 ... DESC_RATEMCS4: -+ case DESC_RATEMCS11 ... DESC_RATEMCS12: -+ case DESC_RATEVHT1SS_MCS3 ... DESC_RATEVHT1SS_MCS4: -+ case DESC_RATEVHT2SS_MCS3 ... DESC_RATEVHT2SS_MCS4: -+ pwr_tracking_limit = 30; -+ break; -+ case DESC_RATE54M: -+ case DESC_RATEMCS5 ... DESC_RATEMCS7: -+ case DESC_RATEMCS13 ... DESC_RATEMCS15: -+ case DESC_RATEVHT1SS_MCS5 ... DESC_RATEVHT1SS_MCS6: -+ case DESC_RATEVHT2SS_MCS5 ... DESC_RATEVHT2SS_MCS6: -+ pwr_tracking_limit = 28; -+ break; -+ case DESC_RATEMCS0 ... DESC_RATEMCS2: -+ case DESC_RATEMCS8 ... DESC_RATEMCS10: -+ case DESC_RATEVHT1SS_MCS0 ... DESC_RATEVHT1SS_MCS2: -+ case DESC_RATEVHT2SS_MCS0 ... DESC_RATEVHT2SS_MCS2: -+ pwr_tracking_limit = 34; -+ break; -+ case DESC_RATEVHT1SS_MCS7: -+ case DESC_RATEVHT2SS_MCS7: -+ pwr_tracking_limit = 26; -+ break; -+ default: -+ case DESC_RATEVHT1SS_MCS8: -+ case DESC_RATEVHT2SS_MCS8: -+ pwr_tracking_limit = 24; -+ break; -+ case DESC_RATEVHT1SS_MCS9: -+ case DESC_RATEVHT2SS_MCS9: -+ pwr_tracking_limit = 22; -+ break; -+ } -+ -+ cck_swing_idx = dm_info->delta_power_index[path] + dm_info->default_cck_index; -+ ofdm_swing_idx = dm_info->delta_power_index[path] + dm_info->default_ofdm_index; -+ -+ if (ofdm_swing_idx > pwr_tracking_limit) { -+ if (path == RF_PATH_A) -+ dm_info->txagc_remnant_cck = cck_swing_idx - pwr_tracking_limit; -+ dm_info->txagc_remnant_ofdm[path] = ofdm_swing_idx - pwr_tracking_limit; -+ -+ ofdm_swing_idx = pwr_tracking_limit; -+ } else if (ofdm_swing_idx == 0) { -+ if (path == RF_PATH_A) -+ dm_info->txagc_remnant_cck = cck_swing_idx; -+ dm_info->txagc_remnant_ofdm[path] = ofdm_swing_idx; -+ } else { -+ if (path == RF_PATH_A) -+ dm_info->txagc_remnant_cck = 0; -+ dm_info->txagc_remnant_ofdm[path] = 0; -+ } -+ -+ rtw_write32_mask(rtwdev, reg_txscale[path], GENMASK(31, 21), -+ rtw88xxa_txscale_tbl[ofdm_swing_idx]); -+} -+ -+void rtw88xxa_phy_pwrtrack(struct rtw_dev *rtwdev, -+ void (*do_lck)(struct rtw_dev *rtwdev), -+ void (*do_iqk)(struct rtw_dev *rtwdev)) -+{ -+ struct rtw_dm_info *dm_info = &rtwdev->dm_info; -+ struct rtw_hal *hal = &rtwdev->hal; -+ struct rtw_swing_table swing_table; -+ s8 remnant_pre[RTW_RF_PATH_MAX]; -+ u8 thermal_value, delta, path; -+ bool need_iqk; -+ -+ rtw_phy_config_swing_table(rtwdev, &swing_table); -+ -+ if (rtwdev->efuse.thermal_meter[0] == 0xff) { -+ pr_err_once("efuse thermal meter is 0xff\n"); -+ return; -+ } -+ -+ thermal_value = rtw_read_rf(rtwdev, RF_PATH_A, RF_T_METER, 0xfc00); -+ -+ rtw_phy_pwrtrack_avg(rtwdev, thermal_value, RF_PATH_A); -+ -+ need_iqk = rtw_phy_pwrtrack_need_iqk(rtwdev); -+ -+ if (need_iqk && do_lck) -+ do_lck(rtwdev); -+ -+ if (dm_info->pwr_trk_init_trigger) -+ dm_info->pwr_trk_init_trigger = false; -+ else if (!rtw_phy_pwrtrack_thermal_changed(rtwdev, thermal_value, -+ RF_PATH_A)) -+ goto iqk; -+ -+ delta = rtw_phy_pwrtrack_get_delta(rtwdev, RF_PATH_A); -+ -+ for (path = RF_PATH_A; path < hal->rf_path_num; path++) { -+ remnant_pre[path] = dm_info->txagc_remnant_ofdm[path]; -+ -+ dm_info->delta_power_index[path] = -+ rtw_phy_pwrtrack_get_pwridx(rtwdev, &swing_table, path, -+ RF_PATH_A, delta); -+ -+ if (dm_info->delta_power_index[path] != -+ dm_info->delta_power_index_last[path]) { -+ dm_info->delta_power_index_last[path] = -+ dm_info->delta_power_index[path]; -+ -+ rtw88xxa_pwrtrack_set(rtwdev, dm_info->tx_rate, path); -+ } -+ } -+ -+ for (path = RF_PATH_A; path < hal->rf_path_num; path++) { -+ if (remnant_pre[path] != dm_info->txagc_remnant_ofdm[path]) { -+ rtw_phy_set_tx_power_level(rtwdev, -+ hal->current_channel); -+ break; -+ } -+ } -+ -+iqk: -+ if (need_iqk) -+ do_iqk(rtwdev); -+} -+EXPORT_SYMBOL(rtw88xxa_phy_pwrtrack); -+ -+void rtw88xxa_phy_cck_pd_set(struct rtw_dev *rtwdev, u8 new_lvl) -+{ -+ static const u8 pd[CCK_PD_LV_MAX] = {0x40, 0x83, 0xcd, 0xdd, 0xed}; -+ struct rtw_dm_info *dm_info = &rtwdev->dm_info; -+ -+ /* Override rtw_phy_cck_pd_lv_link(). It implements something -+ * like type 2/3/4. We need type 1 here. -+ */ -+ if (rtw_is_assoc(rtwdev)) { -+ if (dm_info->min_rssi > 60) { -+ new_lvl = CCK_PD_LV3; -+ } else if (dm_info->min_rssi > 35) { -+ new_lvl = CCK_PD_LV2; -+ } else if (dm_info->min_rssi > 20) { -+ if (dm_info->cck_fa_avg > 500) -+ new_lvl = CCK_PD_LV2; -+ else if (dm_info->cck_fa_avg < 250) -+ new_lvl = CCK_PD_LV1; -+ else -+ return; -+ } else { -+ new_lvl = CCK_PD_LV1; -+ } -+ } -+ -+ rtw_dbg(rtwdev, RTW_DBG_PHY, "lv: (%d) -> (%d)\n", -+ dm_info->cck_pd_lv[RTW_CHANNEL_WIDTH_20][RF_PATH_A], new_lvl); -+ -+ if (dm_info->cck_pd_lv[RTW_CHANNEL_WIDTH_20][RF_PATH_A] == new_lvl) -+ return; -+ -+ dm_info->cck_fa_avg = CCK_FA_AVG_RESET; -+ dm_info->cck_pd_lv[RTW_CHANNEL_WIDTH_20][RF_PATH_A] = new_lvl; -+ -+ rtw_write8(rtwdev, REG_CCK_PD_TH, pd[new_lvl]); -+} -+EXPORT_SYMBOL(rtw88xxa_phy_cck_pd_set); -+ -+MODULE_AUTHOR("Realtek Corporation"); -+MODULE_DESCRIPTION("Realtek 802.11ac wireless 8821a/8811a/8812a common code"); -+MODULE_LICENSE("Dual BSD/GPL"); ---- /dev/null -+++ b/drivers/net/wireless/realtek/rtw88/rtw88xxa.h -@@ -0,0 +1,175 @@ -+/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ -+/* Copyright(c) 2024 Realtek Corporation -+ */ -+ -+#ifndef __RTW88XXA_H__ -+#define __RTW88XXA_H__ -+ -+#include -+#include "reg.h" -+ -+struct rtw8821au_efuse { -+ u8 res4[48]; /* 0xd0 */ -+ u8 vid[2]; /* 0x100 */ -+ u8 pid[2]; -+ u8 res8[3]; -+ u8 mac_addr[ETH_ALEN]; /* 0x107 */ -+ u8 res9[243]; -+} __packed; -+ -+struct rtw8812au_efuse { -+ u8 vid[2]; /* 0xd0 */ -+ u8 pid[2]; /* 0xd2 */ -+ u8 res0[3]; -+ u8 mac_addr[ETH_ALEN]; /* 0xd7 */ -+ u8 res1[291]; -+} __packed; -+ -+struct rtw88xxa_efuse { -+ __le16 rtl_id; -+ u8 res0[6]; /* 0x02 */ -+ u8 usb_mode; /* 0x08 */ -+ u8 res1[7]; /* 0x09 */ -+ -+ /* power index for four RF paths */ -+ struct rtw_txpwr_idx txpwr_idx_table[4]; -+ -+ u8 channel_plan; /* 0xb8 */ -+ u8 xtal_k; -+ u8 thermal_meter; -+ u8 iqk_lck; -+ u8 pa_type; /* 0xbc */ -+ u8 lna_type_2g; /* 0xbd */ -+ u8 res2; -+ u8 lna_type_5g; /* 0xbf */ -+ u8 res3; -+ u8 rf_board_option; /* 0xc1 */ -+ u8 rf_feature_option; -+ u8 rf_bt_setting; -+ u8 eeprom_version; -+ u8 eeprom_customer_id; /* 0xc5 */ -+ u8 tx_bb_swing_setting_2g; -+ u8 tx_bb_swing_setting_5g; -+ u8 tx_pwr_calibrate_rate; -+ u8 rf_antenna_option; /* 0xc9 */ -+ u8 rfe_option; -+ u8 country_code[2]; -+ u8 res4[3]; -+ union { -+ struct rtw8821au_efuse rtw8821au; -+ struct rtw8812au_efuse rtw8812au; -+ }; -+} __packed; -+ -+static_assert(sizeof(struct rtw88xxa_efuse) == 512); -+ -+#define WLAN_BCN_DMA_TIME 0x02 -+#define WLAN_TBTT_PROHIBIT 0x04 -+#define WLAN_TBTT_HOLD_TIME 0x064 -+#define WLAN_TBTT_TIME (WLAN_TBTT_PROHIBIT |\ -+ (WLAN_TBTT_HOLD_TIME << BIT_SHIFT_TBTT_HOLD_TIME_AP)) -+ -+struct rtw_jaguar_phy_status_rpt { -+ __le32 w0; -+ __le32 w1; -+ __le32 w2; -+ __le32 w3; -+ __le32 w4; -+ __le32 w5; -+ __le32 w6; -+} __packed; -+ -+#define RTW_JGRPHY_W0_GAIN_A GENMASK(6, 0) -+#define RTW_JGRPHY_W0_TRSW_A BIT(7) -+#define RTW_JGRPHY_W0_GAIN_B GENMASK(14, 8) -+#define RTW_JGRPHY_W0_TRSW_B BIT(15) -+#define RTW_JGRPHY_W0_CHL_NUM GENMASK(25, 16) -+#define RTW_JGRPHY_W0_SUB_CHNL GENMASK(29, 26) -+#define RTW_JGRPHY_W0_R_RFMOD GENMASK(31, 30) -+ -+/* CCK: */ -+#define RTW_JGRPHY_W1_SIG_QUAL GENMASK(7, 0) -+#define RTW_JGRPHY_W1_AGC_RPT_VGA_IDX GENMASK(12, 8) -+#define RTW_JGRPHY_W1_AGC_RPT_LNA_IDX GENMASK(15, 13) -+#define RTW_JGRPHY_W1_BB_POWER GENMASK(23, 16) -+/* OFDM: */ -+#define RTW_JGRPHY_W1_PWDB_ALL GENMASK(7, 0) -+#define RTW_JGRPHY_W1_CFO_SHORT_A GENMASK(15, 8) /* s8 */ -+#define RTW_JGRPHY_W1_CFO_SHORT_B GENMASK(23, 16) /* s8 */ -+#define RTW_JGRPHY_W1_BT_RF_CH_MSB GENMASK(31, 30) -+ -+#define RTW_JGRPHY_W2_ANT_DIV_SW_A BIT(0) -+#define RTW_JGRPHY_W2_ANT_DIV_SW_B BIT(1) -+#define RTW_JGRPHY_W2_BT_RF_CH_LSB GENMASK(7, 2) -+#define RTW_JGRPHY_W2_CFO_TAIL_A GENMASK(15, 8) /* s8 */ -+#define RTW_JGRPHY_W2_CFO_TAIL_B GENMASK(23, 16) /* s8 */ -+#define RTW_JGRPHY_W2_PCTS_MSK_RPT_0 GENMASK(31, 24) -+ -+#define RTW_JGRPHY_W3_PCTS_MSK_RPT_1 GENMASK(7, 0) -+/* Stream 1 and 2 RX EVM: */ -+#define RTW_JGRPHY_W3_RXEVM_1 GENMASK(15, 8) /* s8 */ -+#define RTW_JGRPHY_W3_RXEVM_2 GENMASK(23, 16) /* s8 */ -+#define RTW_JGRPHY_W3_RXSNR_A GENMASK(31, 24) /* s8 */ -+ -+#define RTW_JGRPHY_W4_RXSNR_B GENMASK(7, 0) /* s8 */ -+#define RTW_JGRPHY_W4_PCTS_MSK_RPT_2 GENMASK(21, 8) -+#define RTW_JGRPHY_W4_PCTS_RPT_VALID BIT(22) -+#define RTW_JGRPHY_W4_RXEVM_3 GENMASK(31, 24) /* s8 */ -+ -+#define RTW_JGRPHY_W5_RXEVM_4 GENMASK(7, 0) /* s8 */ -+/* 8812a, stream 1 and 2 CSI: */ -+#define RTW_JGRPHY_W5_CSI_CURRENT_1 GENMASK(15, 8) -+#define RTW_JGRPHY_W5_CSI_CURRENT_2 GENMASK(23, 16) -+/* 8814a: */ -+#define RTW_JGRPHY_W5_RXSNR_C GENMASK(15, 8) /* s8 */ -+#define RTW_JGRPHY_W5_RXSNR_D GENMASK(23, 16) /* s8 */ -+#define RTW_JGRPHY_W5_GAIN_C GENMASK(30, 24) -+#define RTW_JGRPHY_W5_TRSW_C BIT(31) -+ -+#define RTW_JGRPHY_W6_GAIN_D GENMASK(6, 0) -+#define RTW_JGRPHY_W6_TRSW_D BIT(7) -+#define RTW_JGRPHY_W6_SIGEVM GENMASK(15, 8) /* s8 */ -+#define RTW_JGRPHY_W6_ANTIDX_ANTC GENMASK(18, 16) -+#define RTW_JGRPHY_W6_ANTIDX_ANTD GENMASK(21, 19) -+#define RTW_JGRPHY_W6_DPDT_CTRL_KEEP BIT(22) -+#define RTW_JGRPHY_W6_GNT_BT_KEEP BIT(23) -+#define RTW_JGRPHY_W6_ANTIDX_ANTA GENMASK(26, 24) -+#define RTW_JGRPHY_W6_ANTIDX_ANTB GENMASK(29, 27) -+#define RTW_JGRPHY_W6_HW_ANTSW_OCCUR GENMASK(31, 30) -+ -+#define RF18_BW_MASK (BIT(11) | BIT(10)) -+ -+void rtw88xxa_efuse_grant(struct rtw_dev *rtwdev, bool on); -+int rtw88xxa_read_efuse(struct rtw_dev *rtwdev, u8 *log_map); -+void rtw88xxa_power_off(struct rtw_dev *rtwdev, -+ const struct rtw_pwr_seq_cmd *const *enter_lps_flow); -+int rtw88xxa_power_on(struct rtw_dev *rtwdev); -+u32 rtw88xxa_phy_read_rf(struct rtw_dev *rtwdev, -+ enum rtw_rf_path rf_path, u32 addr, u32 mask); -+void rtw88xxa_set_channel(struct rtw_dev *rtwdev, u8 channel, u8 bw, -+ u8 primary_chan_idx); -+void rtw88xxa_query_phy_status(struct rtw_dev *rtwdev, u8 *phy_status, -+ struct rtw_rx_pkt_stat *pkt_stat, -+ s8 (*cck_rx_pwr)(u8 lna_idx, u8 vga_idx)); -+void rtw88xxa_set_tx_power_index(struct rtw_dev *rtwdev); -+void rtw88xxa_false_alarm_statistics(struct rtw_dev *rtwdev); -+void rtw88xxa_iqk_backup_mac_bb(struct rtw_dev *rtwdev, -+ u32 *macbb_backup, -+ const u32 *backup_macbb_reg, -+ u32 macbb_num); -+void rtw88xxa_iqk_backup_afe(struct rtw_dev *rtwdev, u32 *afe_backup, -+ const u32 *backup_afe_reg, u32 afe_num); -+void rtw88xxa_iqk_restore_mac_bb(struct rtw_dev *rtwdev, -+ u32 *macbb_backup, -+ const u32 *backup_macbb_reg, -+ u32 macbb_num); -+void rtw88xxa_iqk_configure_mac(struct rtw_dev *rtwdev); -+bool rtw88xxa_iqk_finish(int average, int threshold, -+ int *x_temp, int *y_temp, int *x, int *y, -+ bool break_inner, bool break_outer); -+void rtw88xxa_phy_pwrtrack(struct rtw_dev *rtwdev, -+ void (*do_lck)(struct rtw_dev *rtwdev), -+ void (*do_iqk)(struct rtw_dev *rtwdev)); -+void rtw88xxa_phy_cck_pd_set(struct rtw_dev *rtwdev, u8 new_lvl); -+ -+#endif diff --git a/package/kernel/mac80211/patches/rtl/042-v6.13-wifi-rtw88-Add-rtw8821a.-c-h.patch b/package/kernel/mac80211/patches/rtl/042-v6.13-wifi-rtw88-Add-rtw8821a.-c-h.patch deleted file mode 100644 index dca3f7b275a..00000000000 --- a/package/kernel/mac80211/patches/rtl/042-v6.13-wifi-rtw88-Add-rtw8821a.-c-h.patch +++ /dev/null @@ -1,1230 +0,0 @@ -From 32e284a238806d1984ea68cda25f6b09a4053b94 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Wed, 30 Oct 2024 20:28:15 +0200 -Subject: [PATCH] wifi: rtw88: Add rtw8821a.{c,h} - -These contain code specific to RTL8821AU. - -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/37218648-ada7-4fad-b7bd-d2aee28cefb9@gmail.com ---- - drivers/net/wireless/realtek/rtw88/rtw8821a.c | 1197 +++++++++++++++++ - drivers/net/wireless/realtek/rtw88/rtw8821a.h | 10 + - 2 files changed, 1207 insertions(+) - create mode 100644 drivers/net/wireless/realtek/rtw88/rtw8821a.c - create mode 100644 drivers/net/wireless/realtek/rtw88/rtw8821a.h - ---- /dev/null -+++ b/drivers/net/wireless/realtek/rtw88/rtw8821a.c -@@ -0,0 +1,1197 @@ -+// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause -+/* Copyright(c) 2024 Realtek Corporation -+ */ -+ -+#include "main.h" -+#include "coex.h" -+#include "phy.h" -+#include "reg.h" -+#include "rtw88xxa.h" -+#include "rtw8821a.h" -+#include "rtw8821a_table.h" -+#include "tx.h" -+ -+static void rtw8821a_power_off(struct rtw_dev *rtwdev) -+{ -+ rtw88xxa_power_off(rtwdev, enter_lps_flow_8821a); -+} -+ -+static s8 rtw8821a_cck_rx_pwr(u8 lna_idx, u8 vga_idx) -+{ -+ static const s8 lna_gain_table[] = {15, -1, -17, 0, -30, -38}; -+ s8 rx_pwr_all = 0; -+ s8 lna_gain; -+ -+ switch (lna_idx) { -+ case 5: -+ case 4: -+ case 2: -+ case 1: -+ case 0: -+ lna_gain = lna_gain_table[lna_idx]; -+ rx_pwr_all = lna_gain - 2 * vga_idx; -+ break; -+ default: -+ break; -+ } -+ -+ return rx_pwr_all; -+} -+ -+static void rtw8821a_query_phy_status(struct rtw_dev *rtwdev, u8 *phy_status, -+ struct rtw_rx_pkt_stat *pkt_stat) -+{ -+ rtw88xxa_query_phy_status(rtwdev, phy_status, pkt_stat, -+ rtw8821a_cck_rx_pwr); -+} -+ -+static void rtw8821a_cfg_ldo25(struct rtw_dev *rtwdev, bool enable) -+{ -+} -+ -+#define CAL_NUM_8821A 3 -+#define MACBB_REG_NUM_8821A 8 -+#define AFE_REG_NUM_8821A 4 -+#define RF_REG_NUM_8821A 3 -+ -+static void rtw8821a_iqk_backup_rf(struct rtw_dev *rtwdev, u32 *rfa_backup, -+ const u32 *backup_rf_reg, u32 rf_num) -+{ -+ u32 i; -+ -+ /* [31] = 0 --> Page C */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x0); -+ -+ /* Save RF Parameters */ -+ for (i = 0; i < rf_num; i++) -+ rfa_backup[i] = rtw_read_rf(rtwdev, RF_PATH_A, -+ backup_rf_reg[i], MASKDWORD); -+} -+ -+static void rtw8821a_iqk_restore_rf(struct rtw_dev *rtwdev, -+ const u32 *backup_rf_reg, -+ u32 *RF_backup, u32 rf_reg_num) -+{ -+ u32 i; -+ -+ /* [31] = 0 --> Page C */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x0); -+ -+ for (i = 0; i < rf_reg_num; i++) -+ rtw_write_rf(rtwdev, RF_PATH_A, backup_rf_reg[i], -+ RFREG_MASK, RF_backup[i]); -+} -+ -+static void rtw8821a_iqk_restore_afe(struct rtw_dev *rtwdev, u32 *afe_backup, -+ const u32 *backup_afe_reg, u32 afe_num) -+{ -+ u32 i; -+ -+ /* [31] = 0 --> Page C */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x0); -+ -+ /* Reload AFE Parameters */ -+ for (i = 0; i < afe_num; i++) -+ rtw_write32(rtwdev, backup_afe_reg[i], afe_backup[i]); -+ -+ /* [31] = 1 --> Page C1 */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x1); -+ -+ rtw_write32(rtwdev, REG_OFDM0_XA_TX_IQ_IMBALANCE, 0x0); -+ rtw_write32(rtwdev, REG_OFDM0_A_TX_AFE, 0x0); -+ rtw_write32(rtwdev, REG_OFDM0_XB_TX_IQ_IMBALANCE, 0x0); -+ rtw_write32(rtwdev, REG_TSSI_TRK_SW, 0x3c000000); -+ rtw_write32(rtwdev, REG_LSSI_WRITE_A, 0x00000080); -+ rtw_write32(rtwdev, REG_TXAGCIDX, 0x00000000); -+ rtw_write32(rtwdev, REG_IQK_DPD_CFG, 0x20040000); -+ rtw_write32(rtwdev, REG_CFG_PMPD, 0x20000000); -+ rtw_write32(rtwdev, REG_RFECTL_A, 0x0); -+} -+ -+static void rtw8821a_iqk_rx_fill(struct rtw_dev *rtwdev, -+ unsigned int rx_x, unsigned int rx_y) -+{ -+ /* [31] = 0 --> Page C */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x0); -+ -+ rtw_write32_mask(rtwdev, REG_RX_IQC_AB_A, -+ 0x000003ff, rx_x >> 1); -+ rtw_write32_mask(rtwdev, REG_RX_IQC_AB_A, -+ 0x03ff0000, (rx_y >> 1) & 0x3ff); -+} -+ -+static void rtw8821a_iqk_tx_fill(struct rtw_dev *rtwdev, -+ unsigned int tx_x, unsigned int tx_y) -+{ -+ /* [31] = 1 --> Page C1 */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x1); -+ -+ rtw_write32(rtwdev, REG_LSSI_WRITE_A, 0x00000080); -+ rtw_write32(rtwdev, REG_IQK_DPD_CFG, 0x20040000); -+ rtw_write32(rtwdev, REG_CFG_PMPD, 0x20000000); -+ rtw_write32_mask(rtwdev, REG_IQC_Y, 0x000007ff, tx_y); -+ rtw_write32_mask(rtwdev, REG_IQC_X, 0x000007ff, tx_x); -+} -+ -+static void rtw8821a_iqk_tx_vdf_true(struct rtw_dev *rtwdev, u32 cal, -+ bool *tx0iqkok, -+ int tx_x0[CAL_NUM_8821A], -+ int tx_y0[CAL_NUM_8821A]) -+{ -+ u32 cal_retry, delay_count, iqk_ready, tx_fail; -+ int tx_dt[3], vdf_y[3], vdf_x[3]; -+ int k; -+ -+ for (k = 0; k < 3; k++) { -+ switch (k) { -+ case 0: -+ /* TX_Tone_idx[9:0], TxK_Mask[29] TX_Tone = 16 */ -+ rtw_write32(rtwdev, REG_OFDM0_XA_TX_IQ_IMBALANCE, -+ 0x18008c38); -+ /* RX_Tone_idx[9:0], RxK_Mask[29] */ -+ rtw_write32(rtwdev, REG_OFDM0_A_TX_AFE, 0x38008c38); -+ rtw_write32_mask(rtwdev, REG_INTPO_SETA, BIT(31), 0x0); -+ break; -+ case 1: -+ rtw_write32_mask(rtwdev, REG_OFDM0_XA_TX_IQ_IMBALANCE, -+ BIT(28), 0x0); -+ rtw_write32_mask(rtwdev, REG_OFDM0_A_TX_AFE, -+ BIT(28), 0x0); -+ rtw_write32_mask(rtwdev, REG_INTPO_SETA, BIT(31), 0x0); -+ break; -+ case 2: -+ rtw_dbg(rtwdev, RTW_DBG_RFK, -+ "vdf_y[1] = %x vdf_y[0] = %x\n", -+ vdf_y[1] >> 21 & 0x00007ff, -+ vdf_y[0] >> 21 & 0x00007ff); -+ -+ rtw_dbg(rtwdev, RTW_DBG_RFK, -+ "vdf_x[1] = %x vdf_x[0] = %x\n", -+ vdf_x[1] >> 21 & 0x00007ff, -+ vdf_x[0] >> 21 & 0x00007ff); -+ -+ tx_dt[cal] = (vdf_y[1] >> 20) - (vdf_y[0] >> 20); -+ tx_dt[cal] = (16 * tx_dt[cal]) * 10000 / 15708; -+ tx_dt[cal] = (tx_dt[cal] >> 1) + (tx_dt[cal] & BIT(0)); -+ -+ /* TX_Tone_idx[9:0], TxK_Mask[29] TX_Tone = 16 */ -+ rtw_write32(rtwdev, REG_OFDM0_XA_TX_IQ_IMBALANCE, -+ 0x18008c20); -+ /* RX_Tone_idx[9:0], RxK_Mask[29] */ -+ rtw_write32(rtwdev, REG_OFDM0_A_TX_AFE, 0x38008c20); -+ rtw_write32_mask(rtwdev, REG_INTPO_SETA, BIT(31), 0x1); -+ rtw_write32_mask(rtwdev, REG_INTPO_SETA, 0x3fff0000, -+ tx_dt[cal] & 0x00003fff); -+ break; -+ } -+ -+ rtw_write32(rtwdev, REG_RFECTL_A, 0x00100000); -+ -+ for (cal_retry = 0; cal_retry < 10; cal_retry++) { -+ /* one shot */ -+ rtw_write32(rtwdev, REG_IQK_COM64, 0xfa000000); -+ rtw_write32(rtwdev, REG_IQK_COM64, 0xf8000000); -+ -+ mdelay(10); -+ -+ rtw_write32(rtwdev, REG_RFECTL_A, 0x00000000); -+ -+ for (delay_count = 0; delay_count < 20; delay_count++) { -+ iqk_ready = rtw_read32_mask(rtwdev, -+ REG_IQKA_END, -+ BIT(10)); -+ -+ /* Originally: if (~iqk_ready || delay_count > 20) -+ * that looks like a typo so make it more explicit -+ */ -+ iqk_ready = true; -+ -+ if (iqk_ready) -+ break; -+ -+ mdelay(1); -+ } -+ -+ if (delay_count < 20) { -+ /* ============TXIQK Check============== */ -+ tx_fail = rtw_read32_mask(rtwdev, -+ REG_IQKA_END, -+ BIT(12)); -+ -+ /* Originally: if (~tx_fail) { -+ * It looks like a typo, so make it more explicit. -+ */ -+ tx_fail = false; -+ -+ if (!tx_fail) { -+ rtw_write32(rtwdev, REG_RFECTL_A, -+ 0x02000000); -+ vdf_x[k] = rtw_read32_mask(rtwdev, -+ REG_IQKA_END, -+ 0x07ff0000); -+ vdf_x[k] <<= 21; -+ -+ rtw_write32(rtwdev, REG_RFECTL_A, -+ 0x04000000); -+ vdf_y[k] = rtw_read32_mask(rtwdev, -+ REG_IQKA_END, -+ 0x07ff0000); -+ vdf_y[k] <<= 21; -+ -+ *tx0iqkok = true; -+ break; -+ } -+ -+ rtw_write32_mask(rtwdev, REG_IQC_Y, -+ 0x000007ff, 0x0); -+ rtw_write32_mask(rtwdev, REG_IQC_X, -+ 0x000007ff, 0x200); -+ } -+ -+ *tx0iqkok = false; -+ } -+ } -+ -+ if (k == 3) { -+ tx_x0[cal] = vdf_x[k - 1]; -+ tx_y0[cal] = vdf_y[k - 1]; -+ } -+} -+ -+static void rtw8821a_iqk_tx_vdf_false(struct rtw_dev *rtwdev, u32 cal, -+ bool *tx0iqkok, -+ int tx_x0[CAL_NUM_8821A], -+ int tx_y0[CAL_NUM_8821A]) -+{ -+ u32 cal_retry, delay_count, iqk_ready, tx_fail; -+ -+ /* TX_Tone_idx[9:0], TxK_Mask[29] TX_Tone = 16 */ -+ rtw_write32(rtwdev, REG_OFDM0_XA_TX_IQ_IMBALANCE, 0x18008c10); -+ /* RX_Tone_idx[9:0], RxK_Mask[29] */ -+ rtw_write32(rtwdev, REG_OFDM0_A_TX_AFE, 0x38008c10); -+ rtw_write32(rtwdev, REG_RFECTL_A, 0x00100000); -+ -+ for (cal_retry = 0; cal_retry < 10; cal_retry++) { -+ /* one shot */ -+ rtw_write32(rtwdev, REG_IQK_COM64, 0xfa000000); -+ rtw_write32(rtwdev, REG_IQK_COM64, 0xf8000000); -+ -+ mdelay(10); -+ rtw_write32(rtwdev, REG_RFECTL_A, 0x00000000); -+ -+ for (delay_count = 0; delay_count < 20; delay_count++) { -+ iqk_ready = rtw_read32_mask(rtwdev, REG_IQKA_END, BIT(10)); -+ -+ /* Originally: if (~iqk_ready || delay_count > 20) -+ * that looks like a typo so make it more explicit -+ */ -+ iqk_ready = true; -+ -+ if (iqk_ready) -+ break; -+ -+ mdelay(1); -+ } -+ -+ if (delay_count < 20) { -+ /* ============TXIQK Check============== */ -+ tx_fail = rtw_read32_mask(rtwdev, REG_IQKA_END, BIT(12)); -+ -+ /* Originally: if (~tx_fail) { -+ * It looks like a typo, so make it more explicit. -+ */ -+ tx_fail = false; -+ -+ if (!tx_fail) { -+ rtw_write32(rtwdev, REG_RFECTL_A, 0x02000000); -+ tx_x0[cal] = rtw_read32_mask(rtwdev, REG_IQKA_END, -+ 0x07ff0000); -+ tx_x0[cal] <<= 21; -+ -+ rtw_write32(rtwdev, REG_RFECTL_A, 0x04000000); -+ tx_y0[cal] = rtw_read32_mask(rtwdev, REG_IQKA_END, -+ 0x07ff0000); -+ tx_y0[cal] <<= 21; -+ -+ *tx0iqkok = true; -+ break; -+ } -+ -+ rtw_write32_mask(rtwdev, REG_IQC_Y, 0x000007ff, 0x0); -+ rtw_write32_mask(rtwdev, REG_IQC_X, 0x000007ff, 0x200); -+ } -+ -+ *tx0iqkok = false; -+ } -+} -+ -+static void rtw8821a_iqk_rx(struct rtw_dev *rtwdev, u32 cal, bool *rx0iqkok, -+ int rx_x0[CAL_NUM_8821A], -+ int rx_y0[CAL_NUM_8821A]) -+{ -+ u32 cal_retry, delay_count, iqk_ready, rx_fail; -+ -+ rtw_write32(rtwdev, REG_RFECTL_A, 0x00100000); -+ -+ for (cal_retry = 0; cal_retry < 10; cal_retry++) { -+ /* one shot */ -+ rtw_write32(rtwdev, REG_IQK_COM64, 0xfa000000); -+ rtw_write32(rtwdev, REG_IQK_COM64, 0xf8000000); -+ -+ mdelay(10); -+ -+ rtw_write32(rtwdev, REG_RFECTL_A, 0x00000000); -+ -+ for (delay_count = 0; delay_count < 20; delay_count++) { -+ iqk_ready = rtw_read32_mask(rtwdev, REG_IQKA_END, BIT(10)); -+ -+ /* Originally: if (~iqk_ready || delay_count > 20) -+ * that looks like a typo so make it more explicit -+ */ -+ iqk_ready = true; -+ -+ if (iqk_ready) -+ break; -+ -+ mdelay(1); -+ } -+ -+ if (delay_count < 20) { -+ /* ============RXIQK Check============== */ -+ rx_fail = rtw_read32_mask(rtwdev, REG_IQKA_END, BIT(11)); -+ if (!rx_fail) { -+ rtw_write32(rtwdev, REG_RFECTL_A, 0x06000000); -+ rx_x0[cal] = rtw_read32_mask(rtwdev, REG_IQKA_END, -+ 0x07ff0000); -+ rx_x0[cal] <<= 21; -+ -+ rtw_write32(rtwdev, REG_RFECTL_A, 0x08000000); -+ rx_y0[cal] = rtw_read32_mask(rtwdev, REG_IQKA_END, -+ 0x07ff0000); -+ rx_y0[cal] <<= 21; -+ -+ *rx0iqkok = true; -+ break; -+ } -+ -+ rtw_write32_mask(rtwdev, REG_RX_IQC_AB_A, -+ 0x000003ff, 0x200 >> 1); -+ rtw_write32_mask(rtwdev, REG_RX_IQC_AB_A, -+ 0x03ff0000, 0x0 >> 1); -+ } -+ -+ *rx0iqkok = false; -+ } -+} -+ -+static void rtw8821a_iqk(struct rtw_dev *rtwdev) -+{ -+ int tx_average = 0, rx_average = 0, rx_iqk_loop = 0; -+ const struct rtw_efuse *efuse = &rtwdev->efuse; -+ int tx_x = 0, tx_y = 0, rx_x = 0, rx_y = 0; -+ const struct rtw_hal *hal = &rtwdev->hal; -+ bool tx0iqkok = false, rx0iqkok = false; -+ int rx_x_temp = 0, rx_y_temp = 0; -+ int rx_x0[2][CAL_NUM_8821A]; -+ int rx_y0[2][CAL_NUM_8821A]; -+ int tx_x0[CAL_NUM_8821A]; -+ int tx_y0[CAL_NUM_8821A]; -+ bool rx_finish1 = false; -+ bool rx_finish2 = false; -+ bool vdf_enable; -+ u32 cal; -+ int i; -+ -+ rtw_dbg(rtwdev, RTW_DBG_RFK, -+ "band_width = %d, ext_pa = %d, ext_pa_5g = %d\n", -+ hal->current_band_width, efuse->ext_pa_2g, efuse->ext_pa_5g); -+ -+ vdf_enable = hal->current_band_width == RTW_CHANNEL_WIDTH_80; -+ -+ for (cal = 0; cal < CAL_NUM_8821A; cal++) { -+ /* path-A LOK */ -+ -+ /* [31] = 0 --> Page C */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x0); -+ -+ /* ========path-A AFE all on======== */ -+ /* Port 0 DAC/ADC on */ -+ rtw_write32(rtwdev, REG_AFE_PWR1_A, 0x77777777); -+ rtw_write32(rtwdev, REG_AFE_PWR2_A, 0x77777777); -+ -+ rtw_write32(rtwdev, REG_RX_WAIT_CCA_TX_CCK_RFON_A, 0x19791979); -+ -+ /* hardware 3-wire off */ -+ rtw_write32_mask(rtwdev, REG_3WIRE_SWA, 0xf, 0x4); -+ -+ /* LOK setting */ -+ -+ /* 1. DAC/ADC sampling rate (160 MHz) */ -+ rtw_write32_mask(rtwdev, REG_CK_MONHA, GENMASK(26, 24), 0x7); -+ -+ /* 2. LoK RF setting (at BW = 20M) */ -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_LUTWE, RFREG_MASK, 0x80002); -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_CFGCH, 0x00c00, 0x3); -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_MODE_TABLE_ADDR, RFREG_MASK, -+ 0x20000); -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_MODE_TABLE_DATA0, RFREG_MASK, -+ 0x0003f); -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_MODE_TABLE_DATA1, RFREG_MASK, -+ 0xf3fc3); -+ -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_TXA_PREPAD, RFREG_MASK, -+ 0x931d5); -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_RXBB2, RFREG_MASK, 0x8a001); -+ rtw_write32(rtwdev, REG_DAC_RSTB, 0x00008000); -+ rtw_write32_mask(rtwdev, REG_TXAGCIDX, BIT(0), 0x1); -+ /* TX (X,Y) */ -+ rtw_write32(rtwdev, REG_IQK_COM00, 0x29002000); -+ /* RX (X,Y) */ -+ rtw_write32(rtwdev, REG_IQK_COM32, 0xa9002000); -+ /* [0]:AGC_en, [15]:idac_K_Mask */ -+ rtw_write32(rtwdev, REG_IQK_COM96, 0x00462910); -+ -+ /* [31] = 1 --> Page C1 */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x1); -+ -+ if (efuse->ext_pa_5g) -+ rtw_write32(rtwdev, REG_OFDM0_XB_TX_IQ_IMBALANCE, -+ 0x821403f7); -+ else -+ rtw_write32(rtwdev, REG_OFDM0_XB_TX_IQ_IMBALANCE, -+ 0x821403f4); -+ -+ if (hal->current_band_type == RTW_BAND_5G) -+ rtw_write32(rtwdev, REG_TSSI_TRK_SW, 0x68163e96); -+ else -+ rtw_write32(rtwdev, REG_TSSI_TRK_SW, 0x28163e96); -+ -+ /* TX_Tone_idx[9:0], TxK_Mask[29] TX_Tone = 16 */ -+ rtw_write32(rtwdev, REG_OFDM0_XA_TX_IQ_IMBALANCE, 0x18008c10); -+ /* RX_Tone_idx[9:0], RxK_Mask[29] */ -+ rtw_write32(rtwdev, REG_OFDM0_A_TX_AFE, 0x38008c10); -+ rtw_write32(rtwdev, REG_RFECTL_A, 0x00100000); -+ rtw_write32(rtwdev, REG_IQK_COM64, 0xfa000000); -+ rtw_write32(rtwdev, REG_IQK_COM64, 0xf8000000); -+ -+ mdelay(10); -+ rtw_write32(rtwdev, REG_RFECTL_A, 0x00000000); -+ -+ /* [31] = 0 --> Page C */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x0); -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_TXMOD, 0x7fe00, -+ rtw_read_rf(rtwdev, RF_PATH_A, RF_DTXLOK, 0xffc00)); -+ -+ if (hal->current_band_width == RTW_CHANNEL_WIDTH_40) -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_CFGCH, -+ RF18_BW_MASK, 0x1); -+ else if (hal->current_band_width == RTW_CHANNEL_WIDTH_80) -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_CFGCH, -+ RF18_BW_MASK, 0x0); -+ -+ /* [31] = 1 --> Page C1 */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x1); -+ -+ /* 3. TX RF setting */ -+ /* [31] = 0 --> Page C */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x0); -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_LUTWE, RFREG_MASK, 0x80000); -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_MODE_TABLE_ADDR, RFREG_MASK, -+ 0x20000); -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_MODE_TABLE_DATA0, RFREG_MASK, -+ 0x0003f); -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_MODE_TABLE_DATA1, RFREG_MASK, -+ 0xf3fc3); -+ -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_TXA_PREPAD, RFREG_MASK, 0x931d5); -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_RXBB2, RFREG_MASK, 0x8a001); -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_LUTWE, RFREG_MASK, 0x00000); -+ rtw_write32(rtwdev, REG_DAC_RSTB, 0x00008000); -+ rtw_write32_mask(rtwdev, REG_TXAGCIDX, BIT(0), 0x1); -+ /* TX (X,Y) */ -+ rtw_write32(rtwdev, REG_IQK_COM00, 0x29002000); -+ /* RX (X,Y) */ -+ rtw_write32(rtwdev, REG_IQK_COM32, 0xa9002000); -+ /* [0]:AGC_en, [15]:idac_K_Mask */ -+ rtw_write32(rtwdev, REG_IQK_COM96, 0x0046a910); -+ -+ /* [31] = 1 --> Page C1 */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x1); -+ -+ if (efuse->ext_pa_5g) -+ rtw_write32(rtwdev, REG_OFDM0_XB_TX_IQ_IMBALANCE, -+ 0x821403f7); -+ else -+ rtw_write32(rtwdev, REG_OFDM0_XB_TX_IQ_IMBALANCE, -+ 0x821403e3); -+ -+ if (hal->current_band_type == RTW_BAND_5G) -+ rtw_write32(rtwdev, REG_TSSI_TRK_SW, 0x40163e96); -+ else -+ rtw_write32(rtwdev, REG_TSSI_TRK_SW, 0x00163e96); -+ -+ if (vdf_enable) -+ rtw8821a_iqk_tx_vdf_true(rtwdev, cal, &tx0iqkok, -+ tx_x0, tx_y0); -+ else -+ rtw8821a_iqk_tx_vdf_false(rtwdev, cal, &tx0iqkok, -+ tx_x0, tx_y0); -+ -+ if (!tx0iqkok) -+ break; /* TXK fail, Don't do RXK */ -+ -+ /* ====== RX IQK ====== */ -+ /* [31] = 0 --> Page C */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x0); -+ /* 1. RX RF setting */ -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_LUTWE, RFREG_MASK, 0x80000); -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_MODE_TABLE_ADDR, RFREG_MASK, -+ 0x30000); -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_MODE_TABLE_DATA0, RFREG_MASK, -+ 0x0002f); -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_MODE_TABLE_DATA1, RFREG_MASK, -+ 0xfffbb); -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_RXBB2, RFREG_MASK, 0x88001); -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_TXA_PREPAD, RFREG_MASK, 0x931d8); -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_LUTWE, RFREG_MASK, 0x00000); -+ -+ rtw_write32_mask(rtwdev, REG_IQK_COM00, 0x03FF8000, -+ (tx_x0[cal] >> 21) & 0x000007ff); -+ rtw_write32_mask(rtwdev, REG_IQK_COM00, 0x000007FF, -+ (tx_y0[cal] >> 21) & 0x000007ff); -+ rtw_write32_mask(rtwdev, REG_IQK_COM00, BIT(31), 0x1); -+ rtw_write32_mask(rtwdev, REG_IQK_COM00, BIT(31), 0x0); -+ rtw_write32(rtwdev, REG_DAC_RSTB, 0x00008000); -+ rtw_write32(rtwdev, REG_IQK_COM96, 0x0046a911); -+ -+ /* [31] = 1 --> Page C1 */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x1); -+ -+ /* TX_Tone_idx[9:0], TxK_Mask[29] TX_Tone = 16 */ -+ rtw_write32(rtwdev, REG_OFDM0_XA_TX_IQ_IMBALANCE, 0x38008c10); -+ /* RX_Tone_idx[9:0], RxK_Mask[29] */ -+ rtw_write32(rtwdev, REG_OFDM0_A_TX_AFE, 0x18008c10); -+ rtw_write32(rtwdev, REG_OFDM0_XB_TX_IQ_IMBALANCE, 0x02140119); -+ -+ if (rtw_hci_type(rtwdev) == RTW_HCI_TYPE_PCIE) -+ rx_iqk_loop = 2; /* for 2% fail; */ -+ else -+ rx_iqk_loop = 1; -+ -+ for (i = 0; i < rx_iqk_loop; i++) { -+ if (rtw_hci_type(rtwdev) == RTW_HCI_TYPE_PCIE && i == 0) -+ rtw_write32(rtwdev, REG_TSSI_TRK_SW, 0x28161100); /* Good */ -+ else -+ rtw_write32(rtwdev, REG_TSSI_TRK_SW, 0x28160d00); -+ -+ rtw8821a_iqk_rx(rtwdev, cal, &rx0iqkok, -+ rx_x0[i], rx_y0[i]); -+ } -+ -+ if (tx0iqkok) -+ tx_average++; -+ if (rx0iqkok) -+ rx_average++; -+ } -+ -+ /* FillIQK Result */ -+ -+ if (tx_average == 0) -+ return; -+ -+ for (i = 0; i < tx_average; i++) -+ rtw_dbg(rtwdev, RTW_DBG_RFK, -+ "tx_x0[%d] = %x ;; tx_y0[%d] = %x\n", -+ i, (tx_x0[i] >> 21) & 0x000007ff, -+ i, (tx_y0[i] >> 21) & 0x000007ff); -+ -+ if (rtw88xxa_iqk_finish(tx_average, 3, tx_x0, tx_y0, -+ &tx_x, &tx_y, true, true)) -+ rtw8821a_iqk_tx_fill(rtwdev, tx_x, tx_y); -+ else -+ rtw8821a_iqk_tx_fill(rtwdev, 0x200, 0x0); -+ -+ if (rx_average == 0) -+ return; -+ -+ for (i = 0; i < rx_average; i++) { -+ rtw_dbg(rtwdev, RTW_DBG_RFK, -+ "rx_x0[0][%d] = %x ;; rx_y0[0][%d] = %x\n", -+ i, (rx_x0[0][i] >> 21) & 0x000007ff, -+ i, (rx_y0[0][i] >> 21) & 0x000007ff); -+ -+ if (rx_iqk_loop == 2) -+ rtw_dbg(rtwdev, RTW_DBG_RFK, -+ "rx_x0[1][%d] = %x ;; rx_y0[1][%d] = %x\n", -+ i, (rx_x0[1][i] >> 21) & 0x000007ff, -+ i, (rx_y0[1][i] >> 21) & 0x000007ff); -+ } -+ -+ rx_finish1 = rtw88xxa_iqk_finish(rx_average, 4, rx_x0[0], rx_y0[0], -+ &rx_x_temp, &rx_y_temp, true, true); -+ -+ if (rx_finish1) { -+ rx_x = rx_x_temp; -+ rx_y = rx_y_temp; -+ } -+ -+ if (rx_iqk_loop == 2) { -+ rx_finish2 = rtw88xxa_iqk_finish(rx_average, 4, -+ rx_x0[1], rx_y0[1], -+ &rx_x, &rx_y, true, true); -+ -+ if (rx_finish1 && rx_finish2) { -+ rx_x = (rx_x + rx_x_temp) / 2; -+ rx_y = (rx_y + rx_y_temp) / 2; -+ } -+ } -+ -+ if (rx_finish1 || rx_finish2) -+ rtw8821a_iqk_rx_fill(rtwdev, rx_x, rx_y); -+ else -+ rtw8821a_iqk_rx_fill(rtwdev, 0x200, 0x0); -+} -+ -+static void rtw8821a_do_iqk(struct rtw_dev *rtwdev) -+{ -+ static const u32 backup_macbb_reg[MACBB_REG_NUM_8821A] = { -+ 0x520, 0x550, 0x808, 0xa04, 0x90c, 0xc00, 0x838, 0x82c -+ }; -+ static const u32 backup_afe_reg[AFE_REG_NUM_8821A] = { -+ 0xc5c, 0xc60, 0xc64, 0xc68 -+ }; -+ static const u32 backup_rf_reg[RF_REG_NUM_8821A] = { -+ 0x65, 0x8f, 0x0 -+ }; -+ u32 macbb_backup[MACBB_REG_NUM_8821A]; -+ u32 afe_backup[AFE_REG_NUM_8821A]; -+ u32 rfa_backup[RF_REG_NUM_8821A]; -+ -+ rtw88xxa_iqk_backup_mac_bb(rtwdev, macbb_backup, -+ backup_macbb_reg, MACBB_REG_NUM_8821A); -+ rtw88xxa_iqk_backup_afe(rtwdev, afe_backup, -+ backup_afe_reg, AFE_REG_NUM_8821A); -+ rtw8821a_iqk_backup_rf(rtwdev, rfa_backup, -+ backup_rf_reg, RF_REG_NUM_8821A); -+ -+ rtw88xxa_iqk_configure_mac(rtwdev); -+ -+ rtw8821a_iqk(rtwdev); -+ -+ rtw8821a_iqk_restore_rf(rtwdev, backup_rf_reg, -+ rfa_backup, RF_REG_NUM_8821A); -+ rtw8821a_iqk_restore_afe(rtwdev, afe_backup, -+ backup_afe_reg, AFE_REG_NUM_8821A); -+ rtw88xxa_iqk_restore_mac_bb(rtwdev, macbb_backup, -+ backup_macbb_reg, MACBB_REG_NUM_8821A); -+} -+ -+static void rtw8821a_phy_calibration(struct rtw_dev *rtwdev) -+{ -+ rtw8821a_do_iqk(rtwdev); -+} -+ -+static void rtw8821a_pwr_track(struct rtw_dev *rtwdev) -+{ -+ struct rtw_dm_info *dm_info = &rtwdev->dm_info; -+ -+ if (!dm_info->pwr_trk_triggered) { -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_T_METER, -+ GENMASK(17, 16), 0x03); -+ dm_info->pwr_trk_triggered = true; -+ return; -+ } -+ -+ rtw88xxa_phy_pwrtrack(rtwdev, NULL, rtw8821a_do_iqk); -+ dm_info->pwr_trk_triggered = false; -+} -+ -+static void rtw8821a_fill_txdesc_checksum(struct rtw_dev *rtwdev, -+ struct rtw_tx_pkt_info *pkt_info, -+ u8 *txdesc) -+{ -+ fill_txdesc_checksum_common(txdesc, 16); -+} -+ -+static void rtw8821a_coex_cfg_init(struct rtw_dev *rtwdev) -+{ -+ u8 val8; -+ -+ /* BT report packet sample rate */ -+ rtw_write8_mask(rtwdev, REG_BT_TDMA_TIME, BIT_MASK_SAMPLE_RATE, 0x5); -+ -+ val8 = BIT_STATIS_BT_EN; -+ if (rtwdev->efuse.share_ant) -+ val8 |= BIT_R_GRANTALL_WLMASK; -+ rtw_write8(rtwdev, REG_BT_COEX_ENH_INTR_CTRL, val8); -+ -+ /* enable BT counter statistics */ -+ rtw_write8(rtwdev, REG_BT_STAT_CTRL, 0x3); -+ -+ /* enable PTA */ -+ rtw_write32_set(rtwdev, REG_GPIO_MUXCFG, BIT_BT_PTA_EN); -+} -+ -+static void rtw8821a_coex_cfg_ant_switch(struct rtw_dev *rtwdev, u8 ctrl_type, -+ u8 pos_type) -+{ -+ bool share_ant = rtwdev->efuse.share_ant; -+ struct rtw_coex *coex = &rtwdev->coex; -+ struct rtw_coex_dm *coex_dm = &coex->dm; -+ u32 phase = coex_dm->cur_ant_pos_type; -+ -+ if (!rtwdev->efuse.btcoex) -+ return; -+ -+ switch (phase) { -+ case COEX_SET_ANT_POWERON: -+ case COEX_SET_ANT_INIT: -+ rtw_write32_clr(rtwdev, REG_LED_CFG, BIT_DPDT_SEL_EN); -+ rtw_write32_set(rtwdev, REG_LED_CFG, BIT_DPDT_WL_SEL); -+ rtw_write8_set(rtwdev, REG_GNT_BT, BIT_PTA_SW_CTL); -+ -+ rtw_write8(rtwdev, REG_RFE_CTRL8, -+ share_ant ? PTA_CTRL_PIN : DPDT_CTRL_PIN); -+ rtw_write32_mask(rtwdev, REG_RFE_CTRL8, 0x30000000, 0x1); -+ break; -+ case COEX_SET_ANT_WONLY: -+ rtw_write32_clr(rtwdev, REG_LED_CFG, BIT_DPDT_SEL_EN); -+ rtw_write32_set(rtwdev, REG_LED_CFG, BIT_DPDT_WL_SEL); -+ rtw_write8_clr(rtwdev, REG_GNT_BT, BIT_PTA_SW_CTL); -+ -+ rtw_write8(rtwdev, REG_RFE_CTRL8, DPDT_CTRL_PIN); -+ rtw_write32_mask(rtwdev, REG_RFE_CTRL8, 0x30000000, 0x1); -+ break; -+ case COEX_SET_ANT_2G: -+ rtw_write32_clr(rtwdev, REG_LED_CFG, BIT_DPDT_SEL_EN); -+ rtw_write32_set(rtwdev, REG_LED_CFG, BIT_DPDT_WL_SEL); -+ rtw_write8_clr(rtwdev, REG_GNT_BT, BIT_PTA_SW_CTL); -+ -+ rtw_write8(rtwdev, REG_RFE_CTRL8, -+ share_ant ? PTA_CTRL_PIN : DPDT_CTRL_PIN); -+ rtw_write32_mask(rtwdev, REG_RFE_CTRL8, 0x30000000, 0x1); -+ break; -+ case COEX_SET_ANT_5G: -+ rtw_write32_clr(rtwdev, REG_LED_CFG, BIT_DPDT_SEL_EN); -+ rtw_write32_set(rtwdev, REG_LED_CFG, BIT_DPDT_WL_SEL); -+ rtw_write8_set(rtwdev, REG_GNT_BT, BIT_PTA_SW_CTL); -+ -+ rtw_write8(rtwdev, REG_RFE_CTRL8, DPDT_CTRL_PIN); -+ rtw_write32_mask(rtwdev, REG_RFE_CTRL8, 0x30000000, -+ share_ant ? 0x2 : 0x1); -+ break; -+ case COEX_SET_ANT_WOFF: -+ rtw_write32_clr(rtwdev, REG_LED_CFG, BIT_DPDT_SEL_EN); -+ rtw_write32_clr(rtwdev, REG_LED_CFG, BIT_DPDT_WL_SEL); -+ rtw_write8_set(rtwdev, REG_GNT_BT, BIT_PTA_SW_CTL); -+ -+ rtw_write8(rtwdev, REG_RFE_CTRL8, DPDT_CTRL_PIN); -+ rtw_write32_mask(rtwdev, REG_RFE_CTRL8, 0x30000000, -+ share_ant ? 0x2 : 0x1); -+ break; -+ default: -+ rtw_warn(rtwdev, "%s: not handling phase %d\n", -+ __func__, phase); -+ break; -+ } -+} -+ -+static void rtw8821a_coex_cfg_gnt_fix(struct rtw_dev *rtwdev) -+{ -+} -+ -+static void rtw8821a_coex_cfg_gnt_debug(struct rtw_dev *rtwdev) -+{ -+} -+ -+static void rtw8821a_coex_cfg_rfe_type(struct rtw_dev *rtwdev) -+{ -+ struct rtw_coex *coex = &rtwdev->coex; -+ struct rtw_coex_rfe *coex_rfe = &coex->rfe; -+ -+ coex_rfe->ant_switch_exist = true; -+} -+ -+static void rtw8821a_coex_cfg_wl_tx_power(struct rtw_dev *rtwdev, u8 wl_pwr) -+{ -+ struct rtw_coex *coex = &rtwdev->coex; -+ struct rtw_coex_dm *coex_dm = &coex->dm; -+ struct rtw_efuse *efuse = &rtwdev->efuse; -+ bool share_ant = efuse->share_ant; -+ -+ if (share_ant) -+ return; -+ -+ if (wl_pwr == coex_dm->cur_wl_pwr_lvl) -+ return; -+ -+ coex_dm->cur_wl_pwr_lvl = wl_pwr; -+} -+ -+static void rtw8821a_coex_cfg_wl_rx_gain(struct rtw_dev *rtwdev, bool low_gain) -+{ -+} -+ -+static const struct rtw_chip_ops rtw8821a_ops = { -+ .power_on = rtw88xxa_power_on, -+ .power_off = rtw8821a_power_off, -+ .phy_set_param = NULL, -+ .read_efuse = rtw88xxa_read_efuse, -+ .query_phy_status = rtw8821a_query_phy_status, -+ .set_channel = rtw88xxa_set_channel, -+ .mac_init = NULL, -+ .read_rf = rtw88xxa_phy_read_rf, -+ .write_rf = rtw_phy_write_rf_reg_sipi, -+ .set_antenna = NULL, -+ .set_tx_power_index = rtw88xxa_set_tx_power_index, -+ .cfg_ldo25 = rtw8821a_cfg_ldo25, -+ .efuse_grant = rtw88xxa_efuse_grant, -+ .false_alarm_statistics = rtw88xxa_false_alarm_statistics, -+ .phy_calibration = rtw8821a_phy_calibration, -+ .cck_pd_set = rtw88xxa_phy_cck_pd_set, -+ .pwr_track = rtw8821a_pwr_track, -+ .config_bfee = NULL, -+ .set_gid_table = NULL, -+ .cfg_csi_rate = NULL, -+ .fill_txdesc_checksum = rtw8821a_fill_txdesc_checksum, -+ .coex_set_init = rtw8821a_coex_cfg_init, -+ .coex_set_ant_switch = rtw8821a_coex_cfg_ant_switch, -+ .coex_set_gnt_fix = rtw8821a_coex_cfg_gnt_fix, -+ .coex_set_gnt_debug = rtw8821a_coex_cfg_gnt_debug, -+ .coex_set_rfe_type = rtw8821a_coex_cfg_rfe_type, -+ .coex_set_wl_tx_power = rtw8821a_coex_cfg_wl_tx_power, -+ .coex_set_wl_rx_gain = rtw8821a_coex_cfg_wl_rx_gain, -+}; -+ -+static const struct rtw_page_table page_table_8821a[] = { -+ /* hq_num, nq_num, lq_num, exq_num, gapq_num */ -+ {0, 0, 0, 0, 0}, /* SDIO */ -+ {0, 0, 0, 0, 0}, /* PCI */ -+ {8, 0, 0, 0, 1}, /* 2 bulk out endpoints */ -+ {8, 0, 8, 0, 1}, /* 3 bulk out endpoints */ -+ {8, 0, 8, 4, 1}, /* 4 bulk out endpoints */ -+}; -+ -+static const struct rtw_rqpn rqpn_table_8821a[] = { -+ {RTW_DMA_MAPPING_NORMAL, RTW_DMA_MAPPING_NORMAL, -+ RTW_DMA_MAPPING_LOW, RTW_DMA_MAPPING_LOW, -+ RTW_DMA_MAPPING_EXTRA, RTW_DMA_MAPPING_HIGH}, -+ -+ {RTW_DMA_MAPPING_NORMAL, RTW_DMA_MAPPING_NORMAL, -+ RTW_DMA_MAPPING_LOW, RTW_DMA_MAPPING_LOW, -+ RTW_DMA_MAPPING_EXTRA, RTW_DMA_MAPPING_HIGH}, -+ -+ {RTW_DMA_MAPPING_HIGH, RTW_DMA_MAPPING_HIGH, -+ RTW_DMA_MAPPING_NORMAL, RTW_DMA_MAPPING_NORMAL, -+ RTW_DMA_MAPPING_HIGH, RTW_DMA_MAPPING_HIGH}, -+ -+ {RTW_DMA_MAPPING_HIGH, RTW_DMA_MAPPING_NORMAL, -+ RTW_DMA_MAPPING_LOW, RTW_DMA_MAPPING_LOW, -+ RTW_DMA_MAPPING_HIGH, RTW_DMA_MAPPING_HIGH}, -+ -+ {RTW_DMA_MAPPING_NORMAL, RTW_DMA_MAPPING_NORMAL, -+ RTW_DMA_MAPPING_LOW, RTW_DMA_MAPPING_LOW, -+ RTW_DMA_MAPPING_EXTRA, RTW_DMA_MAPPING_HIGH}, -+}; -+ -+static const struct rtw_prioq_addrs prioq_addrs_8821a = { -+ .prio[RTW_DMA_MAPPING_EXTRA] = { -+ .rsvd = REG_RQPN_NPQ + 2, .avail = REG_RQPN_NPQ + 3, -+ }, -+ .prio[RTW_DMA_MAPPING_LOW] = { -+ .rsvd = REG_RQPN + 1, .avail = REG_FIFOPAGE_CTRL_2 + 1, -+ }, -+ .prio[RTW_DMA_MAPPING_NORMAL] = { -+ .rsvd = REG_RQPN_NPQ, .avail = REG_RQPN_NPQ + 1, -+ }, -+ .prio[RTW_DMA_MAPPING_HIGH] = { -+ .rsvd = REG_RQPN, .avail = REG_FIFOPAGE_CTRL_2, -+ }, -+ .wsize = false, -+}; -+ -+static const struct rtw_hw_reg rtw8821a_dig[] = { -+ [0] = { .addr = REG_RXIGI_A, .mask = 0x7f }, -+}; -+ -+static const struct rtw_rfe_def rtw8821a_rfe_defs[] = { -+ [0] = { .phy_pg_tbl = &rtw8821a_bb_pg_tbl, -+ .txpwr_lmt_tbl = &rtw8821a_txpwr_lmt_tbl, -+ .pwr_track_tbl = &rtw8821a_rtw_pwr_track_tbl, }, -+}; -+ -+/* TODO */ -+/* rssi in percentage % (dbm = % - 100) */ -+static const u8 wl_rssi_step_8821a[] = {101, 45, 101, 40}; -+static const u8 bt_rssi_step_8821a[] = {101, 101, 101, 101}; -+ -+/* table_sant_8821a, table_nsant_8821a, tdma_sant_8821a, and tdma_nsant_8821a -+ * are copied from rtw8821c.c because the 8821au driver's tables are not -+ * compatible with the coex code in rtw88. -+ * -+ * tdma case 112 (A2DP) byte 0 had to be modified from 0x61 to 0x51, -+ * otherwise the firmware gets confused after pausing the music: -+ * rtw_8821au 1-2:1.2: [BTCoex], Bt_info[1], len=7, data=[81 00 0a 01 00 00] -+ * - 81 means PAN (personal area network) when it should be 4x (A2DP) -+ * The music is not smooth with the PAN algorithm. -+ */ -+ -+/* Shared-Antenna Coex Table */ -+static const struct coex_table_para table_sant_8821a[] = { -+ {0x55555555, 0x55555555}, /* case-0 */ -+ {0x55555555, 0x55555555}, -+ {0x66555555, 0x66555555}, -+ {0xaaaaaaaa, 0xaaaaaaaa}, -+ {0x5a5a5a5a, 0x5a5a5a5a}, -+ {0xfafafafa, 0xfafafafa}, /* case-5 */ -+ {0x6a5a5555, 0xaaaaaaaa}, -+ {0x6a5a56aa, 0x6a5a56aa}, -+ {0x6a5a5a5a, 0x6a5a5a5a}, -+ {0x66555555, 0x5a5a5a5a}, -+ {0x66555555, 0x6a5a5a5a}, /* case-10 */ -+ {0x66555555, 0xaaaaaaaa}, -+ {0x66555555, 0x6a5a5aaa}, -+ {0x66555555, 0x6aaa6aaa}, -+ {0x66555555, 0x6a5a5aaa}, -+ {0x66555555, 0xaaaaaaaa}, /* case-15 */ -+ {0xffff55ff, 0xfafafafa}, -+ {0xffff55ff, 0x6afa5afa}, -+ {0xaaffffaa, 0xfafafafa}, -+ {0xaa5555aa, 0x5a5a5a5a}, -+ {0xaa5555aa, 0x6a5a5a5a}, /* case-20 */ -+ {0xaa5555aa, 0xaaaaaaaa}, -+ {0xffffffff, 0x55555555}, -+ {0xffffffff, 0x5a5a5a5a}, -+ {0xffffffff, 0x5a5a5a5a}, -+ {0xffffffff, 0x5a5a5aaa}, /* case-25 */ -+ {0x55555555, 0x5a5a5a5a}, -+ {0x55555555, 0xaaaaaaaa}, -+ {0x66555555, 0x6a5a6a5a}, -+ {0x66556655, 0x66556655}, -+ {0x66556aaa, 0x6a5a6aaa}, /* case-30 */ -+ {0xffffffff, 0x5aaa5aaa}, -+ {0x56555555, 0x5a5a5aaa} -+}; -+ -+/* Non-Shared-Antenna Coex Table */ -+static const struct coex_table_para table_nsant_8821a[] = { -+ {0xffffffff, 0xffffffff}, /* case-100 */ -+ {0xffff55ff, 0xfafafafa}, -+ {0x66555555, 0x66555555}, -+ {0xaaaaaaaa, 0xaaaaaaaa}, -+ {0x5a5a5a5a, 0x5a5a5a5a}, -+ {0xffffffff, 0xffffffff}, /* case-105 */ -+ {0x5afa5afa, 0x5afa5afa}, -+ {0x55555555, 0xfafafafa}, -+ {0x66555555, 0xfafafafa}, -+ {0x66555555, 0x5a5a5a5a}, -+ {0x66555555, 0x6a5a5a5a}, /* case-110 */ -+ {0x66555555, 0xaaaaaaaa}, -+ {0xffff55ff, 0xfafafafa}, -+ {0xffff55ff, 0x5afa5afa}, -+ {0xffff55ff, 0xaaaaaaaa}, -+ {0xffff55ff, 0xffff55ff}, /* case-115 */ -+ {0xaaffffaa, 0x5afa5afa}, -+ {0xaaffffaa, 0xaaaaaaaa}, -+ {0xffffffff, 0xfafafafa}, -+ {0xffff55ff, 0xfafafafa}, -+ {0xffffffff, 0xaaaaaaaa}, /* case-120 */ -+ {0xffff55ff, 0x5afa5afa}, -+ {0xffff55ff, 0x5afa5afa}, -+ {0x55ff55ff, 0x55ff55ff} -+}; -+ -+/* Shared-Antenna TDMA */ -+static const struct coex_tdma_para tdma_sant_8821a[] = { -+ { {0x00, 0x00, 0x00, 0x00, 0x00} }, /* case-0 */ -+ { {0x61, 0x45, 0x03, 0x11, 0x11} }, /* case-1 */ -+ { {0x61, 0x3a, 0x03, 0x11, 0x11} }, -+ { {0x61, 0x35, 0x03, 0x11, 0x11} }, -+ { {0x61, 0x20, 0x03, 0x11, 0x11} }, -+ { {0x61, 0x3a, 0x03, 0x11, 0x11} }, /* case-5 */ -+ { {0x61, 0x45, 0x03, 0x11, 0x10} }, -+ { {0x61, 0x35, 0x03, 0x11, 0x10} }, -+ { {0x61, 0x30, 0x03, 0x11, 0x10} }, -+ { {0x61, 0x20, 0x03, 0x11, 0x10} }, -+ { {0x61, 0x10, 0x03, 0x11, 0x10} }, /* case-10 */ -+ { {0x61, 0x08, 0x03, 0x11, 0x15} }, -+ { {0x61, 0x08, 0x03, 0x10, 0x14} }, -+ { {0x51, 0x08, 0x03, 0x10, 0x54} }, -+ { {0x51, 0x08, 0x03, 0x10, 0x55} }, -+ { {0x51, 0x08, 0x07, 0x10, 0x54} }, /* case-15 */ -+ { {0x51, 0x45, 0x03, 0x10, 0x50} }, -+ { {0x51, 0x3a, 0x03, 0x11, 0x50} }, -+ { {0x51, 0x30, 0x03, 0x10, 0x50} }, -+ { {0x51, 0x21, 0x03, 0x10, 0x50} }, -+ { {0x51, 0x10, 0x03, 0x10, 0x50} }, /* case-20 */ -+ { {0x51, 0x4a, 0x03, 0x10, 0x50} }, -+ { {0x51, 0x08, 0x03, 0x30, 0x54} }, -+ { {0x55, 0x08, 0x03, 0x10, 0x54} }, -+ { {0x65, 0x10, 0x03, 0x11, 0x10} }, -+ { {0x51, 0x10, 0x03, 0x10, 0x51} }, /* case-25 */ -+ { {0x51, 0x21, 0x03, 0x10, 0x50} }, -+ { {0x61, 0x08, 0x03, 0x11, 0x11} } -+}; -+ -+/* Non-Shared-Antenna TDMA */ -+static const struct coex_tdma_para tdma_nsant_8821a[] = { -+ { {0x00, 0x00, 0x00, 0x40, 0x00} }, /* case-100 */ -+ { {0x61, 0x45, 0x03, 0x11, 0x11} }, -+ { {0x61, 0x25, 0x03, 0x11, 0x11} }, -+ { {0x61, 0x35, 0x03, 0x11, 0x11} }, -+ { {0x61, 0x20, 0x03, 0x11, 0x11} }, -+ { {0x61, 0x10, 0x03, 0x11, 0x11} }, /* case-105 */ -+ { {0x61, 0x45, 0x03, 0x11, 0x10} }, -+ { {0x61, 0x30, 0x03, 0x11, 0x10} }, -+ { {0x61, 0x30, 0x03, 0x11, 0x10} }, -+ { {0x61, 0x20, 0x03, 0x11, 0x10} }, -+ { {0x61, 0x10, 0x03, 0x11, 0x10} }, /* case-110 */ -+ { {0x61, 0x10, 0x03, 0x11, 0x11} }, -+ { {0x51, 0x08, 0x03, 0x10, 0x14} }, /* a2dp high rssi */ -+ { {0x51, 0x08, 0x03, 0x10, 0x54} }, /* a2dp not high rssi */ -+ { {0x51, 0x08, 0x03, 0x10, 0x55} }, -+ { {0x51, 0x08, 0x07, 0x10, 0x54} }, /* case-115 */ -+ { {0x51, 0x45, 0x03, 0x10, 0x50} }, -+ { {0x51, 0x3a, 0x03, 0x10, 0x50} }, -+ { {0x51, 0x30, 0x03, 0x10, 0x50} }, -+ { {0x51, 0x21, 0x03, 0x10, 0x50} }, -+ { {0x51, 0x21, 0x03, 0x10, 0x50} }, /* case-120 */ -+ { {0x51, 0x10, 0x03, 0x10, 0x50} } -+}; -+ -+/* TODO */ -+static const struct coex_rf_para rf_para_tx_8821a[] = { -+ {0, 0, false, 7}, /* for normal */ -+ {0, 20, false, 7}, /* for WL-CPT */ -+ {8, 17, true, 4}, -+ {7, 18, true, 4}, -+ {6, 19, true, 4}, -+ {5, 20, true, 4} -+}; -+ -+static const struct coex_rf_para rf_para_rx_8821a[] = { -+ {0, 0, false, 7}, /* for normal */ -+ {0, 20, false, 7}, /* for WL-CPT */ -+ {3, 24, true, 5}, -+ {2, 26, true, 5}, -+ {1, 27, true, 5}, -+ {0, 28, true, 5} -+}; -+ -+static_assert(ARRAY_SIZE(rf_para_tx_8821a) == ARRAY_SIZE(rf_para_rx_8821a)); -+ -+static const struct coex_5g_afh_map afh_5g_8821a[] = { {0, 0, 0} }; -+ -+static const struct rtw_reg_domain coex_info_hw_regs_8821a[] = { -+ {0xCB0, MASKDWORD, RTW_REG_DOMAIN_MAC32}, -+ {0xCB4, MASKDWORD, RTW_REG_DOMAIN_MAC32}, -+ {0xCBA, MASKBYTE0, RTW_REG_DOMAIN_MAC8}, -+ {0, 0, RTW_REG_DOMAIN_NL}, -+ {0x430, MASKDWORD, RTW_REG_DOMAIN_MAC32}, -+ {0x434, MASKDWORD, RTW_REG_DOMAIN_MAC32}, -+ {0x42a, MASKLWORD, RTW_REG_DOMAIN_MAC16}, -+ {0x426, MASKBYTE0, RTW_REG_DOMAIN_MAC8}, -+ {0x45e, BIT(3), RTW_REG_DOMAIN_MAC8}, -+ {0x454, MASKLWORD, RTW_REG_DOMAIN_MAC16}, -+ {0, 0, RTW_REG_DOMAIN_NL}, -+ {0x4c, BIT(24) | BIT(23), RTW_REG_DOMAIN_MAC32}, -+ {0x64, BIT(0), RTW_REG_DOMAIN_MAC8}, -+ {0x4c6, BIT(4), RTW_REG_DOMAIN_MAC8}, -+ {0x40, BIT(5), RTW_REG_DOMAIN_MAC8}, -+ {0x1, RFREG_MASK, RTW_REG_DOMAIN_RF_A}, -+ {0, 0, RTW_REG_DOMAIN_NL}, -+ {0x550, MASKDWORD, RTW_REG_DOMAIN_MAC32}, -+ {0x522, MASKBYTE0, RTW_REG_DOMAIN_MAC8}, -+ {0x953, BIT(1), RTW_REG_DOMAIN_MAC8}, -+ {0xc50, MASKBYTE0, RTW_REG_DOMAIN_MAC8}, -+ {0x60A, MASKBYTE0, RTW_REG_DOMAIN_MAC8}, -+}; -+ -+const struct rtw_chip_info rtw8821a_hw_spec = { -+ .ops = &rtw8821a_ops, -+ .id = RTW_CHIP_TYPE_8821A, -+ .fw_name = "rtw88/rtw8821a_fw.bin", -+ .wlan_cpu = RTW_WCPU_11N, -+ .tx_pkt_desc_sz = 40, -+ .tx_buf_desc_sz = 16, -+ .rx_pkt_desc_sz = 24, -+ .rx_buf_desc_sz = 8, -+ .phy_efuse_size = 512, -+ .log_efuse_size = 512, -+ .ptct_efuse_size = 96 + 1, /* TODO or just 18? */ -+ .txff_size = 65536, -+ .rxff_size = 16128, -+ .rsvd_drv_pg_num = 8, -+ .txgi_factor = 1, -+ .is_pwr_by_rate_dec = true, -+ .max_power_index = 0x3f, -+ .csi_buf_pg_num = 0, -+ .band = RTW_BAND_2G | RTW_BAND_5G, -+ .page_size = 256, -+ .dig_min = 0x20, -+ .ht_supported = true, -+ .vht_supported = true, -+ .lps_deep_mode_supported = 0, -+ .sys_func_en = 0xFD, -+ .pwr_on_seq = card_enable_flow_8821a, -+ .pwr_off_seq = card_disable_flow_8821a, -+ .page_table = page_table_8821a, -+ .rqpn_table = rqpn_table_8821a, -+ .prioq_addrs = &prioq_addrs_8821a, -+ .intf_table = NULL, -+ .dig = rtw8821a_dig, -+ .rf_sipi_addr = {REG_LSSI_WRITE_A, REG_LSSI_WRITE_B}, -+ .ltecoex_addr = NULL, -+ .mac_tbl = &rtw8821a_mac_tbl, -+ .agc_tbl = &rtw8821a_agc_tbl, -+ .bb_tbl = &rtw8821a_bb_tbl, -+ .rf_tbl = {&rtw8821a_rf_a_tbl}, -+ .rfe_defs = rtw8821a_rfe_defs, -+ .rfe_defs_size = ARRAY_SIZE(rtw8821a_rfe_defs), -+ .rx_ldpc = false, -+ .hw_feature_report = false, -+ .c2h_ra_report_size = 4, -+ .old_datarate_fb_limit = true, -+ .usb_tx_agg_desc_num = 6, -+ .iqk_threshold = 8, -+ .ampdu_density = IEEE80211_HT_MPDU_DENSITY_16, -+ .max_scan_ie_len = IEEE80211_MAX_DATA_LEN, -+ -+ .coex_para_ver = 20190509, /* glcoex_ver_date_8821a_1ant */ -+ .bt_desired_ver = 0x62, /* But for 2 ant it's 0x5c */ -+ .scbd_support = false, -+ .new_scbd10_def = false, -+ .ble_hid_profile_support = false, -+ .wl_mimo_ps_support = false, -+ .pstdma_type = COEX_PSTDMA_FORCE_LPSOFF, -+ .bt_rssi_type = COEX_BTRSSI_RATIO, -+ .ant_isolation = 10, -+ .rssi_tolerance = 2, -+ .wl_rssi_step = wl_rssi_step_8821a, -+ .bt_rssi_step = bt_rssi_step_8821a, -+ .table_sant_num = ARRAY_SIZE(table_sant_8821a), -+ .table_sant = table_sant_8821a, -+ .table_nsant_num = ARRAY_SIZE(table_nsant_8821a), -+ .table_nsant = table_nsant_8821a, -+ .tdma_sant_num = ARRAY_SIZE(tdma_sant_8821a), -+ .tdma_sant = tdma_sant_8821a, -+ .tdma_nsant_num = ARRAY_SIZE(tdma_nsant_8821a), -+ .tdma_nsant = tdma_nsant_8821a, -+ .wl_rf_para_num = ARRAY_SIZE(rf_para_tx_8821a), -+ .wl_rf_para_tx = rf_para_tx_8821a, -+ .wl_rf_para_rx = rf_para_rx_8821a, -+ .bt_afh_span_bw20 = 0x20, -+ .bt_afh_span_bw40 = 0x30, -+ .afh_5g_num = ARRAY_SIZE(afh_5g_8821a), -+ .afh_5g = afh_5g_8821a, -+ -+ .coex_info_hw_regs_num = ARRAY_SIZE(coex_info_hw_regs_8821a), -+ .coex_info_hw_regs = coex_info_hw_regs_8821a, -+}; -+EXPORT_SYMBOL(rtw8821a_hw_spec); -+ -+MODULE_FIRMWARE("rtw88/rtw8821a_fw.bin"); -+ -+MODULE_AUTHOR("Realtek Corporation"); -+MODULE_DESCRIPTION("Realtek 802.11ac wireless 8821a/8811a driver"); -+MODULE_LICENSE("Dual BSD/GPL"); ---- /dev/null -+++ b/drivers/net/wireless/realtek/rtw88/rtw8821a.h -@@ -0,0 +1,10 @@ -+/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ -+/* Copyright(c) 2024 Realtek Corporation -+ */ -+ -+#ifndef __RTW8821A_H__ -+#define __RTW8821A_H__ -+ -+extern const struct rtw_chip_info rtw8821a_hw_spec; -+ -+#endif diff --git a/package/kernel/mac80211/patches/rtl/043-v6.13-wifi-rtw88-Add-rtw8812a.-c-h.patch b/package/kernel/mac80211/patches/rtl/043-v6.13-wifi-rtw88-Add-rtw8812a.-c-h.patch deleted file mode 100644 index 610dca037a2..00000000000 --- a/package/kernel/mac80211/patches/rtl/043-v6.13-wifi-rtw88-Add-rtw8812a.-c-h.patch +++ /dev/null @@ -1,1135 +0,0 @@ -From 4f8ec8927bc292b2a71cd5a253c96ce3c6b2927f Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Wed, 30 Oct 2024 20:28:49 +0200 -Subject: [PATCH] wifi: rtw88: Add rtw8812a.{c,h} - -These contain code specific to RTL8812AU. - -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/a0057683-79eb-4ab2-8f74-11a3bc58adfb@gmail.com ---- - drivers/net/wireless/realtek/rtw88/rtw8812a.c | 1102 +++++++++++++++++ - drivers/net/wireless/realtek/rtw88/rtw8812a.h | 10 + - 2 files changed, 1112 insertions(+) - create mode 100644 drivers/net/wireless/realtek/rtw88/rtw8812a.c - create mode 100644 drivers/net/wireless/realtek/rtw88/rtw8812a.h - ---- /dev/null -+++ b/drivers/net/wireless/realtek/rtw88/rtw8812a.c -@@ -0,0 +1,1102 @@ -+// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause -+/* Copyright(c) 2024 Realtek Corporation -+ */ -+ -+#include "main.h" -+#include "coex.h" -+#include "phy.h" -+#include "reg.h" -+#include "rtw88xxa.h" -+#include "rtw8812a.h" -+#include "rtw8812a_table.h" -+#include "tx.h" -+ -+static void rtw8812a_power_off(struct rtw_dev *rtwdev) -+{ -+ rtw88xxa_power_off(rtwdev, enter_lps_flow_8812a); -+} -+ -+static s8 rtw8812a_cck_rx_pwr(u8 lna_idx, u8 vga_idx) -+{ -+ s8 rx_pwr_all = 0; -+ -+ switch (lna_idx) { -+ case 7: -+ if (vga_idx <= 27) -+ rx_pwr_all = -94 + 2 * (27 - vga_idx); -+ else -+ rx_pwr_all = -94; -+ break; -+ case 6: -+ rx_pwr_all = -42 + 2 * (2 - vga_idx); -+ break; -+ case 5: -+ rx_pwr_all = -36 + 2 * (7 - vga_idx); -+ break; -+ case 4: -+ rx_pwr_all = -30 + 2 * (7 - vga_idx); -+ break; -+ case 3: -+ rx_pwr_all = -18 + 2 * (7 - vga_idx); -+ break; -+ case 2: -+ rx_pwr_all = 2 * (5 - vga_idx); -+ break; -+ case 1: -+ rx_pwr_all = 14 - 2 * vga_idx; -+ break; -+ case 0: -+ rx_pwr_all = 20 - 2 * vga_idx; -+ break; -+ default: -+ break; -+ } -+ -+ return rx_pwr_all; -+} -+ -+static void rtw8812a_query_phy_status(struct rtw_dev *rtwdev, u8 *phy_status, -+ struct rtw_rx_pkt_stat *pkt_stat) -+{ -+ rtw88xxa_query_phy_status(rtwdev, phy_status, pkt_stat, -+ rtw8812a_cck_rx_pwr); -+ -+ if (pkt_stat->rate >= DESC_RATE6M) -+ return; -+ -+ if (rtwdev->hal.cck_high_power) -+ return; -+ -+ if (pkt_stat->rssi >= 80) -+ pkt_stat->rssi = ((pkt_stat->rssi - 80) << 1) + -+ ((pkt_stat->rssi - 80) >> 1) + 80; -+ else if (pkt_stat->rssi <= 78 && pkt_stat->rssi >= 20) -+ pkt_stat->rssi += 3; -+} -+ -+static void rtw8812a_cfg_ldo25(struct rtw_dev *rtwdev, bool enable) -+{ -+} -+ -+static void rtw8812a_do_lck(struct rtw_dev *rtwdev) -+{ -+ u32 cont_tx, lc_cal, i; -+ -+ cont_tx = rtw_read32_mask(rtwdev, REG_SINGLE_TONE_CONT_TX, 0x70000); -+ -+ lc_cal = rtw_read_rf(rtwdev, RF_PATH_A, RF_CFGCH, RFREG_MASK); -+ -+ if (!cont_tx) -+ rtw_write8(rtwdev, REG_TXPAUSE, 0xff); -+ -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_LCK, BIT(14), 1); -+ -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_CFGCH, 0x08000, 1); -+ -+ mdelay(150); -+ -+ for (i = 0; i < 5; i++) { -+ if (rtw_read_rf(rtwdev, RF_PATH_A, RF_CFGCH, 0x08000) != 1) -+ break; -+ -+ mdelay(10); -+ } -+ -+ if (i == 5) -+ rtw_dbg(rtwdev, RTW_DBG_RFK, "LCK timed out\n"); -+ -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_CFGCH, RFREG_MASK, lc_cal); -+ -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_LCK, BIT(14), 0); -+ -+ if (!cont_tx) -+ rtw_write8(rtwdev, REG_TXPAUSE, 0); -+ -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_CFGCH, RFREG_MASK, lc_cal); -+} -+ -+static void rtw8812a_iqk_backup_rf(struct rtw_dev *rtwdev, u32 *rfa_backup, -+ u32 *rfb_backup, const u32 *backup_rf_reg, -+ u32 rf_num) -+{ -+ u32 i; -+ -+ /* [31] = 0 --> Page C */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x0); -+ -+ /* Save RF Parameters */ -+ for (i = 0; i < rf_num; i++) { -+ rfa_backup[i] = rtw_read_rf(rtwdev, RF_PATH_A, -+ backup_rf_reg[i], MASKDWORD); -+ rfb_backup[i] = rtw_read_rf(rtwdev, RF_PATH_B, -+ backup_rf_reg[i], MASKDWORD); -+ } -+} -+ -+static void rtw8812a_iqk_restore_rf(struct rtw_dev *rtwdev, -+ enum rtw_rf_path path, -+ const u32 *backup_rf_reg, -+ u32 *RF_backup, u32 rf_reg_num) -+{ -+ u32 i; -+ -+ /* [31] = 0 --> Page C */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x0); -+ -+ for (i = 0; i < rf_reg_num; i++) -+ rtw_write_rf(rtwdev, path, backup_rf_reg[i], -+ RFREG_MASK, RF_backup[i]); -+ -+ rtw_write_rf(rtwdev, path, RF_LUTWE, RFREG_MASK, 0); -+} -+ -+static void rtw8812a_iqk_restore_afe(struct rtw_dev *rtwdev, u32 *afe_backup, -+ const u32 *backup_afe_reg, u32 afe_num) -+{ -+ u32 i; -+ -+ /* [31] = 0 --> Page C */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x0); -+ -+ /* Reload AFE Parameters */ -+ for (i = 0; i < afe_num; i++) -+ rtw_write32(rtwdev, backup_afe_reg[i], afe_backup[i]); -+ -+ /* [31] = 1 --> Page C1 */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x1); -+ -+ rtw_write32(rtwdev, REG_OFDM0_XA_TX_IQ_IMBALANCE, 0x0); -+ rtw_write32(rtwdev, REG_OFDM0_A_TX_AFE, 0x0); -+ rtw_write32(rtwdev, REG_OFDM0_XB_TX_IQ_IMBALANCE, 0x0); -+ rtw_write32(rtwdev, REG_TSSI_TRK_SW, 0x3c000000); -+ rtw_write32_mask(rtwdev, REG_LSSI_WRITE_A, BIT(7), 1); -+ rtw_write32_mask(rtwdev, REG_IQK_DPD_CFG, BIT(18), 1); -+ rtw_write32_mask(rtwdev, REG_IQK_DPD_CFG, BIT(29), 1); -+ rtw_write32_mask(rtwdev, REG_CFG_PMPD, BIT(29), 1); -+ -+ rtw_write32(rtwdev, REG_TXTONEB, 0x0); -+ rtw_write32(rtwdev, REG_RXTONEB, 0x0); -+ rtw_write32(rtwdev, REG_TXPITMB, 0x0); -+ rtw_write32(rtwdev, REG_RXPITMB, 0x3c000000); -+ rtw_write32_mask(rtwdev, REG_LSSI_WRITE_B, BIT(7), 1); -+ rtw_write32_mask(rtwdev, REG_BPBDB, BIT(18), 1); -+ rtw_write32_mask(rtwdev, REG_BPBDB, BIT(29), 1); -+ rtw_write32_mask(rtwdev, REG_PHYTXONB, BIT(29), 1); -+} -+ -+static void rtw8812a_iqk_rx_fill(struct rtw_dev *rtwdev, enum rtw_rf_path path, -+ unsigned int rx_x, unsigned int rx_y) -+{ -+ switch (path) { -+ case RF_PATH_A: -+ /* [31] = 0 --> Page C */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x0); -+ if (rx_x >> 1 >= 0x112 || -+ (rx_y >> 1 >= 0x12 && rx_y >> 1 <= 0x3ee)) { -+ rtw_write32_mask(rtwdev, REG_RX_IQC_AB_A, -+ 0x000003ff, 0x100); -+ rtw_write32_mask(rtwdev, REG_RX_IQC_AB_A, -+ 0x03ff0000, 0); -+ } else { -+ rtw_write32_mask(rtwdev, REG_RX_IQC_AB_A, -+ 0x000003ff, rx_x >> 1); -+ rtw_write32_mask(rtwdev, REG_RX_IQC_AB_A, -+ 0x03ff0000, rx_y >> 1); -+ } -+ rtw_dbg(rtwdev, RTW_DBG_RFK, -+ "rx_x = %x;;rx_y = %x ====>fill to IQC\n", -+ rx_x >> 1 & 0x000003ff, rx_y >> 1 & 0x000003ff); -+ rtw_dbg(rtwdev, RTW_DBG_RFK, "0xc10 = %x ====>fill to IQC\n", -+ rtw_read32(rtwdev, REG_RX_IQC_AB_A)); -+ break; -+ case RF_PATH_B: -+ /* [31] = 0 --> Page C */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x0); -+ if (rx_x >> 1 >= 0x112 || -+ (rx_y >> 1 >= 0x12 && rx_y >> 1 <= 0x3ee)) { -+ rtw_write32_mask(rtwdev, REG_RX_IQC_AB_B, -+ 0x000003ff, 0x100); -+ rtw_write32_mask(rtwdev, REG_RX_IQC_AB_B, -+ 0x03ff0000, 0); -+ } else { -+ rtw_write32_mask(rtwdev, REG_RX_IQC_AB_B, -+ 0x000003ff, rx_x >> 1); -+ rtw_write32_mask(rtwdev, REG_RX_IQC_AB_B, -+ 0x03ff0000, rx_y >> 1); -+ } -+ rtw_dbg(rtwdev, RTW_DBG_RFK, -+ "rx_x = %x;;rx_y = %x ====>fill to IQC\n", -+ rx_x >> 1 & 0x000003ff, rx_y >> 1 & 0x000003ff); -+ rtw_dbg(rtwdev, RTW_DBG_RFK, "0xe10 = %x====>fill to IQC\n", -+ rtw_read32(rtwdev, REG_RX_IQC_AB_B)); -+ break; -+ default: -+ break; -+ } -+} -+ -+static void rtw8812a_iqk_tx_fill(struct rtw_dev *rtwdev, enum rtw_rf_path path, -+ unsigned int tx_x, unsigned int tx_y) -+{ -+ switch (path) { -+ case RF_PATH_A: -+ /* [31] = 1 --> Page C1 */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x1); -+ rtw_write32_mask(rtwdev, REG_PREDISTA, BIT(7), 0x1); -+ rtw_write32_mask(rtwdev, REG_IQK_DPD_CFG, BIT(18), 0x1); -+ rtw_write32_mask(rtwdev, REG_IQK_DPD_CFG, BIT(29), 0x1); -+ rtw_write32_mask(rtwdev, REG_CFG_PMPD, BIT(29), 0x1); -+ rtw_write32_mask(rtwdev, REG_IQC_Y, 0x000007ff, tx_y); -+ rtw_write32_mask(rtwdev, REG_IQC_X, 0x000007ff, tx_x); -+ rtw_dbg(rtwdev, RTW_DBG_RFK, -+ "tx_x = %x;;tx_y = %x =====> fill to IQC\n", -+ tx_x & 0x000007ff, tx_y & 0x000007ff); -+ rtw_dbg(rtwdev, RTW_DBG_RFK, -+ "0xcd4 = %x;;0xccc = %x ====>fill to IQC\n", -+ rtw_read32_mask(rtwdev, REG_IQC_X, 0x000007ff), -+ rtw_read32_mask(rtwdev, REG_IQC_Y, 0x000007ff)); -+ break; -+ case RF_PATH_B: -+ /* [31] = 1 --> Page C1 */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x1); -+ rtw_write32_mask(rtwdev, REG_PREDISTB, BIT(7), 0x1); -+ rtw_write32_mask(rtwdev, REG_BPBDB, BIT(18), 0x1); -+ rtw_write32_mask(rtwdev, REG_BPBDB, BIT(29), 0x1); -+ rtw_write32_mask(rtwdev, REG_PHYTXONB, BIT(29), 0x1); -+ rtw_write32_mask(rtwdev, REG_IQKYB, 0x000007ff, tx_y); -+ rtw_write32_mask(rtwdev, REG_IQKXB, 0x000007ff, tx_x); -+ rtw_dbg(rtwdev, RTW_DBG_RFK, -+ "tx_x = %x;;tx_y = %x =====> fill to IQC\n", -+ tx_x & 0x000007ff, tx_y & 0x000007ff); -+ rtw_dbg(rtwdev, RTW_DBG_RFK, -+ "0xed4 = %x;;0xecc = %x ====>fill to IQC\n", -+ rtw_read32_mask(rtwdev, REG_IQKXB, 0x000007ff), -+ rtw_read32_mask(rtwdev, REG_IQKYB, 0x000007ff)); -+ break; -+ default: -+ break; -+ } -+} -+ -+static void rtw8812a_iqk(struct rtw_dev *rtwdev) -+{ -+ int tx_x0_temp[10], tx_y0_temp[10], tx_x1_temp[10], tx_y1_temp[10]; -+ int rx_x0_temp[10], rx_y0_temp[10], rx_x1_temp[10], rx_y1_temp[10]; -+ bool iqk0_ready = false, tx0_finish = false, rx0_finish = false; -+ bool iqk1_ready = false, tx1_finish = false, rx1_finish = false; -+ u8 tx0_avg = 0, tx1_avg = 0, rx0_avg = 0, rx1_avg = 0; -+ int tx_x0 = 0, tx_y0 = 0, tx_x1 = 0, tx_y1 = 0; -+ int rx_x0 = 0, rx_y0 = 0, rx_x1 = 0, rx_y1 = 0; -+ struct rtw_efuse *efuse = &rtwdev->efuse; -+ bool tx0_fail = true, rx0_fail = true; -+ bool tx1_fail = true, rx1_fail = true; -+ u8 cal0_retry, cal1_retry; -+ u8 delay_count; -+ -+ /* [31] = 0 --> Page C */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x0); -+ -+ /* ========path-A AFE all on======== */ -+ /* Port 0 DAC/ADC on */ -+ rtw_write32(rtwdev, REG_AFE_PWR1_A, 0x77777777); -+ rtw_write32(rtwdev, REG_AFE_PWR2_A, 0x77777777); -+ -+ /* Port 1 DAC/ADC on */ -+ rtw_write32(rtwdev, REG_AFE_PWR1_B, 0x77777777); -+ rtw_write32(rtwdev, REG_AFE_PWR2_B, 0x77777777); -+ -+ rtw_write32(rtwdev, REG_RX_WAIT_CCA_TX_CCK_RFON_A, 0x19791979); -+ rtw_write32(rtwdev, REG_RX_WAIT_CCA_TX_CCK_RFON_B, 0x19791979); -+ -+ /* hardware 3-wire off */ -+ rtw_write32_mask(rtwdev, REG_3WIRE_SWA, 0xf, 0x4); -+ rtw_write32_mask(rtwdev, REG_3WIRE_SWB, 0xf, 0x4); -+ -+ /* DAC/ADC sampling rate (160 MHz) */ -+ rtw_write32_mask(rtwdev, REG_CK_MONHA, GENMASK(26, 24), 0x7); -+ rtw_write32_mask(rtwdev, REG_CK_MONHB, GENMASK(26, 24), 0x7); -+ -+ /* [31] = 0 --> Page C */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x0); -+ /* ====== path A TX IQK RF setting ====== */ -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_LUTWE, RFREG_MASK, 0x80002); -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_MODE_TABLE_ADDR, RFREG_MASK, 0x20000); -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_MODE_TABLE_DATA0, RFREG_MASK, 0x3fffd); -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_MODE_TABLE_DATA1, RFREG_MASK, 0xfe83f); -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_TXA_PREPAD, RFREG_MASK, 0x931d5); -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_RXBB2, RFREG_MASK, 0x8a001); -+ -+ /* ====== path B TX IQK RF setting ====== */ -+ rtw_write_rf(rtwdev, RF_PATH_B, RF_LUTWE, RFREG_MASK, 0x80002); -+ rtw_write_rf(rtwdev, RF_PATH_B, RF_MODE_TABLE_ADDR, RFREG_MASK, 0x20000); -+ rtw_write_rf(rtwdev, RF_PATH_B, RF_MODE_TABLE_DATA0, RFREG_MASK, 0x3fffd); -+ rtw_write_rf(rtwdev, RF_PATH_B, RF_MODE_TABLE_DATA1, RFREG_MASK, 0xfe83f); -+ rtw_write_rf(rtwdev, RF_PATH_B, RF_TXA_PREPAD, RFREG_MASK, 0x931d5); -+ rtw_write_rf(rtwdev, RF_PATH_B, RF_RXBB2, RFREG_MASK, 0x8a001); -+ -+ rtw_write32(rtwdev, REG_DAC_RSTB, 0x00008000); -+ rtw_write32_mask(rtwdev, REG_TXAGCIDX, BIT(0), 0x1); -+ rtw_write32_mask(rtwdev, REG_INIDLYB, BIT(0), 0x1); -+ rtw_write32(rtwdev, REG_IQK_COM00, 0x29002000); /* TX (X,Y) */ -+ rtw_write32(rtwdev, REG_IQK_COM32, 0xa9002000); /* RX (X,Y) */ -+ rtw_write32(rtwdev, REG_IQK_COM96, 0x00462910); /* [0]:AGC_en, [15]:idac_K_Mask */ -+ /* [31] = 1 --> Page C1 */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x1); -+ -+ if (efuse->ext_pa_5g) { -+ if (efuse->rfe_option == 1) { -+ rtw_write32(rtwdev, REG_OFDM0_XB_TX_IQ_IMBALANCE, 0x821403e3); -+ rtw_write32(rtwdev, REG_TXPITMB, 0x821403e3); -+ } else { -+ rtw_write32(rtwdev, REG_OFDM0_XB_TX_IQ_IMBALANCE, 0x821403f7); -+ rtw_write32(rtwdev, REG_TXPITMB, 0x821403f7); -+ } -+ } else { -+ rtw_write32(rtwdev, REG_OFDM0_XB_TX_IQ_IMBALANCE, 0x821403f1); -+ rtw_write32(rtwdev, REG_TXPITMB, 0x821403f1); -+ } -+ -+ if (rtwdev->hal.current_band_type == RTW_BAND_5G) { -+ rtw_write32(rtwdev, REG_TSSI_TRK_SW, 0x68163e96); -+ rtw_write32(rtwdev, REG_RXPITMB, 0x68163e96); -+ } else { -+ rtw_write32(rtwdev, REG_TSSI_TRK_SW, 0x28163e96); -+ rtw_write32(rtwdev, REG_RXPITMB, 0x28163e96); -+ -+ if (efuse->rfe_option == 3) { -+ if (efuse->ext_pa_2g) -+ rtw_write32(rtwdev, REG_OFDM0_XB_TX_IQ_IMBALANCE, -+ 0x821403e3); -+ else -+ rtw_write32(rtwdev, REG_OFDM0_XB_TX_IQ_IMBALANCE, -+ 0x821403f7); -+ } -+ } -+ -+ /* TX_Tone_idx[9:0], TxK_Mask[29] TX_Tone = 16 */ -+ rtw_write32(rtwdev, REG_OFDM0_XA_TX_IQ_IMBALANCE, 0x18008c10); -+ /* RX_Tone_idx[9:0], RxK_Mask[29] */ -+ rtw_write32(rtwdev, REG_OFDM0_A_TX_AFE, 0x38008c10); -+ rtw_write32(rtwdev, REG_INTPO_SETA, 0x00000000); -+ /* TX_Tone_idx[9:0], TxK_Mask[29] TX_Tone = 16 */ -+ rtw_write32(rtwdev, REG_TXTONEB, 0x18008c10); -+ /* RX_Tone_idx[9:0], RxK_Mask[29] */ -+ rtw_write32(rtwdev, REG_RXTONEB, 0x38008c10); -+ rtw_write32(rtwdev, REG_INTPO_SETB, 0x00000000); -+ -+ cal0_retry = 0; -+ cal1_retry = 0; -+ while (1) { -+ /* one shot */ -+ rtw_write32(rtwdev, REG_RFECTL_A, 0x00100000); -+ rtw_write32(rtwdev, REG_RFECTL_B, 0x00100000); -+ rtw_write32(rtwdev, REG_IQK_COM64, 0xfa000000); -+ rtw_write32(rtwdev, REG_IQK_COM64, 0xf8000000); -+ -+ mdelay(10); -+ -+ rtw_write32(rtwdev, REG_RFECTL_A, 0x00000000); -+ rtw_write32(rtwdev, REG_RFECTL_B, 0x00000000); -+ -+ for (delay_count = 0; delay_count < 20; delay_count++) { -+ if (!tx0_finish) -+ iqk0_ready = rtw_read32_mask(rtwdev, -+ REG_IQKA_END, -+ BIT(10)); -+ if (!tx1_finish) -+ iqk1_ready = rtw_read32_mask(rtwdev, -+ REG_IQKB_END, -+ BIT(10)); -+ if (iqk0_ready && iqk1_ready) -+ break; -+ -+ mdelay(1); -+ } -+ -+ rtw_dbg(rtwdev, RTW_DBG_RFK, "TX delay_count = %d\n", -+ delay_count); -+ -+ if (delay_count < 20) { /* If 20ms No Result, then cal_retry++ */ -+ /* ============TXIQK Check============== */ -+ tx0_fail = rtw_read32_mask(rtwdev, REG_IQKA_END, BIT(12)); -+ tx1_fail = rtw_read32_mask(rtwdev, REG_IQKB_END, BIT(12)); -+ -+ if (!(tx0_fail || tx0_finish)) { -+ rtw_write32(rtwdev, REG_RFECTL_A, 0x02000000); -+ tx_x0_temp[tx0_avg] = rtw_read32_mask(rtwdev, -+ REG_IQKA_END, -+ 0x07ff0000); -+ rtw_write32(rtwdev, REG_RFECTL_A, 0x04000000); -+ tx_y0_temp[tx0_avg] = rtw_read32_mask(rtwdev, -+ REG_IQKA_END, -+ 0x07ff0000); -+ -+ rtw_dbg(rtwdev, RTW_DBG_RFK, -+ "tx_x0[%d] = %x ;; tx_y0[%d] = %x\n", -+ tx0_avg, tx_x0_temp[tx0_avg], -+ tx0_avg, tx_y0_temp[tx0_avg]); -+ -+ tx_x0_temp[tx0_avg] <<= 21; -+ tx_y0_temp[tx0_avg] <<= 21; -+ -+ tx0_avg++; -+ } else { -+ cal0_retry++; -+ if (cal0_retry == 10) -+ break; -+ } -+ -+ if (!(tx1_fail || tx1_finish)) { -+ rtw_write32(rtwdev, REG_RFECTL_B, 0x02000000); -+ tx_x1_temp[tx1_avg] = rtw_read32_mask(rtwdev, -+ REG_IQKB_END, -+ 0x07ff0000); -+ rtw_write32(rtwdev, REG_RFECTL_B, 0x04000000); -+ tx_y1_temp[tx1_avg] = rtw_read32_mask(rtwdev, -+ REG_IQKB_END, -+ 0x07ff0000); -+ -+ rtw_dbg(rtwdev, RTW_DBG_RFK, -+ "tx_x1[%d] = %x ;; tx_y1[%d] = %x\n", -+ tx1_avg, tx_x1_temp[tx1_avg], -+ tx1_avg, tx_y1_temp[tx1_avg]); -+ -+ tx_x1_temp[tx1_avg] <<= 21; -+ tx_y1_temp[tx1_avg] <<= 21; -+ -+ tx1_avg++; -+ } else { -+ cal1_retry++; -+ if (cal1_retry == 10) -+ break; -+ } -+ } else { -+ cal0_retry++; -+ cal1_retry++; -+ -+ rtw_dbg(rtwdev, RTW_DBG_RFK, -+ "delay 20ms TX IQK Not Ready!!!!!\n"); -+ -+ if (cal0_retry == 10) -+ break; -+ } -+ -+ if (tx0_avg >= 2) -+ tx0_finish = rtw88xxa_iqk_finish(tx0_avg, 4, -+ tx_x0_temp, tx_y0_temp, &tx_x0, &tx_y0, -+ false, false); -+ -+ if (tx1_avg >= 2) -+ tx1_finish = rtw88xxa_iqk_finish(tx1_avg, 4, -+ tx_x1_temp, tx_y1_temp, &tx_x1, &tx_y1, -+ false, false); -+ -+ rtw_dbg(rtwdev, RTW_DBG_RFK, -+ "tx0_average = %d, tx1_average = %d\n", -+ tx0_avg, tx1_avg); -+ rtw_dbg(rtwdev, RTW_DBG_RFK, -+ "tx0_finish = %d, tx1_finish = %d\n", -+ tx0_finish, tx1_finish); -+ -+ if (tx0_finish && tx1_finish) -+ break; -+ -+ if ((cal0_retry + tx0_avg) >= 10 || -+ (cal1_retry + tx1_avg) >= 10) -+ break; -+ } -+ -+ rtw_dbg(rtwdev, RTW_DBG_RFK, "TXA_cal_retry = %d\n", cal0_retry); -+ rtw_dbg(rtwdev, RTW_DBG_RFK, "TXB_cal_retry = %d\n", cal1_retry); -+ -+ /* [31] = 0 --> Page C */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x0); -+ /* Load LOK */ -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_TXMOD, 0x7fe00, -+ rtw_read_rf(rtwdev, RF_PATH_A, RF_DTXLOK, 0xffc00)); -+ rtw_write_rf(rtwdev, RF_PATH_B, RF_TXMOD, 0x7fe00, -+ rtw_read_rf(rtwdev, RF_PATH_B, RF_DTXLOK, 0xffc00)); -+ /* [31] = 1 --> Page C1 */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x1); -+ -+ /* [31] = 0 --> Page C */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x0); -+ if (tx0_finish) { -+ /* ====== path A RX IQK RF setting====== */ -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_LUTWE, RFREG_MASK, 0x80000); -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_MODE_TABLE_ADDR, RFREG_MASK, -+ 0x30000); -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_MODE_TABLE_DATA0, RFREG_MASK, -+ 0x3f7ff); -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_MODE_TABLE_DATA1, RFREG_MASK, -+ 0xfe7bf); -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_RXBB2, RFREG_MASK, 0x88001); -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_TXA_PREPAD, RFREG_MASK, 0x931d1); -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_LUTWE, RFREG_MASK, 0x00000); -+ } -+ if (tx1_finish) { -+ /* ====== path B RX IQK RF setting====== */ -+ rtw_write_rf(rtwdev, RF_PATH_B, RF_LUTWE, RFREG_MASK, 0x80000); -+ rtw_write_rf(rtwdev, RF_PATH_B, RF_MODE_TABLE_ADDR, RFREG_MASK, -+ 0x30000); -+ rtw_write_rf(rtwdev, RF_PATH_B, RF_MODE_TABLE_DATA0, RFREG_MASK, -+ 0x3f7ff); -+ rtw_write_rf(rtwdev, RF_PATH_B, RF_MODE_TABLE_DATA1, RFREG_MASK, -+ 0xfe7bf); -+ rtw_write_rf(rtwdev, RF_PATH_B, RF_RXBB2, RFREG_MASK, 0x88001); -+ rtw_write_rf(rtwdev, RF_PATH_B, RF_TXA_PREPAD, RFREG_MASK, 0x931d1); -+ rtw_write_rf(rtwdev, RF_PATH_B, RF_LUTWE, RFREG_MASK, 0x00000); -+ } -+ -+ rtw_write32_mask(rtwdev, REG_IQK_COM00, BIT(31), 0x1); -+ rtw_write32_mask(rtwdev, REG_IQK_COM00, BIT(31), 0x0); -+ rtw_write32(rtwdev, REG_DAC_RSTB, 0x00008000); -+ -+ if (rtwdev->hci.type == RTW_HCI_TYPE_PCIE) -+ rtw_write32(rtwdev, REG_IQK_COM96, 0x0046a911); -+ else -+ rtw_write32(rtwdev, REG_IQK_COM96, 0x0046a890); -+ -+ if (efuse->rfe_option == 1) { -+ rtw_write32(rtwdev, REG_RFE_PINMUX_A, 0x77777717); -+ rtw_write32(rtwdev, REG_RFE_INV_A, 0x00000077); -+ rtw_write32(rtwdev, REG_RFE_PINMUX_B, 0x77777717); -+ rtw_write32(rtwdev, REG_RFE_INV_B, 0x00000077); -+ } else { -+ rtw_write32(rtwdev, REG_RFE_PINMUX_A, 0x77777717); -+ rtw_write32(rtwdev, REG_RFE_INV_A, 0x02000077); -+ rtw_write32(rtwdev, REG_RFE_PINMUX_B, 0x77777717); -+ rtw_write32(rtwdev, REG_RFE_INV_B, 0x02000077); -+ } -+ -+ /* [31] = 1 --> Page C1 */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x1); -+ -+ if (tx0_finish) { -+ /* TX_Tone_idx[9:0], TxK_Mask[29] TX_Tone = 16 */ -+ rtw_write32(rtwdev, REG_OFDM0_XA_TX_IQ_IMBALANCE, 0x38008c10); -+ /* RX_Tone_idx[9:0], RxK_Mask[29] */ -+ rtw_write32(rtwdev, REG_OFDM0_A_TX_AFE, 0x18008c10); -+ rtw_write32(rtwdev, REG_OFDM0_XB_TX_IQ_IMBALANCE, 0x82140119); -+ } -+ if (tx1_finish) { -+ /* TX_Tone_idx[9:0], TxK_Mask[29] TX_Tone = 16 */ -+ rtw_write32(rtwdev, REG_TXTONEB, 0x38008c10); -+ /* RX_Tone_idx[9:0], RxK_Mask[29] */ -+ rtw_write32(rtwdev, REG_RXTONEB, 0x18008c10); -+ rtw_write32(rtwdev, REG_TXPITMB, 0x82140119); -+ } -+ -+ cal0_retry = 0; -+ cal1_retry = 0; -+ while (1) { -+ /* one shot */ -+ /* [31] = 0 --> Page C */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x0); -+ -+ if (tx0_finish) { -+ rtw_write32_mask(rtwdev, REG_IQK_COM00, 0x03FF8000, -+ tx_x0 & 0x000007ff); -+ rtw_write32_mask(rtwdev, REG_IQK_COM00, 0x000007FF, -+ tx_y0 & 0x000007ff); -+ /* [31] = 1 --> Page C1 */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x1); -+ if (efuse->rfe_option == 1) -+ rtw_write32(rtwdev, REG_TSSI_TRK_SW, 0x28161500); -+ else -+ rtw_write32(rtwdev, REG_TSSI_TRK_SW, 0x28160cc0); -+ rtw_write32(rtwdev, REG_RFECTL_A, 0x00300000); -+ rtw_write32(rtwdev, REG_RFECTL_A, 0x00100000); -+ mdelay(5); -+ rtw_write32(rtwdev, REG_TSSI_TRK_SW, 0x3c000000); -+ rtw_write32(rtwdev, REG_RFECTL_A, 0x00000000); -+ } -+ -+ if (tx1_finish) { -+ /* [31] = 0 --> Page C */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x0); -+ rtw_write32_mask(rtwdev, REG_IQK_COM00, 0x03FF8000, -+ tx_x1 & 0x000007ff); -+ rtw_write32_mask(rtwdev, REG_IQK_COM00, 0x000007FF, -+ tx_y1 & 0x000007ff); -+ /* [31] = 1 --> Page C1 */ -+ rtw_write32_mask(rtwdev, REG_CCASEL, BIT(31), 0x1); -+ if (efuse->rfe_option == 1) -+ rtw_write32(rtwdev, REG_RXPITMB, 0x28161500); -+ else -+ rtw_write32(rtwdev, REG_RXPITMB, 0x28160ca0); -+ rtw_write32(rtwdev, REG_RFECTL_B, 0x00300000); -+ rtw_write32(rtwdev, REG_RFECTL_B, 0x00100000); -+ mdelay(5); -+ rtw_write32(rtwdev, REG_RXPITMB, 0x3c000000); -+ rtw_write32(rtwdev, REG_RFECTL_B, 0x00000000); -+ } -+ -+ for (delay_count = 0; delay_count < 20; delay_count++) { -+ if (!rx0_finish && tx0_finish) -+ iqk0_ready = rtw_read32_mask(rtwdev, -+ REG_IQKA_END, -+ BIT(10)); -+ if (!rx1_finish && tx1_finish) -+ iqk1_ready = rtw_read32_mask(rtwdev, -+ REG_IQKB_END, -+ BIT(10)); -+ if (iqk0_ready && iqk1_ready) -+ break; -+ -+ mdelay(1); -+ } -+ -+ rtw_dbg(rtwdev, RTW_DBG_RFK, "RX delay_count = %d\n", -+ delay_count); -+ -+ if (delay_count < 20) { /* If 20ms No Result, then cal_retry++ */ -+ /* ============RXIQK Check============== */ -+ rx0_fail = rtw_read32_mask(rtwdev, REG_IQKA_END, BIT(11)); -+ rx1_fail = rtw_read32_mask(rtwdev, REG_IQKB_END, BIT(11)); -+ -+ if (!(rx0_fail || rx0_finish) && tx0_finish) { -+ rtw_write32(rtwdev, REG_RFECTL_A, 0x06000000); -+ rx_x0_temp[rx0_avg] = rtw_read32_mask(rtwdev, -+ REG_IQKA_END, -+ 0x07ff0000); -+ rtw_write32(rtwdev, REG_RFECTL_A, 0x08000000); -+ rx_y0_temp[rx0_avg] = rtw_read32_mask(rtwdev, -+ REG_IQKA_END, -+ 0x07ff0000); -+ -+ rtw_dbg(rtwdev, RTW_DBG_RFK, -+ "rx_x0[%d] = %x ;; rx_y0[%d] = %x\n", -+ rx0_avg, rx_x0_temp[rx0_avg], -+ rx0_avg, rx_y0_temp[rx0_avg]); -+ -+ rx_x0_temp[rx0_avg] <<= 21; -+ rx_y0_temp[rx0_avg] <<= 21; -+ -+ rx0_avg++; -+ } else { -+ rtw_dbg(rtwdev, RTW_DBG_RFK, -+ "1. RXA_cal_retry = %d\n", cal0_retry); -+ -+ cal0_retry++; -+ if (cal0_retry == 10) -+ break; -+ } -+ -+ if (!(rx1_fail || rx1_finish) && tx1_finish) { -+ rtw_write32(rtwdev, REG_RFECTL_B, 0x06000000); -+ rx_x1_temp[rx1_avg] = rtw_read32_mask(rtwdev, -+ REG_IQKB_END, -+ 0x07ff0000); -+ rtw_write32(rtwdev, REG_RFECTL_B, 0x08000000); -+ rx_y1_temp[rx1_avg] = rtw_read32_mask(rtwdev, -+ REG_IQKB_END, -+ 0x07ff0000); -+ -+ rtw_dbg(rtwdev, RTW_DBG_RFK, -+ "rx_x1[%d] = %x ;; rx_y1[%d] = %x\n", -+ rx1_avg, rx_x1_temp[rx1_avg], -+ rx1_avg, rx_y1_temp[rx1_avg]); -+ -+ rx_x1_temp[rx1_avg] <<= 21; -+ rx_y1_temp[rx1_avg] <<= 21; -+ -+ rx1_avg++; -+ } else { -+ cal1_retry++; -+ if (cal1_retry == 10) -+ break; -+ } -+ } else { -+ rtw_dbg(rtwdev, RTW_DBG_RFK, -+ "2. RXA_cal_retry = %d\n", cal0_retry); -+ -+ cal0_retry++; -+ cal1_retry++; -+ -+ rtw_dbg(rtwdev, RTW_DBG_RFK, -+ "delay 20ms RX IQK Not Ready!!!!!\n"); -+ -+ if (cal0_retry == 10) -+ break; -+ } -+ -+ rtw_dbg(rtwdev, RTW_DBG_RFK, "3. RXA_cal_retry = %d\n", -+ cal0_retry); -+ -+ if (rx0_avg >= 2) -+ rx0_finish = rtw88xxa_iqk_finish(rx0_avg, 4, -+ rx_x0_temp, rx_y0_temp, -+ &rx_x0, &rx_y0, -+ true, false); -+ -+ if (rx1_avg >= 2) -+ rx1_finish = rtw88xxa_iqk_finish(rx1_avg, 4, -+ rx_x1_temp, rx_y1_temp, -+ &rx_x1, &rx_y1, -+ true, false); -+ -+ rtw_dbg(rtwdev, RTW_DBG_RFK, -+ "rx0_average = %d, rx1_average = %d\n", -+ rx0_avg, rx1_avg); -+ rtw_dbg(rtwdev, RTW_DBG_RFK, -+ "rx0_finish = %d, rx1_finish = %d\n", -+ rx0_finish, rx1_finish); -+ -+ if ((rx0_finish || !tx0_finish) && (rx1_finish || !tx1_finish)) -+ break; -+ -+ if ((cal0_retry + rx0_avg) >= 10 || -+ (cal1_retry + rx1_avg) >= 10 || -+ rx0_avg == 3 || rx1_avg == 3) -+ break; -+ } -+ -+ rtw_dbg(rtwdev, RTW_DBG_RFK, "RXA_cal_retry = %d\n", cal0_retry); -+ rtw_dbg(rtwdev, RTW_DBG_RFK, "RXB_cal_retry = %d\n", cal1_retry); -+ -+ /* FillIQK Result */ -+ rtw_dbg(rtwdev, RTW_DBG_RFK, "========Path_A =======\n"); -+ -+ if (tx0_finish) -+ rtw8812a_iqk_tx_fill(rtwdev, RF_PATH_A, tx_x0, tx_y0); -+ else -+ rtw8812a_iqk_tx_fill(rtwdev, RF_PATH_A, 0x200, 0x0); -+ -+ if (rx0_finish) -+ rtw8812a_iqk_rx_fill(rtwdev, RF_PATH_A, rx_x0, rx_y0); -+ else -+ rtw8812a_iqk_rx_fill(rtwdev, RF_PATH_A, 0x200, 0x0); -+ -+ rtw_dbg(rtwdev, RTW_DBG_RFK, "========Path_B =======\n"); -+ -+ if (tx1_finish) -+ rtw8812a_iqk_tx_fill(rtwdev, RF_PATH_B, tx_x1, tx_y1); -+ else -+ rtw8812a_iqk_tx_fill(rtwdev, RF_PATH_B, 0x200, 0x0); -+ -+ if (rx1_finish) -+ rtw8812a_iqk_rx_fill(rtwdev, RF_PATH_B, rx_x1, rx_y1); -+ else -+ rtw8812a_iqk_rx_fill(rtwdev, RF_PATH_B, 0x200, 0x0); -+} -+ -+#define MACBB_REG_NUM_8812A 9 -+#define AFE_REG_NUM_8812A 12 -+#define RF_REG_NUM_8812A 3 -+ -+static void rtw8812a_do_iqk(struct rtw_dev *rtwdev) -+{ -+ static const u32 backup_macbb_reg[MACBB_REG_NUM_8812A] = { -+ 0x520, 0x550, 0x808, 0xa04, 0x90c, 0xc00, 0xe00, 0x838, 0x82c -+ }; -+ static const u32 backup_afe_reg[AFE_REG_NUM_8812A] = { -+ 0xc5c, 0xc60, 0xc64, 0xc68, 0xcb0, 0xcb4, -+ 0xe5c, 0xe60, 0xe64, 0xe68, 0xeb0, 0xeb4 -+ }; -+ static const u32 backup_rf_reg[RF_REG_NUM_8812A] = { -+ 0x65, 0x8f, 0x0 -+ }; -+ u32 macbb_backup[MACBB_REG_NUM_8812A] = {}; -+ u32 afe_backup[AFE_REG_NUM_8812A] = {}; -+ u32 rfa_backup[RF_REG_NUM_8812A] = {}; -+ u32 rfb_backup[RF_REG_NUM_8812A] = {}; -+ u32 reg_cb8, reg_eb8; -+ -+ rtw88xxa_iqk_backup_mac_bb(rtwdev, macbb_backup, -+ backup_macbb_reg, MACBB_REG_NUM_8812A); -+ -+ rtw_write32_set(rtwdev, REG_CCASEL, BIT(31)); -+ reg_cb8 = rtw_read32(rtwdev, REG_RFECTL_A); -+ reg_eb8 = rtw_read32(rtwdev, REG_RFECTL_B); -+ rtw_write32_clr(rtwdev, REG_CCASEL, BIT(31)); -+ -+ rtw88xxa_iqk_backup_afe(rtwdev, afe_backup, -+ backup_afe_reg, AFE_REG_NUM_8812A); -+ rtw8812a_iqk_backup_rf(rtwdev, rfa_backup, rfb_backup, -+ backup_rf_reg, RF_REG_NUM_8812A); -+ -+ rtw88xxa_iqk_configure_mac(rtwdev); -+ -+ rtw8812a_iqk(rtwdev); -+ -+ rtw8812a_iqk_restore_rf(rtwdev, RF_PATH_A, backup_rf_reg, -+ rfa_backup, RF_REG_NUM_8812A); -+ rtw8812a_iqk_restore_rf(rtwdev, RF_PATH_B, backup_rf_reg, -+ rfb_backup, RF_REG_NUM_8812A); -+ -+ rtw8812a_iqk_restore_afe(rtwdev, afe_backup, -+ backup_afe_reg, AFE_REG_NUM_8812A); -+ -+ rtw_write32_set(rtwdev, REG_CCASEL, BIT(31)); -+ rtw_write32(rtwdev, REG_RFECTL_A, reg_cb8); -+ rtw_write32(rtwdev, REG_RFECTL_B, reg_eb8); -+ rtw_write32_clr(rtwdev, REG_CCASEL, BIT(31)); -+ -+ rtw88xxa_iqk_restore_mac_bb(rtwdev, macbb_backup, -+ backup_macbb_reg, MACBB_REG_NUM_8812A); -+} -+ -+static void rtw8812a_phy_calibration(struct rtw_dev *rtwdev) -+{ -+ u8 channel = rtwdev->hal.current_channel; -+ -+ rtw8812a_do_iqk(rtwdev); -+ -+ /* The official driver wants to do this after connecting -+ * but before first writing a new igi (phydm_get_new_igi). -+ * Here seems close enough. -+ */ -+ if (channel >= 36 && channel <= 64) -+ rtw_load_table(rtwdev, &rtw8812a_agc_diff_lb_tbl); -+ else if (channel >= 100) -+ rtw_load_table(rtwdev, &rtw8812a_agc_diff_hb_tbl); -+} -+ -+static void rtw8812a_pwr_track(struct rtw_dev *rtwdev) -+{ -+ struct rtw_dm_info *dm_info = &rtwdev->dm_info; -+ -+ if (!dm_info->pwr_trk_triggered) { -+ rtw_write_rf(rtwdev, RF_PATH_A, RF_T_METER, -+ GENMASK(17, 16), 0x03); -+ dm_info->pwr_trk_triggered = true; -+ return; -+ } -+ -+ rtw88xxa_phy_pwrtrack(rtwdev, rtw8812a_do_lck, rtw8812a_do_iqk); -+ dm_info->pwr_trk_triggered = false; -+} -+ -+static void rtw8812a_fill_txdesc_checksum(struct rtw_dev *rtwdev, -+ struct rtw_tx_pkt_info *pkt_info, -+ u8 *txdesc) -+{ -+ fill_txdesc_checksum_common(txdesc, 16); -+} -+ -+static void rtw8812a_coex_cfg_init(struct rtw_dev *rtwdev) -+{ -+} -+ -+static void rtw8812a_coex_cfg_gnt_fix(struct rtw_dev *rtwdev) -+{ -+} -+ -+static void rtw8821a_coex_cfg_rfe_type(struct rtw_dev *rtwdev) -+{ -+} -+ -+static void rtw8821a_coex_cfg_wl_tx_power(struct rtw_dev *rtwdev, u8 wl_pwr) -+{ -+} -+ -+static void rtw8821a_coex_cfg_wl_rx_gain(struct rtw_dev *rtwdev, bool low_gain) -+{ -+} -+ -+static const struct rtw_chip_ops rtw8812a_ops = { -+ .power_on = rtw88xxa_power_on, -+ .power_off = rtw8812a_power_off, -+ .phy_set_param = NULL, -+ .read_efuse = rtw88xxa_read_efuse, -+ .query_phy_status = rtw8812a_query_phy_status, -+ .set_channel = rtw88xxa_set_channel, -+ .mac_init = NULL, -+ .read_rf = rtw88xxa_phy_read_rf, -+ .write_rf = rtw_phy_write_rf_reg_sipi, -+ .set_antenna = NULL, -+ .set_tx_power_index = rtw88xxa_set_tx_power_index, -+ .cfg_ldo25 = rtw8812a_cfg_ldo25, -+ .efuse_grant = rtw88xxa_efuse_grant, -+ .false_alarm_statistics = rtw88xxa_false_alarm_statistics, -+ .phy_calibration = rtw8812a_phy_calibration, -+ .cck_pd_set = rtw88xxa_phy_cck_pd_set, -+ .pwr_track = rtw8812a_pwr_track, -+ .config_bfee = NULL, -+ .set_gid_table = NULL, -+ .cfg_csi_rate = NULL, -+ .fill_txdesc_checksum = rtw8812a_fill_txdesc_checksum, -+ .coex_set_init = rtw8812a_coex_cfg_init, -+ .coex_set_ant_switch = NULL, -+ .coex_set_gnt_fix = rtw8812a_coex_cfg_gnt_fix, -+ .coex_set_gnt_debug = NULL, -+ .coex_set_rfe_type = rtw8821a_coex_cfg_rfe_type, -+ .coex_set_wl_tx_power = rtw8821a_coex_cfg_wl_tx_power, -+ .coex_set_wl_rx_gain = rtw8821a_coex_cfg_wl_rx_gain, -+}; -+ -+static const struct rtw_page_table page_table_8812a[] = { -+ /* hq_num, nq_num, lq_num, exq_num, gapq_num */ -+ {0, 0, 0, 0, 0}, /* SDIO */ -+ {0, 0, 0, 0, 0}, /* PCI */ -+ {16, 0, 0, 0, 1}, /* 2 bulk out endpoints */ -+ {16, 0, 16, 0, 1}, /* 3 bulk out endpoints */ -+ {16, 0, 16, 0, 1}, /* 4 bulk out endpoints */ -+}; -+ -+static const struct rtw_rqpn rqpn_table_8812a[] = { -+ {RTW_DMA_MAPPING_NORMAL, RTW_DMA_MAPPING_NORMAL, -+ RTW_DMA_MAPPING_LOW, RTW_DMA_MAPPING_LOW, -+ RTW_DMA_MAPPING_EXTRA, RTW_DMA_MAPPING_HIGH}, -+ -+ {RTW_DMA_MAPPING_NORMAL, RTW_DMA_MAPPING_NORMAL, -+ RTW_DMA_MAPPING_LOW, RTW_DMA_MAPPING_LOW, -+ RTW_DMA_MAPPING_EXTRA, RTW_DMA_MAPPING_HIGH}, -+ -+ {RTW_DMA_MAPPING_HIGH, RTW_DMA_MAPPING_HIGH, -+ RTW_DMA_MAPPING_NORMAL, RTW_DMA_MAPPING_NORMAL, -+ RTW_DMA_MAPPING_HIGH, RTW_DMA_MAPPING_HIGH}, -+ -+ {RTW_DMA_MAPPING_HIGH, RTW_DMA_MAPPING_NORMAL, -+ RTW_DMA_MAPPING_LOW, RTW_DMA_MAPPING_LOW, -+ RTW_DMA_MAPPING_HIGH, RTW_DMA_MAPPING_HIGH}, -+ -+ {RTW_DMA_MAPPING_NORMAL, RTW_DMA_MAPPING_NORMAL, -+ RTW_DMA_MAPPING_LOW, RTW_DMA_MAPPING_LOW, -+ RTW_DMA_MAPPING_EXTRA, RTW_DMA_MAPPING_HIGH}, -+}; -+ -+static const struct rtw_prioq_addrs prioq_addrs_8812a = { -+ .prio[RTW_DMA_MAPPING_EXTRA] = { -+ .rsvd = REG_RQPN_NPQ + 2, .avail = REG_RQPN_NPQ + 3, -+ }, -+ .prio[RTW_DMA_MAPPING_LOW] = { -+ .rsvd = REG_RQPN + 1, .avail = REG_FIFOPAGE_CTRL_2 + 1, -+ }, -+ .prio[RTW_DMA_MAPPING_NORMAL] = { -+ .rsvd = REG_RQPN_NPQ, .avail = REG_RQPN_NPQ + 1, -+ }, -+ .prio[RTW_DMA_MAPPING_HIGH] = { -+ .rsvd = REG_RQPN, .avail = REG_FIFOPAGE_CTRL_2, -+ }, -+ .wsize = false, -+}; -+ -+static const struct rtw_hw_reg rtw8812a_dig[] = { -+ [0] = { .addr = REG_RXIGI_A, .mask = 0x7f }, -+ [1] = { .addr = REG_RXIGI_B, .mask = 0x7f }, -+}; -+ -+static const struct rtw_rfe_def rtw8812a_rfe_defs[] = { -+ [0] = { .phy_pg_tbl = &rtw8812a_bb_pg_tbl, -+ .txpwr_lmt_tbl = &rtw8812a_txpwr_lmt_tbl, -+ .pwr_track_tbl = &rtw8812a_rtw_pwr_track_tbl, }, -+ [1] = { .phy_pg_tbl = &rtw8812a_bb_pg_tbl, -+ .txpwr_lmt_tbl = &rtw8812a_txpwr_lmt_tbl, -+ .pwr_track_tbl = &rtw8812a_rtw_pwr_track_tbl, }, -+ [3] = { .phy_pg_tbl = &rtw8812a_bb_pg_rfe3_tbl, -+ .txpwr_lmt_tbl = &rtw8812a_txpwr_lmt_tbl, -+ .pwr_track_tbl = &rtw8812a_rtw_pwr_track_rfe3_tbl, }, -+}; -+ -+static const u8 wl_rssi_step_8812a[] = {101, 45, 101, 40}; -+static const u8 bt_rssi_step_8812a[] = {101, 101, 101, 101}; -+ -+static const struct coex_rf_para rf_para_tx_8812a[] = { -+ {0, 0, false, 7}, /* for normal */ -+ {0, 20, false, 7}, /* for WL-CPT */ -+ {8, 17, true, 4}, -+ {7, 18, true, 4}, -+ {6, 19, true, 4}, -+ {5, 20, true, 4} -+}; -+ -+static const struct coex_rf_para rf_para_rx_8812a[] = { -+ {0, 0, false, 7}, /* for normal */ -+ {0, 20, false, 7}, /* for WL-CPT */ -+ {3, 24, true, 5}, -+ {2, 26, true, 5}, -+ {1, 27, true, 5}, -+ {0, 28, true, 5} -+}; -+ -+static_assert(ARRAY_SIZE(rf_para_tx_8812a) == ARRAY_SIZE(rf_para_rx_8812a)); -+ -+const struct rtw_chip_info rtw8812a_hw_spec = { -+ .ops = &rtw8812a_ops, -+ .id = RTW_CHIP_TYPE_8812A, -+ .fw_name = "rtw88/rtw8812a_fw.bin", -+ .wlan_cpu = RTW_WCPU_11N, -+ .tx_pkt_desc_sz = 40, -+ .tx_buf_desc_sz = 16, -+ .rx_pkt_desc_sz = 24, -+ .rx_buf_desc_sz = 8, -+ .phy_efuse_size = 512, -+ .log_efuse_size = 512, -+ .ptct_efuse_size = 96 + 1, /* TODO or just 18? */ -+ .txff_size = 131072, -+ .rxff_size = 16128, -+ .rsvd_drv_pg_num = 9, -+ .txgi_factor = 1, -+ .is_pwr_by_rate_dec = true, -+ .max_power_index = 0x3f, -+ .csi_buf_pg_num = 0, -+ .band = RTW_BAND_2G | RTW_BAND_5G, -+ .page_size = 512, -+ .dig_min = 0x20, -+ .ht_supported = true, -+ .vht_supported = true, -+ .lps_deep_mode_supported = 0, -+ .sys_func_en = 0xFD, -+ .pwr_on_seq = card_enable_flow_8812a, -+ .pwr_off_seq = card_disable_flow_8812a, -+ .page_table = page_table_8812a, -+ .rqpn_table = rqpn_table_8812a, -+ .prioq_addrs = &prioq_addrs_8812a, -+ .intf_table = NULL, -+ .dig = rtw8812a_dig, -+ .rf_sipi_addr = {REG_LSSI_WRITE_A, REG_LSSI_WRITE_B}, -+ .ltecoex_addr = NULL, -+ .mac_tbl = &rtw8812a_mac_tbl, -+ .agc_tbl = &rtw8812a_agc_tbl, -+ .bb_tbl = &rtw8812a_bb_tbl, -+ .rf_tbl = {&rtw8812a_rf_a_tbl, &rtw8812a_rf_b_tbl}, -+ .rfe_defs = rtw8812a_rfe_defs, -+ .rfe_defs_size = ARRAY_SIZE(rtw8812a_rfe_defs), -+ .rx_ldpc = false, -+ .hw_feature_report = false, -+ .c2h_ra_report_size = 4, -+ .old_datarate_fb_limit = true, -+ .usb_tx_agg_desc_num = 1, -+ .iqk_threshold = 8, -+ .ampdu_density = IEEE80211_HT_MPDU_DENSITY_16, -+ .max_scan_ie_len = IEEE80211_MAX_DATA_LEN, -+ -+ .coex_para_ver = 0, /* no coex code in 8812au driver */ -+ .bt_desired_ver = 0, -+ .scbd_support = false, -+ .new_scbd10_def = false, -+ .ble_hid_profile_support = false, -+ .wl_mimo_ps_support = false, -+ .pstdma_type = COEX_PSTDMA_FORCE_LPSOFF, -+ .bt_rssi_type = COEX_BTRSSI_RATIO, -+ .ant_isolation = 15, -+ .rssi_tolerance = 2, -+ .wl_rssi_step = wl_rssi_step_8812a, -+ .bt_rssi_step = bt_rssi_step_8812a, -+ .table_sant_num = 0, -+ .table_sant = NULL, -+ .table_nsant_num = 0, -+ .table_nsant = NULL, -+ .tdma_sant_num = 0, -+ .tdma_sant = NULL, -+ .tdma_nsant_num = 0, -+ .tdma_nsant = NULL, -+ .wl_rf_para_num = ARRAY_SIZE(rf_para_tx_8812a), -+ .wl_rf_para_tx = rf_para_tx_8812a, -+ .wl_rf_para_rx = rf_para_rx_8812a, -+ .bt_afh_span_bw20 = 0x20, -+ .bt_afh_span_bw40 = 0x30, -+ .afh_5g_num = 0, -+ .afh_5g = NULL, -+ .coex_info_hw_regs_num = 0, -+ .coex_info_hw_regs = NULL, -+}; -+EXPORT_SYMBOL(rtw8812a_hw_spec); -+ -+MODULE_FIRMWARE("rtw88/rtw8812a_fw.bin"); -+ -+MODULE_AUTHOR("Realtek Corporation"); -+MODULE_DESCRIPTION("Realtek 802.11ac wireless 8812a driver"); -+MODULE_LICENSE("Dual BSD/GPL"); ---- /dev/null -+++ b/drivers/net/wireless/realtek/rtw88/rtw8812a.h -@@ -0,0 +1,10 @@ -+/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ -+/* Copyright(c) 2024 Realtek Corporation -+ */ -+ -+#ifndef __RTW8812A_H__ -+#define __RTW8812A_H__ -+ -+extern const struct rtw_chip_info rtw8812a_hw_spec; -+ -+#endif diff --git a/package/kernel/mac80211/patches/rtl/044-v6.13-wifi-rtw88-Add-rtw8821au.c-and-rtw8812au.c.patch b/package/kernel/mac80211/patches/rtl/044-v6.13-wifi-rtw88-Add-rtw8821au.c-and-rtw8812au.c.patch deleted file mode 100644 index a37f131bab8..00000000000 --- a/package/kernel/mac80211/patches/rtl/044-v6.13-wifi-rtw88-Add-rtw8821au.c-and-rtw8812au.c.patch +++ /dev/null @@ -1,80 +0,0 @@ -From 8f82bb2cfaf7b8992e0e8493cb765138254f87c9 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Wed, 30 Oct 2024 20:29:28 +0200 -Subject: [PATCH] wifi: rtw88: Add rtw8821au.c and rtw8812au.c - -These are the entry points for the new modules rtw88_8821au -(RTL8821AU/RTL8811AU) and rtw88_8812au (RTL8812AU). - -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/91c495f8-a607-429b-8bc0-5a45d3c1393e@gmail.com ---- - .../net/wireless/realtek/rtw88/rtw8812au.c | 28 +++++++++++++++++++ - .../net/wireless/realtek/rtw88/rtw8821au.c | 28 +++++++++++++++++++ - 2 files changed, 56 insertions(+) - create mode 100644 drivers/net/wireless/realtek/rtw88/rtw8812au.c - create mode 100644 drivers/net/wireless/realtek/rtw88/rtw8821au.c - ---- /dev/null -+++ b/drivers/net/wireless/realtek/rtw88/rtw8812au.c -@@ -0,0 +1,28 @@ -+// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause -+/* Copyright(c) 2024 Realtek Corporation -+ */ -+ -+#include -+#include -+#include "main.h" -+#include "rtw8812a.h" -+#include "usb.h" -+ -+static const struct usb_device_id rtw_8812au_id_table[] = { -+ { USB_DEVICE_AND_INTERFACE_INFO(0x2604, 0x0012, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, -+ {}, -+}; -+MODULE_DEVICE_TABLE(usb, rtw_8812au_id_table); -+ -+static struct usb_driver rtw_8812au_driver = { -+ .name = "rtw_8812au", -+ .id_table = rtw_8812au_id_table, -+ .probe = rtw_usb_probe, -+ .disconnect = rtw_usb_disconnect, -+}; -+module_usb_driver(rtw_8812au_driver); -+ -+MODULE_AUTHOR("Bitterblue Smith "); -+MODULE_DESCRIPTION("Realtek 802.11ac wireless 8812au driver"); -+MODULE_LICENSE("Dual BSD/GPL"); ---- /dev/null -+++ b/drivers/net/wireless/realtek/rtw88/rtw8821au.c -@@ -0,0 +1,28 @@ -+// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause -+/* Copyright(c) 2024 Realtek Corporation -+ */ -+ -+#include -+#include -+#include "main.h" -+#include "rtw8821a.h" -+#include "usb.h" -+ -+static const struct usb_device_id rtw_8821au_id_table[] = { -+ { USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x011e, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8821a_hw_spec) }, -+ {}, -+}; -+MODULE_DEVICE_TABLE(usb, rtw_8821au_id_table); -+ -+static struct usb_driver rtw_8821au_driver = { -+ .name = "rtw_8821au", -+ .id_table = rtw_8821au_id_table, -+ .probe = rtw_usb_probe, -+ .disconnect = rtw_usb_disconnect, -+}; -+module_usb_driver(rtw_8821au_driver); -+ -+MODULE_AUTHOR("Bitterblue Smith "); -+MODULE_DESCRIPTION("Realtek 802.11ac wireless 8821au/8811au driver"); -+MODULE_LICENSE("Dual BSD/GPL"); diff --git a/package/kernel/mac80211/patches/rtl/045-v6.13-wifi-rtw88-Enable-the-new-RTL8821AU-RTL8812AU-driver.patch b/package/kernel/mac80211/patches/rtl/045-v6.13-wifi-rtw88-Enable-the-new-RTL8821AU-RTL8812AU-driver.patch deleted file mode 100644 index 6a4a2aff698..00000000000 --- a/package/kernel/mac80211/patches/rtl/045-v6.13-wifi-rtw88-Enable-the-new-RTL8821AU-RTL8812AU-driver.patch +++ /dev/null @@ -1,153 +0,0 @@ -From 0e3e8284f8e1bf2fc0f7bf247194efe5cfc568c1 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Wed, 30 Oct 2024 20:31:28 +0200 -Subject: [PATCH] wifi: rtw88: Enable the new RTL8821AU/RTL8812AU drivers - -These are older Wifi 5 chips. RTL8821AU is 1x1, with or without -Bluetooth. RTL8812AU is 2x2, without Bluetooth. - -Beamforming is not implemented. It looks like these chips need a -different implementation than what is in bf.c. - -Speed tests with RTL8821AU: 137 Mbps download, 144 Mbps upload. -Speed tests with RTL8812AU: 344 Mbps download, 387 Mbps upload. - -Station mode and AP mode were tested. - -Bluetooth coexistence works. I used my Bluetooth headphones for -several days, listening to music and watching videos. There is only -a problem with the wifi speeds with one router: - -With ISP's HG6544C router: -Official driver: 3/5 Mbps. -rtw88: a bit more, but not steady at all. Not enough to watch a 1080p -Youtube video. - -With my D-Link Eagle R32 router running Openwrt, on the same channel: -Official driver: 6/10 Mbps. -rtw88: download starts around 30, climbs to 50 / upload is 10 Mbps. -I can watch a 1080p Youtube video. - -The music doesn't cut out during any speed tests. - -I also tested transferring files to and from my phone. I don't have -other types of Bluetooth devices to test. - -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/0b8e8093-8103-4999-86bf-0055ec52ea64@gmail.com ---- -Kconfig.local | 15 ++++++++ - drivers/net/wireless/realtek/rtw88/Kconfig | 40 ++++++++++++++++++++- - drivers/net/wireless/realtek/rtw88/Makefile | 15 ++++++++ - 3 files changed, 69 insertions(+), 1 deletion(-) - ---- a/Kconfig.local -+++ b/Kconfig.local -@@ -1144,6 +1144,15 @@ config BACKPORTED_RTW88_8723D - config BACKPORTED_RTW88_8821C - tristate - default RTW88_8821C -+config BACKPORTED_RTW88_88XXA -+ tristate -+ default RTW88_88XXA -+config BACKPORTED_RTW88_8821A -+ tristate -+ default RTW88_8821A -+config BACKPORTED_RTW88_8812A -+ tristate -+ default RTW88_8812A - config BACKPORTED_RTW88_8822BE - tristate - default RTW88_8822BE -@@ -1183,6 +1192,12 @@ config BACKPORTED_RTW88_8821CS - config BACKPORTED_RTW88_8821CU - tristate - default RTW88_8821CU -+config BACKPORTED_RTW88_8821AU -+ tristate -+ default RTW88_8821AU -+config BACKPORTED_RTW88_8812AU -+ tristate -+ default RTW88_8812AU - config BACKPORTED_RTW88_DEBUG - tristate - default RTW88_DEBUG ---- a/drivers/net/wireless/realtek/rtw88/Kconfig -+++ b/drivers/net/wireless/realtek/rtw88/Kconfig -@@ -54,6 +54,20 @@ config RTW88_8821C - tristate - depends on m - -+config RTW88_88XXA -+ tristate -+ depends on m -+ -+config RTW88_8821A -+ tristate -+ depends on m -+ select RTW88_88XXA -+ -+config RTW88_8812A -+ tristate -+ depends on m -+ select RTW88_88XXA -+ - config RTW88_8822BE - tristate "Realtek 8822BE PCI wireless network adapter" - depends on m -@@ -213,6 +227,30 @@ config RTW88_8821CU - - 802.11ac USB wireless network adapter - -+config RTW88_8821AU -+ tristate "Realtek 8821AU/8811AU USB wireless network adapter" -+ depends on m -+ depends on USB -+ select RTW88_CORE -+ select RTW88_USB -+ select RTW88_8821A -+ help -+ Select this option will enable support for 8821AU and 8811AU chipset -+ -+ 802.11ac USB wireless network adapter -+ -+config RTW88_8812AU -+ tristate "Realtek 8812AU USB wireless network adapter" -+ depends on m -+ depends on USB -+ select RTW88_CORE -+ select RTW88_USB -+ select RTW88_8812A -+ help -+ Select this option will enable support for 8812AU chipset -+ -+ 802.11ac USB wireless network adapter -+ - config RTW88_DEBUG - bool "Realtek rtw88 debug support" - depends on RTW88_CORE ---- a/drivers/net/wireless/realtek/rtw88/Makefile -+++ b/drivers/net/wireless/realtek/rtw88/Makefile -@@ -77,6 +77,21 @@ rtw88_8821cs-objs := rtw8821cs.o - obj-$(CPTCFG_RTW88_8821CU) += rtw88_8821cu.o - rtw88_8821cu-objs := rtw8821cu.o - -+obj-$(CPTCFG_RTW88_88XXA) += rtw88_88xxa.o -+rtw88_88xxa-objs := rtw88xxa.o -+ -+obj-$(CPTCFG_RTW88_8821A) += rtw88_8821a.o -+rtw88_8821a-objs := rtw8821a.o rtw8821a_table.o -+ -+obj-$(CPTCFG_RTW88_8812A) += rtw88_8812a.o -+rtw88_8812a-objs := rtw8812a.o rtw8812a_table.o -+ -+obj-$(CPTCFG_RTW88_8821AU) += rtw88_8821au.o -+rtw88_8821au-objs := rtw8821au.o -+ -+obj-$(CPTCFG_RTW88_8812AU) += rtw88_8812au.o -+rtw88_8812au-objs := rtw8812au.o -+ - obj-$(CPTCFG_RTW88_PCI) += rtw88_pci.o - rtw88_pci-objs := pci.o - diff --git a/package/kernel/mac80211/patches/rtl/046-v6.14-wifi-rtw88-8821au-Add-additional-devices-to-the-USB_.patch b/package/kernel/mac80211/patches/rtl/046-v6.14-wifi-rtw88-8821au-Add-additional-devices-to-the-USB_.patch deleted file mode 100644 index d1e268c79b9..00000000000 --- a/package/kernel/mac80211/patches/rtl/046-v6.14-wifi-rtw88-8821au-Add-additional-devices-to-the-USB_.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 7b5ce65d90187f0944e70dc5741aa0edfac926f4 Mon Sep 17 00:00:00 2001 -From: Larry Finger -Date: Wed, 6 Nov 2024 15:55:31 +0200 -Subject: [PATCH] wifi: rtw88: 8821au: Add additional devices to the USB_DEVICE - list - -These are the entries that Nick Morrow provided. From -https://github.com/morrownr/8821au-20210708 - -Signed-off-by: Larry Finger -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/da05b866-a9ff-428c-a008-35e8cf200a98@gmail.com ---- - .../net/wireless/realtek/rtw88/rtw8821au.c | 52 ++++++++++++++++++- - 1 file changed, 51 insertions(+), 1 deletion(-) - ---- a/drivers/net/wireless/realtek/rtw88/rtw8821au.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8821au.c -@@ -9,8 +9,58 @@ - #include "usb.h" - - static const struct usb_device_id rtw_8821au_id_table[] = { -- { USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x011e, 0xff, 0xff, 0xff), -+ { USB_DEVICE_AND_INTERFACE_INFO(RTW_USB_VENDOR_ID_REALTEK, 0x0811, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8821a_hw_spec) }, -+ { USB_DEVICE_AND_INTERFACE_INFO(RTW_USB_VENDOR_ID_REALTEK, 0x0820, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8821a_hw_spec) }, -+ { USB_DEVICE_AND_INTERFACE_INFO(RTW_USB_VENDOR_ID_REALTEK, 0x0821, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8821a_hw_spec) }, -+ { USB_DEVICE_AND_INTERFACE_INFO(RTW_USB_VENDOR_ID_REALTEK, 0x8822, 0xff, 0xff, 0xff), - .driver_info = (kernel_ulong_t)&(rtw8821a_hw_spec) }, -+ { USB_DEVICE_AND_INTERFACE_INFO(RTW_USB_VENDOR_ID_REALTEK, 0x0823, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8821a_hw_spec) }, -+ { USB_DEVICE_AND_INTERFACE_INFO(RTW_USB_VENDOR_ID_REALTEK, 0xa811, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8821a_hw_spec) }, -+ { USB_DEVICE_AND_INTERFACE_INFO(0x0411, 0x0242, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8821a_hw_spec) }, /* Buffalo */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x0411, 0x029b, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8821a_hw_spec) }, /* Buffalo */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x04bb, 0x0953, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8821a_hw_spec) }, /* I-O DATA */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x056e, 0x4007, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8821a_hw_spec) }, /* ELECOM */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x056e, 0x400e, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8821a_hw_spec) }, /* ELECOM */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x056e, 0x400f, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8821a_hw_spec) }, /* ELECOM */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x0846, 0x9052, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8821a_hw_spec) }, /* Netgear */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x0e66, 0x0023, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8821a_hw_spec) }, /* HAWKING */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x3314, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8821a_hw_spec) }, /* D-Link */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x3318, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8821a_hw_spec) }, /* D-Link */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x2019, 0xab32, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8821a_hw_spec) }, /* Planex */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x20f4, 0x804b, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8821a_hw_spec) }, /* TRENDnet */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x011e, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8821a_hw_spec) }, /* TP Link */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x011f, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8821a_hw_spec) }, /* TP Link */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x0120, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8821a_hw_spec) }, /* TP Link */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x3823, 0x6249, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8821a_hw_spec) }, /* Obihai */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x7392, 0xa811, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8821a_hw_spec) }, /* Edimax */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x7392, 0xa812, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8821a_hw_spec) }, /* Edimax */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x7392, 0xa813, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8821a_hw_spec) }, /* Edimax */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x7392, 0xb611, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8821a_hw_spec) }, /* Edimax */ - {}, - }; - MODULE_DEVICE_TABLE(usb, rtw_8821au_id_table); diff --git a/package/kernel/mac80211/patches/rtl/047-v6.14-wifi-rtw88-8812au-Add-more-device-IDs.patch b/package/kernel/mac80211/patches/rtl/047-v6.14-wifi-rtw88-8812au-Add-more-device-IDs.patch deleted file mode 100644 index e03f2461646..00000000000 --- a/package/kernel/mac80211/patches/rtl/047-v6.14-wifi-rtw88-8812au-Add-more-device-IDs.patch +++ /dev/null @@ -1,93 +0,0 @@ -From 1ee6ff9ae3c1a9eda9081f9db04f85d3a7352d38 Mon Sep 17 00:00:00 2001 -From: Nick Morrow -Date: Wed, 6 Nov 2024 15:57:10 +0200 -Subject: [PATCH] wifi: rtw88: 8812au: Add more device IDs - -From https://github.com/morrownr/8812au-20210820. - -Signed-off-by: Nick Morrow -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/31b7ee6b-f96d-43e0-a32f-a9eb1174a0c1@gmail.com ---- - .../net/wireless/realtek/rtw88/rtw8812au.c | 68 ++++++++++++++++++- - 1 file changed, 67 insertions(+), 1 deletion(-) - ---- a/drivers/net/wireless/realtek/rtw88/rtw8812au.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8812au.c -@@ -9,8 +9,74 @@ - #include "usb.h" - - static const struct usb_device_id rtw_8812au_id_table[] = { -- { USB_DEVICE_AND_INTERFACE_INFO(0x2604, 0x0012, 0xff, 0xff, 0xff), -+ { USB_DEVICE_AND_INTERFACE_INFO(RTW_USB_VENDOR_ID_REALTEK, 0x8812, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, -+ { USB_DEVICE_AND_INTERFACE_INFO(RTW_USB_VENDOR_ID_REALTEK, 0x881a, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, -+ { USB_DEVICE_AND_INTERFACE_INFO(RTW_USB_VENDOR_ID_REALTEK, 0x881b, 0xff, 0xff, 0xff), - .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, -+ { USB_DEVICE_AND_INTERFACE_INFO(RTW_USB_VENDOR_ID_REALTEK, 0x881c, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, -+ { USB_DEVICE_AND_INTERFACE_INFO(0x0409, 0x0408, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, /* NEC */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x0411, 0x025d, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, /* Buffalo */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x04bb, 0x0952, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, /* I-O DATA */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x050d, 0x1106, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, /* Belkin */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x050d, 0x1109, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, /* Belkin */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x0586, 0x3426, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, /* ZyXEL */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x0789, 0x016e, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, /* Logitec */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x07b8, 0x8812, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, /* Abocom */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x0846, 0x9051, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, /* Netgear */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x0b05, 0x17d2, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, /* ASUS */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x0df6, 0x0074, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, /* Sitecom */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x0e66, 0x0022, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, /* Hawking */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x1058, 0x0632, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, /* WD */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x13b1, 0x003f, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, /* Linksys */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x148f, 0x9097, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, /* Amped Wireless */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x1740, 0x0100, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, /* EnGenius */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x330e, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, /* D-Link */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x3313, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, /* D-Link */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x3315, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, /* D-Link */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x3316, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, /* D-Link */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x2019, 0xab30, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, /* Planex */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x20f4, 0x805b, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, /* TRENDnet */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x0101, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, /* TP-Link */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x0103, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, /* TP-Link */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x010d, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, /* TP-Link */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x010e, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, /* TP-Link */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x010f, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, /* TP-Link */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x2357, 0x0122, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, /* TP-Link */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x2604, 0x0012, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, /* Tenda */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x7392, 0xa822, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8812a_hw_spec) }, /* Edimax */ - {}, - }; - MODULE_DEVICE_TABLE(usb, rtw_8812au_id_table); diff --git a/package/kernel/mac80211/patches/rtl/048-v6.14-wifi-rtw88-Add-additional-USB-IDs-for-RTL8812BU.patch b/package/kernel/mac80211/patches/rtl/048-v6.14-wifi-rtw88-Add-additional-USB-IDs-for-RTL8812BU.patch deleted file mode 100644 index bf0bcbf1890..00000000000 --- a/package/kernel/mac80211/patches/rtl/048-v6.14-wifi-rtw88-Add-additional-USB-IDs-for-RTL8812BU.patch +++ /dev/null @@ -1,33 +0,0 @@ -From d4c4903508f9e1b2bfec88f777718484e27343fb Mon Sep 17 00:00:00 2001 -From: Nick Morrow -Date: Thu, 7 Nov 2024 08:28:46 +0800 -Subject: [PATCH] wifi: rtw88: Add additional USB IDs for RTL8812BU - -Add three additional USB IDs found in -https://github.com/morrownr/88x2bu-20210702 -to support more RTL8812BU devices. - -Signed-off-by: Nick Morrow -Signed-off-by: Zenm Chen -Reviewed-by: Mikhail Novosyolov -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/20241107002846.13748-1-zenmchen@gmail.com ---- - drivers/net/wireless/realtek/rtw88/rtw8822bu.c | 6 ++++++ - 1 file changed, 6 insertions(+) - ---- a/drivers/net/wireless/realtek/rtw88/rtw8822bu.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8822bu.c -@@ -67,6 +67,12 @@ static const struct usb_device_id rtw_88 - .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* LiteOn */ - { USB_DEVICE_AND_INTERFACE_INFO(0x20f4, 0x808a, 0xff, 0xff, 0xff), - .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* TRENDnet TEW-808UBM */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x20f4, 0x805a, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* TRENDnet TEW-805UBH */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x056e, 0x4011, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* ELECOM WDB-867DU3S */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x2c4e, 0x0107, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* Mercusys MA30H */ - {}, - }; - MODULE_DEVICE_TABLE(usb, rtw_8822bu_id_table); diff --git a/package/kernel/mac80211/patches/rtl/049-v6.14-wifi-rtw88-usb-Support-USB-3-with-RTL8812AU.patch b/package/kernel/mac80211/patches/rtl/049-v6.14-wifi-rtw88-usb-Support-USB-3-with-RTL8812AU.patch deleted file mode 100644 index 694c32f79dc..00000000000 --- a/package/kernel/mac80211/patches/rtl/049-v6.14-wifi-rtw88-usb-Support-USB-3-with-RTL8812AU.patch +++ /dev/null @@ -1,85 +0,0 @@ -From 82a35723a67c29f685d7b518962154a73b7163a2 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Thu, 14 Nov 2024 17:46:08 +0200 -Subject: [PATCH] wifi: rtw88: usb: Support USB 3 with RTL8812AU - -Add the function to automatically switch the RTL8812AU into USB 3 mode. - -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/19cda72b-f1f1-4b69-8369-0e4376b646bf@gmail.com ---- - drivers/net/wireless/realtek/rtw88/usb.c | 44 ++++++++++++++++++++++-- - 1 file changed, 42 insertions(+), 2 deletions(-) - ---- 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 - usb_set_intfdata(intf, NULL); - } - -+static int rtw_usb_switch_mode_old(struct rtw_dev *rtwdev) -+{ -+ struct rtw_usb *rtwusb = rtw_get_usb_priv(rtwdev); -+ enum usb_device_speed cur_speed = rtwusb->udev->speed; -+ u8 hci_opt; -+ -+ if (cur_speed == USB_SPEED_HIGH) { -+ hci_opt = rtw_read8(rtwdev, REG_HCI_OPT_CTRL); -+ -+ if ((hci_opt & (BIT(2) | BIT(3))) != BIT(3)) { -+ rtw_write8(rtwdev, REG_HCI_OPT_CTRL, 0x8); -+ rtw_write8(rtwdev, REG_SYS_SDIO_CTRL, 0x2); -+ rtw_write8(rtwdev, REG_ACLK_MON, 0x1); -+ rtw_write8(rtwdev, 0x3d, 0x3); -+ /* usb disconnect */ -+ rtw_write8(rtwdev, REG_SYS_PW_CTRL + 1, 0x80); -+ return 1; -+ } -+ } else if (cur_speed == USB_SPEED_SUPER) { -+ rtw_write8_clr(rtwdev, REG_SYS_SDIO_CTRL, BIT(1)); -+ rtw_write8_clr(rtwdev, REG_ACLK_MON, BIT(0)); -+ } -+ -+ return 0; -+} -+ - static int rtw_usb_switch_mode_new(struct rtw_dev *rtwdev) - { - enum usb_device_speed cur_speed; -@@ -979,11 +1005,22 @@ static int rtw_usb_switch_mode_new(struc - return 1; - } - -+static bool rtw_usb3_chip_old(u8 chip_id) -+{ -+ return chip_id == RTW_CHIP_TYPE_8812A; -+} -+ -+static bool rtw_usb3_chip_new(u8 chip_id) -+{ -+ return chip_id == RTW_CHIP_TYPE_8822C || -+ chip_id == RTW_CHIP_TYPE_8822B; -+} -+ - static int rtw_usb_switch_mode(struct rtw_dev *rtwdev) - { - u8 id = rtwdev->chip->id; - -- if (id != RTW_CHIP_TYPE_8822C && id != RTW_CHIP_TYPE_8822B) -+ if (!rtw_usb3_chip_new(id) && !rtw_usb3_chip_old(id)) - return 0; - - if (!rtwdev->efuse.usb_mode_switch) { -@@ -998,7 +1035,10 @@ static int rtw_usb_switch_mode(struct rt - return 0; - } - -- return rtw_usb_switch_mode_new(rtwdev); -+ if (rtw_usb3_chip_old(id)) -+ return rtw_usb_switch_mode_old(rtwdev); -+ else -+ return rtw_usb_switch_mode_new(rtwdev); - } - - int rtw_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) diff --git a/package/kernel/mac80211/patches/rtl/050-v6.14-wifi-rtlwifi-rtl8821ae-phy-restore-removed-code-to-f.patch b/package/kernel/mac80211/patches/rtl/050-v6.14-wifi-rtlwifi-rtl8821ae-phy-restore-removed-code-to-f.patch deleted file mode 100644 index 3e66f5b2493..00000000000 --- a/package/kernel/mac80211/patches/rtl/050-v6.14-wifi-rtlwifi-rtl8821ae-phy-restore-removed-code-to-f.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 5e5903a442bb889a62a0f5d89ac33e53ab08592c Mon Sep 17 00:00:00 2001 -From: Colin Ian King -Date: Wed, 6 Nov 2024 15:46:42 +0000 -Subject: [PATCH] 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 -Tested-by: Ping-Ke Shih -Reviewed-by: Su Hui -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/20241106154642.1627886-1-colin.i.king@gmail.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]; -+ } - } - } - } diff --git a/package/kernel/mac80211/patches/rtl/051-v6.14-wifi-rtw88-usb-Enable-RX-aggregation-for-8821au-8812.patch b/package/kernel/mac80211/patches/rtl/051-v6.14-wifi-rtw88-usb-Enable-RX-aggregation-for-8821au-8812.patch deleted file mode 100644 index 1debe2dc73d..00000000000 --- a/package/kernel/mac80211/patches/rtl/051-v6.14-wifi-rtw88-usb-Enable-RX-aggregation-for-8821au-8812.patch +++ /dev/null @@ -1,65 +0,0 @@ -From ce5dea83ee8f945203144fb891fdcb978216e45a Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Thu, 14 Nov 2024 17:48:09 +0200 -Subject: [PATCH] wifi: rtw88: usb: Enable RX aggregation for 8821au/8812au - -USB RX aggregation improves the RX speed on certain ARM systems, like -the NanoPi NEO Core2. With RTL8811AU, before: 30 Mbps, after: 224 Mbps. - -The out-of-tree driver uses aggregation size of 7 in USB 3 mode, but -that doesn't work here. rtw88 advertises support for receiving AMSDU -in AMPDU, so the AP sends larger frames, up to ~5100 bytes. With a size -of 7 RTL8812AU frequently tries to aggregate more frames than will fit -in 32768 bytes. Use a size of 6 instead. - -Signed-off-by: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/63012163-a425-4b15-b830-43f279c06b73@gmail.com ---- - drivers/net/wireless/realtek/rtw88/usb.c | 28 ++++++++++++++++++++++++ - 1 file changed, 28 insertions(+) - ---- a/drivers/net/wireless/realtek/rtw88/usb.c -+++ b/drivers/net/wireless/realtek/rtw88/usb.c -@@ -789,6 +789,30 @@ 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_v2(struct rtw_dev *rtwdev, bool enable) -+{ -+ struct rtw_usb *rtwusb = rtw_get_usb_priv(rtwdev); -+ u8 size, timeout; -+ u16 val16; -+ -+ if (!enable) { -+ size = 0x0; -+ timeout = 0x1; -+ } else if (rtwusb->udev->speed == USB_SPEED_SUPER) { -+ size = 0x6; -+ timeout = 0x1a; -+ } else { -+ size = 0x5; -+ timeout = 0x20; -+ } -+ -+ val16 = u16_encode_bits(size, BIT_RXDMA_AGG_PG_TH) | -+ u16_encode_bits(timeout, BIT_DMA_AGG_TO_V1); -+ -+ rtw_write16(rtwdev, REG_RXDMA_AGG_PG_TH, val16); -+ rtw_write8_set(rtwdev, REG_TXDMA_PQ_MAP, BIT_RXDMA_AGG_EN); -+} -+ - static void rtw_usb_dynamic_rx_agg(struct rtw_dev *rtwdev, bool enable) - { - switch (rtwdev->chip->id) { -@@ -797,6 +821,10 @@ static void rtw_usb_dynamic_rx_agg(struc - case RTW_CHIP_TYPE_8821C: - rtw_usb_dynamic_rx_agg_v1(rtwdev, enable); - break; -+ case RTW_CHIP_TYPE_8821A: -+ case RTW_CHIP_TYPE_8812A: -+ rtw_usb_dynamic_rx_agg_v2(rtwdev, enable); -+ break; - case RTW_CHIP_TYPE_8723D: - /* Doesn't like aggregation. */ - break; diff --git a/package/kernel/mac80211/patches/rtl/052-v6.14-wifi-rtw88-add-__packed-attribute-to-efuse-layout-st.patch b/package/kernel/mac80211/patches/rtl/052-v6.14-wifi-rtw88-add-__packed-attribute-to-efuse-layout-st.patch deleted file mode 100644 index 6132bb7d418..00000000000 --- a/package/kernel/mac80211/patches/rtl/052-v6.14-wifi-rtw88-add-__packed-attribute-to-efuse-layout-st.patch +++ /dev/null @@ -1,195 +0,0 @@ -From 0daa521a1c8c29ffbefe6530f0d276e74e2749d0 Mon Sep 17 00:00:00 2001 -From: Ping-Ke Shih -Date: Thu, 12 Dec 2024 13:42:03 +0800 -Subject: [PATCH] wifi: rtw88: add __packed attribute to efuse layout struct - -The layout struct of efuse should not do address alignment by compiler. -Otherwise it leads unexpected layout and size for certain arch suc as arm. -In x86-64, the results are identical before and after this patch. - -Also adjust bit-field to prevent over adjacent byte to avoid warning: - rtw88/rtw8822b.h:66:1: note: offset of packed bit-field `res2` has changed in GCC 4.4 - 66 | } __packed; - | ^ - -Reported-by: kernel test robot -Closes: https://lore.kernel.org/oe-kbuild-all/202412120131.qk0x6OhE-lkp@intel.com/ -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/20241212054203.135046-1-pkshih@realtek.com ---- - drivers/net/wireless/realtek/rtw88/main.h | 4 ++-- - drivers/net/wireless/realtek/rtw88/rtw8723x.h | 8 ++++---- - drivers/net/wireless/realtek/rtw88/rtw8821c.h | 9 +++++---- - drivers/net/wireless/realtek/rtw88/rtw8822b.h | 9 +++++---- - drivers/net/wireless/realtek/rtw88/rtw8822c.h | 9 +++++---- - 5 files changed, 21 insertions(+), 18 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/main.h -+++ b/drivers/net/wireless/realtek/rtw88/main.h -@@ -510,12 +510,12 @@ struct rtw_5g_txpwr_idx { - struct rtw_5g_vht_ns_pwr_idx_diff vht_2s_diff; - struct rtw_5g_vht_ns_pwr_idx_diff vht_3s_diff; - struct rtw_5g_vht_ns_pwr_idx_diff vht_4s_diff; --}; -+} __packed; - - struct rtw_txpwr_idx { - struct rtw_2g_txpwr_idx pwr_idx_2g; - struct rtw_5g_txpwr_idx pwr_idx_5g; --}; -+} __packed; - - struct rtw_channel_params { - u8 center_chan; ---- a/drivers/net/wireless/realtek/rtw88/rtw8723x.h -+++ b/drivers/net/wireless/realtek/rtw88/rtw8723x.h -@@ -47,7 +47,7 @@ struct rtw8723xe_efuse { - u8 device_id[2]; - u8 sub_vendor_id[2]; - u8 sub_device_id[2]; --}; -+} __packed; - - struct rtw8723xu_efuse { - u8 res4[48]; /* 0xd0 */ -@@ -56,12 +56,12 @@ struct rtw8723xu_efuse { - u8 usb_option; /* 0x104 */ - u8 res5[2]; /* 0x105 */ - u8 mac_addr[ETH_ALEN]; /* 0x107 */ --}; -+} __packed; - - struct rtw8723xs_efuse { - u8 res4[0x4a]; /* 0xd0 */ - u8 mac_addr[ETH_ALEN]; /* 0x11a */ --}; -+} __packed; - - struct rtw8723x_efuse { - __le16 rtl_id; -@@ -96,7 +96,7 @@ struct rtw8723x_efuse { - struct rtw8723xu_efuse u; - struct rtw8723xs_efuse s; - }; --}; -+} __packed; - - #define RTW8723X_IQK_ADDA_REG_NUM 16 - #define RTW8723X_IQK_MAC8_REG_NUM 3 ---- a/drivers/net/wireless/realtek/rtw88/rtw8821c.h -+++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.h -@@ -27,7 +27,7 @@ struct rtw8821cu_efuse { - u8 res11[0xcf]; - u8 package_type; /* 0x1fb */ - u8 res12[0x4]; --}; -+} __packed; - - struct rtw8821ce_efuse { - u8 mac_addr[ETH_ALEN]; /* 0xd0 */ -@@ -47,7 +47,8 @@ struct rtw8821ce_efuse { - u8 ltr_en:1; - u8 res1:2; - u8 obff:2; -- u8 res2:3; -+ u8 res2_1:1; -+ u8 res2_2:2; - u8 obff_cap:2; - u8 res3:4; - u8 res4[3]; -@@ -63,7 +64,7 @@ struct rtw8821ce_efuse { - u8 res6:1; - u8 port_t_power_on_value:5; - u8 res7; --}; -+} __packed; - - struct rtw8821cs_efuse { - u8 res4[0x4a]; /* 0xd0 */ -@@ -101,7 +102,7 @@ struct rtw8821c_efuse { - struct rtw8821cu_efuse u; - struct rtw8821cs_efuse s; - }; --}; -+} __packed; - - static inline void - _rtw_write32s_mask(struct rtw_dev *rtwdev, u32 addr, u32 mask, u32 data) ---- a/drivers/net/wireless/realtek/rtw88/rtw8822b.h -+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.h -@@ -27,7 +27,7 @@ struct rtw8822bu_efuse { - u8 res11[0xcf]; - u8 package_type; /* 0x1fb */ - u8 res12[0x4]; --}; -+} __packed; - - struct rtw8822be_efuse { - u8 mac_addr[ETH_ALEN]; /* 0xd0 */ -@@ -47,7 +47,8 @@ struct rtw8822be_efuse { - u8 ltr_en:1; - u8 res1:2; - u8 obff:2; -- u8 res2:3; -+ u8 res2_1:1; -+ u8 res2_2:2; - u8 obff_cap:2; - u8 res3:4; - u8 res4[3]; -@@ -63,7 +64,7 @@ struct rtw8822be_efuse { - u8 res6:1; - u8 port_t_power_on_value:5; - u8 res7; --}; -+} __packed; - - struct rtw8822bs_efuse { - u8 res4[0x4a]; /* 0xd0 */ -@@ -103,7 +104,7 @@ struct rtw8822b_efuse { - struct rtw8822bu_efuse u; - struct rtw8822bs_efuse s; - }; --}; -+} __packed; - - static inline void - _rtw_write32s_mask(struct rtw_dev *rtwdev, u32 addr, u32 mask, u32 data) ---- a/drivers/net/wireless/realtek/rtw88/rtw8822c.h -+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.h -@@ -14,7 +14,7 @@ struct rtw8822cu_efuse { - u8 res1[3]; - u8 mac_addr[ETH_ALEN]; /* 0x157 */ - u8 res2[0x3d]; --}; -+} __packed; - - struct rtw8822cs_efuse { - u8 res0[0x4a]; /* 0x120 */ -@@ -39,7 +39,8 @@ struct rtw8822ce_efuse { - u8 ltr_en:1; - u8 res1:2; - u8 obff:2; -- u8 res2:3; -+ u8 res2_1:1; -+ u8 res2_2:2; - u8 obff_cap:2; - u8 res3:4; - u8 class_code[3]; -@@ -55,7 +56,7 @@ struct rtw8822ce_efuse { - u8 res6:1; - u8 port_t_power_on_value:5; - u8 res7; --}; -+} __packed; - - struct rtw8822c_efuse { - __le16 rtl_id; -@@ -102,7 +103,7 @@ struct rtw8822c_efuse { - struct rtw8822cu_efuse u; - struct rtw8822cs_efuse s; - }; --}; -+} __packed; - - enum rtw8822c_dpk_agc_phase { - RTW_DPK_GAIN_CHECK, diff --git a/package/kernel/mac80211/patches/rtl/053-v6.14-wifi-rtw88-8812a-Support-RFE-type-2.patch b/package/kernel/mac80211/patches/rtl/053-v6.14-wifi-rtw88-8812a-Support-RFE-type-2.patch deleted file mode 100644 index d59facb3f9d..00000000000 --- a/package/kernel/mac80211/patches/rtl/053-v6.14-wifi-rtw88-8812a-Support-RFE-type-2.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 59ab27a9f20f8de6f7989e8a8c3d97c04ed8199c Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Wed, 18 Dec 2024 02:13:22 +0200 -Subject: [PATCH] wifi: rtw88: 8812a: Support RFE type 2 - -RF front end type 2 exists in the wild and can be treated like types -0 and 1. - -Signed-off-by: Bitterblue Smith -Acked-by: Ping-Ke Shih -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/2917c7fc-6d88-4007-b6a6-9130bd1991e5@gmail.com ---- - drivers/net/wireless/realtek/rtw88/rtw8812a.c | 3 +++ - 1 file changed, 3 insertions(+) - ---- a/drivers/net/wireless/realtek/rtw88/rtw8812a.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8812a.c -@@ -985,6 +985,9 @@ static const struct rtw_rfe_def rtw8812a - [1] = { .phy_pg_tbl = &rtw8812a_bb_pg_tbl, - .txpwr_lmt_tbl = &rtw8812a_txpwr_lmt_tbl, - .pwr_track_tbl = &rtw8812a_rtw_pwr_track_tbl, }, -+ [2] = { .phy_pg_tbl = &rtw8812a_bb_pg_tbl, -+ .txpwr_lmt_tbl = &rtw8812a_txpwr_lmt_tbl, -+ .pwr_track_tbl = &rtw8812a_rtw_pwr_track_tbl, }, - [3] = { .phy_pg_tbl = &rtw8812a_bb_pg_rfe3_tbl, - .txpwr_lmt_tbl = &rtw8812a_txpwr_lmt_tbl, - .pwr_track_tbl = &rtw8812a_rtw_pwr_track_rfe3_tbl, }, diff --git a/package/kernel/mac80211/patches/rtl/054-v6.14-wifi-rtw88-8821a-8812a-Set-ptct_efuse_size-to-0.patch b/package/kernel/mac80211/patches/rtl/054-v6.14-wifi-rtw88-8821a-8812a-Set-ptct_efuse_size-to-0.patch deleted file mode 100644 index 3b5dea793a7..00000000000 --- a/package/kernel/mac80211/patches/rtl/054-v6.14-wifi-rtw88-8821a-8812a-Set-ptct_efuse_size-to-0.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 74a72c367573ad521becf6cc4d649e14387b3c64 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Wed, 18 Dec 2024 02:16:11 +0200 -Subject: [PATCH] wifi: rtw88: 8821a/8812a: Set ptct_efuse_size to 0 - -Some RTL8812AU devices fail to probe: - -[ 12.478774] rtw_8812au 1-1.3:1.0: failed to dump efuse logical map -[ 12.487712] rtw_8812au 1-1.3:1.0: failed to setup chip efuse info -[ 12.487742] rtw_8812au 1-1.3:1.0: failed to setup chip information -[ 12.491077] rtw_8812au: probe of 1-1.3:1.0 failed with error -22 - -It turns out these chips don't need to "protect" any bytes at the end of -the efuse. - -The original value of 96 was copied from rtw8821c.c. - -No one reported any failures with RTL8821AU yet, but the vendor driver -uses the same efuse reading code for both chips. - -Signed-off-by: Bitterblue Smith -Acked-by: Ping-Ke Shih -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/1a477adb-60c3-463c-b158-3f86c94cb821@gmail.com ---- - drivers/net/wireless/realtek/rtw88/rtw8812a.c | 2 +- - drivers/net/wireless/realtek/rtw88/rtw8821a.c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/rtw8812a.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8812a.c -@@ -1027,7 +1027,7 @@ const struct rtw_chip_info rtw8812a_hw_s - .rx_buf_desc_sz = 8, - .phy_efuse_size = 512, - .log_efuse_size = 512, -- .ptct_efuse_size = 96 + 1, /* TODO or just 18? */ -+ .ptct_efuse_size = 0, - .txff_size = 131072, - .rxff_size = 16128, - .rsvd_drv_pg_num = 9, ---- a/drivers/net/wireless/realtek/rtw88/rtw8821a.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8821a.c -@@ -1118,7 +1118,7 @@ const struct rtw_chip_info rtw8821a_hw_s - .rx_buf_desc_sz = 8, - .phy_efuse_size = 512, - .log_efuse_size = 512, -- .ptct_efuse_size = 96 + 1, /* TODO or just 18? */ -+ .ptct_efuse_size = 0, - .txff_size = 65536, - .rxff_size = 16128, - .rsvd_drv_pg_num = 8, diff --git a/package/kernel/mac80211/patches/rtl/055-v6.14-wifi-rtw88-usb-Copy-instead-of-cloning-the-RX-skb.patch b/package/kernel/mac80211/patches/rtl/055-v6.14-wifi-rtw88-usb-Copy-instead-of-cloning-the-RX-skb.patch deleted file mode 100644 index 30f13f9d385..00000000000 --- a/package/kernel/mac80211/patches/rtl/055-v6.14-wifi-rtw88-usb-Copy-instead-of-cloning-the-RX-skb.patch +++ /dev/null @@ -1,130 +0,0 @@ -From e9048e2935f7d797c2ba047c15b705b57c2fa99a Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Thu, 19 Dec 2024 00:33:20 +0200 -Subject: [PATCH] wifi: rtw88: usb: Copy instead of cloning the RX skb - -"iperf3 -c 192.168.0.1 -R --udp -b 0" shows about 40% of datagrams -are lost. Many torrents don't download faster than 3 MiB/s, probably -because the Bittorrent protocol uses UDP. This is somehow related to -the use of skb_clone() in the RX path. - -Don't use skb_clone(). Instead allocate a new skb for each 802.11 frame -received and copy the data from the big (32768 byte) skb. - -With this patch, "iperf3 -c 192.168.0.1 -R --udp -b 0" shows only 1-2% -of datagrams are lost, and torrents can reach download speeds of 36 -MiB/s. - -Tested with RTL8812AU and RTL8822CU. - -Signed-off-by: Bitterblue Smith -Acked-by: Ping-Ke Shih -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/8c9d4f9d-ebd8-4dc0-a0c4-9ebe430521dd@gmail.com ---- - drivers/net/wireless/realtek/rtw88/usb.c | 52 ++++++++++++++---------- - 1 file changed, 31 insertions(+), 21 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/usb.c -+++ b/drivers/net/wireless/realtek/rtw88/usb.c -@@ -7,6 +7,7 @@ - #include - #include "main.h" - #include "debug.h" -+#include "mac.h" - #include "reg.h" - #include "tx.h" - #include "rx.h" -@@ -547,49 +548,58 @@ static void rtw_usb_rx_handler(struct wo - { - struct rtw_usb *rtwusb = container_of(work, struct rtw_usb, rx_work); - struct rtw_dev *rtwdev = rtwusb->rtwdev; -- const struct rtw_chip_info *chip = rtwdev->chip; -- u32 pkt_desc_sz = chip->rx_pkt_desc_sz; - struct ieee80211_rx_status rx_status; -- u32 pkt_offset, next_pkt, urb_len; - struct rtw_rx_pkt_stat pkt_stat; -- struct sk_buff *next_skb; -+ struct sk_buff *rx_skb; - struct sk_buff *skb; -+ u32 pkt_desc_sz = rtwdev->chip->rx_pkt_desc_sz; -+ u32 max_skb_len = pkt_desc_sz + PHY_STATUS_SIZE * 8 + -+ IEEE80211_MAX_MPDU_LEN_VHT_11454; -+ u32 pkt_offset, next_pkt, skb_len; - u8 *rx_desc; - int limit; - - for (limit = 0; limit < 200; limit++) { -- skb = skb_dequeue(&rtwusb->rx_queue); -- if (!skb) -+ rx_skb = skb_dequeue(&rtwusb->rx_queue); -+ if (!rx_skb) - break; - - if (skb_queue_len(&rtwusb->rx_queue) >= RTW_USB_MAX_RXQ_LEN) { - dev_dbg_ratelimited(rtwdev->dev, "failed to get rx_queue, overflow\n"); -- dev_kfree_skb_any(skb); -+ dev_kfree_skb_any(rx_skb); - continue; - } - -- urb_len = skb->len; -+ rx_desc = rx_skb->data; - - do { -- rx_desc = skb->data; - rtw_rx_query_rx_desc(rtwdev, rx_desc, &pkt_stat, - &rx_status); - pkt_offset = pkt_desc_sz + pkt_stat.drv_info_sz + - pkt_stat.shift; - -- next_pkt = round_up(pkt_stat.pkt_len + pkt_offset, 8); -+ skb_len = pkt_stat.pkt_len + pkt_offset; -+ if (skb_len > max_skb_len) { -+ rtw_dbg(rtwdev, RTW_DBG_USB, -+ "skipping too big packet: %u\n", -+ skb_len); -+ goto skip_packet; -+ } -+ -+ skb = alloc_skb(skb_len, GFP_KERNEL); -+ if (!skb) { -+ rtw_dbg(rtwdev, RTW_DBG_USB, -+ "failed to allocate RX skb of size %u\n", -+ skb_len); -+ goto skip_packet; -+ } - -- if (urb_len >= next_pkt + pkt_desc_sz) -- next_skb = skb_clone(skb, GFP_KERNEL); -- else -- next_skb = NULL; -+ skb_put_data(skb, rx_desc, skb_len); - - if (pkt_stat.is_c2h) { -- skb_trim(skb, pkt_stat.pkt_len + pkt_offset); - rtw_fw_c2h_cmd_rx_irqsafe(rtwdev, pkt_offset, skb); - } else { - skb_pull(skb, pkt_offset); -- skb_trim(skb, pkt_stat.pkt_len); - rtw_update_rx_freq_for_invalid(rtwdev, skb, - &rx_status, - &pkt_stat); -@@ -598,12 +608,12 @@ static void rtw_usb_rx_handler(struct wo - ieee80211_rx_irqsafe(rtwdev->hw, skb); - } - -- skb = next_skb; -- if (skb) -- skb_pull(skb, next_pkt); -+skip_packet: -+ next_pkt = round_up(skb_len, 8); -+ rx_desc += next_pkt; -+ } while (rx_desc + pkt_desc_sz < rx_skb->data + rx_skb->len); - -- urb_len -= next_pkt; -- } while (skb); -+ dev_kfree_skb_any(rx_skb); - } - } - diff --git a/package/kernel/mac80211/patches/rtl/058-v6.14-wifi-rtw88-Add-USB-PHY-configuration.patch b/package/kernel/mac80211/patches/rtl/058-v6.14-wifi-rtw88-Add-USB-PHY-configuration.patch deleted file mode 100644 index 606c0fd6fca..00000000000 --- a/package/kernel/mac80211/patches/rtl/058-v6.14-wifi-rtw88-Add-USB-PHY-configuration.patch +++ /dev/null @@ -1,141 +0,0 @@ -From 5b1b9545262b5126a3c2776e7e64ff29765cbe6e Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Wed, 1 Jan 2025 18:16:32 +0200 -Subject: [PATCH] wifi: rtw88: Add USB PHY configuration - -Add some extra configuration for USB devices. Currently only RTL8822BU -version (cut) D needs this. The new code makes use of the existing -usb3_param_8822b array from rtw8822b.c. - -A user reported that TP-Link Archer T3U in USB 3 mode was randomly -disconnecting from USB: - -[ 26.036502] usb 2-2: new SuperSpeed USB device number 3 using xhci_hcd -... -[ 27.576491] usb 2-2: USB disconnect, device number 3 -[ 28.621528] usb 2-2: new SuperSpeed USB device number 4 using xhci_hcd -... -[ 45.984521] usb 2-2: USB disconnect, device number 4 -... -[ 46.845585] usb 2-2: new SuperSpeed USB device number 5 using xhci_hcd -... -[ 94.400380] usb 2-2: USB disconnect, device number 5 -... -[ 95.590421] usb 2-2: new SuperSpeed USB device number 6 using xhci_hcd - -This patch fixes that. - -Link: https://github.com/lwfinger/rtw88/issues/262 -Signed-off-by: Bitterblue Smith -Acked-by: Ping-Ke Shih -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/9d312b14-0146-4be8-9c50-ef432234db50@gmail.com ---- - drivers/net/wireless/realtek/rtw88/reg.h | 10 ++++ - drivers/net/wireless/realtek/rtw88/usb.c | 68 ++++++++++++++++++++++++ - 2 files changed, 78 insertions(+) - ---- a/drivers/net/wireless/realtek/rtw88/reg.h -+++ b/drivers/net/wireless/realtek/rtw88/reg.h -@@ -871,7 +871,17 @@ - - #define REG_USB_MOD 0xf008 - #define REG_USB3_RXITV 0xf050 -+#define REG_USB2_PHY_ADR 0xfe40 -+#define REG_USB2_PHY_DAT 0xfe41 -+#define REG_USB2_PHY_CMD 0xfe42 -+#define BIT_USB2_PHY_CMD_TRG 0x81 - #define REG_USB_HRPWM 0xfe58 -+#define REG_USB3_PHY_ADR 0xff0c -+#define REG_USB3_PHY_DAT_L 0xff0d -+#define REG_USB3_PHY_DAT_H 0xff0e -+#define BIT_USB3_PHY_ADR_WR BIT(7) -+#define BIT_USB3_PHY_ADR_RD BIT(6) -+#define BIT_USB3_PHY_ADR_MASK GENMASK(5, 0) - - #define RF_MODE 0x00 - #define RF_MODOPT 0x01 ---- a/drivers/net/wireless/realtek/rtw88/usb.c -+++ b/drivers/net/wireless/realtek/rtw88/usb.c -@@ -1079,6 +1079,71 @@ static int rtw_usb_switch_mode(struct rt - return rtw_usb_switch_mode_new(rtwdev); - } - -+#define USB_REG_PAGE 0xf4 -+#define USB_PHY_PAGE0 0x9b -+#define USB_PHY_PAGE1 0xbb -+ -+static void rtw_usb_phy_write(struct rtw_dev *rtwdev, u8 addr, u16 data, -+ enum usb_device_speed speed) -+{ -+ if (speed == USB_SPEED_SUPER) { -+ rtw_write8(rtwdev, REG_USB3_PHY_DAT_L, data & 0xff); -+ rtw_write8(rtwdev, REG_USB3_PHY_DAT_H, data >> 8); -+ rtw_write8(rtwdev, REG_USB3_PHY_ADR, addr | BIT_USB3_PHY_ADR_WR); -+ } else if (speed == USB_SPEED_HIGH) { -+ rtw_write8(rtwdev, REG_USB2_PHY_DAT, data); -+ rtw_write8(rtwdev, REG_USB2_PHY_ADR, addr); -+ rtw_write8(rtwdev, REG_USB2_PHY_CMD, BIT_USB2_PHY_CMD_TRG); -+ } -+} -+ -+static void rtw_usb_page_switch(struct rtw_dev *rtwdev, -+ enum usb_device_speed speed, u8 page) -+{ -+ if (speed == USB_SPEED_SUPER) -+ return; -+ -+ rtw_usb_phy_write(rtwdev, USB_REG_PAGE, page, speed); -+} -+ -+static void rtw_usb_phy_cfg(struct rtw_dev *rtwdev, -+ enum usb_device_speed speed) -+{ -+ const struct rtw_intf_phy_para *para = NULL; -+ u16 offset; -+ -+ if (!rtwdev->chip->intf_table) -+ return; -+ -+ if (speed == USB_SPEED_SUPER) -+ para = rtwdev->chip->intf_table->usb3_para; -+ else if (speed == USB_SPEED_HIGH) -+ para = rtwdev->chip->intf_table->usb2_para; -+ -+ if (!para) -+ return; -+ -+ for ( ; para->offset != 0xffff; para++) { -+ if (!(para->cut_mask & BIT(rtwdev->hal.cut_version))) -+ continue; -+ -+ offset = para->offset; -+ -+ if (para->ip_sel == RTW_IP_SEL_MAC) { -+ rtw_write8(rtwdev, offset, para->value); -+ } else { -+ if (offset > 0x100) -+ rtw_usb_page_switch(rtwdev, speed, USB_PHY_PAGE1); -+ else -+ rtw_usb_page_switch(rtwdev, speed, USB_PHY_PAGE0); -+ -+ offset &= 0xff; -+ -+ rtw_usb_phy_write(rtwdev, offset, para->value, speed); -+ } -+ } -+} -+ - int rtw_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) - { - struct rtw_dev *rtwdev; -@@ -1134,6 +1199,9 @@ int rtw_usb_probe(struct usb_interface * - goto err_destroy_rxwq; - } - -+ rtw_usb_phy_cfg(rtwdev, USB_SPEED_HIGH); -+ rtw_usb_phy_cfg(rtwdev, USB_SPEED_SUPER); -+ - ret = rtw_usb_switch_mode(rtwdev); - if (ret) { - /* Not a fail, but we do need to skip rtw_register_hw. */ diff --git a/package/kernel/mac80211/patches/rtl/059-v6.14-wifi-rtw88-Delete-rf_type-member-of-struct-rtw_sta_i.patch b/package/kernel/mac80211/patches/rtl/059-v6.14-wifi-rtw88-Delete-rf_type-member-of-struct-rtw_sta_i.patch deleted file mode 100644 index 6a4998e783f..00000000000 --- a/package/kernel/mac80211/patches/rtl/059-v6.14-wifi-rtw88-Delete-rf_type-member-of-struct-rtw_sta_i.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 5ad483955acc85dc91b88c7b76dc1429e8ba33bc Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Wed, 1 Jan 2025 18:27:35 +0200 -Subject: [PATCH] wifi: rtw88: Delete rf_type member of struct rtw_sta_info - -It's not used for anything. - -Signed-off-by: Bitterblue Smith -Acked-by: Ping-Ke Shih -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/b80f7904-c6b4-4d12-a5f9-69ab9b965732@gmail.com ---- - drivers/net/wireless/realtek/rtw88/main.c | 9 ++------- - drivers/net/wireless/realtek/rtw88/main.h | 1 - - 2 files changed, 2 insertions(+), 8 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/main.c -+++ b/drivers/net/wireless/realtek/rtw88/main.c -@@ -1217,7 +1217,6 @@ void rtw_update_sta_info(struct rtw_dev - u8 wireless_set; - u8 bw_mode; - u8 rate_id; -- u8 rf_type = RF_1T1R; - u8 stbc_en = 0; - u8 ldpc_en = 0; - u8 tx_num = 1; -@@ -1302,13 +1301,10 @@ void rtw_update_sta_info(struct rtw_dev - break; - } - -- if (sta->deflink.vht_cap.vht_supported && ra_mask & 0xffc00000) { -+ if (sta->deflink.vht_cap.vht_supported && ra_mask & 0xffc00000) - tx_num = 2; -- rf_type = RF_2T2R; -- } else if (sta->deflink.ht_cap.ht_supported && ra_mask & 0xfff00000) { -+ else if (sta->deflink.ht_cap.ht_supported && ra_mask & 0xfff00000) - tx_num = 2; -- rf_type = RF_2T2R; -- } - - rate_id = get_rate_id(wireless_set, bw_mode, tx_num); - -@@ -1319,7 +1315,6 @@ void rtw_update_sta_info(struct rtw_dev - si->bw_mode = bw_mode; - si->stbc_en = stbc_en; - si->ldpc_en = ldpc_en; -- si->rf_type = rf_type; - si->sgi_enable = is_support_sgi; - si->vht_enable = is_vht_enable; - si->ra_mask = ra_mask; ---- a/drivers/net/wireless/realtek/rtw88/main.h -+++ b/drivers/net/wireless/realtek/rtw88/main.h -@@ -757,7 +757,6 @@ struct rtw_sta_info { - u8 mac_id; - u8 rate_id; - enum rtw_bandwidth bw_mode; -- enum rtw_rf_type rf_type; - u8 stbc_en:2; - u8 ldpc_en:2; - bool sgi_enable; diff --git a/package/kernel/mac80211/patches/rtl/060-v6.14-wifi-rtw88-8703b-Fix-RX-TX-issues.patch b/package/kernel/mac80211/patches/rtl/060-v6.14-wifi-rtw88-8703b-Fix-RX-TX-issues.patch deleted file mode 100644 index 0a512a38592..00000000000 --- a/package/kernel/mac80211/patches/rtl/060-v6.14-wifi-rtw88-8703b-Fix-RX-TX-issues.patch +++ /dev/null @@ -1,59 +0,0 @@ -From a806a8160a0fcaff368bb510c8a52eff37faf727 Mon Sep 17 00:00:00 2001 -From: Vasily Khoruzhick -Date: Thu, 2 Jan 2025 23:50:53 -0800 -Subject: [PATCH] wifi: rtw88: 8703b: Fix RX/TX issues - -Fix 3 typos in 8703b driver. 2 typos in calibration routines are not -fatal and do not seem to have any impact, just fix them to match vendor -driver. - -However the last one in rtw8703b_set_channel_bb() clears too many bits -in REG_OFDM0_TX_PSD_NOISE, causing TX and RX issues (neither rate goes -above MCS0-MCS1). Vendor driver clears only 2 most significant bits. - -With the last typo fixed, the driver is able to reach MCS7 on Pinebook - -Cc: stable@vger.kernel.org -Fixes: 9bb762b3a957 ("wifi: rtw88: Add definitions for 8703b chip") -Signed-off-by: Vasily Khoruzhick -Acked-by: Ping-Ke Shih -Tested-by: Fiona Klute -Tested-by: Andrey Skvortsov -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/20250103075107.1337533-1-anarsoul@gmail.com ---- - drivers/net/wireless/realtek/rtw88/rtw8703b.c | 8 ++++---- - 1 file changed, 4 insertions(+), 4 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/rtw8703b.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8703b.c -@@ -903,7 +903,7 @@ static void rtw8703b_set_channel_bb(stru - rtw_write32_mask(rtwdev, REG_FPGA0_RFMOD, BIT_MASK_RFMOD, 0x0); - rtw_write32_mask(rtwdev, REG_FPGA1_RFMOD, BIT_MASK_RFMOD, 0x0); - rtw_write32_mask(rtwdev, REG_OFDM0_TX_PSD_NOISE, -- GENMASK(31, 20), 0x0); -+ GENMASK(31, 30), 0x0); - rtw_write32(rtwdev, REG_BBRX_DFIR, 0x4A880000); - rtw_write32(rtwdev, REG_OFDM0_A_TX_AFE, 0x19F60000); - break; -@@ -1198,9 +1198,9 @@ static u8 rtw8703b_iqk_rx_path(struct rt - rtw_write32(rtwdev, REG_RXIQK_TONE_A_11N, 0x38008c1c); - rtw_write32(rtwdev, REG_TX_IQK_TONE_B, 0x38008c1c); - rtw_write32(rtwdev, REG_RX_IQK_TONE_B, 0x38008c1c); -- rtw_write32(rtwdev, REG_TXIQK_PI_A_11N, 0x8216000f); -+ rtw_write32(rtwdev, REG_TXIQK_PI_A_11N, 0x8214030f); - rtw_write32(rtwdev, REG_RXIQK_PI_A_11N, 0x28110000); -- rtw_write32(rtwdev, REG_TXIQK_PI_B, 0x28110000); -+ rtw_write32(rtwdev, REG_TXIQK_PI_B, 0x82110000); - rtw_write32(rtwdev, REG_RXIQK_PI_B, 0x28110000); - - /* LOK setting */ -@@ -1372,7 +1372,7 @@ void rtw8703b_iqk_fill_a_matrix(struct r - return; - - tmp_rx_iqi |= FIELD_PREP(BIT_MASK_RXIQ_S1_X, result[IQK_S1_RX_X]); -- tmp_rx_iqi |= FIELD_PREP(BIT_MASK_RXIQ_S1_Y1, result[IQK_S1_RX_X]); -+ tmp_rx_iqi |= FIELD_PREP(BIT_MASK_RXIQ_S1_Y1, result[IQK_S1_RX_Y]); - rtw_write32(rtwdev, REG_A_RXIQI, tmp_rx_iqi); - rtw_write32_mask(rtwdev, REG_RXIQK_MATRIX_LSB_11N, BIT_MASK_RXIQ_S1_Y2, - BIT_SET_RXIQ_S1_Y2(result[IQK_S1_RX_Y])); diff --git a/package/kernel/mac80211/patches/rtl/061-v6.14-wifi-rtw88-sdio-Fix-disconnection-after-beacon-loss.patch b/package/kernel/mac80211/patches/rtl/061-v6.14-wifi-rtw88-sdio-Fix-disconnection-after-beacon-loss.patch deleted file mode 100644 index 790dfe04203..00000000000 --- a/package/kernel/mac80211/patches/rtl/061-v6.14-wifi-rtw88-sdio-Fix-disconnection-after-beacon-loss.patch +++ /dev/null @@ -1,31 +0,0 @@ -From fb2fcfbe5eef9ae26b0425978435ae1308951e51 Mon Sep 17 00:00:00 2001 -From: Fiona Klute -Date: Mon, 6 Jan 2025 15:54:34 +0200 -Subject: [PATCH] wifi: rtw88: sdio: Fix disconnection after beacon loss - -This is the equivalent of commit 28818b4d871b ("wifi: rtw88: usb: Fix -disconnection after beacon loss") for SDIO chips. -Tested on Pinephone (RTL8723CS), random disconnections became rare, -instead of a frequent nuisance. - -Cc: stable@vger.kernel.org -Signed-off-by: Fiona Klute -Tested-by: Vasily Khoruzhick # Tested on Pinebook -Acked-by: Ping-Ke Shih -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/20250106135434.35936-1-fiona.klute@gmx.de ---- - drivers/net/wireless/realtek/rtw88/sdio.c | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/drivers/net/wireless/realtek/rtw88/sdio.c -+++ b/drivers/net/wireless/realtek/rtw88/sdio.c -@@ -1192,6 +1192,8 @@ static void rtw_sdio_indicate_tx_status( - struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); - struct ieee80211_hw *hw = rtwdev->hw; - -+ skb_pull(skb, rtwdev->chip->tx_pkt_desc_sz); -+ - /* enqueue to wait for tx report */ - if (info->flags & IEEE80211_TX_CTL_REQ_TX_STATUS) { - rtw_tx_report_enqueue(rtwdev, skb, tx_data->sn); diff --git a/package/kernel/mac80211/patches/rtl/062-v6.14-wifi-rtw88-Add-support-for-LED-blinking.patch b/package/kernel/mac80211/patches/rtl/062-v6.14-wifi-rtw88-Add-support-for-LED-blinking.patch deleted file mode 100644 index b261d02e3f6..00000000000 --- a/package/kernel/mac80211/patches/rtl/062-v6.14-wifi-rtw88-Add-support-for-LED-blinking.patch +++ /dev/null @@ -1,424 +0,0 @@ -From 4b6652bc6d8d5fb0648b3a7a16ef8af4e0345bcd Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Wed, 8 Jan 2025 13:41:23 +0200 -Subject: [PATCH] wifi: rtw88: Add support for LED blinking - -Register a struct led_classdev with the kernel's LED subsystem and -create a throughput-based trigger for it. Then mac80211 makes the LED -blink. - -Tested with Tenda U12 (RTL8812AU), Tenda U9 (RTL8811CU), TP-Link Archer -T2U Nano (RTL8811AU), TP-Link Archer T3U Plus (RTL8812BU), Edimax -EW-7611UCB (RTL8821AU), LM842 (RTL8822CU). - -Also tested with devices which don't have LEDs: the laptop's internal -RTL8822CE and a no-name RTL8723DU. - -Signed-off-by: Bitterblue Smith -Acked-by: Ping-Ke Shih -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/6c43451f-ab2f-4e76-ac6e-ff5a18dd981d@gmail.com ---- - drivers/net/wireless/realtek/rtw88/Makefile | 2 + - drivers/net/wireless/realtek/rtw88/led.c | 73 +++++++++++++++++++ - drivers/net/wireless/realtek/rtw88/led.h | 25 +++++++ - drivers/net/wireless/realtek/rtw88/main.c | 12 ++- - drivers/net/wireless/realtek/rtw88/main.h | 5 ++ - drivers/net/wireless/realtek/rtw88/reg.h | 12 +++ - drivers/net/wireless/realtek/rtw88/rtw8812a.c | 17 +++++ - drivers/net/wireless/realtek/rtw88/rtw8821a.c | 26 +++++++ - drivers/net/wireless/realtek/rtw88/rtw8821c.c | 19 +++++ - drivers/net/wireless/realtek/rtw88/rtw8822b.c | 19 +++++ - drivers/net/wireless/realtek/rtw88/rtw8822c.c | 19 +++++ - 11 files changed, 227 insertions(+), 2 deletions(-) - create mode 100644 drivers/net/wireless/realtek/rtw88/led.c - create mode 100644 drivers/net/wireless/realtek/rtw88/led.h - ---- a/drivers/net/wireless/realtek/rtw88/Makefile -+++ b/drivers/net/wireless/realtek/rtw88/Makefile -@@ -20,6 +20,8 @@ rtw88_core-y += main.o \ - - rtw88_core-$(CONFIG_PM) += wow.o - -+rtw88_core-$(CONFIG_LEDS_CLASS) += led.o -+ - obj-$(CPTCFG_RTW88_8822B) += rtw88_8822b.o - rtw88_8822b-objs := rtw8822b.o rtw8822b_table.o - ---- /dev/null -+++ b/drivers/net/wireless/realtek/rtw88/led.c -@@ -0,0 +1,73 @@ -+// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause -+/* Copyright(c) 2025 Realtek Corporation -+ */ -+ -+#include "main.h" -+#include "debug.h" -+#include "led.h" -+ -+static int rtw_led_set_blocking(struct led_classdev *led, -+ enum led_brightness brightness) -+{ -+ struct rtw_dev *rtwdev = container_of(led, struct rtw_dev, led_cdev); -+ -+ rtwdev->chip->ops->led_set(led, brightness); -+ -+ return 0; -+} -+ -+void rtw_led_init(struct rtw_dev *rtwdev) -+{ -+ static const struct ieee80211_tpt_blink rtw_tpt_blink[] = { -+ { .throughput = 0 * 1024, .blink_time = 334 }, -+ { .throughput = 1 * 1024, .blink_time = 260 }, -+ { .throughput = 5 * 1024, .blink_time = 220 }, -+ { .throughput = 10 * 1024, .blink_time = 190 }, -+ { .throughput = 20 * 1024, .blink_time = 170 }, -+ { .throughput = 50 * 1024, .blink_time = 150 }, -+ { .throughput = 70 * 1024, .blink_time = 130 }, -+ { .throughput = 100 * 1024, .blink_time = 110 }, -+ { .throughput = 200 * 1024, .blink_time = 80 }, -+ { .throughput = 300 * 1024, .blink_time = 50 }, -+ }; -+ struct led_classdev *led = &rtwdev->led_cdev; -+ int err; -+ -+ if (!rtwdev->chip->ops->led_set) -+ return; -+ -+ if (rtw_hci_type(rtwdev) == RTW_HCI_TYPE_PCIE) -+ led->brightness_set = rtwdev->chip->ops->led_set; -+ else -+ led->brightness_set_blocking = rtw_led_set_blocking; -+ -+ snprintf(rtwdev->led_name, sizeof(rtwdev->led_name), -+ "rtw88-%s", dev_name(rtwdev->dev)); -+ -+ led->name = rtwdev->led_name; -+ led->max_brightness = LED_ON; -+ led->default_trigger = -+ ieee80211_create_tpt_led_trigger(rtwdev->hw, -+ IEEE80211_TPT_LEDTRIG_FL_RADIO, -+ rtw_tpt_blink, -+ ARRAY_SIZE(rtw_tpt_blink)); -+ -+ err = led_classdev_register(rtwdev->dev, led); -+ if (err) { -+ rtw_warn(rtwdev, "Failed to register the LED, error %d\n", err); -+ return; -+ } -+ -+ rtwdev->led_registered = true; -+} -+ -+void rtw_led_deinit(struct rtw_dev *rtwdev) -+{ -+ struct led_classdev *led = &rtwdev->led_cdev; -+ -+ if (!rtwdev->led_registered) -+ return; -+ -+ rtwdev->chip->ops->led_set(led, LED_OFF); -+ led_classdev_unregister(led); -+} ---- /dev/null -+++ b/drivers/net/wireless/realtek/rtw88/led.h -@@ -0,0 +1,25 @@ -+/* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ -+/* Copyright(c) 2025 Realtek Corporation -+ */ -+ -+#ifndef __RTW_LED_H -+#define __RTW_LED_H -+ -+#ifdef CONFIG_LEDS_CLASS -+ -+void rtw_led_init(struct rtw_dev *rtwdev); -+void rtw_led_deinit(struct rtw_dev *rtwdev); -+ -+#else -+ -+static inline void rtw_led_init(struct rtw_dev *rtwdev) -+{ -+} -+ -+static inline void rtw_led_deinit(struct rtw_dev *rtwdev) -+{ -+} -+ -+#endif -+ -+#endif ---- a/drivers/net/wireless/realtek/rtw88/main.c -+++ b/drivers/net/wireless/realtek/rtw88/main.c -@@ -19,6 +19,7 @@ - #include "bf.h" - #include "sar.h" - #include "sdio.h" -+#include "led.h" - - bool rtw_disable_lps_deep_mode; - EXPORT_SYMBOL(rtw_disable_lps_deep_mode); -@@ -2292,16 +2293,18 @@ int rtw_register_hw(struct rtw_dev *rtwd - return ret; - } - -+ rtw_led_init(rtwdev); -+ - ret = ieee80211_register_hw(hw); - if (ret) { - rtw_err(rtwdev, "failed to register hw\n"); -- return ret; -+ goto led_deinit; - } - - ret = rtw_regd_hint(rtwdev); - if (ret) { - rtw_err(rtwdev, "failed to hint regd\n"); -- return ret; -+ goto led_deinit; - } - - rtw_debugfs_init(rtwdev); -@@ -2310,6 +2313,10 @@ int rtw_register_hw(struct rtw_dev *rtwd - rtwdev->bf_info.bfer_su_cnt = 0; - - return 0; -+ -+led_deinit: -+ rtw_led_deinit(rtwdev); -+ return ret; - } - EXPORT_SYMBOL(rtw_register_hw); - -@@ -2320,6 +2327,7 @@ void rtw_unregister_hw(struct rtw_dev *r - ieee80211_unregister_hw(hw); - rtw_unset_supported_band(hw, chip); - rtw_debugfs_deinit(rtwdev); -+ rtw_led_deinit(rtwdev); - } - EXPORT_SYMBOL(rtw_unregister_hw); - ---- a/drivers/net/wireless/realtek/rtw88/main.h -+++ b/drivers/net/wireless/realtek/rtw88/main.h -@@ -887,6 +887,7 @@ struct rtw_chip_ops { - bool is_tx2_path); - void (*config_txrx_mode)(struct rtw_dev *rtwdev, u8 tx_path, - u8 rx_path, bool is_tx2_path); -+ void (*led_set)(struct led_classdev *led, enum led_brightness brightness); - /* for USB/SDIO only */ - void (*fill_txdesc_checksum)(struct rtw_dev *rtwdev, - struct rtw_tx_pkt_info *pkt_info, -@@ -2097,6 +2098,10 @@ struct rtw_dev { - struct completion fw_scan_density; - bool ap_active; - -+ bool led_registered; -+ char led_name[32]; -+ struct led_classdev led_cdev; -+ - /* hci related data, must be last */ - u8 priv[] __aligned(sizeof(void *)); - }; ---- a/drivers/net/wireless/realtek/rtw88/reg.h -+++ b/drivers/net/wireless/realtek/rtw88/reg.h -@@ -78,7 +78,19 @@ - #define BIT_PAPE_SEL_EN BIT(25) - #define BIT_DPDT_WL_SEL BIT(24) - #define BIT_DPDT_SEL_EN BIT(23) -+#define BIT_GPIO13_14_WL_CTRL_EN BIT(22) -+#define BIT_LED2_SV BIT(19) -+#define BIT_LED2_CM GENMASK(18, 16) -+#define BIT_LED1_SV BIT(11) -+#define BIT_LED1_CM GENMASK(10, 8) -+#define BIT_LED0_SV BIT(3) -+#define BIT_LED0_CM GENMASK(2, 0) -+#define BIT_LED_MODE_SW_CTRL 0 -+#define BIT_LED_MODE_RX 6 -+#define BIT_LED_MODE_TX 4 -+#define BIT_LED_MODE_TRX 2 - #define REG_LEDCFG2 0x004E -+#define REG_GPIO_PIN_CTRL_2 0x0060 - #define REG_PAD_CTRL1 0x0064 - #define BIT_BT_BTG_SEL BIT(31) - #define BIT_PAPE_WLBT_SEL BIT(29) ---- a/drivers/net/wireless/realtek/rtw88/rtw8812a.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8812a.c -@@ -868,6 +868,22 @@ static void rtw8812a_pwr_track(struct rt - dm_info->pwr_trk_triggered = false; - } - -+static void rtw8812a_led_set(struct led_classdev *led, -+ enum led_brightness brightness) -+{ -+ struct rtw_dev *rtwdev = container_of(led, struct rtw_dev, led_cdev); -+ u8 ledcfg; -+ -+ ledcfg = rtw_read8(rtwdev, REG_LED_CFG); -+ ledcfg &= BIT(6) | BIT(4); -+ ledcfg |= BIT(5); -+ -+ if (brightness == LED_OFF) -+ ledcfg |= BIT(3); -+ -+ rtw_write8(rtwdev, REG_LED_CFG, ledcfg); -+} -+ - static void rtw8812a_fill_txdesc_checksum(struct rtw_dev *rtwdev, - struct rtw_tx_pkt_info *pkt_info, - u8 *txdesc) -@@ -916,6 +932,7 @@ static const struct rtw_chip_ops rtw8812 - .config_bfee = NULL, - .set_gid_table = NULL, - .cfg_csi_rate = NULL, -+ .led_set = rtw8812a_led_set, - .fill_txdesc_checksum = rtw8812a_fill_txdesc_checksum, - .coex_set_init = rtw8812a_coex_cfg_init, - .coex_set_ant_switch = NULL, ---- a/drivers/net/wireless/realtek/rtw88/rtw8821a.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8821a.c -@@ -706,6 +706,31 @@ static void rtw8821a_pwr_track(struct rt - dm_info->pwr_trk_triggered = false; - } - -+static void rtw8821a_led_set(struct led_classdev *led, -+ enum led_brightness brightness) -+{ -+ struct rtw_dev *rtwdev = container_of(led, struct rtw_dev, led_cdev); -+ u32 gpio8_cfg; -+ u8 ledcfg; -+ -+ if (brightness == LED_OFF) { -+ gpio8_cfg = rtw_read32(rtwdev, REG_GPIO_PIN_CTRL_2); -+ gpio8_cfg &= ~BIT(24); -+ gpio8_cfg |= BIT(16) | BIT(8); -+ rtw_write32(rtwdev, REG_GPIO_PIN_CTRL_2, gpio8_cfg); -+ } else { -+ ledcfg = rtw_read8(rtwdev, REG_LED_CFG + 2); -+ gpio8_cfg = rtw_read32(rtwdev, REG_GPIO_PIN_CTRL_2); -+ -+ ledcfg &= BIT(7) | BIT(6); -+ rtw_write8(rtwdev, REG_LED_CFG + 2, ledcfg); -+ -+ gpio8_cfg &= ~(BIT(24) | BIT(8)); -+ gpio8_cfg |= BIT(16); -+ rtw_write32(rtwdev, REG_GPIO_PIN_CTRL_2, gpio8_cfg); -+ } -+} -+ - static void rtw8821a_fill_txdesc_checksum(struct rtw_dev *rtwdev, - struct rtw_tx_pkt_info *pkt_info, - u8 *txdesc) -@@ -853,6 +878,7 @@ static const struct rtw_chip_ops rtw8821 - .config_bfee = NULL, - .set_gid_table = NULL, - .cfg_csi_rate = NULL, -+ .led_set = rtw8821a_led_set, - .fill_txdesc_checksum = rtw8821a_fill_txdesc_checksum, - .coex_set_init = rtw8821a_coex_cfg_init, - .coex_set_ant_switch = rtw8821a_coex_cfg_ant_switch, ---- a/drivers/net/wireless/realtek/rtw88/rtw8821c.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8821c.c -@@ -1206,6 +1206,24 @@ static void rtw8821c_phy_cck_pd_set(stru - dm_info->cck_pd_default + new_lvl * 2); - } - -+static void rtw8821c_led_set(struct led_classdev *led, -+ enum led_brightness brightness) -+{ -+ struct rtw_dev *rtwdev = container_of(led, struct rtw_dev, led_cdev); -+ u32 ledcfg; -+ -+ ledcfg = rtw_read32(rtwdev, REG_LED_CFG); -+ u32p_replace_bits(&ledcfg, BIT_LED_MODE_SW_CTRL, BIT_LED2_CM); -+ ledcfg &= ~BIT_GPIO13_14_WL_CTRL_EN; -+ -+ if (brightness == LED_OFF) -+ ledcfg |= BIT_LED2_SV; -+ else -+ ledcfg &= ~BIT_LED2_SV; -+ -+ rtw_write32(rtwdev, REG_LED_CFG, ledcfg); -+} -+ - static void rtw8821c_fill_txdesc_checksum(struct rtw_dev *rtwdev, - struct rtw_tx_pkt_info *pkt_info, - u8 *txdesc) -@@ -1655,6 +1673,7 @@ static const struct rtw_chip_ops rtw8821 - .config_bfee = rtw8821c_bf_config_bfee, - .set_gid_table = rtw_bf_set_gid_table, - .cfg_csi_rate = rtw_bf_cfg_csi_rate, -+ .led_set = rtw8821c_led_set, - .fill_txdesc_checksum = rtw8821c_fill_txdesc_checksum, - - .coex_set_init = rtw8821c_coex_cfg_init, ---- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c -@@ -1566,6 +1566,24 @@ static void rtw8822b_adaptivity(struct r - rtw_phy_set_edcca_th(rtwdev, l2h, h2l); - } - -+static void rtw8822b_led_set(struct led_classdev *led, -+ enum led_brightness brightness) -+{ -+ struct rtw_dev *rtwdev = container_of(led, struct rtw_dev, led_cdev); -+ u32 ledcfg; -+ -+ ledcfg = rtw_read32(rtwdev, REG_LED_CFG); -+ u32p_replace_bits(&ledcfg, BIT_LED_MODE_SW_CTRL, BIT_LED2_CM); -+ ledcfg &= ~BIT_GPIO13_14_WL_CTRL_EN; -+ -+ if (brightness == LED_OFF) -+ ledcfg |= BIT_LED2_SV; -+ else -+ ledcfg &= ~BIT_LED2_SV; -+ -+ rtw_write32(rtwdev, REG_LED_CFG, ledcfg); -+} -+ - static void rtw8822b_fill_txdesc_checksum(struct rtw_dev *rtwdev, - struct rtw_tx_pkt_info *pkt_info, - u8 *txdesc) -@@ -2146,6 +2164,7 @@ static const struct rtw_chip_ops rtw8822 - .cfg_csi_rate = rtw_bf_cfg_csi_rate, - .adaptivity_init = rtw8822b_adaptivity_init, - .adaptivity = rtw8822b_adaptivity, -+ .led_set = rtw8822b_led_set, - .fill_txdesc_checksum = rtw8822b_fill_txdesc_checksum, - - .coex_set_init = rtw8822b_coex_cfg_init, ---- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c -@@ -4537,6 +4537,24 @@ static void rtw8822c_adaptivity(struct r - rtw_phy_set_edcca_th(rtwdev, l2h, h2l); - } - -+static void rtw8822c_led_set(struct led_classdev *led, -+ enum led_brightness brightness) -+{ -+ struct rtw_dev *rtwdev = container_of(led, struct rtw_dev, led_cdev); -+ u32 ledcfg; -+ -+ ledcfg = rtw_read32(rtwdev, REG_LED_CFG); -+ u32p_replace_bits(&ledcfg, BIT_LED_MODE_SW_CTRL, BIT_LED2_CM); -+ ledcfg &= ~BIT_GPIO13_14_WL_CTRL_EN; -+ -+ if (brightness == LED_OFF) -+ ledcfg |= BIT_LED2_SV; -+ else -+ ledcfg &= ~BIT_LED2_SV; -+ -+ rtw_write32(rtwdev, REG_LED_CFG, ledcfg); -+} -+ - static void rtw8822c_fill_txdesc_checksum(struct rtw_dev *rtwdev, - struct rtw_tx_pkt_info *pkt_info, - u8 *txdesc) -@@ -4964,6 +4982,7 @@ static const struct rtw_chip_ops rtw8822 - .cfo_track = rtw8822c_cfo_track, - .config_tx_path = rtw8822c_config_tx_path, - .config_txrx_mode = rtw8822c_config_trx_mode, -+ .led_set = rtw8822c_led_set, - .fill_txdesc_checksum = rtw8822c_fill_txdesc_checksum, - - .coex_set_init = rtw8822c_coex_cfg_init, diff --git a/package/kernel/mac80211/patches/rtl/063-v6.14-wifi-rtw88-add-RTW88_LEDS-depends-on-LEDS_CLASS-to-K.patch b/package/kernel/mac80211/patches/rtl/063-v6.14-wifi-rtw88-add-RTW88_LEDS-depends-on-LEDS_CLASS-to-K.patch deleted file mode 100644 index f1f09fde1a0..00000000000 --- a/package/kernel/mac80211/patches/rtl/063-v6.14-wifi-rtw88-add-RTW88_LEDS-depends-on-LEDS_CLASS-to-K.patch +++ /dev/null @@ -1,73 +0,0 @@ -From b4bfbc50b1b92a0815800eb1231f73bfc917af03 Mon Sep 17 00:00:00 2001 -From: Ping-Ke Shih -Date: Thu, 16 Jan 2025 20:04:24 +0800 -Subject: [PATCH] wifi: rtw88: add RTW88_LEDS depends on LEDS_CLASS to Kconfig - -When using allmodconfig, .config has CONFIG_LEDS_CLASS=m but -autoconf.h has CONFIG_LEDS_CLASS_MODULE (additional suffix _MODULE) -instead of CONFIG_LEDS_CLASS, which condition CONFIG_LEDS_CLASS in -rtw88/led.h can't work properly. - -Add RTW88_LEDS to Kconfig, and use it as condition to fix this problem. - -drivers/net/wireless/realtek/rtw88/led.c:19:6: error: redefinition of 'rtw_led_init' - 19 | void rtw_led_init(struct rtw_dev *rtwdev) - | ^~~~~~~~~~~~ -In file included from drivers/net/wireless/realtek/rtw88/led.c:7: -drivers/net/wireless/realtek/rtw88/led.h:15:20: note: previous definition of 'rtw_led_init' with type 'void(struct rtw_dev *)' - 15 | static inline void rtw_led_init(struct rtw_dev *rtwdev) - | ^~~~~~~~~~~~ -drivers/net/wireless/realtek/rtw88/led.c:64:6: error: redefinition of 'rtw_led_deinit' - 64 | void rtw_led_deinit(struct rtw_dev *rtwdev) - | ^~~~~~~~~~~~~~ -drivers/net/wireless/realtek/rtw88/led.h:19:20: note: previous definition of 'rtw_led_deinit' with type 'void(struct rtw_dev *)' - 19 | static inline void rtw_led_deinit(struct rtw_dev *rtwdev) - | ^~~~~~~~~~~~~~ - -Reported-by: Stephen Rothwell -Closes: https://lore.kernel.org/linux-wireless/e19a87ad9cd54bfa9907f3a043b25d30@realtek.com/T/#me407832de1040ce22e53517bcb18e322ad0e2260 -Fixes: 4b6652bc6d8d ("wifi: rtw88: Add support for LED blinking") -Cc: Bitterblue Smith -Signed-off-by: Ping-Ke Shih -Signed-off-by: Kalle Valo -Link: https://patch.msgid.link/20250116120424.13174-1-pkshih@realtek.com ---- - drivers/net/wireless/realtek/rtw88/Kconfig | 5 +++++ - drivers/net/wireless/realtek/rtw88/Makefile | 2 +- - drivers/net/wireless/realtek/rtw88/led.h | 2 +- - 3 files changed, 7 insertions(+), 2 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/Kconfig -+++ b/drivers/net/wireless/realtek/rtw88/Kconfig -@@ -267,4 +267,9 @@ config RTW88_DEBUGFS - - If unsure, say Y to simplify debug problems - -+config RTW88_LEDS -+ bool -+ depends on LEDS_CLASS=y || LEDS_CLASS=MAC80211 -+ default y -+ - endif ---- a/drivers/net/wireless/realtek/rtw88/Makefile -+++ b/drivers/net/wireless/realtek/rtw88/Makefile -@@ -20,7 +20,7 @@ rtw88_core-y += main.o \ - - rtw88_core-$(CONFIG_PM) += wow.o - --rtw88_core-$(CONFIG_LEDS_CLASS) += led.o -+rtw88_core-$(CPTCFG_RTW88_LEDS) += led.o - - obj-$(CPTCFG_RTW88_8822B) += rtw88_8822b.o - rtw88_8822b-objs := rtw8822b.o rtw8822b_table.o ---- a/drivers/net/wireless/realtek/rtw88/led.h -+++ b/drivers/net/wireless/realtek/rtw88/led.h -@@ -5,7 +5,7 @@ - #ifndef __RTW_LED_H - #define __RTW_LED_H - --#ifdef CONFIG_LEDS_CLASS -+#ifdef CPTCFG_RTW88_LEDS - - void rtw_led_init(struct rtw_dev *rtwdev); - void rtw_led_deinit(struct rtw_dev *rtwdev); diff --git a/package/kernel/mac80211/patches/rtl/064-v6.14.9-wifi-rtw88-Don-t-use-static-local-variable-in-rtw882.patch b/package/kernel/mac80211/patches/rtl/064-v6.14.9-wifi-rtw88-Don-t-use-static-local-variable-in-rtw882.patch deleted file mode 100644 index 3b3550d9bec..00000000000 --- a/package/kernel/mac80211/patches/rtl/064-v6.14.9-wifi-rtw88-Don-t-use-static-local-variable-in-rtw882.patch +++ /dev/null @@ -1,68 +0,0 @@ -From 00451eb3bec763f708e7e58326468c1e575e5a66 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Sun, 26 Jan 2025 16:03:11 +0200 -Subject: [PATCH] wifi: rtw88: Don't use static local variable in - rtw8822b_set_tx_power_index_by_rate - -Some users want to plug two identical USB devices at the same time. -This static variable could theoretically cause them to use incorrect -TX power values. - -Move the variable to the caller and pass a pointer to it to -rtw8822b_set_tx_power_index_by_rate(). - -Signed-off-by: Bitterblue Smith -Acked-by: Ping-Ke Shih -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/8a60f581-0ab5-4d98-a97d-dd83b605008f@gmail.com ---- - drivers/net/wireless/realtek/rtw88/rtw8822b.c | 14 ++++++++------ - 1 file changed, 8 insertions(+), 6 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/rtw8822b.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8822b.c -@@ -935,11 +935,11 @@ static void query_phy_status(struct rtw_ - } - - static void --rtw8822b_set_tx_power_index_by_rate(struct rtw_dev *rtwdev, u8 path, u8 rs) -+rtw8822b_set_tx_power_index_by_rate(struct rtw_dev *rtwdev, u8 path, -+ u8 rs, u32 *phy_pwr_idx) - { - struct rtw_hal *hal = &rtwdev->hal; - static const u32 offset_txagc[2] = {0x1d00, 0x1d80}; -- static u32 phy_pwr_idx; - u8 rate, rate_idx, pwr_index, shift; - int j; - -@@ -947,12 +947,12 @@ rtw8822b_set_tx_power_index_by_rate(stru - rate = rtw_rate_section[rs][j]; - pwr_index = hal->tx_pwr_tbl[path][rate]; - shift = rate & 0x3; -- phy_pwr_idx |= ((u32)pwr_index << (shift * 8)); -+ *phy_pwr_idx |= ((u32)pwr_index << (shift * 8)); - if (shift == 0x3) { - rate_idx = rate & 0xfc; - rtw_write32(rtwdev, offset_txagc[path] + rate_idx, -- phy_pwr_idx); -- phy_pwr_idx = 0; -+ *phy_pwr_idx); -+ *phy_pwr_idx = 0; - } - } - } -@@ -960,11 +960,13 @@ rtw8822b_set_tx_power_index_by_rate(stru - static void rtw8822b_set_tx_power_index(struct rtw_dev *rtwdev) - { - struct rtw_hal *hal = &rtwdev->hal; -+ u32 phy_pwr_idx = 0; - int rs, path; - - for (path = 0; path < hal->rf_path_num; path++) { - for (rs = 0; rs < RTW_RATE_SECTION_MAX; rs++) -- rtw8822b_set_tx_power_index_by_rate(rtwdev, path, rs); -+ rtw8822b_set_tx_power_index_by_rate(rtwdev, path, rs, -+ &phy_pwr_idx); - } - } - diff --git a/package/kernel/mac80211/patches/rtl/067-v6.14.9-wifi-rtw88-Fix-__rtw_download_firmware-for-RTL8814AU.patch b/package/kernel/mac80211/patches/rtl/067-v6.14.9-wifi-rtw88-Fix-__rtw_download_firmware-for-RTL8814AU.patch deleted file mode 100644 index 4de12557641..00000000000 --- a/package/kernel/mac80211/patches/rtl/067-v6.14.9-wifi-rtw88-Fix-__rtw_download_firmware-for-RTL8814AU.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 8425f5c8f04dbcf11ade78f984a494fc0b90e7a0 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Tue, 4 Feb 2025 20:36:56 +0200 -Subject: [PATCH] wifi: rtw88: Fix __rtw_download_firmware() for RTL8814AU - -Don't call ltecoex_read_reg() and ltecoex_reg_write() when the -ltecoex_addr member of struct rtw_chip_info is NULL. The RTL8814AU -doesn't have this feature. - -Signed-off-by: Bitterblue Smith -Acked-by: Ping-Ke Shih -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/55b5641f-094e-4f94-9f79-ac053733f2cf@gmail.com ---- - drivers/net/wireless/realtek/rtw88/mac.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/mac.c -+++ b/drivers/net/wireless/realtek/rtw88/mac.c -@@ -784,7 +784,8 @@ static int __rtw_download_firmware(struc - if (!check_firmware_size(data, size)) - return -EINVAL; - -- if (!ltecoex_read_reg(rtwdev, 0x38, <ecoex_bckp)) -+ if (rtwdev->chip->ltecoex_addr && -+ !ltecoex_read_reg(rtwdev, 0x38, <ecoex_bckp)) - return -EBUSY; - - wlan_cpu_enable(rtwdev, false); -@@ -802,7 +803,8 @@ static int __rtw_download_firmware(struc - - wlan_cpu_enable(rtwdev, true); - -- if (!ltecoex_reg_write(rtwdev, 0x38, ltecoex_bckp)) { -+ if (rtwdev->chip->ltecoex_addr && -+ !ltecoex_reg_write(rtwdev, 0x38, ltecoex_bckp)) { - ret = -EBUSY; - goto dlfw_fail; - } diff --git a/package/kernel/mac80211/patches/rtl/068-v6.14.9-wifi-rtw88-Fix-download_firmware_validate-for-RTL881.patch b/package/kernel/mac80211/patches/rtl/068-v6.14.9-wifi-rtw88-Fix-download_firmware_validate-for-RTL881.patch deleted file mode 100644 index 8ff1dc4e3e2..00000000000 --- a/package/kernel/mac80211/patches/rtl/068-v6.14.9-wifi-rtw88-Fix-download_firmware_validate-for-RTL881.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 9e8243025cc06abc975c876dffda052073207ab3 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Tue, 4 Feb 2025 20:37:36 +0200 -Subject: [PATCH] wifi: rtw88: Fix download_firmware_validate() for RTL8814AU - -After the firmware is uploaded, download_firmware_validate() checks some -bits in REG_MCUFW_CTRL to see if everything went okay. The -RTL8814AU power on sequence sets bits 13 and 12 to 2, which this -function does not expect, so it thinks the firmware upload failed. - -Make download_firmware_validate() ignore bits 13 and 12. - -Signed-off-by: Bitterblue Smith -Acked-by: Ping-Ke Shih -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/049d2887-22fc-47b7-9e59-62627cb525f8@gmail.com ---- - drivers/net/wireless/realtek/rtw88/reg.h | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/drivers/net/wireless/realtek/rtw88/reg.h -+++ b/drivers/net/wireless/realtek/rtw88/reg.h -@@ -130,6 +130,7 @@ - #define BIT_SHIFT_ROM_PGE 16 - #define BIT_FW_INIT_RDY BIT(15) - #define BIT_FW_DW_RDY BIT(14) -+#define BIT_CPU_CLK_SEL (BIT(12) | BIT(13)) - #define BIT_RPWM_TOGGLE BIT(7) - #define BIT_RAM_DL_SEL BIT(7) /* legacy only */ - #define BIT_DMEM_CHKSUM_OK BIT(6) -@@ -147,7 +148,7 @@ - BIT_CHECK_SUM_OK) - #define FW_READY_LEGACY (BIT_MCUFWDL_RDY | BIT_FWDL_CHK_RPT | \ - BIT_WINTINI_RDY | BIT_RAM_DL_SEL) --#define FW_READY_MASK 0xffff -+#define FW_READY_MASK (0xffff & ~BIT_CPU_CLK_SEL) - - #define REG_MCU_TST_CFG 0x84 - #define VAL_FW_TRIGGER 0x1 diff --git a/package/kernel/mac80211/patches/rtl/069-v6.15-wifi-rtw88-Extend-struct-rtw_pwr_track_tbl-for-RTL88.patch b/package/kernel/mac80211/patches/rtl/069-v6.15-wifi-rtw88-Extend-struct-rtw_pwr_track_tbl-for-RTL88.patch index c6ac2818dd7..dec5d5986e7 100644 --- a/package/kernel/mac80211/patches/rtl/069-v6.15-wifi-rtw88-Extend-struct-rtw_pwr_track_tbl-for-RTL88.patch +++ b/package/kernel/mac80211/patches/rtl/069-v6.15-wifi-rtw88-Extend-struct-rtw_pwr_track_tbl-for-RTL88.patch @@ -17,7 +17,7 @@ Link: https://patch.msgid.link/be5a73f4-a0fe-43d6-9457-930cde199284@gmail.com --- a/drivers/net/wireless/realtek/rtw88/main.h +++ b/drivers/net/wireless/realtek/rtw88/main.h -@@ -1130,14 +1130,26 @@ struct rtw_rfe_def { +@@ -1131,14 +1131,26 @@ struct rtw_rfe_def { * For 2G there are cck rate and ofdm rate with different settings. */ struct rtw_pwr_track_tbl { diff --git a/package/kernel/mac80211/patches/rtl/070-v6.15-wifi-rtw88-Extend-rf_base_addr-and-rf_sipi_addr-for-.patch b/package/kernel/mac80211/patches/rtl/070-v6.15-wifi-rtw88-Extend-rf_base_addr-and-rf_sipi_addr-for-.patch index ad80a275f10..393c75453f7 100644 --- a/package/kernel/mac80211/patches/rtl/070-v6.15-wifi-rtw88-Extend-rf_base_addr-and-rf_sipi_addr-for-.patch +++ b/package/kernel/mac80211/patches/rtl/070-v6.15-wifi-rtw88-Extend-rf_base_addr-and-rf_sipi_addr-for-.patch @@ -19,7 +19,7 @@ Link: https://patch.msgid.link/7a4d8209-b8af-4943-b5de-f53d6edf591a@gmail.com --- a/drivers/net/wireless/realtek/rtw88/main.h +++ b/drivers/net/wireless/realtek/rtw88/main.h -@@ -1239,8 +1239,8 @@ struct rtw_chip_info { +@@ -1240,8 +1240,8 @@ struct rtw_chip_info { const struct rtw_hw_reg *dig; const struct rtw_hw_reg *dig_cck; diff --git a/package/kernel/mac80211/patches/rtl/071-v6.14.9-wifi-rtw88-Extend-rtw_fw_send_ra_info-for-RTL8814AU.patch b/package/kernel/mac80211/patches/rtl/071-v6.14.9-wifi-rtw88-Extend-rtw_fw_send_ra_info-for-RTL8814AU.patch deleted file mode 100644 index 9366a54cb5b..00000000000 --- a/package/kernel/mac80211/patches/rtl/071-v6.14.9-wifi-rtw88-Extend-rtw_fw_send_ra_info-for-RTL8814AU.patch +++ /dev/null @@ -1,70 +0,0 @@ -From 8f0076726b66a70727a1bef5c087c60291e90ad8 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Tue, 4 Feb 2025 20:39:29 +0200 -Subject: [PATCH] wifi: rtw88: Extend rtw_fw_send_ra_info() for RTL8814AU - -The existing code is suitable for chips with up to 2 spatial streams. -Inform the firmware about the rates it's allowed to use when -transmitting 3 spatial streams. - -Signed-off-by: Bitterblue Smith -Acked-by: Ping-Ke Shih -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/08e2f328-1aab-4e50-93ac-c1e5dd9541ac@gmail.com ---- - drivers/net/wireless/realtek/rtw88/fw.c | 15 +++++++++++++++ - drivers/net/wireless/realtek/rtw88/fw.h | 1 + - drivers/net/wireless/realtek/rtw88/main.h | 1 + - 3 files changed, 17 insertions(+) - ---- a/drivers/net/wireless/realtek/rtw88/fw.c -+++ b/drivers/net/wireless/realtek/rtw88/fw.c -@@ -736,6 +736,7 @@ void rtw_fw_send_ra_info(struct rtw_dev - { - u8 h2c_pkt[H2C_PKT_SIZE] = {0}; - bool disable_pt = true; -+ u32 mask_hi; - - SET_H2C_CMD_ID_CLASS(h2c_pkt, H2C_CMD_RA_INFO); - -@@ -756,6 +757,20 @@ void rtw_fw_send_ra_info(struct rtw_dev - si->init_ra_lv = 0; - - rtw_fw_send_h2c_command(rtwdev, h2c_pkt); -+ -+ if (rtwdev->chip->id != RTW_CHIP_TYPE_8814A) -+ return; -+ -+ SET_H2C_CMD_ID_CLASS(h2c_pkt, H2C_CMD_RA_INFO_HI); -+ -+ mask_hi = si->ra_mask >> 32; -+ -+ SET_RA_INFO_RA_MASK0(h2c_pkt, (mask_hi & 0xff)); -+ SET_RA_INFO_RA_MASK1(h2c_pkt, (mask_hi & 0xff00) >> 8); -+ SET_RA_INFO_RA_MASK2(h2c_pkt, (mask_hi & 0xff0000) >> 16); -+ SET_RA_INFO_RA_MASK3(h2c_pkt, (mask_hi & 0xff000000) >> 24); -+ -+ rtw_fw_send_h2c_command(rtwdev, h2c_pkt); - } - - void rtw_fw_media_status_report(struct rtw_dev *rtwdev, u8 mac_id, bool connect) ---- a/drivers/net/wireless/realtek/rtw88/fw.h -+++ b/drivers/net/wireless/realtek/rtw88/fw.h -@@ -557,6 +557,7 @@ static inline void rtw_h2c_pkt_set_heade - #define H2C_CMD_DEFAULT_PORT 0x2c - #define H2C_CMD_RA_INFO 0x40 - #define H2C_CMD_RSSI_MONITOR 0x42 -+#define H2C_CMD_RA_INFO_HI 0x46 - #define H2C_CMD_BCN_FILTER_OFFLOAD_P0 0x56 - #define H2C_CMD_BCN_FILTER_OFFLOAD_P1 0x57 - #define H2C_CMD_WL_PHY_INFO 0x58 ---- a/drivers/net/wireless/realtek/rtw88/main.h -+++ b/drivers/net/wireless/realtek/rtw88/main.h -@@ -191,6 +191,7 @@ enum rtw_chip_type { - RTW_CHIP_TYPE_8703B, - RTW_CHIP_TYPE_8821A, - RTW_CHIP_TYPE_8812A, -+ RTW_CHIP_TYPE_8814A, - }; - - enum rtw_tx_queue_type { diff --git a/package/kernel/mac80211/patches/rtl/072-v6.15-wifi-rtw88-Constify-some-more-structs-and-arrays.patch b/package/kernel/mac80211/patches/rtl/072-v6.15-wifi-rtw88-Constify-some-more-structs-and-arrays.patch index 6d3b4e61f9b..fe16a7ec202 100644 --- a/package/kernel/mac80211/patches/rtl/072-v6.15-wifi-rtw88-Constify-some-more-structs-and-arrays.patch +++ b/package/kernel/mac80211/patches/rtl/072-v6.15-wifi-rtw88-Constify-some-more-structs-and-arrays.patch @@ -202,7 +202,7 @@ Link: https://patch.msgid.link/502f124e-ccf3-4c09-80a4-1e5c5304822b@gmail.com .setup = rtw_sdio_setup, --- a/drivers/net/wireless/realtek/rtw88/usb.c +++ b/drivers/net/wireless/realtek/rtw88/usb.c -@@ -844,7 +844,7 @@ static void rtw_usb_dynamic_rx_agg(struc +@@ -881,7 +881,7 @@ static void rtw_usb_dynamic_rx_agg(struc } } diff --git a/package/kernel/mac80211/patches/rtl/075-v6.14.9-wifi-rtw88-Fix-rtw_update_sta_info-for-RTL8814AU.patch b/package/kernel/mac80211/patches/rtl/075-v6.14.9-wifi-rtw88-Fix-rtw_update_sta_info-for-RTL8814AU.patch deleted file mode 100644 index 64bc7f87077..00000000000 --- a/package/kernel/mac80211/patches/rtl/075-v6.14.9-wifi-rtw88-Fix-rtw_update_sta_info-for-RTL8814AU.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 9f00e2218e15a2ea3c284567424a100c10b6fb85 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Tue, 4 Feb 2025 20:42:08 +0200 -Subject: [PATCH] wifi: rtw88: Fix rtw_update_sta_info() for RTL8814AU - -This function tells the firmware what rates it can use. - -Put the 3SS and 4SS HT rates supported by the other station into the -rate mask. - -Remove the 3SS and 4SS rates from the rate mask if the hardware only has -2 spatial streams. - -And finally, select the right rate ID (a parameter for the firmware) -when the hardware has 3 spatial streams. - -Signed-off-by: Bitterblue Smith -Acked-by: Ping-Ke Shih -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/48d1d90f-2aeb-4ec5-9a24-0980e10eae1e@gmail.com ---- - drivers/net/wireless/realtek/rtw88/main.c | 14 +++++++++----- - 1 file changed, 9 insertions(+), 5 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/main.c -+++ b/drivers/net/wireless/realtek/rtw88/main.c -@@ -1234,7 +1234,9 @@ void rtw_update_sta_info(struct rtw_dev - if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC) - ldpc_en = VHT_LDPC_EN; - } else if (sta->deflink.ht_cap.ht_supported) { -- ra_mask |= (sta->deflink.ht_cap.mcs.rx_mask[1] << 20) | -+ ra_mask |= ((u64)sta->deflink.ht_cap.mcs.rx_mask[3] << 36) | -+ ((u64)sta->deflink.ht_cap.mcs.rx_mask[2] << 28) | -+ (sta->deflink.ht_cap.mcs.rx_mask[1] << 20) | - (sta->deflink.ht_cap.mcs.rx_mask[0] << 12); - if (sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_RX_STBC) - stbc_en = HT_STBC_EN; -@@ -1244,6 +1246,9 @@ void rtw_update_sta_info(struct rtw_dev - - if (efuse->hw_cap.nss == 1 || rtwdev->hal.txrx_1ss) - ra_mask &= RA_MASK_VHT_RATES_1SS | RA_MASK_HT_RATES_1SS; -+ else if (efuse->hw_cap.nss == 2) -+ ra_mask &= RA_MASK_VHT_RATES_2SS | RA_MASK_HT_RATES_2SS | -+ RA_MASK_VHT_RATES_1SS | RA_MASK_HT_RATES_1SS; - - if (hal->current_band_type == RTW_BAND_5G) { - ra_mask |= (u64)sta->deflink.supp_rates[NL80211_BAND_5GHZ] << 4; -@@ -1302,10 +1307,9 @@ void rtw_update_sta_info(struct rtw_dev - break; - } - -- if (sta->deflink.vht_cap.vht_supported && ra_mask & 0xffc00000) -- tx_num = 2; -- else if (sta->deflink.ht_cap.ht_supported && ra_mask & 0xfff00000) -- tx_num = 2; -+ if (sta->deflink.vht_cap.vht_supported || -+ sta->deflink.ht_cap.ht_supported) -+ tx_num = efuse->hw_cap.nss; - - rate_id = get_rate_id(wireless_set, bw_mode, tx_num); - diff --git a/package/kernel/mac80211/patches/rtl/076-v6.14-wifi-rtw88-Add-support-for-Mercusys-MA30N-and-D-Link.patch b/package/kernel/mac80211/patches/rtl/076-v6.14-wifi-rtw88-Add-support-for-Mercusys-MA30N-and-D-Link.patch deleted file mode 100644 index e281cf6ecec..00000000000 --- a/package/kernel/mac80211/patches/rtl/076-v6.14-wifi-rtw88-Add-support-for-Mercusys-MA30N-and-D-Link.patch +++ /dev/null @@ -1,31 +0,0 @@ -From 80c4668d024ff7b5427d90b5fad655ce9461c7b1 Mon Sep 17 00:00:00 2001 -From: Zenm Chen -Date: Mon, 10 Feb 2025 15:36:10 +0800 -Subject: [PATCH] wifi: rtw88: Add support for Mercusys MA30N and D-Link - DWA-T185 rev. A1 - -Add two more USB IDs found in -https://github.com/RinCat/RTL88x2BU-Linux-Driver -to support Mercusys MA30N and D-Link DWA-T185 rev. A1. - -Signed-off-by: Zenm Chen -Acked-by: Ping-Ke Shih -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/20250210073610.4174-1-zenmchen@gmail.com ---- - drivers/net/wireless/realtek/rtw88/rtw8822bu.c | 4 ++++ - 1 file changed, 4 insertions(+) - ---- a/drivers/net/wireless/realtek/rtw88/rtw8822bu.c -+++ b/drivers/net/wireless/realtek/rtw88/rtw8822bu.c -@@ -73,6 +73,10 @@ static const struct usb_device_id rtw_88 - .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* ELECOM WDB-867DU3S */ - { USB_DEVICE_AND_INTERFACE_INFO(0x2c4e, 0x0107, 0xff, 0xff, 0xff), - .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* Mercusys MA30H */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x2c4e, 0x010a, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* Mercusys MA30N */ -+ { USB_DEVICE_AND_INTERFACE_INFO(0x2001, 0x3322, 0xff, 0xff, 0xff), -+ .driver_info = (kernel_ulong_t)&(rtw8822b_hw_spec) }, /* D-Link DWA-T185 rev. A1 */ - {}, - }; - MODULE_DEVICE_TABLE(usb, rtw_8822bu_id_table); diff --git a/package/kernel/mac80211/patches/rtl/077-v6.14.9-wifi-rtw88-Fix-rtw_mac_power_switch-for-RTL8814AU.patch b/package/kernel/mac80211/patches/rtl/077-v6.14.9-wifi-rtw88-Fix-rtw_mac_power_switch-for-RTL8814AU.patch deleted file mode 100644 index 092a7677bd4..00000000000 --- a/package/kernel/mac80211/patches/rtl/077-v6.14.9-wifi-rtw88-Fix-rtw_mac_power_switch-for-RTL8814AU.patch +++ /dev/null @@ -1,27 +0,0 @@ -From e66bca16638ee59e997f9d9a3711b3ae587d04d9 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Tue, 18 Feb 2025 01:28:59 +0200 -Subject: [PATCH] wifi: rtw88: Fix rtw_mac_power_switch() for RTL8814AU - -rtw_mac_power_switch() checks bit 8 of REG_SYS_STATUS1 to see if the -chip is powered on. This bit appears to be always on in the RTL8814AU, -so ignore it. - -Signed-off-by: Bitterblue Smith -Acked-by: Ping-Ke Shih -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/2f0fcffb-3067-4d95-a68c-f2f3a5a47921@gmail.com ---- - drivers/net/wireless/realtek/rtw88/mac.c | 1 + - 1 file changed, 1 insertion(+) - ---- a/drivers/net/wireless/realtek/rtw88/mac.c -+++ b/drivers/net/wireless/realtek/rtw88/mac.c -@@ -291,6 +291,7 @@ static int rtw_mac_power_switch(struct r - if (rtw_read8(rtwdev, REG_CR) == 0xea) - cur_pwr = false; - else if (rtw_hci_type(rtwdev) == RTW_HCI_TYPE_USB && -+ chip->id != RTW_CHIP_TYPE_8814A && - (rtw_read8(rtwdev, REG_SYS_STATUS1 + 1) & BIT(0))) - cur_pwr = false; - else diff --git a/package/kernel/mac80211/patches/rtl/078-v6.14.9-wifi-rtw88-Fix-rtw_desc_to_mcsrate-to-handle-MCS16-3.patch b/package/kernel/mac80211/patches/rtl/078-v6.14.9-wifi-rtw88-Fix-rtw_desc_to_mcsrate-to-handle-MCS16-3.patch deleted file mode 100644 index c9588ad545c..00000000000 --- a/package/kernel/mac80211/patches/rtl/078-v6.14.9-wifi-rtw88-Fix-rtw_desc_to_mcsrate-to-handle-MCS16-3.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 86d04f8f991a0509e318fe886d5a1cf795736c7d Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Tue, 18 Feb 2025 01:29:52 +0200 -Subject: [PATCH] wifi: rtw88: Fix rtw_desc_to_mcsrate() to handle MCS16-31 - -This function translates the rate number reported by the hardware into -something mac80211 can understand. It was ignoring the 3SS and 4SS HT -rates. Translate them too. - -Also set *nss to 0 for the HT rates, just to make sure it's -initialised. - -Signed-off-by: Bitterblue Smith -Acked-by: Ping-Ke Shih -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/d0a5a86b-4869-47f6-a5a7-01c0f987cc7f@gmail.com ---- - drivers/net/wireless/realtek/rtw88/util.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - ---- a/drivers/net/wireless/realtek/rtw88/util.c -+++ b/drivers/net/wireless/realtek/rtw88/util.c -@@ -101,7 +101,8 @@ void rtw_desc_to_mcsrate(u16 rate, u8 *m - *nss = 4; - *mcs = rate - DESC_RATEVHT4SS_MCS0; - } else if (rate >= DESC_RATEMCS0 && -- rate <= DESC_RATEMCS15) { -+ rate <= DESC_RATEMCS31) { -+ *nss = 0; - *mcs = rate - DESC_RATEMCS0; - } - } diff --git a/package/kernel/mac80211/patches/rtl/079-v6.14.9-wifi-rtw88-Fix-rtw_init_ht_cap-for-RTL8814AU.patch b/package/kernel/mac80211/patches/rtl/079-v6.14.9-wifi-rtw88-Fix-rtw_init_ht_cap-for-RTL8814AU.patch deleted file mode 100644 index 78014f898b1..00000000000 --- a/package/kernel/mac80211/patches/rtl/079-v6.14.9-wifi-rtw88-Fix-rtw_init_ht_cap-for-RTL8814AU.patch +++ /dev/null @@ -1,49 +0,0 @@ -From c7eea1ba05ca5b0dbf77a27cf2e1e6e2fb3c0043 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Tue, 18 Feb 2025 01:30:22 +0200 -Subject: [PATCH] wifi: rtw88: Fix rtw_init_ht_cap() for RTL8814AU - -Set the RX mask and the highest RX rate according to the number of -spatial streams the chip can receive. For RTL8814AU that is 3. - -Signed-off-by: Bitterblue Smith -Acked-by: Ping-Ke Shih -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/4e786f50-ed1c-4387-8b28-e6ff00e35e81@gmail.com ---- - drivers/net/wireless/realtek/rtw88/main.c | 17 ++++++----------- - 1 file changed, 6 insertions(+), 11 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/main.c -+++ b/drivers/net/wireless/realtek/rtw88/main.c -@@ -1565,6 +1565,7 @@ static void rtw_init_ht_cap(struct rtw_d - { - const struct rtw_chip_info *chip = rtwdev->chip; - struct rtw_efuse *efuse = &rtwdev->efuse; -+ int i; - - ht_cap->ht_supported = true; - ht_cap->cap = 0; -@@ -1584,17 +1585,11 @@ static void rtw_init_ht_cap(struct rtw_d - ht_cap->ampdu_factor = IEEE80211_HT_MAX_AMPDU_64K; - ht_cap->ampdu_density = chip->ampdu_density; - ht_cap->mcs.tx_params = IEEE80211_HT_MCS_TX_DEFINED; -- if (efuse->hw_cap.nss > 1) { -- ht_cap->mcs.rx_mask[0] = 0xFF; -- ht_cap->mcs.rx_mask[1] = 0xFF; -- ht_cap->mcs.rx_mask[4] = 0x01; -- ht_cap->mcs.rx_highest = cpu_to_le16(300); -- } else { -- ht_cap->mcs.rx_mask[0] = 0xFF; -- ht_cap->mcs.rx_mask[1] = 0x00; -- ht_cap->mcs.rx_mask[4] = 0x01; -- ht_cap->mcs.rx_highest = cpu_to_le16(150); -- } -+ -+ for (i = 0; i < efuse->hw_cap.nss; i++) -+ ht_cap->mcs.rx_mask[i] = 0xFF; -+ ht_cap->mcs.rx_mask[4] = 0x01; -+ ht_cap->mcs.rx_highest = cpu_to_le16(150 * efuse->hw_cap.nss); - } - - static void rtw_init_vht_cap(struct rtw_dev *rtwdev, diff --git a/package/kernel/mac80211/patches/rtl/080-v6.14.9-wifi-rtw88-Fix-rtw_init_vht_cap-for-RTL8814AU.patch b/package/kernel/mac80211/patches/rtl/080-v6.14.9-wifi-rtw88-Fix-rtw_init_vht_cap-for-RTL8814AU.patch deleted file mode 100644 index e5f0de87d69..00000000000 --- a/package/kernel/mac80211/patches/rtl/080-v6.14.9-wifi-rtw88-Fix-rtw_init_vht_cap-for-RTL8814AU.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 6be7544d19fcfcb729495e793bc6181f85bb8949 Mon Sep 17 00:00:00 2001 -From: Bitterblue Smith -Date: Tue, 18 Feb 2025 01:30:48 +0200 -Subject: [PATCH] wifi: rtw88: Fix rtw_init_vht_cap() for RTL8814AU - -Set the MCS maps and the highest rates according to the number of -spatial streams the chip has. For RTL8814AU that is 3. - -Signed-off-by: Bitterblue Smith -Acked-by: Ping-Ke Shih -Signed-off-by: Ping-Ke Shih -Link: https://patch.msgid.link/e86aa009-b5bf-4b3a-8112-ea5e3cd49465@gmail.com ---- - drivers/net/wireless/realtek/rtw88/main.c | 23 +++++++++-------------- - 1 file changed, 9 insertions(+), 14 deletions(-) - ---- a/drivers/net/wireless/realtek/rtw88/main.c -+++ b/drivers/net/wireless/realtek/rtw88/main.c -@@ -1596,8 +1596,9 @@ static void rtw_init_vht_cap(struct rtw_ - struct ieee80211_sta_vht_cap *vht_cap) - { - struct rtw_efuse *efuse = &rtwdev->efuse; -- u16 mcs_map; -+ u16 mcs_map = 0; - __le16 highest; -+ int i; - - if (efuse->hw_cap.ptcl != EFUSE_HW_CAP_IGNORE && - efuse->hw_cap.ptcl != EFUSE_HW_CAP_PTCL_VHT) -@@ -1620,21 +1621,15 @@ static void rtw_init_vht_cap(struct rtw_ - if (rtw_chip_has_rx_ldpc(rtwdev)) - vht_cap->cap |= IEEE80211_VHT_CAP_RXLDPC; - -- mcs_map = IEEE80211_VHT_MCS_SUPPORT_0_9 << 0 | -- IEEE80211_VHT_MCS_NOT_SUPPORTED << 4 | -- IEEE80211_VHT_MCS_NOT_SUPPORTED << 6 | -- IEEE80211_VHT_MCS_NOT_SUPPORTED << 8 | -- IEEE80211_VHT_MCS_NOT_SUPPORTED << 10 | -- IEEE80211_VHT_MCS_NOT_SUPPORTED << 12 | -- IEEE80211_VHT_MCS_NOT_SUPPORTED << 14; -- if (efuse->hw_cap.nss > 1) { -- highest = cpu_to_le16(780); -- mcs_map |= IEEE80211_VHT_MCS_SUPPORT_0_9 << 2; -- } else { -- highest = cpu_to_le16(390); -- mcs_map |= IEEE80211_VHT_MCS_NOT_SUPPORTED << 2; -+ for (i = 0; i < 8; i++) { -+ if (i < efuse->hw_cap.nss) -+ mcs_map |= IEEE80211_VHT_MCS_SUPPORT_0_9 << (i * 2); -+ else -+ mcs_map |= IEEE80211_VHT_MCS_NOT_SUPPORTED << (i * 2); - } - -+ highest = cpu_to_le16(390 * efuse->hw_cap.nss); -+ - vht_cap->vht_mcs.rx_mcs_map = cpu_to_le16(mcs_map); - vht_cap->vht_mcs.tx_mcs_map = cpu_to_le16(mcs_map); - vht_cap->vht_mcs.rx_highest = highest; diff --git a/package/kernel/mac80211/patches/rtl/091-v6.15wifi-rtw88-Enable-the-new-RTL8814AE-RTL8814AU-driver.patch b/package/kernel/mac80211/patches/rtl/092-v6.15-wifi-rtw88-Enable-the-new-RTL8814AE-RTL8814AU-driver.patch similarity index 85% rename from package/kernel/mac80211/patches/rtl/091-v6.15wifi-rtw88-Enable-the-new-RTL8814AE-RTL8814AU-driver.patch rename to package/kernel/mac80211/patches/rtl/092-v6.15-wifi-rtw88-Enable-the-new-RTL8814AE-RTL8814AU-driver.patch index 8446ad3a968..0b7d5d72040 100644 --- a/package/kernel/mac80211/patches/rtl/091-v6.15wifi-rtw88-Enable-the-new-RTL8814AE-RTL8814AU-driver.patch +++ b/package/kernel/mac80211/patches/rtl/092-v6.15-wifi-rtw88-Enable-the-new-RTL8814AE-RTL8814AU-driver.patch @@ -24,7 +24,7 @@ Link: https://patch.msgid.link/5795b0a7-511e-40b5-ac36-476b63f174c7@gmail.com --- a/Kconfig.local +++ b/Kconfig.local -@@ -1153,6 +1153,9 @@ config BACKPORTED_RTW88_8821A +@@ -1138,6 +1138,9 @@ config BACKPORTED_RTW88_8821A config BACKPORTED_RTW88_8812A tristate default RTW88_8812A @@ -34,7 +34,7 @@ Link: https://patch.msgid.link/5795b0a7-511e-40b5-ac36-476b63f174c7@gmail.com config BACKPORTED_RTW88_8822BE tristate default RTW88_8822BE -@@ -1198,12 +1201,21 @@ config BACKPORTED_RTW88_8821AU +@@ -1183,6 +1186,12 @@ config BACKPORTED_RTW88_8821AU config BACKPORTED_RTW88_8812AU tristate default RTW88_8812AU @@ -47,15 +47,6 @@ Link: https://patch.msgid.link/5795b0a7-511e-40b5-ac36-476b63f174c7@gmail.com config BACKPORTED_RTW88_DEBUG tristate default RTW88_DEBUG - config BACKPORTED_RTW88_DEBUGFS - tristate - default RTW88_DEBUGFS -+config BACKPORTED_RTW88_LEDS -+ tristate -+ default RTW88_LEDS - config BACKPORTED_RTW89 - tristate - default RTW89 --- a/drivers/net/wireless/realtek/rtw88/Kconfig +++ b/drivers/net/wireless/realtek/rtw88/Kconfig @@ -68,6 +68,10 @@ config RTW88_8812A @@ -120,28 +111,20 @@ Link: https://patch.msgid.link/5795b0a7-511e-40b5-ac36-476b63f174c7@gmail.com --- a/local-symbols +++ b/local-symbols -@@ -377,6 +377,10 @@ RTW88_8723X= - RTW88_8703B= - RTW88_8723D= - RTW88_8821C= -+RTW88_88XXA= -+RTW88_8821A= -+RTW88_8812A= +@@ -375,6 +375,7 @@ RTW88_8821C= + RTW88_88XXA= + RTW88_8821A= + RTW88_8812A= +RTW88_8814A= RTW88_8822BE= RTW88_8822BS= RTW88_8822BU= -@@ -390,8 +394,13 @@ RTW88_8723DU= - RTW88_8821CE= - RTW88_8821CS= +@@ -390,6 +391,8 @@ RTW88_8821CS= RTW88_8821CU= -+RTW88_8821AU= -+RTW88_8812AU= + RTW88_8821AU= + RTW88_8812AU= +RTW88_8814AE= +RTW88_8814AU= RTW88_DEBUG= RTW88_DEBUGFS= -+RTW88_LEDS= - RTW89= - RTW89_CORE= - RTW89_PCI= + RTW88_LEDS= diff --git a/package/kernel/mac80211/patches/rtl/094-v6.16-wifi-rtw88-usb-Remove-redundant-flush_workqueue-call.patch b/package/kernel/mac80211/patches/rtl/094-v6.16-wifi-rtw88-usb-Remove-redundant-flush_workqueue-call.patch index 41e670fd115..f819b8d9552 100644 --- a/package/kernel/mac80211/patches/rtl/094-v6.16-wifi-rtw88-usb-Remove-redundant-flush_workqueue-call.patch +++ b/package/kernel/mac80211/patches/rtl/094-v6.16-wifi-rtw88-usb-Remove-redundant-flush_workqueue-call.patch @@ -26,15 +26,15 @@ Link: https://patch.msgid.link/20250324080303.408084-1-nichen@iscas.ac.cn --- a/drivers/net/wireless/realtek/rtw88/usb.c +++ b/drivers/net/wireless/realtek/rtw88/usb.c -@@ -901,7 +901,6 @@ static void rtw_usb_deinit_rx(struct rtw +@@ -952,7 +952,6 @@ static void rtw_usb_deinit_rx(struct rtw skb_queue_purge(&rtwusb->rx_queue); - flush_workqueue(rtwusb->rxwq); destroy_workqueue(rtwusb->rxwq); - } -@@ -928,7 +927,6 @@ static void rtw_usb_deinit_tx(struct rtw + skb_queue_purge(&rtwusb->rx_free_queue); +@@ -981,7 +980,6 @@ static void rtw_usb_deinit_tx(struct rtw { struct rtw_usb *rtwusb = rtw_get_usb_priv(rtwdev); diff --git a/package/kernel/mac80211/patches/rtl/095-v6.16-wifi-rtw88-usb-Enable-switching-the-RTL8814AU-to-USB.patch b/package/kernel/mac80211/patches/rtl/095-v6.16-wifi-rtw88-usb-Enable-switching-the-RTL8814AU-to-USB.patch index edd3cd5e704..f4d79bdae3c 100644 --- a/package/kernel/mac80211/patches/rtl/095-v6.16-wifi-rtw88-usb-Enable-switching-the-RTL8814AU-to-USB.patch +++ b/package/kernel/mac80211/patches/rtl/095-v6.16-wifi-rtw88-usb-Enable-switching-the-RTL8814AU-to-USB.patch @@ -20,7 +20,7 @@ Link: https://patch.msgid.link/d3608f70-e04f-4f6b-987a-022c8e317165@gmail.com --- a/drivers/net/wireless/realtek/rtw88/usb.c +++ b/drivers/net/wireless/realtek/rtw88/usb.c -@@ -1043,7 +1043,8 @@ static int rtw_usb_switch_mode_new(struc +@@ -1096,7 +1096,8 @@ static int rtw_usb_switch_mode_new(struc static bool rtw_usb3_chip_old(u8 chip_id) { diff --git a/package/kernel/mac80211/patches/rtl/096-v6.16-wifi-rtw88-usb-Enable-RX-aggregation-for-RTL8814AU.patch b/package/kernel/mac80211/patches/rtl/096-v6.16-wifi-rtw88-usb-Enable-RX-aggregation-for-RTL8814AU.patch index 9709528e701..ef5c3db77a0 100644 --- a/package/kernel/mac80211/patches/rtl/096-v6.16-wifi-rtw88-usb-Enable-RX-aggregation-for-RTL8814AU.patch +++ b/package/kernel/mac80211/patches/rtl/096-v6.16-wifi-rtw88-usb-Enable-RX-aggregation-for-RTL8814AU.patch @@ -18,7 +18,7 @@ Link: https://patch.msgid.link/672397ac-dd4d-4420-8b3e-7011578e2243@gmail.com --- a/drivers/net/wireless/realtek/rtw88/usb.c +++ b/drivers/net/wireless/realtek/rtw88/usb.c -@@ -829,6 +829,7 @@ static void rtw_usb_dynamic_rx_agg(struc +@@ -866,6 +866,7 @@ static void rtw_usb_dynamic_rx_agg(struc case RTW_CHIP_TYPE_8822C: case RTW_CHIP_TYPE_8822B: case RTW_CHIP_TYPE_8821C: diff --git a/package/kernel/mac80211/patches/rtl/107-v6.16-wifi-rtw88-usb-Upload-the-firmware-in-bigger-chunks.patch b/package/kernel/mac80211/patches/rtl/107-v6.16-wifi-rtw88-usb-Upload-the-firmware-in-bigger-chunks.patch index 8031e46556d..d3d660edb9c 100644 --- a/package/kernel/mac80211/patches/rtl/107-v6.16-wifi-rtw88-usb-Upload-the-firmware-in-bigger-chunks.patch +++ b/package/kernel/mac80211/patches/rtl/107-v6.16-wifi-rtw88-usb-Upload-the-firmware-in-bigger-chunks.patch @@ -204,7 +204,7 @@ Link: https://patch.msgid.link/43f1daad-3ec0-4a3b-a50c-9cd9eb2c2f52@gmail.com static int dma_mapping_to_ep(enum rtw_dma_mapping dma_mapping) { switch (dma_mapping) { -@@ -855,6 +909,7 @@ static const struct rtw_hci_ops rtw_usb_ +@@ -892,6 +946,7 @@ static const struct rtw_hci_ops rtw_usb_ .link_ps = rtw_usb_link_ps, .interface_cfg = rtw_usb_interface_cfg, .dynamic_rx_agg = rtw_usb_dynamic_rx_agg, diff --git a/package/kernel/mac80211/patches/rtl/108-v6.16-wifi-rtw88-Fix-the-random-error-beacon-valid-message.patch b/package/kernel/mac80211/patches/rtl/108-v6.16-wifi-rtw88-Fix-the-random-error-beacon-valid-message.patch index 8008b58ff4d..adf585e004f 100644 --- a/package/kernel/mac80211/patches/rtl/108-v6.16-wifi-rtw88-Fix-the-random-error-beacon-valid-message.patch +++ b/package/kernel/mac80211/patches/rtl/108-v6.16-wifi-rtw88-Fix-the-random-error-beacon-valid-message.patch @@ -35,7 +35,7 @@ Link: https://patch.msgid.link/c248c40a-d432-47ed-90e0-d81ee6c32464@gmail.com --- a/drivers/net/wireless/realtek/rtw88/fw.c +++ b/drivers/net/wireless/realtek/rtw88/fw.c -@@ -1467,7 +1467,7 @@ void rtw_add_rsvd_page_sta(struct rtw_de +@@ -1466,7 +1466,7 @@ void rtw_add_rsvd_page_sta(struct rtw_de int rtw_fw_write_data_rsvd_page(struct rtw_dev *rtwdev, u16 pg_addr, u8 *buf, u32 size) { @@ -44,7 +44,7 @@ Link: https://patch.msgid.link/c248c40a-d432-47ed-90e0-d81ee6c32464@gmail.com u8 val; u16 rsvd_pg_head; u32 bcn_valid_addr; -@@ -1479,6 +1479,8 @@ int rtw_fw_write_data_rsvd_page(struct r +@@ -1478,6 +1478,8 @@ int rtw_fw_write_data_rsvd_page(struct r if (!size) return -EINVAL; @@ -53,7 +53,7 @@ Link: https://patch.msgid.link/c248c40a-d432-47ed-90e0-d81ee6c32464@gmail.com if (rtw_chip_wcpu_11n(rtwdev)) { rtw_write32_set(rtwdev, REG_DWBCN0_CTRL, BIT_BCN_VALID); } else { -@@ -1492,6 +1494,9 @@ int rtw_fw_write_data_rsvd_page(struct r +@@ -1491,6 +1493,9 @@ int rtw_fw_write_data_rsvd_page(struct r val |= BIT_ENSWBCN >> 8; rtw_write8(rtwdev, REG_CR + 1, val); @@ -63,7 +63,7 @@ Link: https://patch.msgid.link/c248c40a-d432-47ed-90e0-d81ee6c32464@gmail.com if (rtw_hci_type(rtwdev) == RTW_HCI_TYPE_PCIE) { val = rtw_read8(rtwdev, REG_FWHW_TXQ_CTRL + 2); bckp[1] = val; -@@ -1522,6 +1527,7 @@ restore: +@@ -1521,6 +1526,7 @@ restore: rsvd_pg_head = rtwdev->fifo.rsvd_boundary; rtw_write16(rtwdev, REG_FIFOPAGE_CTRL_2, rsvd_pg_head | BIT_BCN_VALID_V1); diff --git a/package/kernel/mac80211/patches/subsys/110-mac80211_keep_keys_on_stop_ap.patch b/package/kernel/mac80211/patches/subsys/110-mac80211_keep_keys_on_stop_ap.patch index 68534f4e7b4..d6cc0857226 100644 --- a/package/kernel/mac80211/patches/subsys/110-mac80211_keep_keys_on_stop_ap.patch +++ b/package/kernel/mac80211/patches/subsys/110-mac80211_keep_keys_on_stop_ap.patch @@ -9,9 +9,9 @@ Used for AP+STA support in OpenWrt - preserve AP mode keys across STA reconnect --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -1649,12 +1649,6 @@ static int ieee80211_stop_ap(struct wiph +@@ -1677,12 +1677,6 @@ static int ieee80211_stop_ap(struct wiph - __sta_info_flush(sdata, true, link_id); + __sta_info_flush(sdata, true, link_id, NULL); - ieee80211_remove_link_keys(link, &keys); - if (!list_empty(&keys)) { diff --git a/package/kernel/mac80211/patches/subsys/130-disable_auto_vif.patch b/package/kernel/mac80211/patches/subsys/130-disable_auto_vif.patch index c9496b5e709..aec9a326678 100644 --- a/package/kernel/mac80211/patches/subsys/130-disable_auto_vif.patch +++ b/package/kernel/mac80211/patches/subsys/130-disable_auto_vif.patch @@ -1,6 +1,6 @@ --- a/net/mac80211/main.c +++ b/net/mac80211/main.c -@@ -1583,24 +1583,6 @@ int ieee80211_register_hw(struct ieee802 +@@ -1595,24 +1595,6 @@ int ieee80211_register_hw(struct ieee802 ieee80211_check_wbrf_support(local); diff --git a/package/kernel/mac80211/patches/subsys/210-ap_scan.patch b/package/kernel/mac80211/patches/subsys/210-ap_scan.patch index ca4ac8adb62..f11a60fd4e7 100644 --- a/package/kernel/mac80211/patches/subsys/210-ap_scan.patch +++ b/package/kernel/mac80211/patches/subsys/210-ap_scan.patch @@ -8,7 +8,7 @@ Subject: [PATCH] mac80211: allow scans in access point mode (for site survey) --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -2863,6 +2863,8 @@ static int ieee80211_scan(struct wiphy * +@@ -2891,6 +2891,8 @@ static int ieee80211_scan(struct wiphy * */ fallthrough; case NL80211_IFTYPE_AP: diff --git a/package/kernel/mac80211/patches/subsys/220-allow-ibss-mixed.patch b/package/kernel/mac80211/patches/subsys/220-allow-ibss-mixed.patch index 378ca275f5b..ea8fb0c6b31 100644 --- a/package/kernel/mac80211/patches/subsys/220-allow-ibss-mixed.patch +++ b/package/kernel/mac80211/patches/subsys/220-allow-ibss-mixed.patch @@ -16,7 +16,7 @@ and we should ignore this. --- a/net/wireless/core.c +++ b/net/wireless/core.c -@@ -678,21 +678,6 @@ int wiphy_verify_iface_combinations(stru +@@ -671,21 +671,6 @@ int wiphy_verify_iface_combinations(stru c->limits[j].max > 1)) return -EINVAL; diff --git a/package/kernel/mac80211/patches/subsys/230-avoid-crashing-missing-band.patch b/package/kernel/mac80211/patches/subsys/230-avoid-crashing-missing-band.patch index 9e9e3844b7a..e85207cb6bb 100644 --- a/package/kernel/mac80211/patches/subsys/230-avoid-crashing-missing-band.patch +++ b/package/kernel/mac80211/patches/subsys/230-avoid-crashing-missing-band.patch @@ -18,7 +18,7 @@ Signed-off-by: David Bauer --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c -@@ -2439,6 +2439,13 @@ static void sta_stats_decode_rate(struct +@@ -2474,6 +2474,13 @@ static void sta_stats_decode_rate(struct sband = local->hw.wiphy->bands[band]; diff --git a/package/kernel/mac80211/patches/subsys/301-mac80211-sta-randomize-BA-session-dialog-token-alloc.patch b/package/kernel/mac80211/patches/subsys/301-mac80211-sta-randomize-BA-session-dialog-token-alloc.patch index edec97cce94..f7690c89c75 100644 --- a/package/kernel/mac80211/patches/subsys/301-mac80211-sta-randomize-BA-session-dialog-token-alloc.patch +++ b/package/kernel/mac80211/patches/subsys/301-mac80211-sta-randomize-BA-session-dialog-token-alloc.patch @@ -28,7 +28,7 @@ Signed-off-by: Johannes Berg --- a/net/mac80211/sta_info.c +++ b/net/mac80211/sta_info.c -@@ -565,6 +565,7 @@ __sta_info_alloc(struct ieee80211_sub_if +@@ -583,6 +583,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); diff --git a/package/kernel/mac80211/patches/subsys/305-mac80211-increase-quantum-for-airtime-scheduler.patch b/package/kernel/mac80211/patches/subsys/305-mac80211-increase-quantum-for-airtime-scheduler.patch index 6cf46ce7e51..d329ad7b6fa 100644 --- a/package/kernel/mac80211/patches/subsys/305-mac80211-increase-quantum-for-airtime-scheduler.patch +++ b/package/kernel/mac80211/patches/subsys/305-mac80211-increase-quantum-for-airtime-scheduler.patch @@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -4081,7 +4081,7 @@ struct ieee80211_txq *ieee80211_next_txq +@@ -4083,7 +4083,7 @@ struct ieee80211_txq *ieee80211_next_txq if (deficit < 0) sta->airtime[txqi->txq.ac].deficit += @@ -32,7 +32,7 @@ Signed-off-by: Felix Fietkau if (deficit < 0 || !aql_check) { list_move_tail(&txqi->schedule_order, -@@ -4224,7 +4224,8 @@ bool ieee80211_txq_may_transmit(struct i +@@ -4226,7 +4226,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) @@ -42,7 +42,7 @@ Signed-off-by: Felix Fietkau list_move_tail(&iter->schedule_order, &local->active_txqs[ac]); } -@@ -4232,7 +4233,7 @@ bool ieee80211_txq_may_transmit(struct i +@@ -4234,7 +4235,7 @@ bool ieee80211_txq_may_transmit(struct i if (sta->airtime[ac].deficit >= 0) goto out; diff --git a/package/kernel/mac80211/patches/subsys/306-wifi-mac80211-call-rate_control_rate_update-for-link.patch b/package/kernel/mac80211/patches/subsys/306-wifi-mac80211-call-rate_control_rate_update-for-link.patch deleted file mode 100644 index 0ccdfb9fb54..00000000000 --- a/package/kernel/mac80211/patches/subsys/306-wifi-mac80211-call-rate_control_rate_update-for-link.patch +++ /dev/null @@ -1,548 +0,0 @@ -From: Johannes Berg -Date: Mon, 7 Oct 2024 15:00:54 +0300 -Subject: [PATCH] wifi: mac80211: call rate_control_rate_update() for link STA - -In order to update the right link information, call the update -rate_control_rate_update() with the right link_sta, and then -pass that through to the driver's sta_rc_update() method. The -software rate control still doesn't support it, but that'll be -skipped by not having a rate control ref. - -Since it now operates on a link sta, rename the driver method. - -Signed-off-by: Johannes Berg -Signed-off-by: Miri Korenblit -Link: https://patch.msgid.link/20241007144851.5851b6b5fd41.Ibdf50d96afa4b761dd9b9dfd54a1147e77a75329@changeid -Signed-off-by: Johannes Berg ---- - ---- a/drivers/net/wireless/ath/ath10k/mac.c -+++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -8507,9 +8507,10 @@ exit: - - static void ath10k_sta_rc_update(struct ieee80211_hw *hw, - struct ieee80211_vif *vif, -- struct ieee80211_sta *sta, -+ struct ieee80211_link_sta *link_sta, - u32 changed) - { -+ struct ieee80211_sta *sta = link_sta->sta; - struct ath10k *ar = hw->priv; - struct ath10k_sta *arsta = (struct ath10k_sta *)sta->drv_priv; - struct ath10k_vif *arvif = (void *)vif->drv_priv; -@@ -9450,7 +9451,7 @@ static const struct ieee80211_ops ath10k - .reconfig_complete = ath10k_reconfig_complete, - .get_survey = ath10k_get_survey, - .set_bitrate_mask = ath10k_mac_op_set_bitrate_mask, -- .sta_rc_update = ath10k_sta_rc_update, -+ .link_sta_rc_update = ath10k_sta_rc_update, - .offset_tsf = ath10k_offset_tsf, - .ampdu_action = ath10k_ampdu_action, - .get_et_sset_count = ath10k_debug_get_et_sset_count, ---- a/drivers/net/wireless/ath/ath11k/mac.c -+++ b/drivers/net/wireless/ath/ath11k/mac.c -@@ -5079,9 +5079,10 @@ static void ath11k_mac_op_sta_set_4addr( - - static void ath11k_mac_op_sta_rc_update(struct ieee80211_hw *hw, - struct ieee80211_vif *vif, -- struct ieee80211_sta *sta, -+ struct ieee80211_link_sta *link_sta, - u32 changed) - { -+ struct ieee80211_sta *sta = link_sta->sta; - struct ath11k *ar = hw->priv; - struct ath11k_sta *arsta = ath11k_sta_to_arsta(sta); - struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif); -@@ -9708,7 +9709,7 @@ static const struct ieee80211_ops ath11k - .sta_state = ath11k_mac_op_sta_state, - .sta_set_4addr = ath11k_mac_op_sta_set_4addr, - .sta_set_txpwr = ath11k_mac_op_sta_set_txpwr, -- .sta_rc_update = ath11k_mac_op_sta_rc_update, -+ .link_sta_rc_update = ath11k_mac_op_sta_rc_update, - .conf_tx = ath11k_mac_op_conf_tx, - .set_antenna = ath11k_mac_op_set_antenna, - .get_antenna = ath11k_mac_op_get_antenna, ---- a/drivers/net/wireless/ath/ath12k/mac.c -+++ b/drivers/net/wireless/ath/ath12k/mac.c -@@ -4740,9 +4740,10 @@ out: - - static void ath12k_mac_op_sta_rc_update(struct ieee80211_hw *hw, - struct ieee80211_vif *vif, -- struct ieee80211_sta *sta, -+ struct ieee80211_link_sta *link_sta, - u32 changed) - { -+ struct ieee80211_sta *sta = link_sta->sta; - struct ath12k *ar; - struct ath12k_sta *arsta = ath12k_sta_to_arsta(sta); - struct ath12k_vif *arvif = ath12k_vif_to_arvif(vif); -@@ -8684,7 +8685,7 @@ static const struct ieee80211_ops ath12k - .set_rekey_data = ath12k_mac_op_set_rekey_data, - .sta_state = ath12k_mac_op_sta_state, - .sta_set_txpwr = ath12k_mac_op_sta_set_txpwr, -- .sta_rc_update = ath12k_mac_op_sta_rc_update, -+ .link_sta_rc_update = ath12k_mac_op_sta_rc_update, - .conf_tx = ath12k_mac_op_conf_tx, - .set_antenna = ath12k_mac_op_set_antenna, - .get_antenna = ath12k_mac_op_get_antenna, ---- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c -+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c -@@ -1357,8 +1357,10 @@ static int ath9k_htc_sta_remove(struct i - - static void ath9k_htc_sta_rc_update(struct ieee80211_hw *hw, - struct ieee80211_vif *vif, -- struct ieee80211_sta *sta, u32 changed) -+ struct ieee80211_link_sta *link_sta, -+ u32 changed) - { -+ struct ieee80211_sta *sta = link_sta->sta; - struct ath9k_htc_sta *ista = (struct ath9k_htc_sta *) sta->drv_priv; - - if (!(changed & IEEE80211_RC_SUPP_RATES_CHANGED)) -@@ -1883,7 +1885,7 @@ struct ieee80211_ops ath9k_htc_ops = { - .sta_add = ath9k_htc_sta_add, - .sta_remove = ath9k_htc_sta_remove, - .conf_tx = ath9k_htc_conf_tx, -- .sta_rc_update = ath9k_htc_sta_rc_update, -+ .link_sta_rc_update = ath9k_htc_sta_rc_update, - .bss_info_changed = ath9k_htc_bss_info_changed, - .set_key = ath9k_htc_set_key, - .get_tsf = ath9k_htc_get_tsf, ---- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c -+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c -@@ -4248,8 +4248,9 @@ int iwl_mvm_mac_set_rts_threshold(struct - } - - void iwl_mvm_sta_rc_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif, -- struct ieee80211_sta *sta, u32 changed) -+ struct ieee80211_link_sta *link_sta, u32 changed) - { -+ struct ieee80211_sta *sta = link_sta->sta; - struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); - - if (changed & (IEEE80211_RC_BW_CHANGED | -@@ -6574,7 +6575,7 @@ const struct ieee80211_ops iwl_mvm_hw_op - .allow_buffered_frames = iwl_mvm_mac_allow_buffered_frames, - .release_buffered_frames = iwl_mvm_mac_release_buffered_frames, - .set_rts_threshold = iwl_mvm_mac_set_rts_threshold, -- .sta_rc_update = iwl_mvm_sta_rc_update, -+ .link_sta_rc_update = iwl_mvm_sta_rc_update, - .conf_tx = iwl_mvm_mac_conf_tx, - .mgd_prepare_tx = iwl_mvm_mac_mgd_prepare_tx, - .mgd_complete_tx = iwl_mvm_mac_mgd_complete_tx, ---- a/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c -+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mld-mac80211.c -@@ -1413,7 +1413,7 @@ const struct ieee80211_ops iwl_mvm_mld_h - .allow_buffered_frames = iwl_mvm_mac_allow_buffered_frames, - .release_buffered_frames = iwl_mvm_mac_release_buffered_frames, - .set_rts_threshold = iwl_mvm_mac_set_rts_threshold, -- .sta_rc_update = iwl_mvm_sta_rc_update, -+ .link_sta_rc_update = iwl_mvm_sta_rc_update, - .conf_tx = iwl_mvm_mld_mac_conf_tx, - .mgd_prepare_tx = iwl_mvm_mac_mgd_prepare_tx, - .mgd_complete_tx = iwl_mvm_mac_mgd_complete_tx, ---- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h -+++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h -@@ -2914,7 +2914,7 @@ iwl_mvm_mac_release_buffered_frames(stru - bool more_data); - int iwl_mvm_mac_set_rts_threshold(struct ieee80211_hw *hw, u32 value); - void iwl_mvm_sta_rc_update(struct ieee80211_hw *hw, struct ieee80211_vif *vif, -- struct ieee80211_sta *sta, u32 changed); -+ struct ieee80211_link_sta *link_sta, u32 changed); - void iwl_mvm_mac_mgd_prepare_tx(struct ieee80211_hw *hw, - struct ieee80211_vif *vif, - struct ieee80211_prep_tx_info *info); ---- a/drivers/net/wireless/mediatek/mt76/mt7915/main.c -+++ b/drivers/net/wireless/mediatek/mt76/mt7915/main.c -@@ -1163,9 +1163,10 @@ static void mt7915_sta_rc_work(void *dat - - static void mt7915_sta_rc_update(struct ieee80211_hw *hw, - struct ieee80211_vif *vif, -- struct ieee80211_sta *sta, -+ struct ieee80211_link_sta *link_sta, - u32 changed) - { -+ struct ieee80211_sta *sta = link_sta->sta; - struct mt7915_phy *phy = mt7915_hw_phy(hw); - struct mt7915_dev *dev = phy->dev; - struct mt7915_sta *msta = (struct mt7915_sta *)sta->drv_priv; -@@ -1709,7 +1710,7 @@ const struct ieee80211_ops mt7915_ops = - .stop_ap = mt7915_stop_ap, - .sta_state = mt76_sta_state, - .sta_pre_rcu_remove = mt76_sta_pre_rcu_remove, -- .sta_rc_update = mt7915_sta_rc_update, -+ .link_sta_rc_update = mt7915_sta_rc_update, - .set_key = mt7915_set_key, - .ampdu_action = mt7915_ampdu_action, - .set_rts_threshold = mt7915_set_rts_threshold, ---- a/drivers/net/wireless/mediatek/mt76/mt7996/main.c -+++ b/drivers/net/wireless/mediatek/mt76/mt7996/main.c -@@ -1060,9 +1060,10 @@ static void mt7996_sta_rc_work(void *dat - - static void mt7996_sta_rc_update(struct ieee80211_hw *hw, - struct ieee80211_vif *vif, -- struct ieee80211_sta *sta, -+ struct ieee80211_link_sta *link_sta, - u32 changed) - { -+ struct ieee80211_sta *sta = link_sta->sta; - struct mt7996_phy *phy = mt7996_hw_phy(hw); - struct mt7996_dev *dev = phy->dev; - -@@ -1472,7 +1473,7 @@ const struct ieee80211_ops mt7996_ops = - .sta_add = mt7996_sta_add, - .sta_remove = mt7996_sta_remove, - .sta_pre_rcu_remove = mt76_sta_pre_rcu_remove, -- .sta_rc_update = mt7996_sta_rc_update, -+ .link_sta_rc_update = mt7996_sta_rc_update, - .set_key = mt7996_set_key, - .ampdu_action = mt7996_ampdu_action, - .set_rts_threshold = mt7996_set_rts_threshold, ---- a/drivers/net/wireless/realtek/rtw88/mac80211.c -+++ b/drivers/net/wireless/realtek/rtw88/mac80211.c -@@ -928,8 +928,10 @@ static int rtw_ops_set_sar_specs(struct - - static void rtw_ops_sta_rc_update(struct ieee80211_hw *hw, - struct ieee80211_vif *vif, -- struct ieee80211_sta *sta, u32 changed) -+ struct ieee80211_link_sta *link_sta, -+ u32 changed) - { -+ struct ieee80211_sta *sta = link_sta->sta; - struct rtw_dev *rtwdev = hw->priv; - struct rtw_sta_info *si = (struct rtw_sta_info *)sta->drv_priv; - -@@ -973,7 +975,7 @@ const struct ieee80211_ops rtw_ops = { - .reconfig_complete = rtw_reconfig_complete, - .hw_scan = rtw_ops_hw_scan, - .cancel_hw_scan = rtw_ops_cancel_hw_scan, -- .sta_rc_update = rtw_ops_sta_rc_update, -+ .link_sta_rc_update = rtw_ops_sta_rc_update, - .set_sar_specs = rtw_ops_set_sar_specs, - #ifdef CONFIG_PM - .suspend = rtw_ops_suspend, ---- a/drivers/net/wireless/realtek/rtw89/mac80211.c -+++ b/drivers/net/wireless/realtek/rtw89/mac80211.c -@@ -1290,8 +1290,10 @@ out: - - static void rtw89_ops_sta_rc_update(struct ieee80211_hw *hw, - struct ieee80211_vif *vif, -- struct ieee80211_sta *sta, u32 changed) -+ struct ieee80211_link_sta *link_sta, -+ u32 changed) - { -+ struct ieee80211_sta *sta = link_sta->sta; - struct rtw89_dev *rtwdev = hw->priv; - - rtw89_phy_ra_update_sta(rtwdev, sta, changed); -@@ -1594,7 +1596,7 @@ const struct ieee80211_ops rtw89_ops = { - .remain_on_channel = rtw89_ops_remain_on_channel, - .cancel_remain_on_channel = rtw89_ops_cancel_remain_on_channel, - .set_sar_specs = rtw89_ops_set_sar_specs, -- .sta_rc_update = rtw89_ops_sta_rc_update, -+ .link_sta_rc_update = rtw89_ops_sta_rc_update, - .set_tid_config = rtw89_ops_set_tid_config, - #ifdef CONFIG_PM - .suspend = rtw89_ops_suspend, ---- a/drivers/net/wireless/ti/wlcore/main.c -+++ b/drivers/net/wireless/ti/wlcore/main.c -@@ -5789,9 +5789,10 @@ static int wlcore_op_cancel_remain_on_ch - - static void wlcore_op_sta_rc_update(struct ieee80211_hw *hw, - struct ieee80211_vif *vif, -- struct ieee80211_sta *sta, -+ struct ieee80211_link_sta *link_sta, - u32 changed) - { -+ struct ieee80211_sta *sta = link_sta->sta; - struct wl12xx_vif *wlvif = wl12xx_vif_to_data(vif); - - wl1271_debug(DEBUG_MAC80211, "mac80211 sta_rc_update"); -@@ -6052,7 +6053,7 @@ static const struct ieee80211_ops wl1271 - .assign_vif_chanctx = wlcore_op_assign_vif_chanctx, - .unassign_vif_chanctx = wlcore_op_unassign_vif_chanctx, - .switch_vif_chanctx = wlcore_op_switch_vif_chanctx, -- .sta_rc_update = wlcore_op_sta_rc_update, -+ .link_sta_rc_update = wlcore_op_sta_rc_update, - .sta_statistics = wlcore_op_sta_statistics, - .get_expected_throughput = wlcore_op_get_expected_throughput, - CFG80211_TESTMODE_CMD(wl1271_tm_cmd) ---- a/drivers/net/wireless/virtual/mac80211_hwsim.c -+++ b/drivers/net/wireless/virtual/mac80211_hwsim.c -@@ -2594,10 +2594,11 @@ static void mac80211_hwsim_link_info_cha - static void - mac80211_hwsim_sta_rc_update(struct ieee80211_hw *hw, - struct ieee80211_vif *vif, -- struct ieee80211_sta *sta, -+ struct ieee80211_link_sta *link_sta, - u32 changed) - { - struct mac80211_hwsim_data *data = hw->priv; -+ struct ieee80211_sta *sta = link_sta->sta; - u32 bw = U32_MAX; - int link_id; - -@@ -2607,7 +2608,6 @@ mac80211_hwsim_sta_rc_update(struct ieee - link_id++) { - enum nl80211_chan_width confbw = NL80211_CHAN_WIDTH_20_NOHT; - struct ieee80211_bss_conf *vif_conf; -- struct ieee80211_link_sta *link_sta; - - link_sta = rcu_dereference(sta->link[link_id]); - -@@ -2659,7 +2659,7 @@ static int mac80211_hwsim_sta_add(struct - - hwsim_check_magic(vif); - hwsim_set_sta_magic(sta); -- mac80211_hwsim_sta_rc_update(hw, vif, sta, 0); -+ mac80211_hwsim_sta_rc_update(hw, vif, &sta->deflink, 0); - - if (sta->valid_links) { - WARN(hweight16(sta->valid_links) > 1, -@@ -3961,7 +3961,7 @@ out: - .link_info_changed = mac80211_hwsim_link_info_changed, \ - .tx_last_beacon = mac80211_hwsim_tx_last_beacon, \ - .sta_notify = mac80211_hwsim_sta_notify, \ -- .sta_rc_update = mac80211_hwsim_sta_rc_update, \ -+ .link_sta_rc_update = mac80211_hwsim_sta_rc_update, \ - .conf_tx = mac80211_hwsim_conf_tx, \ - .get_survey = mac80211_hwsim_get_survey, \ - CFG80211_TESTMODE_CMD(mac80211_hwsim_testmode_cmd) \ ---- a/include/net/mac80211.h -+++ b/include/net/mac80211.h -@@ -4075,8 +4075,8 @@ struct ieee80211_prep_tx_info { - * in @sta_state. - * The callback can sleep. - * -- * @sta_rc_update: Notifies the driver of changes to the bitrates that can be -- * used to transmit to the station. The changes are advertised with bits -+ * @link_sta_rc_update: Notifies the driver of changes to the bitrates that can -+ * be used to transmit to the station. The changes are advertised with bits - * from &enum ieee80211_rate_control_changed and the values are reflected - * in the station data. This callback should only be used when the driver - * uses hardware rate control (%IEEE80211_HW_HAS_RATE_CONTROL) since -@@ -4560,10 +4560,10 @@ struct ieee80211_ops { - void (*sta_pre_rcu_remove)(struct ieee80211_hw *hw, - struct ieee80211_vif *vif, - struct ieee80211_sta *sta); -- void (*sta_rc_update)(struct ieee80211_hw *hw, -- struct ieee80211_vif *vif, -- struct ieee80211_sta *sta, -- u32 changed); -+ void (*link_sta_rc_update)(struct ieee80211_hw *hw, -+ struct ieee80211_vif *vif, -+ struct ieee80211_link_sta *link_sta, -+ u32 changed); - void (*sta_rate_tbl_update)(struct ieee80211_hw *hw, - struct ieee80211_vif *vif, - struct ieee80211_sta *sta); ---- a/net/mac80211/chan.c -+++ b/net/mac80211/chan.c -@@ -467,7 +467,7 @@ static void ieee80211_chan_bw_change(str - continue; - - link_sta->pub->bandwidth = new_sta_bw; -- rate_control_rate_update(local, sband, sta, link_id, -+ rate_control_rate_update(local, sband, link_sta, - IEEE80211_RC_BW_CHANGED); - } - } ---- a/net/mac80211/driver-ops.c -+++ b/net/mac80211/driver-ops.c -@@ -181,9 +181,10 @@ int drv_sta_set_txpwr(struct ieee80211_l - return ret; - } - --void drv_sta_rc_update(struct ieee80211_local *local, -- struct ieee80211_sub_if_data *sdata, -- struct ieee80211_sta *sta, u32 changed) -+void drv_link_sta_rc_update(struct ieee80211_local *local, -+ struct ieee80211_sub_if_data *sdata, -+ struct ieee80211_link_sta *link_sta, -+ u32 changed) - { - sdata = get_bss_sdata(sdata); - if (!check_sdata_in_driver(sdata)) -@@ -193,10 +194,10 @@ void drv_sta_rc_update(struct ieee80211_ - (sdata->vif.type != NL80211_IFTYPE_ADHOC && - sdata->vif.type != NL80211_IFTYPE_MESH_POINT)); - -- trace_drv_sta_rc_update(local, sdata, sta, changed); -- if (local->ops->sta_rc_update) -- local->ops->sta_rc_update(&local->hw, &sdata->vif, -- sta, changed); -+ trace_drv_link_sta_rc_update(local, sdata, link_sta, changed); -+ if (local->ops->link_sta_rc_update) -+ local->ops->link_sta_rc_update(&local->hw, &sdata->vif, -+ link_sta, changed); - - trace_drv_return_void(local); - } ---- a/net/mac80211/driver-ops.h -+++ b/net/mac80211/driver-ops.h -@@ -594,9 +594,9 @@ int drv_sta_set_txpwr(struct ieee80211_l - struct ieee80211_sub_if_data *sdata, - struct sta_info *sta); - --void drv_sta_rc_update(struct ieee80211_local *local, -- struct ieee80211_sub_if_data *sdata, -- struct ieee80211_sta *sta, u32 changed); -+void drv_link_sta_rc_update(struct ieee80211_local *local, -+ struct ieee80211_sub_if_data *sdata, -+ struct ieee80211_link_sta *link_sta, u32 changed); - - static inline void drv_sta_rate_tbl_update(struct ieee80211_local *local, - struct ieee80211_sub_if_data *sdata, ---- a/net/mac80211/ibss.c -+++ b/net/mac80211/ibss.c -@@ -1072,7 +1072,8 @@ static void ieee80211_update_sta_info(st - if (sta->sta.deflink.rx_nss != rx_nss) - changed |= IEEE80211_RC_NSS_CHANGED; - -- drv_sta_rc_update(local, sdata, &sta->sta, changed); -+ drv_link_sta_rc_update(local, sdata, &sta->sta.deflink, -+ changed); - } - - rcu_read_unlock(); ---- a/net/mac80211/mesh_plink.c -+++ b/net/mac80211/mesh_plink.c -@@ -489,7 +489,7 @@ static void mesh_sta_info_init(struct ie - if (!test_sta_flag(sta, WLAN_STA_RATE_CONTROL)) - rate_control_rate_init(sta); - else -- rate_control_rate_update(local, sband, sta, 0, changed); -+ rate_control_rate_update(local, sband, &sta->deflink, changed); - out: - spin_unlock_bh(&sta->mesh->plink_lock); - } ---- a/net/mac80211/rate.c -+++ b/net/mac80211/rate.c -@@ -93,16 +93,15 @@ void rate_control_tx_status(struct ieee8 - - void rate_control_rate_update(struct ieee80211_local *local, - struct ieee80211_supported_band *sband, -- struct sta_info *sta, unsigned int link_id, -+ struct link_sta_info *link_sta, - u32 changed) - { - struct rate_control_ref *ref = local->rate_ctrl; -+ struct sta_info *sta = link_sta->sta; - struct ieee80211_sta *ista = &sta->sta; - void *priv_sta = sta->rate_ctrl_priv; - struct ieee80211_chanctx_conf *chanctx_conf; - -- WARN_ON(link_id != 0); -- - if (ref && ref->ops->rate_update) { - rcu_read_lock(); - -@@ -120,7 +119,8 @@ void rate_control_rate_update(struct iee - } - - if (sta->uploaded) -- drv_sta_rc_update(local, sta->sdata, &sta->sta, changed); -+ drv_link_sta_rc_update(local, sta->sdata, link_sta->pub, -+ changed); - } - - int ieee80211_rate_control_register(const struct rate_control_ops *ops) ---- a/net/mac80211/rate.h -+++ b/net/mac80211/rate.h -@@ -32,8 +32,7 @@ void rate_control_tx_status(struct ieee8 - void rate_control_rate_init(struct sta_info *sta); - void rate_control_rate_update(struct ieee80211_local *local, - struct ieee80211_supported_band *sband, -- struct sta_info *sta, -- unsigned int link_id, -+ struct link_sta_info *link_sta, - u32 changed); - - static inline void *rate_control_alloc_sta(struct rate_control_ref *ref, ---- a/net/mac80211/rx.c -+++ b/net/mac80211/rx.c -@@ -3568,7 +3568,7 @@ ieee80211_rx_h_action(struct ieee80211_r - - sband = rx->local->hw.wiphy->bands[status->band]; - -- rate_control_rate_update(local, sband, rx->sta, 0, -+ rate_control_rate_update(local, sband, rx->link_sta, - IEEE80211_RC_SMPS_CHANGED); - cfg80211_sta_opmode_change_notify(sdata->dev, - rx->sta->addr, -@@ -3605,7 +3605,7 @@ ieee80211_rx_h_action(struct ieee80211_r - ieee80211_sta_rx_bw_to_chan_width(rx->link_sta); - sta_opmode.changed = STA_OPMODE_MAX_BW_CHANGED; - -- rate_control_rate_update(local, sband, rx->sta, 0, -+ rate_control_rate_update(local, sband, rx->link_sta, - IEEE80211_RC_BW_CHANGED); - cfg80211_sta_opmode_change_notify(sdata->dev, - rx->sta->addr, ---- a/net/mac80211/tdls.c -+++ b/net/mac80211/tdls.c -@@ -1342,7 +1342,8 @@ static void iee80211_tdls_recalc_chanctx - bw = min(bw, ieee80211_sta_cap_rx_bw(&sta->deflink)); - if (bw != sta->sta.deflink.bandwidth) { - sta->sta.deflink.bandwidth = bw; -- rate_control_rate_update(local, sband, sta, 0, -+ rate_control_rate_update(local, sband, -+ &sta->deflink, - IEEE80211_RC_BW_CHANGED); - /* - * if a TDLS peer BW was updated, we need to ---- a/net/mac80211/trace.h -+++ b/net/mac80211/trace.h -@@ -945,31 +945,34 @@ TRACE_EVENT(drv_sta_set_txpwr, - ) - ); - --TRACE_EVENT(drv_sta_rc_update, -+TRACE_EVENT(drv_link_sta_rc_update, - TP_PROTO(struct ieee80211_local *local, - struct ieee80211_sub_if_data *sdata, -- struct ieee80211_sta *sta, -+ struct ieee80211_link_sta *link_sta, - u32 changed), - -- TP_ARGS(local, sdata, sta, changed), -+ TP_ARGS(local, sdata, link_sta, changed), - - TP_STRUCT__entry( - LOCAL_ENTRY - VIF_ENTRY - STA_ENTRY - __field(u32, changed) -+ __field(u32, link_id) - ), - - TP_fast_assign( - LOCAL_ASSIGN; - VIF_ASSIGN; -- STA_ASSIGN; -+ STA_NAMED_ASSIGN(link_sta->sta); - __entry->changed = changed; -+ __entry->link_id = link_sta->link_id; - ), - - TP_printk( -- LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " changed: 0x%x", -- LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->changed -+ LOCAL_PR_FMT VIF_PR_FMT STA_PR_FMT " (link %d) changed: 0x%x", -+ LOCAL_PR_ARG, VIF_PR_ARG, STA_PR_ARG, __entry->link_id, -+ __entry->changed - ) - ); - ---- a/net/mac80211/vht.c -+++ b/net/mac80211/vht.c -@@ -766,8 +766,7 @@ void ieee80211_vht_handle_opmode(struct - - if (changed > 0) { - ieee80211_recalc_min_chandef(sdata, link_sta->link_id); -- rate_control_rate_update(local, sband, link_sta->sta, -- link_sta->link_id, changed); -+ rate_control_rate_update(local, sband, link_sta, changed); - } - } - diff --git a/package/kernel/mac80211/patches/subsys/310-cfg80211-allow-grace-period-for-DFS-available-after-.patch b/package/kernel/mac80211/patches/subsys/310-cfg80211-allow-grace-period-for-DFS-available-after-.patch index c86b836f2f5..d264c33f134 100644 --- a/package/kernel/mac80211/patches/subsys/310-cfg80211-allow-grace-period-for-DFS-available-after-.patch +++ b/package/kernel/mac80211/patches/subsys/310-cfg80211-allow-grace-period-for-DFS-available-after-.patch @@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau --- 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. @@ -20,7 +20,7 @@ Signed-off-by: Felix Fietkau * @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; @@ -52,7 +52,7 @@ Signed-off-by: Felix Fietkau --- a/net/wireless/chan.c +++ b/net/wireless/chan.c -@@ -598,6 +598,8 @@ static void cfg80211_set_chans_dfs_state +@@ -648,6 +648,8 @@ void cfg80211_set_dfs_state(struct wiphy c->dfs_state = dfs_state; c->dfs_state_entered = jiffies; @@ -61,8 +61,8 @@ Signed-off-by: Felix Fietkau } } -@@ -1087,6 +1089,49 @@ static bool cfg80211_get_chans_dfs_avail - return true; +@@ -995,6 +997,53 @@ bool cfg80211_any_wiphy_oper_chan(struct + return false; } +static void @@ -73,8 +73,12 @@ Signed-off-by: Felix Fietkau + struct ieee80211_channel *c; + u32 freq, start_freq, end_freq; + -+ start_freq = cfg80211_get_start_freq(center_freq, bandwidth); -+ end_freq = cfg80211_get_end_freq(center_freq, bandwidth); ++ if (bandwidth <= MHZ_TO_KHZ(20)) ++ start_freq = end_freq = center_freq; ++ else { ++ start_freq = center_freq - bandwidth / 2 + MHZ_TO_KHZ(10); ++ end_freq = center_freq + bandwidth / 2 - MHZ_TO_KHZ(10); ++ } + + /* + * Check entire range of channels for the bandwidth. @@ -124,7 +128,7 @@ Signed-off-by: Felix Fietkau --- a/net/wireless/mlme.c +++ b/net/wireless/mlme.c -@@ -1031,6 +1031,8 @@ void cfg80211_dfs_channels_update_work(s +@@ -1038,6 +1038,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; @@ -133,7 +137,7 @@ Signed-off-by: Felix Fietkau } 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 +@@ -1045,11 +1047,10 @@ void cfg80211_dfs_channels_update_work(s time_dfs_update = REG_PRE_CAC_EXPIRY_GRACE_MS; radar_event = NL80211_RADAR_PRE_CAC_EXPIRED; diff --git a/package/kernel/mac80211/patches/subsys/320-mac80211-add-AQL-support-for-broadcast-packets.patch b/package/kernel/mac80211/patches/subsys/320-mac80211-add-AQL-support-for-broadcast-packets.patch index 9513dc14bc3..6599d1b5e89 100644 --- a/package/kernel/mac80211/patches/subsys/320-mac80211-add-AQL-support-for-broadcast-packets.patch +++ b/package/kernel/mac80211/patches/subsys/320-mac80211-add-AQL-support-for-broadcast-packets.patch @@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h -@@ -3423,6 +3423,7 @@ enum wiphy_params_flags { +@@ -3438,6 +3438,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 @@ -70,7 +70,7 @@ Signed-off-by: Felix Fietkau --- 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; @@ -85,7 +85,7 @@ Signed-off-by: Felix Fietkau const struct ieee80211_ops *ops; --- a/net/mac80211/main.c +++ b/net/mac80211/main.c -@@ -954,6 +954,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_ +@@ -959,6 +959,7 @@ struct ieee80211_hw *ieee80211_alloc_hw_ spin_lock_init(&local->rx_path_lock); spin_lock_init(&local->queue_stop_reason_lock); @@ -95,7 +95,7 @@ Signed-off-by: Felix Fietkau 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 +@@ -2388,13 +2388,28 @@ EXPORT_SYMBOL(ieee80211_sta_recalc_aggre void ieee80211_sta_update_pending_airtime(struct ieee80211_local *local, struct sta_info *sta, u8 ac, @@ -127,7 +127,7 @@ Signed-off-by: Felix Fietkau atomic_add(tx_airtime, --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -2554,7 +2554,7 @@ static u16 ieee80211_store_ack_skb(struc +@@ -2555,7 +2555,7 @@ static u16 ieee80211_store_ack_skb(struc spin_lock_irqsave(&local->ack_status_lock, flags); id = idr_alloc(&local->ack_status_frames, ack_skb, @@ -136,7 +136,7 @@ Signed-off-by: Felix Fietkau spin_unlock_irqrestore(&local->ack_status_lock, flags); if (id >= 0) { -@@ -3982,20 +3982,20 @@ begin: +@@ -3984,20 +3984,20 @@ begin: encap_out: info->control.vif = vif; @@ -167,7 +167,7 @@ Signed-off-by: Felix Fietkau } return skb; -@@ -4047,6 +4047,7 @@ struct ieee80211_txq *ieee80211_next_txq +@@ -4049,6 +4049,7 @@ struct ieee80211_txq *ieee80211_next_txq struct ieee80211_txq *ret = NULL; struct txq_info *txqi = NULL, *head = NULL; bool found_eligible_txq = false; @@ -175,7 +175,7 @@ Signed-off-by: Felix Fietkau spin_lock_bh(&local->active_txq_lock[ac]); -@@ -4070,26 +4071,26 @@ struct ieee80211_txq *ieee80211_next_txq +@@ -4072,26 +4073,26 @@ struct ieee80211_txq *ieee80211_next_txq if (!head) head = txqi; @@ -214,7 +214,7 @@ Signed-off-by: Felix Fietkau if (txqi->schedule_round == local->schedule_round[ac]) goto out; -@@ -4154,7 +4155,8 @@ bool ieee80211_txq_airtime_check(struct +@@ -4156,7 +4157,8 @@ bool ieee80211_txq_airtime_check(struct return true; if (!txq->sta) @@ -224,7 +224,7 @@ Signed-off-by: Felix Fietkau if (unlikely(txq->tid == IEEE80211_NUM_TIDS)) return true; -@@ -4203,15 +4205,15 @@ bool ieee80211_txq_may_transmit(struct i +@@ -4205,15 +4207,15 @@ bool ieee80211_txq_may_transmit(struct i spin_lock_bh(&local->active_txq_lock[ac]); @@ -245,7 +245,7 @@ Signed-off-by: Felix Fietkau if (iter == txqi) --- a/include/net/mac80211.h +++ b/include/net/mac80211.h -@@ -1222,8 +1222,8 @@ struct ieee80211_tx_info { +@@ -1237,8 +1237,8 @@ struct ieee80211_tx_info { status_data_idr:1, status_data:13, hw_queue:4, @@ -278,7 +278,7 @@ Signed-off-by: Felix Fietkau rcu_read_unlock(); } -@@ -1158,10 +1158,11 @@ void ieee80211_tx_status_ext(struct ieee +@@ -1143,10 +1143,11 @@ void ieee80211_tx_status_ext(struct ieee /* Do this here to avoid the expensive lookup of the sta * in ieee80211_report_used_skb(). */ diff --git a/package/kernel/mac80211/patches/subsys/330-wifi-cfg80211-add-option-for-vif-allowed-radios.patch b/package/kernel/mac80211/patches/subsys/330-wifi-cfg80211-add-option-for-vif-allowed-radios.patch deleted file mode 100644 index 3b09c46f28a..00000000000 --- a/package/kernel/mac80211/patches/subsys/330-wifi-cfg80211-add-option-for-vif-allowed-radios.patch +++ /dev/null @@ -1,309 +0,0 @@ -From: Felix Fietkau -Date: Wed, 17 Jul 2024 15:43:52 +0200 -Subject: [PATCH] wifi: cfg80211: add option for vif allowed radios - -This allows users to prevent a vif from affecting radios other than the -configured ones. This can be useful in cases where e.g. an AP is running -on one radio, and triggering a scan on another radio should not disturb it. - -Changing the allowed radios list for a vif is supported, but only while -it is down. - -While it is possible to achieve the same by always explicitly specifying -a frequency list for scan requests and ensuring that the wrong channel/band -is never accidentally set on an unrelated interface, this change makes -multi-radio wiphy setups a lot easier to deal with for CLI users. - -By itself, this patch only enforces the radio mask for scanning requests -and remain-on-channel. Follow-up changes build on this to limit configured -frequencies. - -Signed-off-by: Felix Fietkau ---- - ---- a/include/net/cfg80211.h -+++ b/include/net/cfg80211.h -@@ -6271,6 +6271,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 -+ * @radio_mask: Bitmask of radios that this interface is allowed to operate on. - */ - struct wireless_dev { - struct wiphy *wiphy; -@@ -6383,6 +6384,8 @@ struct wireless_dev { - unsigned int cac_time_ms; - } links[IEEE80211_MLD_MAX_NUM_LINKS]; - u16 valid_links; -+ -+ u32 radio_mask; - }; - - static inline const u8 *wdev_address(struct wireless_dev *wdev) -@@ -6569,6 +6572,17 @@ bool cfg80211_radio_chandef_valid(const - const struct cfg80211_chan_def *chandef); - - /** -+ * cfg80211_wdev_channel_allowed - Check if the wdev may use the channel -+ * -+ * @wdev: the wireless device -+ * @chan: channel to check -+ * -+ * Return: whether or not the wdev may use the channel -+ */ -+bool cfg80211_wdev_channel_allowed(struct wireless_dev *wdev, -+ struct ieee80211_channel *chan); -+ -+/** - * ieee80211_get_response_rate - get basic rate for a given rate - * - * @sband: the band to look for rates in ---- a/include/uapi/linux/nl80211.h -+++ b/include/uapi/linux/nl80211.h -@@ -2868,6 +2868,9 @@ enum nl80211_commands { - * nested item, it contains attributes defined in - * &enum nl80211_if_combination_attrs. - * -+ * @NL80211_ATTR_VIF_RADIO_MASK: Bitmask of allowed radios (u32). -+ * A value of 0 means all radios. -+ * - * @NUM_NL80211_ATTR: total number of nl80211_attrs available - * @NL80211_ATTR_MAX: highest attribute number currently defined - * @__NL80211_ATTR_AFTER_LAST: internal use -@@ -3416,6 +3419,8 @@ enum nl80211_attrs { - NL80211_ATTR_WIPHY_RADIOS, - NL80211_ATTR_WIPHY_INTERFACE_COMBINATIONS, - -+ NL80211_ATTR_VIF_RADIO_MASK, -+ - /* add attributes here, update the policy in nl80211.c */ - - __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 - [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 }, -+ [NL80211_ATTR_VIF_RADIO_MASK] = { .type = NLA_U32 }, - }; - - /* policy for the key attributes */ -@@ -3996,7 +3997,8 @@ static int nl80211_send_iface(struct sk_ - nla_put_u32(msg, NL80211_ATTR_GENERATION, - rdev->devlist_generation ^ - (cfg80211_rdev_list_generation << 2)) || -- nla_put_u8(msg, NL80211_ATTR_4ADDR, wdev->use_4addr)) -+ nla_put_u8(msg, NL80211_ATTR_4ADDR, wdev->use_4addr) || -+ nla_put_u32(msg, NL80211_ATTR_VIF_RADIO_MASK, wdev->radio_mask)) - goto nla_put_failure; - - if (rdev->ops->get_channel && !wdev->valid_links) { -@@ -4312,6 +4314,29 @@ static int nl80211_valid_4addr(struct cf - return -EOPNOTSUPP; - } - -+static int nl80211_parse_vif_radio_mask(struct genl_info *info, -+ u32 *radio_mask) -+{ -+ struct cfg80211_registered_device *rdev = info->user_ptr[0]; -+ struct nlattr *attr = info->attrs[NL80211_ATTR_VIF_RADIO_MASK]; -+ u32 mask, allowed; -+ -+ if (!attr) { -+ *radio_mask = 0; -+ return 0; -+ } -+ -+ allowed = BIT(rdev->wiphy.n_radio) - 1; -+ mask = nla_get_u32(attr); -+ if (mask & ~allowed) -+ return -EINVAL; -+ if (!mask) -+ mask = allowed; -+ *radio_mask = mask; -+ -+ return 1; -+} -+ - 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 - int err; - enum nl80211_iftype otype, ntype; - struct net_device *dev = info->user_ptr[1]; -+ struct wireless_dev *wdev = dev->ieee80211_ptr; -+ u32 radio_mask = 0; - bool change = false; - - memset(¶ms, 0, sizeof(params)); -@@ -4332,8 +4359,6 @@ static int nl80211_set_interface(struct - } - - if (info->attrs[NL80211_ATTR_MESH_ID]) { -- struct wireless_dev *wdev = dev->ieee80211_ptr; -- - if (ntype != NL80211_IFTYPE_MESH_POINT) - return -EINVAL; - if (otype != NL80211_IFTYPE_MESH_POINT) -@@ -4364,6 +4389,12 @@ static int nl80211_set_interface(struct - if (err > 0) - change = true; - -+ err = nl80211_parse_vif_radio_mask(info, &radio_mask); -+ if (err < 0) -+ return err; -+ if (err && netif_running(dev)) -+ return -EBUSY; -+ - if (change) - err = cfg80211_change_iface(rdev, dev, ntype, ¶ms); - else -@@ -4372,11 +4403,11 @@ static int nl80211_set_interface(struct - if (!err && params.use_4addr != -1) - dev->ieee80211_ptr->use_4addr = params.use_4addr; - -- if (change && !err) { -- struct wireless_dev *wdev = dev->ieee80211_ptr; -+ if (radio_mask) -+ wdev->radio_mask = radio_mask; - -+ if (change && !err) - nl80211_notify_iface(rdev, wdev, NL80211_CMD_SET_INTERFACE); -- } - - return err; - } -@@ -4387,6 +4418,7 @@ static int _nl80211_new_interface(struct - struct vif_params params; - struct wireless_dev *wdev; - struct sk_buff *msg; -+ u32 radio_mask; - int err; - enum nl80211_iftype type = NL80211_IFTYPE_UNSPECIFIED; - -@@ -4424,6 +4456,10 @@ static int _nl80211_new_interface(struct - if (err < 0) - return err; - -+ err = nl80211_parse_vif_radio_mask(info, &radio_mask); -+ 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 - break; - } - -+ if (radio_mask) -+ wdev->radio_mask = radio_mask; -+ - 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 - - lockdep_assert_wiphy(wdev->wiphy); - -+ if (!cfg80211_wdev_channel_allowed(wdev, chan)) -+ return false; -+ - if (!cfg80211_beaconing_iface_active(wdev)) - return true; - -@@ -9392,7 +9434,8 @@ static int nl80211_trigger_scan(struct s - } - - /* ignore disabled channels */ -- if (chan->flags & IEEE80211_CHAN_DISABLED) -+ if (chan->flags & IEEE80211_CHAN_DISABLED || -+ !cfg80211_wdev_channel_allowed(wdev, chan)) - continue; - - request->channels[i] = chan; -@@ -9412,7 +9455,8 @@ static int nl80211_trigger_scan(struct s - - chan = &wiphy->bands[band]->channels[j]; - -- if (chan->flags & IEEE80211_CHAN_DISABLED) -+ if (chan->flags & IEEE80211_CHAN_DISABLED || -+ !cfg80211_wdev_channel_allowed(wdev, chan)) - continue; - - 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 - struct ieee80211_channel *chan = - ieee80211_get_channel(&rdev->wiphy, ap->center_freq); - -- if (!chan || chan->flags & IEEE80211_CHAN_DISABLED) -+ if (!chan || chan->flags & IEEE80211_CHAN_DISABLED || -+ !cfg80211_wdev_channel_allowed(rdev_req->wdev, chan)) - continue; - - for (i = 0; i < rdev_req->n_channels; i++) { -@@ -3519,9 +3520,12 @@ int cfg80211_wext_siwscan(struct net_dev - continue; - - for (j = 0; j < wiphy->bands[band]->n_channels; j++) { -+ struct ieee80211_channel *chan; -+ - /* ignore disabled channels */ -- if (wiphy->bands[band]->channels[j].flags & -- IEEE80211_CHAN_DISABLED) -+ chan = &wiphy->bands[band]->channels[j]; -+ if (chan->flags & IEEE80211_CHAN_DISABLED || -+ !cfg80211_wdev_channel_allowed(creq->wdev, chan)) - continue; - - /* 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 - return true; - } - EXPORT_SYMBOL(cfg80211_radio_chandef_valid); -+ -+bool cfg80211_wdev_channel_allowed(struct wireless_dev *wdev, -+ struct ieee80211_channel *chan) -+{ -+ struct wiphy *wiphy = wdev->wiphy; -+ const struct wiphy_radio *radio; -+ struct cfg80211_chan_def chandef; -+ u32 radio_mask; -+ int i; -+ -+ radio_mask = wdev->radio_mask; -+ if (!wiphy->n_radio || radio_mask == BIT(wiphy->n_radio) - 1) -+ return true; -+ -+ cfg80211_chandef_create(&chandef, chan, NL80211_CHAN_HT20); -+ for (i = 0; i < wiphy->n_radio; i++) { -+ if (!(radio_mask & BIT(i))) -+ continue; -+ -+ radio = &wiphy->radio[i]; -+ if (!cfg80211_radio_chandef_valid(radio, &chandef)) -+ continue; -+ -+ return true; -+ } -+ -+ return false; -+} -+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_ - /* allow mac80211 to determine the timeout */ - wdev->ps_timeout = -1; - -+ wdev->radio_mask = BIT(wdev->wiphy->n_radio) - 1; -+ - if ((wdev->iftype == NL80211_IFTYPE_STATION || - wdev->iftype == NL80211_IFTYPE_P2P_CLIENT || - wdev->iftype == NL80211_IFTYPE_ADHOC) && !wdev->use_4addr) diff --git a/package/kernel/mac80211/patches/subsys/331-wifi-mac80211-use-vif-radio-mask-to-limit-ibss-scan-.patch b/package/kernel/mac80211/patches/subsys/331-wifi-mac80211-use-vif-radio-mask-to-limit-ibss-scan-.patch deleted file mode 100644 index 779857fe88a..00000000000 --- a/package/kernel/mac80211/patches/subsys/331-wifi-mac80211-use-vif-radio-mask-to-limit-ibss-scan-.patch +++ /dev/null @@ -1,79 +0,0 @@ -From: Felix Fietkau -Date: Thu, 26 Sep 2024 14:06:11 +0200 -Subject: [PATCH] wifi: mac80211: use vif radio mask to limit ibss scan - frequencies - -Reject frequencies not supported by any radio that the vif is allowed to use. - -Signed-off-by: Felix Fietkau ---- - ---- a/net/mac80211/scan.c -+++ b/net/mac80211/scan.c -@@ -1176,14 +1176,14 @@ int ieee80211_request_ibss_scan(struct i - unsigned int n_channels) - { - struct ieee80211_local *local = sdata->local; -- int ret = -EBUSY, i, n_ch = 0; -+ int i, n_ch = 0; - enum nl80211_band band; - - lockdep_assert_wiphy(local->hw.wiphy); - - /* busy scanning */ - if (local->scan_req) -- goto unlock; -+ return -EBUSY; - - /* fill internal scan request */ - if (!channels) { -@@ -1200,7 +1200,9 @@ int ieee80211_request_ibss_scan(struct i - &local->hw.wiphy->bands[band]->channels[i]; - - if (tmp_ch->flags & (IEEE80211_CHAN_NO_IR | -- IEEE80211_CHAN_DISABLED)) -+ IEEE80211_CHAN_DISABLED) || -+ !cfg80211_wdev_channel_allowed(&sdata->wdev, -+ tmp_ch)) - continue; - - local->int_scan_req->channels[n_ch] = tmp_ch; -@@ -1209,21 +1211,23 @@ int ieee80211_request_ibss_scan(struct i - } - - if (WARN_ON_ONCE(n_ch == 0)) -- goto unlock; -+ return -EINVAL; - - local->int_scan_req->n_channels = n_ch; - } else { - for (i = 0; i < n_channels; i++) { - if (channels[i]->flags & (IEEE80211_CHAN_NO_IR | -- IEEE80211_CHAN_DISABLED)) -+ IEEE80211_CHAN_DISABLED) || -+ !cfg80211_wdev_channel_allowed(&sdata->wdev, -+ channels[i])) - continue; - - local->int_scan_req->channels[n_ch] = channels[i]; - n_ch++; - } - -- if (WARN_ON_ONCE(n_ch == 0)) -- goto unlock; -+ if (n_ch == 0) -+ return -EINVAL; - - local->int_scan_req->n_channels = n_ch; - } -@@ -1233,9 +1237,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; - -- ret = __ieee80211_start_scan(sdata, sdata->local->int_scan_req); -- unlock: -- return ret; -+ return __ieee80211_start_scan(sdata, sdata->local->int_scan_req); - } - - void ieee80211_scan_cancel(struct ieee80211_local *local) diff --git a/package/kernel/mac80211/patches/subsys/332-wifi-mac80211-use-vif-radio-mask-to-limit-chanctx-an.patch b/package/kernel/mac80211/patches/subsys/332-wifi-mac80211-use-vif-radio-mask-to-limit-chanctx-an.patch deleted file mode 100644 index 0c8c894eaaa..00000000000 --- a/package/kernel/mac80211/patches/subsys/332-wifi-mac80211-use-vif-radio-mask-to-limit-chanctx-an.patch +++ /dev/null @@ -1,52 +0,0 @@ -From: Felix Fietkau -Date: Thu, 26 Sep 2024 14:07:50 +0200 -Subject: [PATCH] wifi: mac80211: use vif radio mask to limit creating chanctx - -Reject frequencies not supported by any radio that the vif is allowed to use. - -Signed-off-by: Felix Fietkau ---- - ---- a/net/mac80211/chan.c -+++ b/net/mac80211/chan.c -@@ -1169,7 +1169,7 @@ ieee80211_replace_chanctx(struct ieee802 - static bool - ieee80211_find_available_radio(struct ieee80211_local *local, - const struct ieee80211_chan_req *chanreq, -- int *radio_idx) -+ u32 radio_mask, int *radio_idx) - { - struct wiphy *wiphy = local->hw.wiphy; - const struct wiphy_radio *radio; -@@ -1180,6 +1180,9 @@ ieee80211_find_available_radio(struct ie - return true; - - for (i = 0; i < wiphy->n_radio; i++) { -+ if (!(radio_mask & BIT(i))) -+ continue; -+ - radio = &wiphy->radio[i]; - if (!cfg80211_radio_chandef_valid(radio, &chanreq->oper)) - continue; -@@ -1213,7 +1216,9 @@ int ieee80211_link_reserve_chanctx(struc - new_ctx = ieee80211_find_reservation_chanctx(local, chanreq, mode); - if (!new_ctx) { - if (ieee80211_can_create_new_chanctx(local, -1) && -- ieee80211_find_available_radio(local, chanreq, &radio_idx)) -+ ieee80211_find_available_radio(local, chanreq, -+ sdata->wdev.radio_mask, -+ &radio_idx)) - new_ctx = ieee80211_new_chanctx(local, chanreq, mode, - false, radio_idx); - else -@@ -1883,7 +1888,9 @@ int _ieee80211_link_use_channel(struct i - /* Note: context is now reserved */ - if (ctx) - reserved = true; -- else if (!ieee80211_find_available_radio(local, chanreq, &radio_idx)) -+ else if (!ieee80211_find_available_radio(local, chanreq, -+ sdata->wdev.radio_mask, -+ &radio_idx)) - ctx = ERR_PTR(-EBUSY); - else - ctx = ieee80211_new_chanctx(local, chanreq, mode, diff --git a/package/kernel/mac80211/patches/subsys/333-wifi-mac80211-remove-status-ampdu_delimiter_crc.patch b/package/kernel/mac80211/patches/subsys/333-wifi-mac80211-remove-status-ampdu_delimiter_crc.patch deleted file mode 100644 index c0cdcdd6bc1..00000000000 --- a/package/kernel/mac80211/patches/subsys/333-wifi-mac80211-remove-status-ampdu_delimiter_crc.patch +++ /dev/null @@ -1,67 +0,0 @@ -From: Felix Fietkau -Date: Wed, 17 Jul 2024 22:49:16 +0200 -Subject: [PATCH] wifi: mac80211: remove status->ampdu_delimiter_crc - -This was never used by any driver, so remove it to free up some space. - -Signed-off-by: Felix Fietkau ---- - ---- a/include/net/mac80211.h -+++ b/include/net/mac80211.h -@@ -1448,8 +1448,6 @@ ieee80211_tx_info_clear_status(struct ie - * @RX_FLAG_AMPDU_IS_LAST: this subframe is the last subframe of the A-MPDU - * @RX_FLAG_AMPDU_DELIM_CRC_ERROR: A delimiter CRC error has been detected - * on this subframe -- * @RX_FLAG_AMPDU_DELIM_CRC_KNOWN: The delimiter CRC field is known (the CRC -- * is stored in the @ampdu_delimiter_crc field) - * @RX_FLAG_MIC_STRIPPED: The mic was stripped of this packet. Decryption was - * done by the hardware - * @RX_FLAG_ONLY_MONITOR: Report frame only to monitor interfaces without -@@ -1521,7 +1519,7 @@ enum mac80211_rx_flags { - RX_FLAG_AMPDU_LAST_KNOWN = BIT(12), - RX_FLAG_AMPDU_IS_LAST = BIT(13), - RX_FLAG_AMPDU_DELIM_CRC_ERROR = BIT(14), -- RX_FLAG_AMPDU_DELIM_CRC_KNOWN = BIT(15), -+ /* one free bit at 15 */ - RX_FLAG_MACTIME = BIT(16) | BIT(17), - RX_FLAG_MACTIME_PLCP_START = 1 << 16, - RX_FLAG_MACTIME_START = 2 << 16, -@@ -1618,7 +1616,6 @@ enum mac80211_rx_encoding { - * @rx_flags: internal RX flags for mac80211 - * @ampdu_reference: A-MPDU reference number, must be a different value for - * each A-MPDU but the same for each subframe within one A-MPDU -- * @ampdu_delimiter_crc: A-MPDU delimiter CRC - * @zero_length_psdu_type: radiotap type of the 0-length PSDU - * @link_valid: if the link which is identified by @link_id is valid. This flag - * is set only when connection is MLO. -@@ -1656,7 +1653,6 @@ struct ieee80211_rx_status { - s8 signal; - u8 chains; - s8 chain_signal[IEEE80211_MAX_CHAINS]; -- u8 ampdu_delimiter_crc; - u8 zero_length_psdu_type; - u8 link_valid:1, link_id:4; - }; ---- a/net/mac80211/rx.c -+++ b/net/mac80211/rx.c -@@ -508,18 +508,13 @@ ieee80211_add_rx_radiotap_header(struct - flags |= IEEE80211_RADIOTAP_AMPDU_IS_LAST; - if (status->flag & RX_FLAG_AMPDU_DELIM_CRC_ERROR) - flags |= IEEE80211_RADIOTAP_AMPDU_DELIM_CRC_ERR; -- if (status->flag & RX_FLAG_AMPDU_DELIM_CRC_KNOWN) -- flags |= IEEE80211_RADIOTAP_AMPDU_DELIM_CRC_KNOWN; - if (status->flag & RX_FLAG_AMPDU_EOF_BIT_KNOWN) - flags |= IEEE80211_RADIOTAP_AMPDU_EOF_KNOWN; - if (status->flag & RX_FLAG_AMPDU_EOF_BIT) - flags |= IEEE80211_RADIOTAP_AMPDU_EOF; - put_unaligned_le16(flags, pos); - pos += 2; -- if (status->flag & RX_FLAG_AMPDU_DELIM_CRC_KNOWN) -- *pos++ = status->ampdu_delimiter_crc; -- else -- *pos++ = 0; -+ *pos++ = 0; - *pos++ = 0; - } - diff --git a/package/kernel/mac80211/patches/subsys/334-wifi-cfg80211-pass-net_device-to-.set_monitor_channel.patch b/package/kernel/mac80211/patches/subsys/334-wifi-cfg80211-pass-net_device-to-.set_monitor_channel.patch deleted file mode 100644 index 626f2facaf5..00000000000 --- a/package/kernel/mac80211/patches/subsys/334-wifi-cfg80211-pass-net_device-to-.set_monitor_channel.patch +++ /dev/null @@ -1,165 +0,0 @@ -From: Felix Fietkau -Date: Thu, 26 Sep 2024 19:52:30 +0200 -Subject: [PATCH] wifi: cfg80211: pass net_device to .set_monitor_channel - -Preparation for allowing multiple monitor interfaces with different channels -on a multi-radio wiphy. - -Signed-off-by: Felix Fietkau ---- - ---- a/drivers/net/wireless/ath/wil6210/cfg80211.c -+++ b/drivers/net/wireless/ath/wil6210/cfg80211.c -@@ -1493,6 +1493,7 @@ out: - } - - static int wil_cfg80211_set_channel(struct wiphy *wiphy, -+ struct net_device *dev, - struct cfg80211_chan_def *chandef) - { - struct wil6210_priv *wil = wiphy_to_wil(wiphy); ---- a/drivers/net/wireless/marvell/libertas/cfg.c -+++ b/drivers/net/wireless/marvell/libertas/cfg.c -@@ -486,6 +486,7 @@ static int lbs_add_wps_enrollee_tlv(u8 * - */ - - static int lbs_cfg_set_monitor_channel(struct wiphy *wiphy, -+ struct net_device *dev, - struct cfg80211_chan_def *chandef) - { - struct lbs_private *priv = wiphy_priv(wiphy); ---- a/drivers/net/wireless/microchip/wilc1000/cfg80211.c -+++ b/drivers/net/wireless/microchip/wilc1000/cfg80211.c -@@ -231,6 +231,7 @@ struct wilc_vif *wilc_get_wl_to_vif(stru - } - - static int set_channel(struct wiphy *wiphy, -+ struct net_device *dev, - struct cfg80211_chan_def *chandef) - { - struct wilc *wl = wiphy_priv(wiphy); -@@ -1424,7 +1425,7 @@ static int start_ap(struct wiphy *wiphy, - struct wilc_vif *vif = netdev_priv(dev); - int ret; - -- ret = set_channel(wiphy, &settings->chandef); -+ ret = set_channel(wiphy, dev, &settings->chandef); - if (ret != 0) - netdev_err(dev, "Error in setting channel\n"); - ---- a/include/net/cfg80211.h -+++ b/include/net/cfg80211.h -@@ -4700,6 +4700,7 @@ struct cfg80211_ops { - struct ieee80211_channel *chan); - - int (*set_monitor_channel)(struct wiphy *wiphy, -+ struct net_device *dev, - struct cfg80211_chan_def *chandef); - - int (*scan)(struct wiphy *wiphy, ---- a/net/mac80211/cfg.c -+++ b/net/mac80211/cfg.c -@@ -879,6 +879,7 @@ static int ieee80211_get_station(struct - } - - static int ieee80211_set_monitor_channel(struct wiphy *wiphy, -+ struct net_device *dev, - struct cfg80211_chan_def *chandef) - { - 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 - EXPORT_SYMBOL(cfg80211_reg_check_beaconing); - - int cfg80211_set_monitor_channel(struct cfg80211_registered_device *rdev, -+ struct net_device *dev, - struct cfg80211_chan_def *chandef) - { - if (!rdev->ops->set_monitor_channel) -@@ -1680,7 +1681,7 @@ int cfg80211_set_monitor_channel(struct - if (!cfg80211_has_monitors_only(rdev)) - return -EBUSY; - -- return rdev_set_monitor_channel(rdev, chandef); -+ return rdev_set_monitor_channel(rdev, dev, chandef); - } - - bool cfg80211_any_usable_channels(struct wiphy *wiphy, ---- a/net/wireless/core.h -+++ b/net/wireless/core.h -@@ -518,6 +518,7 @@ static inline unsigned int elapsed_jiffi - } - - int cfg80211_set_monitor_channel(struct cfg80211_registered_device *rdev, -+ struct net_device *dev, - struct cfg80211_chan_def *chandef); - - 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 - case NL80211_IFTYPE_MESH_POINT: - return cfg80211_set_mesh_channel(rdev, wdev, &chandef); - case NL80211_IFTYPE_MONITOR: -- return cfg80211_set_monitor_channel(rdev, &chandef); -+ return cfg80211_set_monitor_channel(rdev, dev, &chandef); - default: - break; - } ---- a/net/wireless/rdev-ops.h -+++ b/net/wireless/rdev-ops.h -@@ -445,11 +445,12 @@ rdev_libertas_set_mesh_channel(struct cf - - static inline int - rdev_set_monitor_channel(struct cfg80211_registered_device *rdev, -+ struct net_device *dev, - struct cfg80211_chan_def *chandef) - { - int ret; -- trace_rdev_set_monitor_channel(&rdev->wiphy, chandef); -- ret = rdev->ops->set_monitor_channel(&rdev->wiphy, chandef); -+ trace_rdev_set_monitor_channel(&rdev->wiphy, dev, chandef); -+ ret = rdev->ops->set_monitor_channel(&rdev->wiphy, dev, chandef); - trace_rdev_return_int(&rdev->wiphy, ret); - return ret; - } ---- a/net/wireless/trace.h -+++ b/net/wireless/trace.h -@@ -1322,19 +1322,21 @@ TRACE_EVENT(rdev_libertas_set_mesh_chann - ); - - TRACE_EVENT(rdev_set_monitor_channel, -- TP_PROTO(struct wiphy *wiphy, -+ TP_PROTO(struct wiphy *wiphy, struct net_device *netdev, - struct cfg80211_chan_def *chandef), -- TP_ARGS(wiphy, chandef), -+ TP_ARGS(wiphy, netdev, chandef), - TP_STRUCT__entry( - WIPHY_ENTRY -+ NETDEV_ENTRY - CHAN_DEF_ENTRY - ), - TP_fast_assign( - WIPHY_ASSIGN; -+ NETDEV_ASSIGN; - CHAN_DEF_ASSIGN(chandef); - ), -- TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT, -- WIPHY_PR_ARG, CHAN_DEF_PR_ARG) -+ TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " CHAN_DEF_PR_FMT, -+ WIPHY_PR_ARG, NETDEV_PR_ARG, CHAN_DEF_PR_ARG) - ); - - TRACE_EVENT(rdev_auth, ---- a/net/wireless/wext-compat.c -+++ b/net/wireless/wext-compat.c -@@ -830,7 +830,7 @@ static int cfg80211_wext_siwfreq(struct - ret = -EINVAL; - break; - } -- ret = cfg80211_set_monitor_channel(rdev, &chandef); -+ ret = cfg80211_set_monitor_channel(rdev, dev, &chandef); - break; - case NL80211_IFTYPE_MESH_POINT: - freq = cfg80211_wext_freq(wextfreq); diff --git a/package/kernel/mac80211/patches/subsys/335-wifi-mac80211-add-flag-to-opt-out-of-virtual-monitor.patch b/package/kernel/mac80211/patches/subsys/335-wifi-mac80211-add-flag-to-opt-out-of-virtual-monitor.patch deleted file mode 100644 index 604abfd43fc..00000000000 --- a/package/kernel/mac80211/patches/subsys/335-wifi-mac80211-add-flag-to-opt-out-of-virtual-monitor.patch +++ /dev/null @@ -1,337 +0,0 @@ -From: Felix Fietkau -Date: Mon, 30 Sep 2024 15:09:45 +0200 -Subject: [PATCH] wifi: mac80211: add flag to opt out of virtual monitor - support - -This is useful for multi-radio devices that are capable of monitoring on -multiple channels simultanenously. When this flag is set, each monitor -interface is passed to the driver individually and can have a configured -channel. - -Signed-off-by: Felix Fietkau ---- - ---- a/include/net/mac80211.h -+++ b/include/net/mac80211.h -@@ -2679,6 +2679,11 @@ struct ieee80211_txq { - * a virtual monitor interface when monitor interfaces are the only - * active interfaces. - * -+ * @IEEE80211_HW_NO_VIRTUAL_MONITOR: The driver would like to be informed -+ * of any monitor interface, as well as their configured channel. -+ * This is useful for supporting multiple monitor interfaces on different -+ * channels. -+ * - * @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 { - IEEE80211_HW_SUPPORTS_DYNAMIC_PS, - IEEE80211_HW_MFP_CAPABLE, - IEEE80211_HW_WANT_MONITOR_VIF, -+ IEEE80211_HW_NO_VIRTUAL_MONITOR, - IEEE80211_HW_NO_AUTO_VIF, - IEEE80211_HW_SW_CRYPTO_CONTROL, - IEEE80211_HW_SUPPORT_FAST_XMIT, ---- a/net/mac80211/cfg.c -+++ b/net/mac80211/cfg.c -@@ -105,8 +105,11 @@ static int ieee80211_set_mon_options(str - } - - /* also validate MU-MIMO change */ -- monitor_sdata = wiphy_dereference(local->hw.wiphy, -- local->monitor_sdata); -+ if (ieee80211_hw_check(&local->hw, NO_VIRTUAL_MONITOR)) -+ monitor_sdata = sdata; -+ else -+ monitor_sdata = wiphy_dereference(local->hw.wiphy, -+ local->monitor_sdata); - - if (!monitor_sdata && - (params->vht_mumimo_groups || params->vht_mumimo_follow_addr)) -@@ -114,7 +117,9 @@ static int ieee80211_set_mon_options(str - - /* apply all changes now - no failures allowed */ - -- if (monitor_sdata && ieee80211_hw_check(&local->hw, WANT_MONITOR_VIF)) -+ if (monitor_sdata && -+ (ieee80211_hw_check(&local->hw, WANT_MONITOR_VIF) || -+ ieee80211_hw_check(&local->hw, NO_VIRTUAL_MONITOR))) - ieee80211_set_mu_mimo_follow(monitor_sdata, params); - - if (params->flags) { -@@ -889,22 +894,25 @@ static int ieee80211_set_monitor_channel - - lockdep_assert_wiphy(local->hw.wiphy); - -- if (cfg80211_chandef_identical(&local->monitor_chanreq.oper, -- &chanreq.oper)) -- return 0; -+ sdata = IEEE80211_DEV_TO_SUB_IF(dev); -+ if (!ieee80211_hw_check(&local->hw, NO_VIRTUAL_MONITOR)) { -+ if (cfg80211_chandef_identical(&local->monitor_chanreq.oper, -+ &chanreq.oper)) -+ return 0; - -- sdata = wiphy_dereference(local->hw.wiphy, -- local->monitor_sdata); -- if (!sdata) -- goto done; -+ sdata = wiphy_dereference(wiphy, local->monitor_sdata); -+ if (!sdata) -+ goto done; -+ } - -- if (cfg80211_chandef_identical(&sdata->vif.bss_conf.chanreq.oper, -+ if (rcu_access_pointer(sdata->deflink.conf->chanctx_conf) && -+ cfg80211_chandef_identical(&sdata->vif.bss_conf.chanreq.oper, - &chanreq.oper)) - return 0; - - ieee80211_link_release_channel(&sdata->deflink); - ret = ieee80211_link_use_channel(&sdata->deflink, &chanreq, -- IEEE80211_CHANCTX_EXCLUSIVE); -+ IEEE80211_CHANCTX_SHARED); - if (ret) - return ret; - done: -@@ -3050,7 +3058,8 @@ static int ieee80211_set_tx_power(struct - if (wdev) { - sdata = IEEE80211_WDEV_TO_SUB_IF(wdev); - -- if (sdata->vif.type == NL80211_IFTYPE_MONITOR) { -+ if (sdata->vif.type == NL80211_IFTYPE_MONITOR && -+ !ieee80211_hw_check(&local->hw, NO_VIRTUAL_MONITOR)) { - if (!ieee80211_hw_check(&local->hw, WANT_MONITOR_VIF)) - return -EOPNOTSUPP; - -@@ -3098,7 +3107,8 @@ static int ieee80211_set_tx_power(struct - } - - list_for_each_entry(sdata, &local->interfaces, list) { -- if (sdata->vif.type == NL80211_IFTYPE_MONITOR) { -+ if (sdata->vif.type == NL80211_IFTYPE_MONITOR && -+ !ieee80211_hw_check(&local->hw, NO_VIRTUAL_MONITOR)) { - has_monitor = true; - continue; - } -@@ -3108,7 +3118,8 @@ static int ieee80211_set_tx_power(struct - sdata->vif.bss_conf.txpower_type = txp_type; - } - list_for_each_entry(sdata, &local->interfaces, list) { -- if (sdata->vif.type == NL80211_IFTYPE_MONITOR) -+ if (sdata->vif.type == NL80211_IFTYPE_MONITOR && -+ !ieee80211_hw_check(&local->hw, NO_VIRTUAL_MONITOR)) - continue; - ieee80211_recalc_txpower(sdata, update_txp_type); - } -@@ -4303,7 +4314,8 @@ static int ieee80211_cfg_get_channel(str - if (chanctx_conf) { - *chandef = link->conf->chanreq.oper; - ret = 0; -- } else if (local->open_count > 0 && -+ } else if (!ieee80211_hw_check(&local->hw, NO_VIRTUAL_MONITOR) && -+ local->open_count > 0 && - local->open_count == local->monitors && - sdata->vif.type == NL80211_IFTYPE_MONITOR) { - *chandef = local->monitor_chanreq.oper; ---- a/net/mac80211/chan.c -+++ b/net/mac80211/chan.c -@@ -339,6 +339,10 @@ ieee80211_get_chanctx_max_required_bw(st - case NL80211_IFTYPE_P2P_DEVICE: - case NL80211_IFTYPE_NAN: - continue; -+ case NL80211_IFTYPE_MONITOR: -+ WARN_ON_ONCE(!ieee80211_hw_check(&local->hw, -+ NO_VIRTUAL_MONITOR)); -+ fallthrough; - case NL80211_IFTYPE_ADHOC: - case NL80211_IFTYPE_MESH_POINT: - case NL80211_IFTYPE_OCB: -@@ -347,7 +351,6 @@ ieee80211_get_chanctx_max_required_bw(st - case NL80211_IFTYPE_WDS: - case NL80211_IFTYPE_UNSPECIFIED: - case NUM_NL80211_IFTYPES: -- case NL80211_IFTYPE_MONITOR: - case NL80211_IFTYPE_P2P_CLIENT: - case NL80211_IFTYPE_P2P_GO: - WARN_ON_ONCE(1); -@@ -956,6 +959,10 @@ void ieee80211_recalc_smps_chanctx(struc - if (!link->sdata->u.mgd.associated) - continue; - break; -+ case NL80211_IFTYPE_MONITOR: -+ if (!ieee80211_hw_check(&local->hw, NO_VIRTUAL_MONITOR)) -+ continue; -+ break; - case NL80211_IFTYPE_AP: - case NL80211_IFTYPE_ADHOC: - case NL80211_IFTYPE_MESH_POINT: -@@ -968,6 +975,11 @@ void ieee80211_recalc_smps_chanctx(struc - if (rcu_access_pointer(link->conf->chanctx_conf) != &chanctx->conf) - continue; - -+ if (link->sdata->vif.type == NL80211_IFTYPE_MONITOR) { -+ rx_chains_dynamic = rx_chains_static = local->rx_chains; -+ break; -+ } -+ - switch (link->smps_mode) { - default: - WARN_ONCE(1, "Invalid SMPS mode %d\n", ---- a/net/mac80211/debugfs.c -+++ b/net/mac80211/debugfs.c -@@ -465,6 +465,7 @@ static const char *hw_flag_names[] = { - FLAG(SUPPORTS_DYNAMIC_PS), - FLAG(MFP_CAPABLE), - FLAG(WANT_MONITOR_VIF), -+ FLAG(NO_VIRTUAL_MONITOR), - FLAG(NO_AUTO_VIF), - FLAG(SW_CRYPTO_CONTROL), - FLAG(SUPPORT_FAST_XMIT), ---- a/net/mac80211/driver-ops.c -+++ b/net/mac80211/driver-ops.c -@@ -65,6 +65,7 @@ int drv_add_interface(struct ieee80211_l - if (WARN_ON(sdata->vif.type == NL80211_IFTYPE_AP_VLAN || - (sdata->vif.type == NL80211_IFTYPE_MONITOR && - !ieee80211_hw_check(&local->hw, WANT_MONITOR_VIF) && -+ !ieee80211_hw_check(&local->hw, NO_VIRTUAL_MONITOR) && - !(sdata->u.mntr.flags & MONITOR_FLAG_ACTIVE)))) - return -EINVAL; - ---- a/net/mac80211/iface.c -+++ b/net/mac80211/iface.c -@@ -279,8 +279,13 @@ static int _ieee80211_change_mac(struct - ret = eth_mac_addr(sdata->dev, sa); - - if (ret == 0) { -- memcpy(sdata->vif.addr, sa->sa_data, ETH_ALEN); -- ether_addr_copy(sdata->vif.bss_conf.addr, sdata->vif.addr); -+ if (check_dup) { -+ memcpy(sdata->vif.addr, sa->sa_data, ETH_ALEN); -+ ether_addr_copy(sdata->vif.bss_conf.addr, sdata->vif.addr); -+ } else { -+ memset(sdata->vif.addr, 0, ETH_ALEN); -+ memset(sdata->vif.bss_conf.addr, 0, ETH_ALEN); -+ } - } - - /* Regardless of eth_mac_addr() return we still want to add the -@@ -699,9 +704,11 @@ static void ieee80211_do_stop(struct iee - ieee80211_recalc_idle(local); - ieee80211_recalc_offload(local); - -- if (!(sdata->u.mntr.flags & MONITOR_FLAG_ACTIVE)) -+ if (!(sdata->u.mntr.flags & MONITOR_FLAG_ACTIVE) && -+ !ieee80211_hw_check(&local->hw, NO_VIRTUAL_MONITOR)) - break; - -+ ieee80211_link_release_channel(&sdata->deflink); - fallthrough; - default: - if (!going_down) -@@ -1131,7 +1138,8 @@ int ieee80211_add_virtual_monitor(struct - ASSERT_RTNL(); - lockdep_assert_wiphy(local->hw.wiphy); - -- if (local->monitor_sdata) -+ if (local->monitor_sdata || -+ ieee80211_hw_check(&local->hw, NO_VIRTUAL_MONITOR)) - return 0; - - sdata = kzalloc(sizeof(*sdata) + local->hw.vif_data_size, GFP_KERNEL); -@@ -1193,6 +1201,9 @@ void ieee80211_del_virtual_monitor(struc - { - struct ieee80211_sub_if_data *sdata; - -+ if (ieee80211_hw_check(&local->hw, NO_VIRTUAL_MONITOR)) -+ return; -+ - ASSERT_RTNL(); - lockdep_assert_wiphy(local->hw.wiphy); - -@@ -1328,7 +1339,8 @@ int ieee80211_do_open(struct wireless_de - break; - } - -- if (sdata->u.mntr.flags & MONITOR_FLAG_ACTIVE) { -+ if ((sdata->u.mntr.flags & MONITOR_FLAG_ACTIVE) || -+ ieee80211_hw_check(&local->hw, NO_VIRTUAL_MONITOR)) { - res = drv_add_interface(local, sdata); - if (res) - goto err_stop; ---- a/net/mac80211/rx.c -+++ b/net/mac80211/rx.c -@@ -840,6 +840,9 @@ ieee80211_rx_monitor(struct ieee80211_lo - bool last_monitor = list_is_last(&sdata->u.mntr.list, - &local->mon_list); - -+ if (ieee80211_hw_check(&local->hw, NO_VIRTUAL_MONITOR)) -+ ieee80211_handle_mu_mimo_mon(sdata, origskb, rtap_space); -+ - if (!monskb) - monskb = ieee80211_make_monitor_skb(local, &origskb, - rate, rtap_space, ---- a/net/mac80211/tx.c -+++ b/net/mac80211/tx.c -@@ -1763,7 +1763,8 @@ static bool __ieee80211_tx(struct ieee80 - - switch (sdata->vif.type) { - case NL80211_IFTYPE_MONITOR: -- if (sdata->u.mntr.flags & MONITOR_FLAG_ACTIVE) { -+ if ((sdata->u.mntr.flags & MONITOR_FLAG_ACTIVE) || -+ ieee80211_hw_check(&local->hw, NO_VIRTUAL_MONITOR)) { - vif = &sdata->vif; - break; - } -@@ -3952,7 +3953,8 @@ begin: - - switch (tx.sdata->vif.type) { - case NL80211_IFTYPE_MONITOR: -- if (tx.sdata->u.mntr.flags & MONITOR_FLAG_ACTIVE) { -+ if ((tx.sdata->u.mntr.flags & MONITOR_FLAG_ACTIVE) || -+ ieee80211_hw_check(&local->hw, NO_VIRTUAL_MONITOR)) { - vif = &tx.sdata->vif; - break; - } ---- a/net/mac80211/util.c -+++ b/net/mac80211/util.c -@@ -739,7 +739,8 @@ static void __iterate_interfaces(struct - lockdep_is_held(&local->hw.wiphy->mtx)) { - switch (sdata->vif.type) { - case NL80211_IFTYPE_MONITOR: -- if (!(sdata->u.mntr.flags & MONITOR_FLAG_ACTIVE)) -+ if (!(sdata->u.mntr.flags & MONITOR_FLAG_ACTIVE) && -+ !ieee80211_hw_check(&local->hw, NO_VIRTUAL_MONITOR)) - continue; - break; - case NL80211_IFTYPE_AP_VLAN: -@@ -1856,8 +1857,10 @@ int ieee80211_reconfig(struct ieee80211_ - } - - list_for_each_entry(sdata, &local->interfaces, list) { -+ if (sdata->vif.type == NL80211_IFTYPE_MONITOR && -+ !ieee80211_hw_check(&local->hw, NO_VIRTUAL_MONITOR)) -+ continue; - if (sdata->vif.type != NL80211_IFTYPE_AP_VLAN && -- sdata->vif.type != NL80211_IFTYPE_MONITOR && - ieee80211_sdata_running(sdata)) { - res = drv_add_interface(local, sdata); - if (WARN_ON(res)) -@@ -1870,11 +1873,14 @@ int ieee80211_reconfig(struct ieee80211_ - */ - if (res) { - list_for_each_entry_continue_reverse(sdata, &local->interfaces, -- list) -+ list) { -+ if (sdata->vif.type == NL80211_IFTYPE_MONITOR && -+ !ieee80211_hw_check(&local->hw, NO_VIRTUAL_MONITOR)) -+ continue; - if (sdata->vif.type != NL80211_IFTYPE_AP_VLAN && -- sdata->vif.type != NL80211_IFTYPE_MONITOR && - ieee80211_sdata_running(sdata)) - drv_remove_interface(local, sdata); -+ } - ieee80211_handle_reconfig_failure(local); - return res; - } diff --git a/package/kernel/mac80211/patches/subsys/336-wifi-cfg80211-add-monitor-SKIP_TX-flag.patch b/package/kernel/mac80211/patches/subsys/336-wifi-cfg80211-add-monitor-SKIP_TX-flag.patch deleted file mode 100644 index dfc01c6c9bc..00000000000 --- a/package/kernel/mac80211/patches/subsys/336-wifi-cfg80211-add-monitor-SKIP_TX-flag.patch +++ /dev/null @@ -1,56 +0,0 @@ -From: Felix Fietkau -Date: Mon, 30 Sep 2024 17:04:09 +0200 -Subject: [PATCH] wifi: cfg80211: add monitor SKIP_TX flag - -This can be used to indicate that the user is not interested in receiving -locally sent packets on the monitor interface. - -Signed-off-by: Felix Fietkau ---- - ---- a/include/net/cfg80211.h -+++ b/include/net/cfg80211.h -@@ -2272,6 +2272,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 -+ * @MONITOR_FLAG_SKIP_TX: do not pass locally transmitted frames - */ - enum monitor_flags { - MONITOR_FLAG_CHANGED = BIT(__NL80211_MNTR_FLAG_INVALID), -@@ -2281,6 +2282,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), -+ MONITOR_FLAG_SKIP_TX = BIT(NL80211_MNTR_FLAG_SKIP_TX), - }; - - /** ---- a/include/uapi/linux/nl80211.h -+++ b/include/uapi/linux/nl80211.h -@@ -4703,6 +4703,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_SKIP_TX: do not pass local tx packets - * - * @__NL80211_MNTR_FLAG_AFTER_LAST: internal use - * @NL80211_MNTR_FLAG_MAX: highest possible monitor flag -@@ -4715,6 +4716,7 @@ enum nl80211_mntr_flags { - NL80211_MNTR_FLAG_OTHER_BSS, - NL80211_MNTR_FLAG_COOK_FRAMES, - NL80211_MNTR_FLAG_ACTIVE, -+ NL80211_MNTR_FLAG_SKIP_TX, - - /* keep last */ - __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 - [NL80211_MNTR_FLAG_OTHER_BSS] = { .type = NLA_FLAG }, - [NL80211_MNTR_FLAG_COOK_FRAMES] = { .type = NLA_FLAG }, - [NL80211_MNTR_FLAG_ACTIVE] = { .type = NLA_FLAG }, -+ [NL80211_MNTR_FLAG_SKIP_TX] = { .type = NLA_FLAG }, - }; - - static int parse_monitor_flags(struct nlattr *nla, u32 *mntrflags) diff --git a/package/kernel/mac80211/patches/subsys/337-wifi-mac80211-add-support-for-the-monitor-SKIP_TX-fl.patch b/package/kernel/mac80211/patches/subsys/337-wifi-mac80211-add-support-for-the-monitor-SKIP_TX-fl.patch deleted file mode 100644 index d9e484eebaa..00000000000 --- a/package/kernel/mac80211/patches/subsys/337-wifi-mac80211-add-support-for-the-monitor-SKIP_TX-fl.patch +++ /dev/null @@ -1,54 +0,0 @@ -From: Felix Fietkau -Date: Mon, 30 Sep 2024 17:05:18 +0200 -Subject: [PATCH] wifi: mac80211: add support for the monitor SKIP_TX flag - -Do not pass locally sent packets to monitor interfaces with this flag set. -Skip processing tx packets on the status call entirely if no monitor -interfaces without this flag are present. - -Signed-off-by: Felix Fietkau ---- - ---- a/net/mac80211/ieee80211_i.h -+++ b/net/mac80211/ieee80211_i.h -@@ -1373,7 +1373,7 @@ struct ieee80211_local { - spinlock_t queue_stop_reason_lock; - - int open_count; -- int monitors, cooked_mntrs; -+ int monitors, cooked_mntrs, tx_mntrs; - /* number of interfaces with corresponding FIF_ flags */ - int fif_fcsfail, fif_plcpfail, fif_control, fif_other_bss, fif_pspoll, - fif_probe_req; ---- a/net/mac80211/iface.c -+++ b/net/mac80211/iface.c -@@ -1094,6 +1094,8 @@ void ieee80211_adjust_monitor_flags(stru - ADJUST(CONTROL, control); - ADJUST(CONTROL, pspoll); - ADJUST(OTHER_BSS, other_bss); -+ if (!(flags & MONITOR_FLAG_SKIP_TX)) -+ local->tx_mntrs += offset; - - #undef ADJUST - } ---- a/net/mac80211/status.c -+++ b/net/mac80211/status.c -@@ -927,6 +927,9 @@ void ieee80211_tx_monitor(struct ieee802 - if (!ieee80211_sdata_running(sdata)) - continue; - -+ if (sdata->u.mntr.flags & MONITOR_FLAG_SKIP_TX) -+ continue; -+ - if ((sdata->u.mntr.flags & MONITOR_FLAG_COOK_FRAMES) && - !send_to_cooked) - continue; -@@ -1099,7 +1102,7 @@ static void __ieee80211_tx_status(struct - * This is a bit racy but we can avoid a lot of work - * with this test... - */ -- if (!local->monitors && (!send_to_cooked || !local->cooked_mntrs)) { -+ if (!local->tx_mntrs && (!send_to_cooked || !local->cooked_mntrs)) { - if (status->free_list) - list_add_tail(&skb->list, status->free_list); - else diff --git a/package/kernel/mac80211/patches/subsys/338-wifi-mac80211-refactor-ieee80211_rx_monitor.patch b/package/kernel/mac80211/patches/subsys/338-wifi-mac80211-refactor-ieee80211_rx_monitor.patch deleted file mode 100644 index cc976060d4c..00000000000 --- a/package/kernel/mac80211/patches/subsys/338-wifi-mac80211-refactor-ieee80211_rx_monitor.patch +++ /dev/null @@ -1,94 +0,0 @@ -From: Felix Fietkau -Date: Wed, 2 Oct 2024 12:31:22 +0200 -Subject: [PATCH] wifi: mac80211: refactor ieee80211_rx_monitor - -Rework the monitor mode interface iteration to get rid of the last_monitor -condition. Preparation for further filtering received monitor packets. - -Signed-off-by: Felix Fietkau ---- - ---- a/net/mac80211/rx.c -+++ b/net/mac80211/rx.c -@@ -762,8 +762,8 @@ ieee80211_rx_monitor(struct ieee80211_lo - struct ieee80211_rate *rate) - { - struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(origskb); -- struct ieee80211_sub_if_data *sdata; -- struct sk_buff *monskb = NULL; -+ struct ieee80211_sub_if_data *sdata, *prev_sdata = NULL; -+ struct sk_buff *skb, *monskb = NULL; - int present_fcs_len = 0; - unsigned int rtap_space = 0; - struct ieee80211_sub_if_data *monitor_sdata = -@@ -837,8 +837,10 @@ ieee80211_rx_monitor(struct ieee80211_lo - ieee80211_handle_mu_mimo_mon(monitor_sdata, origskb, rtap_space); - - list_for_each_entry_rcu(sdata, &local->mon_list, u.mntr.list) { -- bool last_monitor = list_is_last(&sdata->u.mntr.list, -- &local->mon_list); -+ if (!prev_sdata) { -+ prev_sdata = sdata; -+ continue; -+ } - - if (ieee80211_hw_check(&local->hw, NO_VIRTUAL_MONITOR)) - ieee80211_handle_mu_mimo_mon(sdata, origskb, rtap_space); -@@ -846,34 +848,34 @@ ieee80211_rx_monitor(struct ieee80211_lo - if (!monskb) - monskb = ieee80211_make_monitor_skb(local, &origskb, - rate, rtap_space, -- only_monitor && -- last_monitor); -- -- if (monskb) { -- struct sk_buff *skb; -+ false); -+ if (!monskb) -+ continue; - -- if (last_monitor) { -- skb = monskb; -- monskb = NULL; -- } else { -- skb = skb_clone(monskb, GFP_ATOMIC); -- } -+ skb = skb_clone(monskb, GFP_ATOMIC); -+ if (!skb) -+ continue; -+ -+ skb->dev = prev_sdata->dev; -+ dev_sw_netstats_rx_add(skb->dev, skb->len); -+ netif_receive_skb(skb); -+ prev_sdata = sdata; -+ } - -- if (skb) { -- skb->dev = sdata->dev; -- dev_sw_netstats_rx_add(skb->dev, skb->len); -- netif_receive_skb(skb); -- } -+ if (prev_sdata) { -+ if (monskb) -+ skb = monskb; -+ else -+ skb = ieee80211_make_monitor_skb(local, &origskb, -+ rate, rtap_space, -+ only_monitor); -+ if (skb) { -+ skb->dev = prev_sdata->dev; -+ dev_sw_netstats_rx_add(skb->dev, skb->len); -+ netif_receive_skb(skb); - } -- -- if (last_monitor) -- break; - } - -- /* this happens if last_monitor was erroneously false */ -- dev_kfree_skb(monskb); -- -- /* ditto */ - if (!origskb) - return NULL; - diff --git a/package/kernel/mac80211/patches/subsys/339-wifi-mac80211-filter-on-monitor-interfaces-based-on-.patch b/package/kernel/mac80211/patches/subsys/339-wifi-mac80211-filter-on-monitor-interfaces-based-on-.patch deleted file mode 100644 index 4b2c67aeba5..00000000000 --- a/package/kernel/mac80211/patches/subsys/339-wifi-mac80211-filter-on-monitor-interfaces-based-on-.patch +++ /dev/null @@ -1,29 +0,0 @@ -From: Felix Fietkau -Date: Wed, 2 Oct 2024 12:35:13 +0200 -Subject: [PATCH] wifi: mac80211: filter on monitor interfaces based on - configured channel - -When a monitor interface has an assigned channel (only happens with the -NO_VIRTUAL_MONITOR feature), only pass packets received on that channel. -This is useful for monitoring on multiple channels at the same time using -multiple monitor interfaces. - -Signed-off-by: Felix Fietkau ---- - ---- a/net/mac80211/rx.c -+++ b/net/mac80211/rx.c -@@ -837,6 +837,13 @@ ieee80211_rx_monitor(struct ieee80211_lo - ieee80211_handle_mu_mimo_mon(monitor_sdata, origskb, rtap_space); - - list_for_each_entry_rcu(sdata, &local->mon_list, u.mntr.list) { -+ struct cfg80211_chan_def *chandef; -+ -+ chandef = &sdata->vif.bss_conf.chanreq.oper; -+ if (chandef->chan && -+ chandef->chan->center_freq != status->freq) -+ continue; -+ - if (!prev_sdata) { - prev_sdata = sdata; - continue; diff --git a/package/kernel/mac80211/patches/subsys/340-wifi-cfg80211-report-per-wiphy-radio-antenna-mask.patch b/package/kernel/mac80211/patches/subsys/340-wifi-cfg80211-report-per-wiphy-radio-antenna-mask.patch deleted file mode 100644 index 178e01dc163..00000000000 --- a/package/kernel/mac80211/patches/subsys/340-wifi-cfg80211-report-per-wiphy-radio-antenna-mask.patch +++ /dev/null @@ -1,64 +0,0 @@ -From: Felix Fietkau -Date: Wed, 7 Aug 2024 13:31:07 +0200 -Subject: [PATCH] wifi: cfg80211: report per wiphy radio antenna mask - -With multi-radio devices, each radio typically gets a fixed set of antennas. -In order to be able to disable specific antennas for some radios, user space -needs to know which antenna mask bits are assigned to which radio. - -Signed-off-by: Felix Fietkau ---- - ---- a/include/net/cfg80211.h -+++ b/include/net/cfg80211.h -@@ -5443,6 +5443,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. -+ * -+ * @antenna_mask: bitmask of antennas connected to this radio. - */ - struct wiphy_radio { - const struct wiphy_radio_freq_range *freq_range; -@@ -5450,6 +5452,8 @@ struct wiphy_radio { - - const struct ieee80211_iface_combination *iface_combinations; - int n_iface_combinations; -+ -+ u32 antenna_mask; - }; - - #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 { - * @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_ANTENNA_MASK: bitmask (u32) of antennas -+ * connected to this radio. - * - * @__NL80211_WIPHY_RADIO_ATTR_LAST: Internal - * @NL80211_WIPHY_RADIO_ATTR_MAX: Highest attribute -@@ -8048,6 +8050,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_ANTENNA_MASK, - - /* keep last */ - __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 - if (nla_put_u32(msg, NL80211_WIPHY_RADIO_ATTR_INDEX, idx)) - goto nla_put_failure; - -+ if (r->antenna_mask && -+ nla_put_u32(msg, NL80211_WIPHY_RADIO_ATTR_ANTENNA_MASK, -+ r->antenna_mask)) -+ goto nla_put_failure; -+ - for (i = 0; i < r->n_freq_range; i++) { - const struct wiphy_radio_freq_range *range = &r->freq_range[i]; - diff --git a/package/kernel/mac80211/patches/subsys/341-wifi-mac80211-fix-vif-addr-when-switching-from-monit.patch b/package/kernel/mac80211/patches/subsys/341-wifi-mac80211-fix-vif-addr-when-switching-from-monit.patch deleted file mode 100644 index f4cfc95aa3b..00000000000 --- a/package/kernel/mac80211/patches/subsys/341-wifi-mac80211-fix-vif-addr-when-switching-from-monit.patch +++ /dev/null @@ -1,63 +0,0 @@ -From: Felix Fietkau -Date: Fri, 15 Nov 2024 12:28:43 +0100 -Subject: [PATCH] wifi: mac80211: fix vif addr when switching from monitor - to station - -Since adding support for opting out of virtual monitor support, a zero vif -addr was used to indicate passive vs active monitor to the driver. -This would break the vif->addr when changing the netdev mac address before -switching the interface from monitor to sta mode. -Fix the regression by adding a separate flag to indicate whether vif->addr -is valid. - -Reported-by: syzbot+9ea265d998de25ac6a46@syzkaller.appspotmail.com -Fixes: 9d40f7e32774 ("wifi: mac80211: add flag to opt out of virtual monitor support") -Signed-off-by: Felix Fietkau ---- - ---- a/include/net/mac80211.h -+++ b/include/net/mac80211.h -@@ -1972,6 +1972,8 @@ enum ieee80211_neg_ttlm_res { - * @neg_ttlm: negotiated TID to link mapping info. - * see &struct ieee80211_neg_ttlm. - * @addr: address of this interface -+ * @addr_valid: indicates if the address is actively used. Set to false for -+ * passive monitor interfaces, true in all other cases. - * @p2p: indicates whether this AP or STA interface is a p2p - * interface, i.e. a GO or p2p-sta respectively - * @netdev_features: tx netdev features supported by the hardware for this -@@ -2011,6 +2013,7 @@ struct ieee80211_vif { - u16 valid_links, active_links, dormant_links, suspended_links; - struct ieee80211_neg_ttlm neg_ttlm; - u8 addr[ETH_ALEN] __aligned(2); -+ bool addr_valid; - bool p2p; - - u8 cab_queue; ---- a/net/mac80211/iface.c -+++ b/net/mac80211/iface.c -@@ -279,13 +279,8 @@ static int _ieee80211_change_mac(struct - ret = eth_mac_addr(sdata->dev, sa); - - if (ret == 0) { -- if (check_dup) { -- memcpy(sdata->vif.addr, sa->sa_data, ETH_ALEN); -- ether_addr_copy(sdata->vif.bss_conf.addr, sdata->vif.addr); -- } else { -- memset(sdata->vif.addr, 0, ETH_ALEN); -- memset(sdata->vif.bss_conf.addr, 0, ETH_ALEN); -- } -+ memcpy(sdata->vif.addr, sa->sa_data, ETH_ALEN); -+ ether_addr_copy(sdata->vif.bss_conf.addr, sdata->vif.addr); - } - - /* Regardless of eth_mac_addr() return we still want to add the -@@ -1324,6 +1319,8 @@ int ieee80211_do_open(struct wireless_de - } - } - -+ sdata->vif.addr_valid = sdata->vif.type != NL80211_IFTYPE_MONITOR || -+ (sdata->u.mntr.flags & MONITOR_FLAG_ACTIVE); - switch (sdata->vif.type) { - case NL80211_IFTYPE_AP_VLAN: - /* no need to tell driver, but set carrier and chanctx */ diff --git a/package/kernel/mac80211/patches/subsys/350-mac80211-allow-scanning-while-on-radar-channel.patch b/package/kernel/mac80211/patches/subsys/350-mac80211-allow-scanning-while-on-radar-channel.patch index d469955a900..4c8531d3289 100644 --- a/package/kernel/mac80211/patches/subsys/350-mac80211-allow-scanning-while-on-radar-channel.patch +++ b/package/kernel/mac80211/patches/subsys/350-mac80211-allow-scanning-while-on-radar-channel.patch @@ -1,6 +1,6 @@ --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -3473,6 +3473,27 @@ static int ieee80211_set_bitrate_mask(st +@@ -3525,6 +3525,27 @@ static int ieee80211_set_bitrate_mask(st return 0; } @@ -28,7 +28,7 @@ static int ieee80211_start_radar_detection(struct wiphy *wiphy, struct net_device *dev, struct cfg80211_chan_def *chandef, -@@ -3486,7 +3507,7 @@ static int ieee80211_start_radar_detecti +@@ -3538,7 +3559,7 @@ static int ieee80211_start_radar_detecti lockdep_assert_wiphy(local->hw.wiphy); @@ -37,7 +37,7 @@ return -EBUSY; link_data = sdata_dereference(sdata->link[link_id], sdata); -@@ -3978,7 +3999,7 @@ __ieee80211_channel_switch(struct wiphy +@@ -4030,7 +4051,7 @@ __ieee80211_channel_switch(struct wiphy lockdep_assert_wiphy(local->hw.wiphy); @@ -48,7 +48,7 @@ if (sdata->wdev.links[link_id].cac_started) --- a/net/mac80211/chan.c +++ b/net/mac80211/chan.c -@@ -629,14 +629,24 @@ ieee80211_find_chanctx(struct ieee80211_ +@@ -644,14 +644,24 @@ ieee80211_find_chanctx(struct ieee80211_ return NULL; } @@ -77,7 +77,7 @@ --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h -@@ -1947,6 +1947,12 @@ int ieee80211_mesh_finish_csa(struct iee +@@ -1958,6 +1958,12 @@ int ieee80211_mesh_finish_csa(struct iee u64 *changed); /* scan/BSS handling */ @@ -90,7 +90,7 @@ void ieee80211_scan_work(struct wiphy *wiphy, struct wiphy_work *work); int ieee80211_request_ibss_scan(struct ieee80211_sub_if_data *sdata, const u8 *ssid, u8 ssid_len, -@@ -1985,6 +1991,7 @@ void ieee80211_sched_scan_stopped_work(s +@@ -1996,6 +2002,7 @@ void ieee80211_sched_scan_stopped_work(s /* off-channel/mgmt-tx */ void ieee80211_offchannel_stop_vifs(struct ieee80211_local *local); void ieee80211_offchannel_return(struct ieee80211_local *local); @@ -98,7 +98,7 @@ void ieee80211_roc_setup(struct ieee80211_local *local); void ieee80211_start_next_roc(struct ieee80211_local *local); void ieee80211_reconfig_roc(struct ieee80211_local *local); -@@ -2629,6 +2636,8 @@ bool ieee80211_chandef_s1g_oper(const st +@@ -2640,6 +2647,8 @@ bool ieee80211_chandef_s1g_oper(const st struct cfg80211_chan_def *chandef); void ieee80211_chandef_downgrade(struct cfg80211_chan_def *chandef, struct ieee80211_conn_settings *conn); @@ -107,7 +107,7 @@ static inline void ieee80211_chanreq_downgrade(struct ieee80211_chan_req *chanreq, struct ieee80211_conn_settings *conn) -@@ -2685,7 +2694,7 @@ void ieee80211_recalc_chanctx_min_def(st +@@ -2696,7 +2705,7 @@ void ieee80211_recalc_chanctx_min_def(st struct ieee80211_chanctx *ctx, struct ieee80211_link_data *rsvd_for, bool check_reserved); @@ -334,9 +334,9 @@ rcu_assign_pointer(local->scan_sdata, sdata); --- a/net/mac80211/util.c +++ b/net/mac80211/util.c -@@ -3644,6 +3644,23 @@ again: - WARN_ON_ONCE(!cfg80211_chandef_valid(c)); +@@ -877,6 +877,23 @@ struct wireless_dev *ieee80211_vif_to_wd } + EXPORT_SYMBOL_GPL(ieee80211_vif_to_wdev); +u32 ieee80211_chandef_radio_mask(struct ieee80211_local *local, + struct cfg80211_chan_def *chandef) @@ -356,11 +356,11 @@ +} + /* - * Returns true if smps_mode_new is strictly more restrictive than - * smps_mode_old. + * Nothing should have been stuffed into the workqueue during + * the suspend->resume cycle. Since we can't check each caller --- a/net/wireless/util.c +++ b/net/wireless/util.c -@@ -2911,6 +2911,9 @@ bool cfg80211_radio_chandef_valid(const +@@ -2907,6 +2907,9 @@ bool cfg80211_radio_chandef_valid(const { u32 freq, width; diff --git a/package/kernel/mac80211/patches/subsys/400-v6.16-wifi-mac80211-do-not-offer-a-mesh-path-if-forwarding.patch b/package/kernel/mac80211/patches/subsys/400-v6.16-wifi-mac80211-do-not-offer-a-mesh-path-if-forwarding.patch index 7c2c0b9f3fb..71ae00e0162 100644 --- a/package/kernel/mac80211/patches/subsys/400-v6.16-wifi-mac80211-do-not-offer-a-mesh-path-if-forwarding.patch +++ b/package/kernel/mac80211/patches/subsys/400-v6.16-wifi-mac80211-do-not-offer-a-mesh-path-if-forwarding.patch @@ -27,7 +27,7 @@ Reviewed-by: Rouven Czerwinski --- a/net/mac80211/mesh_hwmp.c +++ b/net/mac80211/mesh_hwmp.c -@@ -630,7 +630,7 @@ static void hwmp_preq_frame_process(stru +@@ -636,7 +636,7 @@ static void hwmp_preq_frame_process(stru mesh_path_add_gate(mpath); } rcu_read_unlock(); @@ -36,7 +36,7 @@ Reviewed-by: Rouven Czerwinski rcu_read_lock(); mpath = mesh_path_lookup(sdata, target_addr); if (mpath) { -@@ -648,6 +648,8 @@ static void hwmp_preq_frame_process(stru +@@ -654,6 +654,8 @@ static void hwmp_preq_frame_process(stru } } rcu_read_unlock(); @@ -45,7 +45,7 @@ Reviewed-by: Rouven Czerwinski } if (reply) { -@@ -665,7 +667,7 @@ static void hwmp_preq_frame_process(stru +@@ -671,7 +673,7 @@ static void hwmp_preq_frame_process(stru } } diff --git a/package/kernel/mt76/patches/003-wifi-mt76-link_id.patch b/package/kernel/mt76/patches/003-wifi-mt76-link_id.patch new file mode 100644 index 00000000000..494796f9793 --- /dev/null +++ b/package/kernel/mt76/patches/003-wifi-mt76-link_id.patch @@ -0,0 +1,34 @@ +--- a/mac80211.c ++++ b/mac80211.c +@@ -1702,7 +1702,7 @@ s8 mt76_get_power_bound(struct mt76_phy + EXPORT_SYMBOL_GPL(mt76_get_power_bound); + + int mt76_get_txpower(struct ieee80211_hw *hw, struct ieee80211_vif *vif, +- int *dbm) ++ unsigned int link_id, int *dbm) + { + struct mt76_phy *phy = mt76_vif_phy(hw, vif); + int n_chains, delta; +--- a/mt76.h ++++ b/mt76.h +@@ -1496,7 +1496,7 @@ int mt76_get_min_avg_rssi(struct mt76_de + s8 mt76_get_power_bound(struct mt76_phy *phy, s8 txpower); + + int mt76_get_txpower(struct ieee80211_hw *hw, struct ieee80211_vif *vif, +- int *dbm); ++ unsigned int link_id, int *dbm); + int mt76_init_sar_power(struct ieee80211_hw *hw, + const struct cfg80211_sar_specs *sar); + int mt76_get_sar_power(struct mt76_phy *phy, +--- a/mt7996/main.c ++++ b/mt7996/main.c +@@ -664,7 +664,8 @@ static void mt7996_configure_filter(stru + } + + static int +-mt7996_get_txpower(struct ieee80211_hw *hw, struct ieee80211_vif *vif, int *dbm) ++mt7996_get_txpower(struct ieee80211_hw *hw, struct ieee80211_vif *vif, ++ unsigned int link_id, int *dbm) + { + struct mt7996_vif *mvif = (struct mt7996_vif *)vif->drv_priv; + struct mt7996_phy *phy = mt7996_vif_link_phy(&mvif->deflink); diff --git a/package/kernel/rtl8812au-ct/patches/110-link_id.patch b/package/kernel/rtl8812au-ct/patches/110-link_id.patch new file mode 100644 index 00000000000..70121c27be4 --- /dev/null +++ b/package/kernel/rtl8812au-ct/patches/110-link_id.patch @@ -0,0 +1,11 @@ +--- a/os_dep/linux/ioctl_cfg80211.c ++++ b/os_dep/linux/ioctl_cfg80211.c +@@ -3183,7 +3183,7 @@ static int cfg80211_rtw_set_txpower(stru + + static int cfg80211_rtw_get_txpower(struct wiphy *wiphy, + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0)) +- struct wireless_dev *wdev, ++ struct wireless_dev *wdev, unsigned int link_id, + #endif + int *dbm) + {