Update backports to the latest 6.6 point release.
Signed-off-by: Robert Marko <robimarko@gmail.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
PKG_NAME:=mac80211
-PKG_VERSION:=6.5
-PKG_RELEASE:=2
-# PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.15.58/
+PKG_VERSION:=6.6.15
+PKG_RELEASE:=1
PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources/
-PKG_HASH:=908c22dceba185eab83caa5a1e58ce6b3ebdc58f099c3fd3e11c7352ebfab2d7
+PKG_HASH:=3bbc461121134fda9089c084a5eed577d05e7837a157edf9a3797937172a3ece
PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION)
/*
--- a/drivers/net/wireless/ath/ath5k/mac80211-ops.c
+++ b/drivers/net/wireless/ath/ath5k/mac80211-ops.c
-@@ -665,7 +665,7 @@ ath5k_get_survey(struct ieee80211_hw *hw
+@@ -664,7 +664,7 @@ ath5k_get_survey(struct ieee80211_hw *hw
ah->survey.time_rx += cc->rx_frame / div;
ah->survey.time_tx += cc->tx_frame / div;
}
+++ /dev/null
-From 72c8caf904aed2caed5d6e75233294b6159ddb5d Mon Sep 17 00:00:00 2001
-From: Aditya Kumar Singh <quic_adisi@quicinc.com>
-Date: Wed, 26 Jul 2023 10:16:24 +0530
-Subject: [PATCH 1/5] wifi: ath11k: fix band selection for ppdu received in
- channel 177 of 5 GHz
-
-5 GHz band channel 177 support was added with the commit e5e94d10c856 ("wifi:
-ath11k: add channel 177 into 5 GHz channel list"). However, during processing
-for the received ppdu in ath11k_dp_rx_h_ppdu(), channel number is checked only
-till 173. This leads to driver code checking for channel and then fetching the
-band from it which is extra effort since firmware has already given the channel
-number in the metadata.
-
-Fix this issue by checking the channel number till 177 since we support
-it now.
-
-Found via code review. Compile tested only.
-
-Fixes: e5e94d10c856 ("wifi: ath11k: add channel 177 into 5 GHz channel list")
-Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
-Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
-Link: https://lore.kernel.org/r/20230726044624.20507-1-quic_adisi@quicinc.com
----
- drivers/net/wireless/ath/ath11k/dp_rx.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/drivers/net/wireless/ath/ath11k/dp_rx.c
-+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
-@@ -2408,7 +2408,7 @@ static void ath11k_dp_rx_h_ppdu(struct a
- rx_status->freq = center_freq;
- } else if (channel_num >= 1 && channel_num <= 14) {
- rx_status->band = NL80211_BAND_2GHZ;
-- } else if (channel_num >= 36 && channel_num <= 173) {
-+ } else if (channel_num >= 36 && channel_num <= 177) {
- rx_status->band = NL80211_BAND_5GHZ;
- } else {
- spin_lock_bh(&ar->data_lock);
+++ /dev/null
-From 6f092c98dcfa1e4cf37d45f9b8e4d4a3cbeb79d4 Mon Sep 17 00:00:00 2001
-From: Dmitry Antipov <dmantipov@yandex.ru>
-Date: Wed, 26 Jul 2023 12:21:02 +0300
-Subject: [PATCH 2/5] wifi: ath11k: simplify
- ath11k_mac_validate_vht_he_fixed_rate_settings()
-
-In ath11k_mac_validate_vht_he_fixed_rate_settings() ar->ab->peers
-list is not altered so list_for_each_entry() should be safe.
-
-Compile tested only.
-
-Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
-Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
-Link: https://lore.kernel.org/r/20230726092113.78794-1-dmantipov@yandex.ru
----
- drivers/net/wireless/ath/ath11k/mac.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
---- a/drivers/net/wireless/ath/ath11k/mac.c
-+++ b/drivers/net/wireless/ath/ath11k/mac.c
-@@ -8258,7 +8258,7 @@ ath11k_mac_validate_vht_he_fixed_rate_se
- const struct cfg80211_bitrate_mask *mask)
- {
- bool he_fixed_rate = false, vht_fixed_rate = false;
-- struct ath11k_peer *peer, *tmp;
-+ struct ath11k_peer *peer;
- const u16 *vht_mcs_mask, *he_mcs_mask;
- struct ieee80211_link_sta *deflink;
- u8 vht_nss, he_nss;
-@@ -8281,7 +8281,7 @@ ath11k_mac_validate_vht_he_fixed_rate_se
-
- rcu_read_lock();
- spin_lock_bh(&ar->ab->base_lock);
-- list_for_each_entry_safe(peer, tmp, &ar->ab->peers, list) {
-+ list_for_each_entry(peer, &ar->ab->peers, list) {
- if (peer->sta) {
- deflink = &peer->sta->deflink;
-
+++ /dev/null
-From 011e5a3052a22d3758d17442bf0c04c68bf79bea Mon Sep 17 00:00:00 2001
-From: Seevalamuthu Mariappan <quic_seevalam@quicinc.com>
-Date: Wed, 26 Jul 2023 19:40:30 +0530
-Subject: [PATCH 3/5] wifi: ath11k: Split coldboot calibration hw_param
-
-QCN9074 enables coldboot calibration only in Factory Test Mode (FTM).
-Hence, split cold_boot_calib to two hw_params for mission and FTM
-mode.
-
-Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
-
-Signed-off-by: Seevalamuthu Mariappan <quic_seevalam@quicinc.com>
-Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>
-Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
-Link: https://lore.kernel.org/r/20230726141032.3061-2-quic_rajkbhag@quicinc.com
----
- drivers/net/wireless/ath/ath11k/ahb.c | 3 +--
- drivers/net/wireless/ath/ath11k/core.c | 36 ++++++++++++++++++++------
- drivers/net/wireless/ath/ath11k/core.h | 1 +
- drivers/net/wireless/ath/ath11k/hw.h | 3 ++-
- drivers/net/wireless/ath/ath11k/qmi.c | 6 ++---
- 5 files changed, 35 insertions(+), 14 deletions(-)
-
---- a/drivers/net/wireless/ath/ath11k/ahb.c
-+++ b/drivers/net/wireless/ath/ath11k/ahb.c
-@@ -422,8 +422,7 @@ static int ath11k_ahb_fwreset_from_cold_
- {
- int timeout;
-
-- if (ath11k_cold_boot_cal == 0 || ab->qmi.cal_done ||
-- ab->hw_params.cold_boot_calib == 0 ||
-+ if (!ath11k_core_coldboot_cal_support(ab) || ab->qmi.cal_done ||
- ab->hw_params.cbcal_restart_fw == 0)
- return 0;
-
---- a/drivers/net/wireless/ath/ath11k/core.c
-+++ b/drivers/net/wireless/ath/ath11k/core.c
-@@ -86,7 +86,8 @@ static const struct ath11k_hw_params ath
- .supports_shadow_regs = false,
- .idle_ps = false,
- .supports_sta_ps = false,
-- .cold_boot_calib = true,
-+ .coldboot_cal_mm = true,
-+ .coldboot_cal_ftm = true,
- .cbcal_restart_fw = true,
- .fw_mem_mode = 0,
- .num_vdevs = 16 + 1,
-@@ -167,7 +168,8 @@ static const struct ath11k_hw_params ath
- .supports_shadow_regs = false,
- .idle_ps = false,
- .supports_sta_ps = false,
-- .cold_boot_calib = true,
-+ .coldboot_cal_mm = true,
-+ .coldboot_cal_ftm = true,
- .cbcal_restart_fw = true,
- .fw_mem_mode = 0,
- .num_vdevs = 16 + 1,
-@@ -248,7 +250,8 @@ static const struct ath11k_hw_params ath
- .supports_shadow_regs = true,
- .idle_ps = true,
- .supports_sta_ps = true,
-- .cold_boot_calib = false,
-+ .coldboot_cal_mm = false,
-+ .coldboot_cal_ftm = false,
- .cbcal_restart_fw = false,
- .fw_mem_mode = 0,
- .num_vdevs = 16 + 1,
-@@ -332,7 +335,8 @@ static const struct ath11k_hw_params ath
- .supports_shadow_regs = false,
- .idle_ps = false,
- .supports_sta_ps = false,
-- .cold_boot_calib = false,
-+ .coldboot_cal_mm = false,
-+ .coldboot_cal_ftm = false,
- .cbcal_restart_fw = false,
- .fw_mem_mode = 2,
- .num_vdevs = 8,
-@@ -413,7 +417,8 @@ static const struct ath11k_hw_params ath
- .supports_shadow_regs = true,
- .idle_ps = true,
- .supports_sta_ps = true,
-- .cold_boot_calib = false,
-+ .coldboot_cal_mm = false,
-+ .coldboot_cal_ftm = false,
- .cbcal_restart_fw = false,
- .fw_mem_mode = 0,
- .num_vdevs = 16 + 1,
-@@ -495,7 +500,8 @@ static const struct ath11k_hw_params ath
- .supports_shadow_regs = true,
- .idle_ps = true,
- .supports_sta_ps = true,
-- .cold_boot_calib = false,
-+ .coldboot_cal_mm = false,
-+ .coldboot_cal_ftm = false,
- .cbcal_restart_fw = false,
- .fw_mem_mode = 0,
- .num_vdevs = 16 + 1,
-@@ -578,7 +584,8 @@ static const struct ath11k_hw_params ath
- .supports_shadow_regs = true,
- .idle_ps = true,
- .supports_sta_ps = true,
-- .cold_boot_calib = true,
-+ .coldboot_cal_mm = true,
-+ .coldboot_cal_ftm = true,
- .cbcal_restart_fw = false,
- .fw_mem_mode = 0,
- .num_vdevs = 16 + 1,
-@@ -667,7 +674,8 @@ static const struct ath11k_hw_params ath
- .supports_suspend = false,
- .hal_params = &ath11k_hw_hal_params_ipq8074,
- .single_pdev_only = false,
-- .cold_boot_calib = true,
-+ .coldboot_cal_mm = true,
-+ .coldboot_cal_ftm = true,
- .cbcal_restart_fw = true,
- .fix_l1ss = true,
- .supports_dynamic_smps_6ghz = false,
-@@ -749,6 +757,18 @@ void ath11k_fw_stats_free(struct ath11k_
- ath11k_fw_stats_bcn_free(&stats->bcn);
- }
-
-+bool ath11k_core_coldboot_cal_support(struct ath11k_base *ab)
-+{
-+ if (!ath11k_cold_boot_cal)
-+ return false;
-+
-+ if (ath11k_ftm_mode)
-+ return ab->hw_params.coldboot_cal_ftm;
-+
-+ else
-+ return ab->hw_params.coldboot_cal_mm;
-+}
-+
- int ath11k_core_suspend(struct ath11k_base *ab)
- {
- int ret;
---- a/drivers/net/wireless/ath/ath11k/core.h
-+++ b/drivers/net/wireless/ath/ath11k/core.h
-@@ -1186,6 +1186,7 @@ void ath11k_core_halt(struct ath11k *ar)
- int ath11k_core_resume(struct ath11k_base *ab);
- int ath11k_core_suspend(struct ath11k_base *ab);
- void ath11k_core_pre_reconfigure_recovery(struct ath11k_base *ab);
-+bool ath11k_core_coldboot_cal_support(struct ath11k_base *ab);
-
- const struct firmware *ath11k_core_firmware_request(struct ath11k_base *ab,
- const char *filename);
---- a/drivers/net/wireless/ath/ath11k/hw.h
-+++ b/drivers/net/wireless/ath/ath11k/hw.h
-@@ -187,7 +187,8 @@ struct ath11k_hw_params {
- bool supports_shadow_regs;
- bool idle_ps;
- bool supports_sta_ps;
-- bool cold_boot_calib;
-+ bool coldboot_cal_mm;
-+ bool coldboot_cal_ftm;
- bool cbcal_restart_fw;
- int fw_mem_mode;
- u32 num_vdevs;
---- a/drivers/net/wireless/ath/ath11k/qmi.c
-+++ b/drivers/net/wireless/ath/ath11k/qmi.c
-@@ -2079,7 +2079,7 @@ static int ath11k_qmi_assign_target_mem_
- return -EINVAL;
- }
-
-- if (ath11k_cold_boot_cal && ab->hw_params.cold_boot_calib) {
-+ if (ath11k_core_coldboot_cal_support(ab)) {
- if (hremote_node) {
- ab->qmi.target_mem[idx].paddr =
- res.start + host_ddr_sz;
-@@ -3209,8 +3209,8 @@ static void ath11k_qmi_driver_event_work
- break;
- }
-
-- if (ath11k_cold_boot_cal && ab->qmi.cal_done == 0 &&
-- ab->hw_params.cold_boot_calib) {
-+ if (ab->qmi.cal_done == 0 &&
-+ ath11k_core_coldboot_cal_support(ab)) {
- ath11k_qmi_process_coldboot_calibration(ab);
- } else {
- clear_bit(ATH11K_FLAG_CRASH_FLUSH,
+++ /dev/null
-From bdfc967bf5fcd762473a01d39edb81f1165ba290 Mon Sep 17 00:00:00 2001
-From: Anilkumar Kolli <quic_akolli@quicinc.com>
-Date: Wed, 26 Jul 2023 19:40:31 +0530
-Subject: [PATCH 4/5] wifi: ath11k: Add coldboot calibration support for
- QCN9074
-
-QCN9074 supports 6 GHz, which has increased number of channels
-compared to 5 GHz/2 GHz. So, to support coldboot calibration in
-QCN9074 ATH11K_COLD_BOOT_FW_RESET_DELAY extended to 60 seconds. To
-avoid code redundancy, fwreset_from_cold_boot moved to QMI and made
-common for both ahb and pci. Coldboot calibration is enabled only in
-FTM mode for QCN9074. QCN9074 requires firmware restart after coldboot,
-hence enable cbcal_restart_fw in hw_params.
-
-This support can be enabled/disabled using hw params for different
-hardware. Currently it is not enabled for QCA6390.
-
-Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
-
-Signed-off-by: Anilkumar Kolli <quic_akolli@quicinc.com>
-Signed-off-by: Seevalamuthu Mariappan <quic_seevalam@quicinc.com>
-Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>
-Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
-Link: https://lore.kernel.org/r/20230726141032.3061-3-quic_rajkbhag@quicinc.com
----
- drivers/net/wireless/ath/ath11k/ahb.c | 28 ++------------------------
- drivers/net/wireless/ath/ath11k/core.c | 4 ++--
- drivers/net/wireless/ath/ath11k/pci.c | 2 ++
- drivers/net/wireless/ath/ath11k/qmi.c | 28 ++++++++++++++++++++++++++
- drivers/net/wireless/ath/ath11k/qmi.h | 3 ++-
- 5 files changed, 36 insertions(+), 29 deletions(-)
-
---- a/drivers/net/wireless/ath/ath11k/ahb.c
-+++ b/drivers/net/wireless/ath/ath11k/ahb.c
-@@ -14,6 +14,7 @@
- #include "ahb.h"
- #include "debug.h"
- #include "hif.h"
-+#include "qmi.h"
- #include <linux/remoteproc.h>
- #include "pcic.h"
- #include <linux/soc/qcom/smem.h>
-@@ -418,31 +419,6 @@ static void ath11k_ahb_power_down(struct
- rproc_shutdown(ab_ahb->tgt_rproc);
- }
-
--static int ath11k_ahb_fwreset_from_cold_boot(struct ath11k_base *ab)
--{
-- int timeout;
--
-- if (!ath11k_core_coldboot_cal_support(ab) || ab->qmi.cal_done ||
-- ab->hw_params.cbcal_restart_fw == 0)
-- return 0;
--
-- ath11k_dbg(ab, ATH11K_DBG_AHB, "wait for cold boot done\n");
-- timeout = wait_event_timeout(ab->qmi.cold_boot_waitq,
-- (ab->qmi.cal_done == 1),
-- ATH11K_COLD_BOOT_FW_RESET_DELAY);
-- if (timeout <= 0) {
-- ath11k_cold_boot_cal = 0;
-- ath11k_warn(ab, "Coldboot Calibration failed timed out\n");
-- }
--
-- /* reset the firmware */
-- ath11k_ahb_power_down(ab);
-- ath11k_ahb_power_up(ab);
--
-- ath11k_dbg(ab, ATH11K_DBG_AHB, "exited from cold boot mode\n");
-- return 0;
--}
--
- static void ath11k_ahb_init_qmi_ce_config(struct ath11k_base *ab)
- {
- struct ath11k_qmi_ce_cfg *cfg = &ab->qmi.ce_cfg;
-@@ -1225,7 +1201,7 @@ static int ath11k_ahb_probe(struct platf
- goto err_ce_free;
- }
-
-- ath11k_ahb_fwreset_from_cold_boot(ab);
-+ ath11k_qmi_fwreset_from_cold_boot(ab);
-
- return 0;
-
---- a/drivers/net/wireless/ath/ath11k/core.c
-+++ b/drivers/net/wireless/ath/ath11k/core.c
-@@ -336,8 +336,8 @@ static const struct ath11k_hw_params ath
- .idle_ps = false,
- .supports_sta_ps = false,
- .coldboot_cal_mm = false,
-- .coldboot_cal_ftm = false,
-- .cbcal_restart_fw = false,
-+ .coldboot_cal_ftm = true,
-+ .cbcal_restart_fw = true,
- .fw_mem_mode = 2,
- .num_vdevs = 8,
- .num_peers = 128,
---- a/drivers/net/wireless/ath/ath11k/pci.c
-+++ b/drivers/net/wireless/ath/ath11k/pci.c
-@@ -15,6 +15,7 @@
- #include "mhi.h"
- #include "debug.h"
- #include "pcic.h"
-+#include "qmi.h"
-
- #define ATH11K_PCI_BAR_NUM 0
- #define ATH11K_PCI_DMA_MASK 32
-@@ -897,6 +898,7 @@ unsupported_wcn6855_soc:
- ath11k_err(ab, "failed to init core: %d\n", ret);
- goto err_irq_affinity_cleanup;
- }
-+ ath11k_qmi_fwreset_from_cold_boot(ab);
- return 0;
-
- err_irq_affinity_cleanup:
---- a/drivers/net/wireless/ath/ath11k/qmi.c
-+++ b/drivers/net/wireless/ath/ath11k/qmi.c
-@@ -9,6 +9,7 @@
- #include "qmi.h"
- #include "core.h"
- #include "debug.h"
-+#include "hif.h"
- #include <linux/of.h>
- #include <linux/of_address.h>
- #include <linux/ioport.h>
-@@ -2839,6 +2840,33 @@ int ath11k_qmi_firmware_start(struct ath
- return 0;
- }
-
-+int ath11k_qmi_fwreset_from_cold_boot(struct ath11k_base *ab)
-+{
-+ int timeout;
-+
-+ if (!ath11k_core_coldboot_cal_support(ab) || ab->qmi.cal_done ||
-+ ab->hw_params.cbcal_restart_fw == 0)
-+ return 0;
-+
-+ ath11k_dbg(ab, ATH11K_DBG_QMI, "wait for cold boot done\n");
-+
-+ timeout = wait_event_timeout(ab->qmi.cold_boot_waitq,
-+ (ab->qmi.cal_done == 1),
-+ ATH11K_COLD_BOOT_FW_RESET_DELAY);
-+
-+ if (timeout <= 0) {
-+ ath11k_warn(ab, "Coldboot Calibration timed out\n");
-+ return -ETIMEDOUT;
-+ }
-+
-+ /* reset the firmware */
-+ ath11k_hif_power_down(ab);
-+ ath11k_hif_power_up(ab);
-+ ath11k_dbg(ab, ATH11K_DBG_QMI, "exit wait for cold boot done\n");
-+ return 0;
-+}
-+EXPORT_SYMBOL(ath11k_qmi_fwreset_from_cold_boot);
-+
- static int ath11k_qmi_process_coldboot_calibration(struct ath11k_base *ab)
- {
- int timeout;
---- a/drivers/net/wireless/ath/ath11k/qmi.h
-+++ b/drivers/net/wireless/ath/ath11k/qmi.h
-@@ -37,7 +37,7 @@
-
- #define QMI_WLANFW_MAX_DATA_SIZE_V01 6144
- #define ATH11K_FIRMWARE_MODE_OFF 4
--#define ATH11K_COLD_BOOT_FW_RESET_DELAY (40 * HZ)
-+#define ATH11K_COLD_BOOT_FW_RESET_DELAY (60 * HZ)
-
- #define ATH11K_QMI_DEVICE_BAR_SIZE 0x200000
-
-@@ -519,5 +519,6 @@ void ath11k_qmi_msg_recv_work(struct wor
- void ath11k_qmi_deinit_service(struct ath11k_base *ab);
- int ath11k_qmi_init_service(struct ath11k_base *ab);
- void ath11k_qmi_free_resource(struct ath11k_base *ab);
-+int ath11k_qmi_fwreset_from_cold_boot(struct ath11k_base *ab);
-
- #endif
+++ /dev/null
-From 13329d0cb7212b058bd8451a99d215a8f97645ea Mon Sep 17 00:00:00 2001
-From: Seevalamuthu Mariappan <quic_seevalam@quicinc.com>
-Date: Wed, 26 Jul 2023 19:40:32 +0530
-Subject: [PATCH 5/5] wifi: ath11k: Remove cal_done check during probe
-
-In some race conditions, calibration done QMI message is received even
-before host wait starts for calibration to be done.
-Due to this, resetting firmware was not performed after calibration.
-
-Hence, remove cal_done check in ath11k_qmi_fwreset_from_cold_boot()
-as this is called only from probe.
-
-Tested-on: QCN9074 hw1.0 PCI WLAN.HK.2.7.0.1-01744-QCAHKSWPL_SILICONZ-1
-
-Signed-off-by: Seevalamuthu Mariappan <quic_seevalam@quicinc.com>
-Signed-off-by: Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>
-Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
-Link: https://lore.kernel.org/r/20230726141032.3061-4-quic_rajkbhag@quicinc.com
----
- drivers/net/wireless/ath/ath11k/qmi.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/drivers/net/wireless/ath/ath11k/qmi.c
-+++ b/drivers/net/wireless/ath/ath11k/qmi.c
-@@ -2844,7 +2844,7 @@ int ath11k_qmi_fwreset_from_cold_boot(st
- {
- int timeout;
-
-- if (!ath11k_core_coldboot_cal_support(ab) || ab->qmi.cal_done ||
-+ if (!ath11k_core_coldboot_cal_support(ab) ||
- ab->hw_params.cbcal_restart_fw == 0)
- return 0;
-
+++ /dev/null
-From 400ece6c7f346b0a30867bd00b03b5b2563d4357 Mon Sep 17 00:00:00 2001
-From: Sven Eckelmann <sven@narfation.org>
-Date: Tue, 22 Aug 2023 16:42:24 +0300
-Subject: [PATCH] wifi: ath11k: Don't drop tx_status when peer cannot be found
-
-When a station idles for a long time, hostapd will try to send a QoS Null
-frame to the station as "poll". NL80211_CMD_PROBE_CLIENT is used for this
-purpose. And the skb will be added to ack_status_frame - waiting for a
-completion via ieee80211_report_ack_skb().
-
-But when the peer was already removed before the tx_complete arrives, the
-peer will be missing. And when using dev_kfree_skb_any (instead of going
-through mac80211), the entry will stay inside ack_status_frames. This IDR
-will therefore run full after 8K request were generated for such clients.
-At this point, the access point will then just stall and not allow any new
-clients because idr_alloc() for ack_status_frame will fail.
-
-ieee80211_free_txskb() on the other hand will (when required) call
-ieee80211_report_ack_skb() and make sure that (when required) remove the
-entry from the ack_status_frame.
-
-Tested-on: IPQ6018 hw1.0 WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
-
-Fixes: 6257c702264c ("wifi: ath11k: fix tx status reporting in encap offload mode")
-Fixes: 94739d45c388 ("ath11k: switch to using ieee80211_tx_status_ext()")
-Cc: stable@vger.kernel.org
-Signed-off-by: Sven Eckelmann <sven@narfation.org>
-Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
-Link: https://lore.kernel.org/r/20230802-ath11k-ack_status_leak-v2-1-c0af729d6229@narfation.org
----
- drivers/net/wireless/ath/ath11k/dp_tx.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
---- a/drivers/net/wireless/ath/ath11k/dp_tx.c
-+++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
-@@ -369,7 +369,7 @@ ath11k_dp_tx_htt_tx_complete_buf(struct
- "dp_tx: failed to find the peer with peer_id %d\n",
- ts->peer_id);
- spin_unlock_bh(&ab->base_lock);
-- dev_kfree_skb_any(msdu);
-+ ieee80211_free_txskb(ar->hw, msdu);
- return;
- }
- spin_unlock_bh(&ab->base_lock);
-@@ -624,7 +624,7 @@ static void ath11k_dp_tx_complete_msdu(s
- "dp_tx: failed to find the peer with peer_id %d\n",
- ts->peer_id);
- spin_unlock_bh(&ab->base_lock);
-- dev_kfree_skb_any(msdu);
-+ ieee80211_free_txskb(ar->hw, msdu);
- return;
- }
- arsta = (struct ath11k_sta *)peer->sta->drv_priv;
+++ /dev/null
-From 29d15589f084d71a4ea8c544039c5839db0236e2 Mon Sep 17 00:00:00 2001
-From: Sven Eckelmann <sven@narfation.org>
-Date: Tue, 22 Aug 2023 16:42:24 +0300
-Subject: [PATCH] wifi: ath11k: Cleanup mac80211 references on failure during
- tx_complete
-
-When a function is using functions from mac80211 to free an skb then it
-should do it consistently and not switch to the generic dev_kfree_skb_any
-(or similar functions). Otherwise (like in the error handlers), mac80211
-will will not be aware of the freed skb and thus not clean up related
-information in its internal data structures.
-
-Not doing so lead in the past to filled up structure which then prevented
-new clients to connect.
-
-Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
-Fixes: 6257c702264c ("wifi: ath11k: fix tx status reporting in encap offload mode")
-Cc: stable@vger.kernel.org
-Signed-off-by: Sven Eckelmann <sven@narfation.org>
-Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
-Link: https://lore.kernel.org/r/20230802-ath11k-ack_status_leak-v2-2-c0af729d6229@narfation.org
----
- drivers/net/wireless/ath/ath11k/dp_tx.c | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
---- a/drivers/net/wireless/ath/ath11k/dp_tx.c
-+++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
-@@ -344,7 +344,7 @@ ath11k_dp_tx_htt_tx_complete_buf(struct
- dma_unmap_single(ab->dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE);
-
- if (!skb_cb->vif) {
-- dev_kfree_skb_any(msdu);
-+ ieee80211_free_txskb(ar->hw, msdu);
- return;
- }
-
-@@ -566,12 +566,12 @@ static void ath11k_dp_tx_complete_msdu(s
- dma_unmap_single(ab->dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE);
-
- if (unlikely(!rcu_access_pointer(ab->pdevs_active[ar->pdev_idx]))) {
-- dev_kfree_skb_any(msdu);
-+ ieee80211_free_txskb(ar->hw, msdu);
- return;
- }
-
- if (unlikely(!skb_cb->vif)) {
-- dev_kfree_skb_any(msdu);
-+ ieee80211_free_txskb(ar->hw, msdu);
- return;
- }
-
+++ /dev/null
-From 9476cda44c136089f14f8951ae5197d63e91735c Mon Sep 17 00:00:00 2001
-From: Jeff Johnson <quic_jjohnson@quicinc.com>
-Date: Mon, 21 Aug 2023 07:13:36 -0700
-Subject: [PATCH] wifi: ath11k: Consistently use ath11k_vif_to_arvif()
-
-Helper function ath11k_vif_to_arvif() exists to retrieve a struct
-ath11k_vif from a struct ieee80211_vif. However, in multiple places
-this logic is open-coded with inline typecasting. Since the
-typecasting prevents the compiler from type-checking the source and
-destination, update the driver to consistently use the helper
-function.
-
-No functional changes, compile tested only.
-
-Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
-Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
-Link: https://lore.kernel.org/r/20230821-ath11k_vif_to_arvif-v1-1-fa2c3b60b5cf@quicinc.com
----
- drivers/net/wireless/ath/ath11k/mac.c | 64 +++++++++++-----------
- drivers/net/wireless/ath/ath11k/testmode.c | 2 +-
- 2 files changed, 33 insertions(+), 33 deletions(-)
-
---- a/drivers/net/wireless/ath/ath11k/mac.c
-+++ b/drivers/net/wireless/ath/ath11k/mac.c
-@@ -566,7 +566,7 @@ static void ath11k_get_arvif_iter(void *
- struct ieee80211_vif *vif)
- {
- struct ath11k_vif_iter *arvif_iter = data;
-- struct ath11k_vif *arvif = (void *)vif->drv_priv;
-+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
-
- if (arvif->vdev_id == arvif_iter->vdev_id)
- arvif_iter->arvif = arvif;
-@@ -1464,7 +1464,7 @@ static int ath11k_mac_setup_bcn_tmpl_ema
- u32 params = 0;
- u8 i = 0;
-
-- tx_arvif = (void *)arvif->vif->mbssid_tx_vif->drv_priv;
-+ tx_arvif = ath11k_vif_to_arvif(arvif->vif->mbssid_tx_vif);
-
- beacons = ieee80211_beacon_get_template_ema_list(tx_arvif->ar->hw,
- tx_arvif->vif, 0);
-@@ -1520,8 +1520,8 @@ static int ath11k_mac_setup_bcn_tmpl_mbs
- struct sk_buff *bcn;
- int ret;
-
-- if (arvif->vif->mbssid_tx_vif) {
-- tx_arvif = (void *)arvif->vif->mbssid_tx_vif->drv_priv;
-+ if (vif->mbssid_tx_vif) {
-+ tx_arvif = ath11k_vif_to_arvif(vif->mbssid_tx_vif);
- if (tx_arvif != arvif) {
- ar = tx_arvif->ar;
- ab = ar->ab;
-@@ -1562,7 +1562,7 @@ static int ath11k_mac_setup_bcn_tmpl(str
- * non-transmitting interfaces, and results in a crash if sent.
- */
- if (vif->mbssid_tx_vif &&
-- arvif != (void *)vif->mbssid_tx_vif->drv_priv && arvif->is_up)
-+ arvif != ath11k_vif_to_arvif(vif->mbssid_tx_vif) && arvif->is_up)
- return 0;
-
- if (vif->bss_conf.ema_ap && vif->mbssid_tx_vif)
-@@ -1626,7 +1626,7 @@ static void ath11k_control_beaconing(str
- ether_addr_copy(arvif->bssid, info->bssid);
-
- if (arvif->vif->mbssid_tx_vif)
-- tx_arvif = (struct ath11k_vif *)arvif->vif->mbssid_tx_vif->drv_priv;
-+ tx_arvif = ath11k_vif_to_arvif(arvif->vif->mbssid_tx_vif);
-
- ret = ath11k_wmi_vdev_up(arvif->ar, arvif->vdev_id, arvif->aid,
- arvif->bssid,
-@@ -1649,7 +1649,7 @@ static void ath11k_mac_handle_beacon_ite
- {
- struct sk_buff *skb = data;
- struct ieee80211_mgmt *mgmt = (void *)skb->data;
-- struct ath11k_vif *arvif = (void *)vif->drv_priv;
-+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
-
- if (vif->type != NL80211_IFTYPE_STATION)
- return;
-@@ -1672,7 +1672,7 @@ static void ath11k_mac_handle_beacon_mis
- struct ieee80211_vif *vif)
- {
- u32 *vdev_id = data;
-- struct ath11k_vif *arvif = (void *)vif->drv_priv;
-+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
- struct ath11k *ar = arvif->ar;
- struct ieee80211_hw *hw = ar->hw;
-
-@@ -1718,7 +1718,7 @@ static void ath11k_peer_assoc_h_basic(st
- struct ieee80211_sta *sta,
- struct peer_assoc_params *arg)
- {
-- struct ath11k_vif *arvif = (void *)vif->drv_priv;
-+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
- u32 aid;
-
- lockdep_assert_held(&ar->conf_mutex);
-@@ -1746,7 +1746,7 @@ static void ath11k_peer_assoc_h_crypto(s
- struct ieee80211_bss_conf *info = &vif->bss_conf;
- struct cfg80211_chan_def def;
- struct cfg80211_bss *bss;
-- struct ath11k_vif *arvif = (struct ath11k_vif *)vif->drv_priv;
-+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
- const u8 *rsnie = NULL;
- const u8 *wpaie = NULL;
-
-@@ -1804,7 +1804,7 @@ static void ath11k_peer_assoc_h_rates(st
- struct ieee80211_sta *sta,
- struct peer_assoc_params *arg)
- {
-- struct ath11k_vif *arvif = (void *)vif->drv_priv;
-+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
- struct wmi_rate_set_arg *rateset = &arg->peer_legacy_rates;
- struct cfg80211_chan_def def;
- const struct ieee80211_supported_band *sband;
-@@ -1867,7 +1867,7 @@ static void ath11k_peer_assoc_h_ht(struc
- struct peer_assoc_params *arg)
- {
- const struct ieee80211_sta_ht_cap *ht_cap = &sta->deflink.ht_cap;
-- struct ath11k_vif *arvif = (void *)vif->drv_priv;
-+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
- struct cfg80211_chan_def def;
- enum nl80211_band band;
- const u8 *ht_mcs_mask;
-@@ -2064,7 +2064,7 @@ static void ath11k_peer_assoc_h_vht(stru
- struct peer_assoc_params *arg)
- {
- const struct ieee80211_sta_vht_cap *vht_cap = &sta->deflink.vht_cap;
-- struct ath11k_vif *arvif = (void *)vif->drv_priv;
-+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
- struct cfg80211_chan_def def;
- enum nl80211_band band;
- u16 *vht_mcs_mask;
-@@ -2261,7 +2261,7 @@ static void ath11k_peer_assoc_h_he(struc
- struct ieee80211_sta *sta,
- struct peer_assoc_params *arg)
- {
-- struct ath11k_vif *arvif = (void *)vif->drv_priv;
-+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
- struct cfg80211_chan_def def;
- const struct ieee80211_sta_he_cap *he_cap = &sta->deflink.he_cap;
- enum nl80211_band band;
-@@ -2584,7 +2584,7 @@ static void ath11k_peer_assoc_h_qos(stru
- struct ieee80211_sta *sta,
- struct peer_assoc_params *arg)
- {
-- struct ath11k_vif *arvif = (void *)vif->drv_priv;
-+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
-
- switch (arvif->vdev_type) {
- case WMI_VDEV_TYPE_AP:
-@@ -2747,7 +2747,7 @@ static void ath11k_peer_assoc_h_phymode(
- struct ieee80211_sta *sta,
- struct peer_assoc_params *arg)
- {
-- struct ath11k_vif *arvif = (void *)vif->drv_priv;
-+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
- struct cfg80211_chan_def def;
- enum nl80211_band band;
- const u8 *ht_mcs_mask;
-@@ -2933,7 +2933,7 @@ static bool ath11k_mac_vif_recalc_sta_he
- struct ieee80211_vif *vif,
- struct ieee80211_sta_he_cap *he_cap)
- {
-- struct ath11k_vif *arvif = (void *)vif->drv_priv;
-+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
- struct ieee80211_he_cap_elem he_cap_elem = {0};
- struct ieee80211_sta_he_cap *cap_band = NULL;
- struct cfg80211_chan_def def;
-@@ -2995,7 +2995,7 @@ static void ath11k_bss_assoc(struct ieee
- struct ieee80211_bss_conf *bss_conf)
- {
- struct ath11k *ar = hw->priv;
-- struct ath11k_vif *arvif = (void *)vif->drv_priv;
-+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
- struct peer_assoc_params peer_arg;
- struct ieee80211_sta *ap_sta;
- struct ath11k_peer *peer;
-@@ -3111,7 +3111,7 @@ static void ath11k_bss_disassoc(struct i
- struct ieee80211_vif *vif)
- {
- struct ath11k *ar = hw->priv;
-- struct ath11k_vif *arvif = (void *)vif->drv_priv;
-+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
- int ret;
-
- lockdep_assert_held(&ar->conf_mutex);
-@@ -3160,7 +3160,7 @@ static void ath11k_recalculate_mgmt_rate
- struct ieee80211_vif *vif,
- struct cfg80211_chan_def *def)
- {
-- struct ath11k_vif *arvif = (void *)vif->drv_priv;
-+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
- const struct ieee80211_supported_band *sband;
- u8 basic_rate_idx;
- int hw_rate_code;
-@@ -4632,7 +4632,7 @@ static int ath11k_station_disassoc(struc
- struct ieee80211_vif *vif,
- struct ieee80211_sta *sta)
- {
-- struct ath11k_vif *arvif = (void *)vif->drv_priv;
-+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
- int ret = 0;
-
- lockdep_assert_held(&ar->conf_mutex);
-@@ -5160,7 +5160,7 @@ static int ath11k_mac_op_sta_set_txpwr(s
- struct ieee80211_sta *sta)
- {
- struct ath11k *ar = hw->priv;
-- struct ath11k_vif *arvif = (void *)vif->drv_priv;
-+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
- int ret = 0;
- s16 txpwr;
-
-@@ -5210,7 +5210,7 @@ static void ath11k_mac_op_sta_rc_update(
- {
- struct ath11k *ar = hw->priv;
- struct ath11k_sta *arsta = (struct ath11k_sta *)sta->drv_priv;
-- struct ath11k_vif *arvif = (void *)vif->drv_priv;
-+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
- struct ath11k_peer *peer;
- u32 bw, smps;
-
-@@ -5337,7 +5337,7 @@ static int ath11k_mac_op_conf_tx(struct
- const struct ieee80211_tx_queue_params *params)
- {
- struct ath11k *ar = hw->priv;
-- struct ath11k_vif *arvif = (void *)vif->drv_priv;
-+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
- struct wmi_wmm_params_arg *p = NULL;
- int ret;
-
-@@ -6458,7 +6458,7 @@ static int ath11k_mac_setup_vdev_params_
- return 0;
- }
-
-- tx_arvif = (void *)tx_vif->drv_priv;
-+ tx_arvif = ath11k_vif_to_arvif(tx_vif);
-
- if (arvif->vif->bss_conf.nontransmitted) {
- if (ar->hw->wiphy != ieee80211_vif_to_wdev(tx_vif)->wiphy)
-@@ -7411,7 +7411,7 @@ ath11k_mac_update_vif_chan(struct ath11k
- /* TODO: Update ar->rx_channel */
-
- for (i = 0; i < n_vifs; i++) {
-- arvif = (void *)vifs[i].vif->drv_priv;
-+ arvif = ath11k_vif_to_arvif(vifs[i].vif);
-
- if (WARN_ON(!arvif->is_started))
- continue;
-@@ -7453,7 +7453,7 @@ ath11k_mac_update_vif_chan(struct ath11k
-
- mbssid_tx_vif = arvif->vif->mbssid_tx_vif;
- if (mbssid_tx_vif)
-- tx_arvif = (struct ath11k_vif *)mbssid_tx_vif->drv_priv;
-+ tx_arvif = ath11k_vif_to_arvif(mbssid_tx_vif);
-
- ret = ath11k_wmi_vdev_up(arvif->ar, arvif->vdev_id, arvif->aid,
- arvif->bssid,
-@@ -7549,7 +7549,7 @@ static int ath11k_start_vdev_delay(struc
- {
- struct ath11k *ar = hw->priv;
- struct ath11k_base *ab = ar->ab;
-- struct ath11k_vif *arvif = (void *)vif->drv_priv;
-+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
- int ret;
-
- if (WARN_ON(arvif->is_started))
-@@ -7599,7 +7599,7 @@ ath11k_mac_op_assign_vif_chanctx(struct
- {
- struct ath11k *ar = hw->priv;
- struct ath11k_base *ab = ar->ab;
-- struct ath11k_vif *arvif = (void *)vif->drv_priv;
-+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
- int ret;
- struct peer_create_params param;
-
-@@ -7689,7 +7689,7 @@ ath11k_mac_op_unassign_vif_chanctx(struc
- {
- struct ath11k *ar = hw->priv;
- struct ath11k_base *ab = ar->ab;
-- struct ath11k_vif *arvif = (void *)vif->drv_priv;
-+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
- struct ath11k_peer *peer;
- int ret;
-
-@@ -8310,7 +8310,7 @@ ath11k_mac_op_set_bitrate_mask(struct ie
- struct ieee80211_vif *vif,
- const struct cfg80211_bitrate_mask *mask)
- {
-- struct ath11k_vif *arvif = (void *)vif->drv_priv;
-+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
- struct cfg80211_chan_def def;
- struct ath11k_pdev_cap *cap;
- struct ath11k *ar = arvif->ar;
-@@ -8907,7 +8907,7 @@ static int ath11k_mac_op_remain_on_chann
- enum ieee80211_roc_type type)
- {
- struct ath11k *ar = hw->priv;
-- struct ath11k_vif *arvif = (void *)vif->drv_priv;
-+ struct ath11k_vif *arvif = ath11k_vif_to_arvif(vif);
- struct scan_req_params arg;
- int ret;
- u32 scan_time_msec;
---- a/drivers/net/wireless/ath/ath11k/testmode.c
-+++ b/drivers/net/wireless/ath/ath11k/testmode.c
-@@ -350,7 +350,7 @@ static int ath11k_tm_cmd_wmi(struct ath1
- if (ar->ab->fw_mode != ATH11K_FIRMWARE_MODE_FTM &&
- (tag == WMI_TAG_VDEV_SET_PARAM_CMD || tag == WMI_TAG_UNIT_TEST_CMD)) {
- if (vif) {
-- arvif = (struct ath11k_vif *)vif->drv_priv;
-+ arvif = ath11k_vif_to_arvif(vif);
- *ptr = arvif->vdev_id;
- } else {
- ret = -EINVAL;
+++ /dev/null
-From d68a283bfc39aeed2a51c67804e014bf4b35c7e1 Mon Sep 17 00:00:00 2001
-From: Jeff Johnson <quic_jjohnson@quicinc.com>
-Date: Tue, 22 Aug 2023 07:50:49 -0700
-Subject: [PATCH] wifi: ath11k: Fix a few spelling errors
-
-Fix a few issues flagged by 'codespell'.
-
-Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
-Acked-by: Randy Dunlap <rdunlap@infradead.org>
-Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
-Link: https://lore.kernel.org/r/20230822-ath_spelling-v1-2-8e2698759564@quicinc.com
----
- drivers/net/wireless/ath/ath11k/dp.h | 2 +-
- drivers/net/wireless/ath/ath11k/dp_rx.c | 2 +-
- drivers/net/wireless/ath/ath11k/dp_tx.c | 2 +-
- 3 files changed, 3 insertions(+), 3 deletions(-)
-
---- a/drivers/net/wireless/ath/ath11k/dp.h
-+++ b/drivers/net/wireless/ath/ath11k/dp.h
-@@ -635,7 +635,7 @@ enum htt_ppdu_stats_tag_type {
- * b'24 - status_swap: 1 is to swap status TLV
- * b'25 - pkt_swap: 1 is to swap packet TLV
- * b'26:31 - rsvd1: reserved for future use
-- * dword1 - b'0:16 - ring_buffer_size: size of bufferes referenced by rx ring,
-+ * dword1 - b'0:16 - ring_buffer_size: size of buffers referenced by rx ring,
- * in byte units.
- * Valid only for HW_TO_SW_RING and SW_TO_HW_RING
- * - b'16:31 - rsvd2: Reserved for future use
---- a/drivers/net/wireless/ath/ath11k/dp_rx.c
-+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
-@@ -3423,7 +3423,7 @@ static int ath11k_dp_rx_h_defrag_reo_rei
- ath11k_hal_rx_buf_addr_info_set(msdu0, paddr, cookie,
- ab->hw_params.hal_params->rx_buf_rbm);
-
-- /* Fill mpdu details into reo entrace ring */
-+ /* Fill mpdu details into reo entrance ring */
- srng = &ab->hal.srng_list[ab->dp.reo_reinject_ring.ring_id];
-
- spin_lock_bh(&srng->lock);
---- a/drivers/net/wireless/ath/ath11k/dp_tx.c
-+++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
-@@ -238,7 +238,7 @@ tcl_ring_sel:
- spin_unlock_bh(&tcl_ring->lock);
- ret = -ENOMEM;
-
-- /* Checking for available tcl descritors in another ring in
-+ /* Checking for available tcl descriptors in another ring in
- * case of failure due to full tcl ring now, is better than
- * checking this ring earlier for each pkt tx.
- * Restart ring selection if some rings are not checked yet.
+++ /dev/null
-From 749a660b39030bfbacc366cd8670df2ee0e878b2 Mon Sep 17 00:00:00 2001
-From: Yang Yingliang <yangyingliang@huawei.com>
-Date: Fri, 4 Aug 2023 17:12:55 +0800
-Subject: [PATCH] wifi: ath11k: simplify the code with module_platform_driver
-
-The init/exit() of driver only calls platform_driver_register/unregister,
-it can be simpilfied with module_platform_driver.
-
-Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
-Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
-Link: https://lore.kernel.org/r/20230804091255.1347178-1-yangyingliang@huawei.com
----
- drivers/net/wireless/ath/ath11k/ahb.c | 12 +-----------
- 1 file changed, 1 insertion(+), 11 deletions(-)
-
---- a/drivers/net/wireless/ath/ath11k/ahb.c
-+++ b/drivers/net/wireless/ath/ath11k/ahb.c
-@@ -1306,17 +1306,7 @@ static struct platform_driver ath11k_ahb
- .shutdown = ath11k_ahb_shutdown,
- };
-
--static int ath11k_ahb_init(void)
--{
-- return platform_driver_register(&ath11k_ahb_driver);
--}
--module_init(ath11k_ahb_init);
--
--static void ath11k_ahb_exit(void)
--{
-- platform_driver_unregister(&ath11k_ahb_driver);
--}
--module_exit(ath11k_ahb_exit);
-+module_platform_driver(ath11k_ahb_driver);
-
- MODULE_DESCRIPTION("Driver support for Qualcomm Technologies 802.11ax WLAN AHB devices");
- MODULE_LICENSE("Dual BSD/GPL");
+++ /dev/null
-From 6763ef191d672ff3c2db0622652d49b0c0a60c4a Mon Sep 17 00:00:00 2001
-From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
-Date: Thu, 10 Aug 2023 11:12:23 +0200
-Subject: [PATCH] wifi: ath11k: fix Wvoid-pointer-to-enum-cast warning
-
-'hw_rev' is an enum, thus cast of pointer on 64-bit compile test with W=1
-causes:
-
- h11k/ahb.c:1124:11: error: cast to smaller integer type 'enum ath11k_hw_rev' from 'const void *' [-Werror,-Wvoid-pointer-to-enum-cast]
-
-Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
-Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
-Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
-Link: https://lore.kernel.org/r/20230810091224.70088-1-krzysztof.kozlowski@linaro.org
----
- drivers/net/wireless/ath/ath11k/ahb.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/drivers/net/wireless/ath/ath11k/ahb.c
-+++ b/drivers/net/wireless/ath/ath11k/ahb.c
-@@ -1096,7 +1096,7 @@ static int ath11k_ahb_probe(struct platf
- return -EINVAL;
- }
-
-- hw_rev = (enum ath11k_hw_rev)of_id->data;
-+ hw_rev = (uintptr_t)of_id->data;
-
- switch (hw_rev) {
- case ATH11K_HW_IPQ8074:
+++ /dev/null
-From adb0b206709f4f2f1256a1ea20619ab98e99f2e7 Mon Sep 17 00:00:00 2001
-From: Yue Haibing <yuehaibing@huawei.com>
-Date: Fri, 11 Aug 2023 18:44:13 +0800
-Subject: [PATCH] wifi: ath11k: Remove unused declarations
-
-Commit 2c3960c2253d ("ath11k: setup ce tasklet for control path")
-declared but never implemented ath11k_ce_map_service_to_pipe().
-Commit e3396b8bddd2 ("ath11k: ce: support different CE configurations")
-declared but never implemented ath11k_ce_attr_attach().
-Commit d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
-declared but never implemented ath11k_qmi_event_work()/ath11k_qmi_msg_recv_work().
-
-Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
-Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
-Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
-Link: https://lore.kernel.org/r/20230811104413.33668-1-yuehaibing@huawei.com
----
- drivers/net/wireless/ath/ath11k/ce.h | 3 ---
- drivers/net/wireless/ath/ath11k/qmi.h | 2 --
- 2 files changed, 5 deletions(-)
-
---- a/drivers/net/wireless/ath/ath11k/ce.h
-+++ b/drivers/net/wireless/ath/ath11k/ce.h
-@@ -203,9 +203,6 @@ int ath11k_ce_alloc_pipes(struct ath11k_
- void ath11k_ce_free_pipes(struct ath11k_base *ab);
- int ath11k_ce_get_attr_flags(struct ath11k_base *ab, int ce_id);
- void ath11k_ce_poll_send_completed(struct ath11k_base *ab, u8 pipe_id);
--int ath11k_ce_map_service_to_pipe(struct ath11k_base *ab, u16 service_id,
-- u8 *ul_pipe, u8 *dl_pipe);
--int ath11k_ce_attr_attach(struct ath11k_base *ab);
- void ath11k_ce_get_shadow_config(struct ath11k_base *ab,
- u32 **shadow_cfg, u32 *shadow_cfg_len);
- void ath11k_ce_stop_shadow_timers(struct ath11k_base *ab);
---- a/drivers/net/wireless/ath/ath11k/qmi.h
-+++ b/drivers/net/wireless/ath/ath11k/qmi.h
-@@ -514,8 +514,6 @@ struct qmi_wlanfw_wlan_ini_resp_msg_v01
- int ath11k_qmi_firmware_start(struct ath11k_base *ab,
- u32 mode);
- void ath11k_qmi_firmware_stop(struct ath11k_base *ab);
--void ath11k_qmi_event_work(struct work_struct *work);
--void ath11k_qmi_msg_recv_work(struct work_struct *work);
- void ath11k_qmi_deinit_service(struct ath11k_base *ab);
- int ath11k_qmi_init_service(struct ath11k_base *ab);
- void ath11k_qmi_free_resource(struct ath11k_base *ab);
+++ /dev/null
-From 39564b475ac5a589e6c22c43a08cbd283c295d2c Mon Sep 17 00:00:00 2001
-From: Baochen Qiang <quic_bqiang@quicinc.com>
-Date: Thu, 7 Sep 2023 09:56:06 +0800
-Subject: [PATCH] wifi: ath11k: fix boot failure with one MSI vector
-
-Commit 5b32b6dd96633 ("ath11k: Remove core PCI references from
-PCI common code") breaks with one MSI vector because it moves
-affinity setting after IRQ request, see below log:
-
-[ 1417.278835] ath11k_pci 0000:02:00.0: failed to receive control response completion, polling..
-[ 1418.302829] ath11k_pci 0000:02:00.0: Service connect timeout
-[ 1418.302833] ath11k_pci 0000:02:00.0: failed to connect to HTT: -110
-[ 1418.303669] ath11k_pci 0000:02:00.0: failed to start core: -110
-
-The detail is, if do affinity request after IRQ activated,
-which is done in request_irq(), kernel caches that request and
-returns success directly. Later when a subsequent MHI interrupt is
-fired, kernel will do the real affinity setting work, as a result,
-changs the MSI vector. However at that time host has configured
-old vector to hardware, so host never receives CE or DP interrupts.
-
-Fix it by setting affinity before registering MHI controller
-where host is, for the first time, doing IRQ request.
-
-Tested-on: WCN6855 hw2.0 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3
-Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.23
-Tested-on: WCN6750 hw1.0 AHB WLAN.MSL.1.0.1-01160-QCAMSLSWPLZ-1
-
-Fixes: 5b32b6dd9663 ("ath11k: Remove core PCI references from PCI common code")
-Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
-Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
-Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
-Link: https://lore.kernel.org/r/20230907015606.16297-1-quic_bqiang@quicinc.com
----
- drivers/net/wireless/ath/ath11k/pci.c | 24 ++++++++++++------------
- 1 file changed, 12 insertions(+), 12 deletions(-)
-
---- a/drivers/net/wireless/ath/ath11k/pci.c
-+++ b/drivers/net/wireless/ath/ath11k/pci.c
-@@ -852,10 +852,16 @@ unsupported_wcn6855_soc:
- if (ret)
- goto err_pci_disable_msi;
-
-+ ret = ath11k_pci_set_irq_affinity_hint(ab_pci, cpumask_of(0));
-+ if (ret) {
-+ ath11k_err(ab, "failed to set irq affinity %d\n", ret);
-+ goto err_pci_disable_msi;
-+ }
-+
- ret = ath11k_mhi_register(ab_pci);
- if (ret) {
- ath11k_err(ab, "failed to register mhi: %d\n", ret);
-- goto err_pci_disable_msi;
-+ goto err_irq_affinity_cleanup;
- }
-
- ret = ath11k_hal_srng_init(ab);
-@@ -876,12 +882,6 @@ unsupported_wcn6855_soc:
- goto err_ce_free;
- }
-
-- ret = ath11k_pci_set_irq_affinity_hint(ab_pci, cpumask_of(0));
-- if (ret) {
-- ath11k_err(ab, "failed to set irq affinity %d\n", ret);
-- goto err_free_irq;
-- }
--
- /* kernel may allocate a dummy vector before request_irq and
- * then allocate a real vector when request_irq is called.
- * So get msi_data here again to avoid spurious interrupt
-@@ -890,20 +890,17 @@ unsupported_wcn6855_soc:
- ret = ath11k_pci_config_msi_data(ab_pci);
- if (ret) {
- ath11k_err(ab, "failed to config msi_data: %d\n", ret);
-- goto err_irq_affinity_cleanup;
-+ goto err_free_irq;
- }
-
- ret = ath11k_core_init(ab);
- if (ret) {
- ath11k_err(ab, "failed to init core: %d\n", ret);
-- goto err_irq_affinity_cleanup;
-+ goto err_free_irq;
- }
- ath11k_qmi_fwreset_from_cold_boot(ab);
- return 0;
-
--err_irq_affinity_cleanup:
-- ath11k_pci_set_irq_affinity_hint(ab_pci, NULL);
--
- err_free_irq:
- ath11k_pcic_free_irq(ab);
-
-@@ -916,6 +913,9 @@ err_hal_srng_deinit:
- err_mhi_unregister:
- ath11k_mhi_unregister(ab_pci);
-
-+err_irq_affinity_cleanup:
-+ ath11k_pci_set_irq_affinity_hint(ab_pci, NULL);
-+
- err_pci_disable_msi:
- ath11k_pci_free_msi(ab_pci);
-
--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
-@@ -5094,13 +5094,6 @@ static void ath11k_dp_rx_mon_dest_proces
+@@ -5100,13 +5100,6 @@ static void ath11k_dp_rx_mon_dest_proces
mon_dst_srng = &ar->ab->hal.srng_list[ring_id];
switch (tag) {
case HTT_PPDU_STATS_TAG_COMMON:
-@@ -4486,8 +4486,7 @@ int ath11k_dp_rx_monitor_link_desc_retur
+@@ -4492,8 +4492,7 @@ int ath11k_dp_rx_monitor_link_desc_retur
src_srng_desc = ath11k_hal_srng_src_get_next_entry(ar->ab, hal_srng);
if (src_srng_desc) {
*src_desc = *((struct ath11k_buffer_addr *)p_last_buf_addr_info);
} else {
-@@ -4506,8 +4505,7 @@ void ath11k_dp_rx_mon_next_link_desc_get
+@@ -4512,8 +4511,7 @@ void ath11k_dp_rx_mon_next_link_desc_get
u8 *rbm,
void **pp_buf_addr_info)
{
struct ath11k_buffer_addr *buf_addr_info;
buf_addr_info = (struct ath11k_buffer_addr *)&msdu_link->buf_addr_info;
-@@ -4548,7 +4546,7 @@ static void ath11k_hal_rx_msdu_list_get(
+@@ -4554,7 +4552,7 @@ static void ath11k_hal_rx_msdu_list_get(
u32 first = FIELD_PREP(RX_MSDU_DESC_INFO0_FIRST_MSDU_IN_MPDU, 1);
u8 tmp = 0;
msdu_details = &msdu_link->msdu_link[0];
for (i = 0; i < HAL_RX_NUM_MSDU_DESC; i++) {
-@@ -4645,8 +4643,7 @@ ath11k_dp_rx_mon_mpdu_pop(struct ath11k
+@@ -4651,8 +4649,7 @@ ath11k_dp_rx_mon_mpdu_pop(struct ath11k
bool is_frag, is_first_msdu;
bool drop_mpdu = false;
struct ath11k_skb_rxcb *rxcb;
--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
-@@ -9060,6 +9060,14 @@ static int ath11k_mac_op_get_txpower(str
- if (ar->state != ATH11K_STATE_ON)
- goto err_fallback;
+@@ -9068,6 +9068,14 @@ static int ath11k_mac_op_get_txpower(str
+ return -EAGAIN;
+ }
+ /* Firmware doesn't provide Tx power during CAC hence no need to fetch
+ * the stats.
memset(&arsta->txrate, 0, sizeof(arsta->txrate));
-@@ -5242,7 +5242,7 @@ int ath11k_dp_rx_process_mon_status(stru
+@@ -5248,7 +5248,7 @@ int ath11k_dp_rx_process_mon_status(stru
goto next_skb;
}
/* debugfs: queues etc */
-@@ -997,6 +1088,8 @@ ath5k_debug_init_device(struct ath5k_hw
+@@ -995,6 +1086,8 @@ ath5k_debug_init_device(struct ath5k_hw
debugfs_create_file("queue", 0600, phydir, ah, &fops_queue);
debugfs_create_bool("32khz_clock", 0600, phydir,
&ah->ah_use_32khz_clock);
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
-@@ -1471,6 +1471,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);
void ath9k_cmn_debug_recv(struct dentry *debugfs_phy,
--- a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
-@@ -519,6 +519,7 @@ int ath9k_htc_init_debug(struct ath_hw *
+@@ -514,6 +514,7 @@ int ath9k_htc_init_debug(struct ath_hw *
ath9k_cmn_debug_base_eeprom(priv->debug.debugfs_phy, priv->ah);
ath9k_cmn_debug_modal_eeprom(priv->debug.debugfs_phy, priv->ah);
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
-@@ -1472,6 +1472,7 @@ int ath9k_init_debug(struct ath_hw *ah)
+@@ -1432,6 +1432,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);
+EXPORT_SYMBOL(ath9k_cmn_debug_chanbw);
--- a/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_debug.c
-@@ -520,6 +520,7 @@ int ath9k_htc_init_debug(struct ath_hw *
+@@ -515,6 +515,7 @@ int ath9k_htc_init_debug(struct ath_hw *
ath9k_cmn_debug_base_eeprom(priv->debug.debugfs_phy, priv->ah);
ath9k_cmn_debug_modal_eeprom(priv->debug.debugfs_phy, priv->ah);
ath9k_cmn_debug_eeprom(priv->debug.debugfs_phy, priv->ah);
#endif
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
-@@ -128,6 +128,61 @@ static const struct file_operations fops
+@@ -123,6 +123,61 @@ static const struct file_operations fops
#define DMA_BUF_LEN 1024
static ssize_t read_file_ani(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
-@@ -1432,6 +1487,10 @@ int ath9k_init_debug(struct ath_hw *ah)
+@@ -1392,6 +1447,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);
--- a/drivers/net/wireless/ath/ath9k/debug.c
+++ b/drivers/net/wireless/ath/ath9k/debug.c
-@@ -1468,6 +1468,50 @@ void ath9k_deinit_debug(struct ath_softc
+@@ -1428,6 +1428,50 @@ void ath9k_deinit_debug(struct ath_softc
ath9k_cmn_spectral_deinit_debug(&sc->spec_priv);
}
int ath9k_init_debug(struct ath_hw *ah)
{
struct ath_common *common = ath9k_hw_common(ah);
-@@ -1491,6 +1535,8 @@ int ath9k_init_debug(struct ath_hw *ah)
+@@ -1451,6 +1495,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
--- a/local-symbols
+++ b/local-symbols
-@@ -491,43 +491,6 @@ USB_VL600=
+@@ -493,43 +493,6 @@ USB_VL600=
USB_NET_CH9200=
USB_NET_AQC111=
USB_RTL8153_ECM=
depends on CORDIC
--- a/Kconfig.local
+++ b/Kconfig.local
-@@ -1477,117 +1477,6 @@ config BACKPORTED_USB_NET_AQC111
+@@ -1483,117 +1483,6 @@ config BACKPORTED_USB_NET_AQC111
config BACKPORTED_USB_RTL8153_ECM
tristate
default USB_RTL8153_ECM
};
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
-@@ -17509,7 +17509,9 @@ static struct genl_family nl80211_fam __
+@@ -17551,7 +17551,9 @@ static struct genl_family nl80211_fam __
.n_ops = ARRAY_SIZE(nl80211_ops),
.small_ops = nl80211_small_ops,
.n_small_ops = ARRAY_SIZE(nl80211_small_ops),
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
-@@ -16400,8 +16400,7 @@ static u32 nl80211_internal_flags[] = {
+@@ -16442,8 +16442,7 @@ static u32 nl80211_internal_flags[] = {
#undef SELECTOR
};
struct genl_info *info)
{
struct cfg80211_registered_device *rdev = NULL;
-@@ -16502,8 +16501,7 @@ out_unlock:
+@@ -16544,8 +16543,7 @@ out_unlock:
return err;
}
--- 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
+@@ -1086,6 +1086,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);
adapter->cmd_wait_q.status = -1;
--- a/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
+++ b/drivers/net/wireless/marvell/mwifiex/uap_cmd.c
-@@ -794,7 +794,8 @@ int mwifiex_uap_prepare_cmd(struct mwifi
+@@ -802,7 +802,8 @@ int mwifiex_uap_prepare_cmd(struct mwifi
break;
default:
mwifiex_dbg(priv->adapter, ERROR,
+++ /dev/null
-From 186f2432741f6d28d86ff723ac7830446affddfc Mon Sep 17 00:00:00 2001
-From: Shiji Yang <yangshiji66@outlook.com>
-Date: Sat, 5 Aug 2023 17:17:28 +0800
-Subject: wifi: rt2x00: correct MAC_SYS_CTRL register RX mask in R-Calibration
-
-For MAC_SYS_CTRL register, Bit[2] controls MAC_TX_EN and Bit[3]
-controls MAC_RX_EN (Bit index starts from 0). Therefore, 0x08 is
-the correct mask for RX.
-
-Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
-Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
-Signed-off-by: Kalle Valo <kvalo@kernel.org>
-Link: https://lore.kernel.org/r/TYAP286MB03150B571B67B896A504AC34BC0EA@TYAP286MB0315.JPNP286.PROD.OUTLOOK.COM
----
- drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-@@ -8561,7 +8561,7 @@ static void rt2800_r_calibration(struct
- rt2x00_warn(rt2x00dev, "Wait MAC Tx Status to MAX !!!\n");
-
- maccfg = rt2800_register_read(rt2x00dev, MAC_SYS_CTRL);
-- maccfg &= (~0x04);
-+ maccfg &= (~0x08);
- rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, maccfg);
-
- if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev, MAC_STATUS_CFG_BBP_RF_BUSY_RX)))
+++ /dev/null
-From 821b5192c955144bd2f0aeea6cd153e1aedd16e1 Mon Sep 17 00:00:00 2001
-From: Shiji Yang <yangshiji66@outlook.com>
-Date: Fri, 11 Aug 2023 14:34:54 +0800
-Subject: wifi: rt2x00: limit MT7620 TX power based on eeprom calibration
-
-In the vendor driver, the current channel power is queried from
-EEPROM_TXPOWER_BG1 and EEPROM_TXPOWER_BG2. And then the mixed value
-will be written into the low half-word of the TX_ALC_CFG_0 register.
-The high half-word of the TX_ALC_CFG_0 is a fixed value 0x2f2f.
-
-We can't get the accurate TX power. Based on my tests and the new
-MediaTek mt76 driver source code, the real TX power is approximately
-equal to channel_power + (max) rate_power. Usually max rate_power is
-the gain of the OFDM 6M rate, which can be readed from the offset
-EEPROM_TXPOWER_BYRATE +1.
-
-Based on these eeprom values, this patch adds basic TX power control
-for the MT7620 and limits its maximum TX power. This can avoid the
-link speed decrease caused by chip overheating. rt2800_config_alc()
-function has also been renamed to rt2800_config_alc_rt6352() because
-it's only used by RT6352 (MT7620).
-
-Notice:
-It's still need some work to sync the max channel power to the user
-interface. This part is missing from the rt2x00 driver framework. If
-we set the power exceed the calibration value, it won't take effect.
-
-Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
-Acked-by: Stanislaw Gruszka <stf_xl@wp.pl>
-Signed-off-by: Kalle Valo <kvalo@kernel.org>
-Link: https://lore.kernel.org/r/TYAP286MB03159090ED14044215E59FD6BC10A@TYAP286MB0315.JPNP286.PROD.OUTLOOK.COM
----
- drivers/net/wireless/ralink/rt2x00/rt2800lib.c | 57 ++++++++++++++++++--------
- 1 file changed, 40 insertions(+), 17 deletions(-)
-
---- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
-@@ -3865,28 +3865,51 @@ static void rt2800_config_channel_rf7620
- }
- }
-
--static void rt2800_config_alc(struct rt2x00_dev *rt2x00dev,
-- struct ieee80211_channel *chan,
-- int power_level) {
-- u16 eeprom, target_power, max_power;
-+static void rt2800_config_alc_rt6352(struct rt2x00_dev *rt2x00dev,
-+ struct ieee80211_channel *chan,
-+ int power_level)
-+{
-+ int cur_channel = rt2x00dev->rf_channel;
-+ u16 eeprom, chan_power, rate_power, target_power;
-+ u16 tx_power[2];
-+ s8 *power_group[2];
- u32 mac_sys_ctrl;
-- u32 reg;
-+ u32 cnt, reg;
- u8 bbp;
-
-- /* hardware unit is 0.5dBm, limited to 23.5dBm */
-- power_level *= 2;
-- if (power_level > 0x2f)
-- power_level = 0x2f;
--
-- max_power = chan->max_power * 2;
-- if (max_power > 0x2f)
-- max_power = 0x2f;
-+ if (WARN_ON(cur_channel < 1 || cur_channel > 14))
-+ return;
-+
-+ /* get per chain power, 2 chains in total, unit is 0.5dBm */
-+ power_level = (power_level - 3) * 2;
-+
-+ /* We can't get the accurate TX power. Based on some tests, the real
-+ * TX power is approximately equal to channel_power + (max)rate_power.
-+ * Usually max rate_power is the gain of the OFDM 6M rate. The antenna
-+ * gain and externel PA gain are not included as we are unable to
-+ * obtain these values.
-+ */
-+ rate_power = rt2800_eeprom_read_from_array(rt2x00dev,
-+ EEPROM_TXPOWER_BYRATE, 1);
-+ rate_power &= 0x3f;
-+ power_level -= rate_power;
-+ if (power_level < 1)
-+ power_level = 1;
-+
-+ power_group[0] = rt2800_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_BG1);
-+ power_group[1] = rt2800_eeprom_addr(rt2x00dev, EEPROM_TXPOWER_BG2);
-+ for (cnt = 0; cnt < 2; cnt++) {
-+ chan_power = power_group[cnt][cur_channel - 1];
-+ if (chan_power >= 0x20 || chan_power == 0)
-+ chan_power = 0x10;
-+ tx_power[cnt] = power_level < chan_power ? power_level : chan_power;
-+ }
-
- reg = rt2800_register_read(rt2x00dev, TX_ALC_CFG_0);
-- rt2x00_set_field32(®, TX_ALC_CFG_0_CH_INIT_0, power_level);
-- rt2x00_set_field32(®, TX_ALC_CFG_0_CH_INIT_1, power_level);
-- rt2x00_set_field32(®, TX_ALC_CFG_0_LIMIT_0, max_power);
-- rt2x00_set_field32(®, TX_ALC_CFG_0_LIMIT_1, max_power);
-+ rt2x00_set_field32(®, TX_ALC_CFG_0_CH_INIT_0, tx_power[0]);
-+ rt2x00_set_field32(®, TX_ALC_CFG_0_CH_INIT_1, tx_power[1]);
-+ rt2x00_set_field32(®, TX_ALC_CFG_0_LIMIT_0, 0x2f);
-+ rt2x00_set_field32(®, TX_ALC_CFG_0_LIMIT_1, 0x2f);
-
- eeprom = rt2800_eeprom_read(rt2x00dev, EEPROM_NIC_CONF1);
- if (rt2x00_get_field16(eeprom, EEPROM_NIC_CONF1_INTERNAL_TX_ALC)) {
-@@ -5268,7 +5291,7 @@ static void rt2800_config_txpower_rt6352
- rt2x00_set_field32(&pwreg, TX_PWR_CFG_9B_STBC_MCS7, t);
- rt2800_register_write(rt2x00dev, TX_PWR_CFG_9, pwreg);
-
-- rt2800_config_alc(rt2x00dev, chan, power_level);
-+ rt2800_config_alc_rt6352(rt2x00dev, chan, power_level);
-
- /* TODO: temperature compensation code! */
- }
--- a/local-symbols
+++ b/local-symbols
-@@ -350,6 +350,7 @@ RT2X00_LIB_FIRMWARE=
+@@ -352,6 +352,7 @@ RT2X00_LIB_FIRMWARE=
RT2X00_LIB_CRYPTO=
RT2X00_LIB_LEDS=
RT2X00_LIB_DEBUGFS=
+++ /dev/null
-From ee0db868ee4d88493dfdc82f59e3b4e449ddddd5 Mon Sep 17 00:00:00 2001
-From: Oldřich Jedlička <oldium.pro@gmail.com>
-Date: Sat, 4 Nov 2023 15:13:33 +0100
-Subject: wifi: mac80211: do not pass AP_VLAN vif pointer to drivers during
- flush
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-[ Upstream commit 3e3a2b645c043f7e3e488d5011478cefb69bbe8b ]
-
-This fixes WARN_ONs when using AP_VLANs after station removal. The flush
-call passed AP_VLAN vif to driver, but because these vifs are virtual and
-not registered with drivers, we need to translate to the correct AP vif
-first.
-
-Closes: https://github.com/openwrt/openwrt/issues/12420
-Fixes: 0b75a1b1e42e ("wifi: mac80211: flush queues on STA removal")
-Fixes: d00800a289c9 ("wifi: mac80211: add flush_sta method")
-Tested-by: Konstantin Demin <rockdrilla@gmail.com>
-Tested-by: Koen Vandeputte <koen.vandeputte@citymesh.com>
-Signed-off-by: Oldřich Jedlička <oldium.pro@gmail.com>
-Link: https://lore.kernel.org/r/20231104141333.3710-1-oldium.pro@gmail.com
-Signed-off-by: Johannes Berg <johannes.berg@intel.com>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- net/mac80211/driver-ops.h | 9 +++++++--
- 1 file changed, 7 insertions(+), 2 deletions(-)
-
---- a/net/mac80211/driver-ops.h
-+++ b/net/mac80211/driver-ops.h
-@@ -23,7 +23,7 @@
- static inline struct ieee80211_sub_if_data *
- get_bss_sdata(struct ieee80211_sub_if_data *sdata)
- {
-- if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
-+ if (sdata && sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
- sdata = container_of(sdata->bss, struct ieee80211_sub_if_data,
- u.ap);
-
-@@ -638,10 +638,13 @@ static inline void drv_flush(struct ieee
- struct ieee80211_sub_if_data *sdata,
- u32 queues, bool drop)
- {
-- struct ieee80211_vif *vif = sdata ? &sdata->vif : NULL;
-+ struct ieee80211_vif *vif;
-
- might_sleep();
-
-+ sdata = get_bss_sdata(sdata);
-+ vif = sdata ? &sdata->vif : NULL;
-+
- if (sdata && !check_sdata_in_driver(sdata))
- return;
-
-@@ -657,6 +660,8 @@ static inline void drv_flush_sta(struct
- {
- might_sleep();
-
-+ sdata = get_bss_sdata(sdata);
-+
- if (sdata && !check_sdata_in_driver(sdata))
- return;
-
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
-@@ -1632,7 +1632,6 @@ static int ieee80211_stop_ap(struct wiph
+@@ -1635,7 +1635,6 @@ static int ieee80211_stop_ap(struct wiph
link_conf->bssid_indicator = 0;
__sta_info_flush(sdata, true);
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
-@@ -1396,24 +1396,6 @@ int ieee80211_register_hw(struct ieee802
+@@ -1393,24 +1393,6 @@ int ieee80211_register_hw(struct ieee802
debugfs_hw_add(local);
rate_control_add_debugfs(local);
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
-@@ -2843,6 +2843,8 @@ static int ieee80211_scan(struct wiphy *
+@@ -2847,6 +2847,8 @@ static int ieee80211_scan(struct wiphy *
*/
fallthrough;
case NL80211_IFTYPE_AP:
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
-@@ -558,6 +558,7 @@ __sta_info_alloc(struct ieee80211_sub_if
+@@ -561,6 +561,7 @@ __sta_info_alloc(struct ieee80211_sub_if
INIT_WORK(&sta->drv_deliver_wk, sta_deliver_ps_frames);
INIT_WORK(&sta->ampdu_mlme.work, ieee80211_ba_session_work);
mutex_init(&sta->ampdu_mlme.mtx);
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
-@@ -4059,7 +4059,7 @@ struct ieee80211_txq *ieee80211_next_txq
+@@ -4060,7 +4060,7 @@ struct ieee80211_txq *ieee80211_next_txq
if (deficit < 0)
sta->airtime[txqi->txq.ac].deficit +=
if (deficit < 0 || !aql_check) {
list_move_tail(&txqi->schedule_order,
-@@ -4202,7 +4202,8 @@ bool ieee80211_txq_may_transmit(struct i
+@@ -4203,7 +4203,8 @@ bool ieee80211_txq_may_transmit(struct i
}
sta = container_of(iter->txq.sta, struct sta_info, sta);
if (ieee80211_sta_deficit(sta, ac) < 0)
list_move_tail(&iter->schedule_order, &local->active_txqs[ac]);
}
-@@ -4210,7 +4211,7 @@ bool ieee80211_txq_may_transmit(struct i
+@@ -4211,7 +4212,7 @@ bool ieee80211_txq_may_transmit(struct i
if (sta->airtime[ac].deficit >= 0)
goto out;
struct ieee80211_fast_tx fast_tx;
u8 hdr[sizeof(struct ieee80211s_hdr) + sizeof(rfc1042_header)];
-@@ -334,7 +358,8 @@ void mesh_path_tx_root_frame(struct ieee
+@@ -333,7 +357,8 @@ void mesh_path_tx_root_frame(struct ieee
bool mesh_action_is_path_sel(struct ieee80211_mgmt *mgmt);
struct ieee80211_mesh_fast_tx *
+ ether_addr_copy(key.addr, addr);
cache = &sdata->u.mesh.tx_cache;
spin_lock_bh(&cache->walk_lock);
-- entry = rhashtable_lookup(&cache->rht, addr, fast_tx_rht_params);
+- entry = rhashtable_lookup_fast(&cache->rht, addr, fast_tx_rht_params);
- if (entry)
- mesh_fast_tx_entry_free(cache, entry);
+ for (i = MESH_FAST_TX_TYPE_LOCAL; i < MESH_FAST_TX_TYPE_FORWARDED; i++) {
+ key.type = i;
-+ entry = rhashtable_lookup(&cache->rht, &key, fast_tx_rht_params);
++ entry = rhashtable_lookup_fast(&cache->rht, &key, fast_tx_rht_params);
+ if (entry)
+ mesh_fast_tx_entry_free(cache, entry);
+ }
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
-@@ -2727,7 +2727,10 @@ ieee80211_rx_mesh_fast_forward(struct ie
+@@ -2726,7 +2726,10 @@ ieee80211_rx_mesh_fast_forward(struct ie
struct sk_buff *skb, int hdrlen)
{
struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
struct ieee80211s_hdr *mesh_hdr;
struct tid_ampdu_tx *tid_tx;
struct sta_info *sta;
-@@ -2736,9 +2739,13 @@ ieee80211_rx_mesh_fast_forward(struct ie
+@@ -2735,9 +2738,13 @@ ieee80211_rx_mesh_fast_forward(struct ie
mesh_hdr = (struct ieee80211s_hdr *)(skb->data + sizeof(eth));
if ((mesh_hdr->flags & MESH_FLAGS_AE) == MESH_FLAGS_AE_A5_A6)
+++ /dev/null
-From: Felix Fietkau <nbd@nbd.name>
-Date: Tue, 12 Sep 2023 15:09:27 +0200
-Subject: [PATCH] mac80211: fix mesh id corruption on 32 bit systems
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Since the changed field size was increased to u64, mesh_bss_info_changed
-pulls invalid bits from the first 3 bytes of the mesh id, clears them, and
-passes them on to ieee80211_link_info_change_notify, because
-ifmsh->mbss_changed was not updated to match its size.
-Fix this by turning into ifmsh->mbss_changed into an unsigned long array with
-64 bit size.
-
-Fixes: 15ddba5f4311 ("wifi: mac80211: consistently use u64 for BSS changes")
-Reported-by: Thomas Hühn <thomas.huehn@hs-nordhausen.de>
-Signed-off-by: Felix Fietkau <nbd@nbd.name>
----
-
---- a/net/mac80211/ieee80211_i.h
-+++ b/net/mac80211/ieee80211_i.h
-@@ -678,7 +678,7 @@ struct ieee80211_if_mesh {
- struct timer_list mesh_path_root_timer;
-
- unsigned long wrkq_flags;
-- unsigned long mbss_changed;
-+ unsigned long mbss_changed[64 / BITS_PER_LONG];
-
- bool userspace_handles_dfs;
-
---- a/net/mac80211/mesh.c
-+++ b/net/mac80211/mesh.c
-@@ -1181,7 +1181,7 @@ void ieee80211_mbss_info_change_notify(s
-
- /* if we race with running work, worst case this work becomes a noop */
- for_each_set_bit(bit, &bits, sizeof(changed) * BITS_PER_BYTE)
-- set_bit(bit, &ifmsh->mbss_changed);
-+ set_bit(bit, ifmsh->mbss_changed);
- set_bit(MESH_WORK_MBSS_CHANGED, &ifmsh->wrkq_flags);
- wiphy_work_queue(sdata->local->hw.wiphy, &sdata->work);
- }
-@@ -1263,7 +1263,7 @@ void ieee80211_stop_mesh(struct ieee8021
-
- /* clear any mesh work (for next join) we may have accrued */
- ifmsh->wrkq_flags = 0;
-- ifmsh->mbss_changed = 0;
-+ memset(ifmsh->mbss_changed, 0, sizeof(ifmsh->mbss_changed));
-
- local->fif_other_bss--;
- atomic_dec(&local->iff_allmultis);
-@@ -1730,9 +1730,9 @@ static void mesh_bss_info_changed(struct
- u32 bit;
- u64 changed = 0;
-
-- for_each_set_bit(bit, &ifmsh->mbss_changed,
-+ for_each_set_bit(bit, ifmsh->mbss_changed,
- sizeof(changed) * BITS_PER_BYTE) {
-- clear_bit(bit, &ifmsh->mbss_changed);
-+ clear_bit(bit, ifmsh->mbss_changed);
- changed |= BIT(bit);
- }
-
--- a/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-nvm-parse.c
-@@ -1075,8 +1075,8 @@ static void iwl_init_he_hw_capab(struct
+@@ -1078,8 +1078,8 @@ static void iwl_init_he_hw_capab(struct
memcpy(iftype_data, iwl_he_eht_capa, sizeof(iwl_he_eht_capa));
iwl_nvm_fixup_sband_iftd(trans, data, sband, &iftype_data[i],
--- a/drivers/net/wireless/mediatek/mt76/mt7915/init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7915/init.c
-@@ -1119,8 +1119,7 @@ void mt7915_set_stream_he_caps(struct mt
+@@ -1127,8 +1127,7 @@ void mt7915_set_stream_he_caps(struct mt
n = mt7915_init_he_caps(phy, NL80211_BAND_2GHZ, data);
band = &phy->mt76->sband_2g.sband;
}
if (phy->mt76->cap.has_5ghz) {
-@@ -1128,8 +1127,7 @@ void mt7915_set_stream_he_caps(struct mt
+@@ -1136,8 +1135,7 @@ void mt7915_set_stream_he_caps(struct mt
n = mt7915_init_he_caps(phy, NL80211_BAND_5GHZ, data);
band = &phy->mt76->sband_5g.sband;
}
if (phy->mt76->cap.has_6ghz) {
-@@ -1137,8 +1135,7 @@ void mt7915_set_stream_he_caps(struct mt
+@@ -1145,8 +1143,7 @@ void mt7915_set_stream_he_caps(struct mt
n = mt7915_init_he_caps(phy, NL80211_BAND_6GHZ, data);
band = &phy->mt76->sband_6g.sband;
}
--- a/drivers/net/wireless/mediatek/mt76/mt7996/init.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7996/init.c
-@@ -823,8 +823,7 @@ __mt7996_set_stream_he_eht_caps(struct m
+@@ -828,8 +828,7 @@ __mt7996_set_stream_he_eht_caps(struct m
n++;
}
kfree(wiphy->bands[band]->channels);
--- a/drivers/net/wireless/realtek/rtw89/core.c
+++ b/drivers/net/wireless/realtek/rtw89/core.c
-@@ -3328,8 +3328,7 @@ static void rtw89_init_he_cap(struct rtw
+@@ -3359,8 +3359,7 @@ static void rtw89_init_he_cap(struct rtw
idx++;
}
}
static int rtw89_core_set_supported_band(struct rtw89_dev *rtwdev)
-@@ -3374,11 +3373,11 @@ err:
+@@ -3405,11 +3404,11 @@ err:
hw->wiphy->bands[NL80211_BAND_5GHZ] = NULL;
hw->wiphy->bands[NL80211_BAND_6GHZ] = NULL;
if (sband_2ghz)
kfree(sband_2ghz);
kfree(sband_5ghz);
kfree(sband_6ghz);
-@@ -3390,11 +3389,11 @@ static void rtw89_core_clr_supported_ban
+@@ -3421,11 +3420,11 @@ static void rtw89_core_clr_supported_ban
struct ieee80211_hw *hw = rtwdev->hw;
if (hw->wiphy->bands[NL80211_BAND_2GHZ])
kfree(hw->wiphy->bands[NL80211_BAND_6GHZ]);
--- a/drivers/net/wireless/realtek/rtw89/regd.c
+++ b/drivers/net/wireless/realtek/rtw89/regd.c
-@@ -376,7 +376,7 @@ bottom:
+@@ -377,7 +377,7 @@ bottom:
return;
wiphy->bands[NL80211_BAND_6GHZ] = NULL;
--- a/drivers/net/wireless/virtual/mac80211_hwsim.c
+++ b/drivers/net/wireless/virtual/mac80211_hwsim.c
-@@ -4900,25 +4900,19 @@ static const struct ieee80211_sband_ifty
+@@ -4899,25 +4899,19 @@ static const struct ieee80211_sband_ifty
static void mac80211_hwsim_sband_capab(struct ieee80211_supported_band *sband)
{
}
--- a/net/mac80211/main.c
+++ b/net/mac80211/main.c
-@@ -1055,6 +1055,7 @@ int ieee80211_register_hw(struct ieee802
+@@ -1052,6 +1052,7 @@ int ieee80211_register_hw(struct ieee802
supp_he = false;
supp_eht = false;
for (band = 0; band < NUM_NL80211_BANDS; band++) {
struct ieee80211_supported_band *sband;
sband = local->hw.wiphy->bands[band];
-@@ -1101,11 +1102,7 @@ int ieee80211_register_hw(struct ieee802
+@@ -1098,11 +1099,7 @@ int ieee80211_register_hw(struct ieee802
supp_ht = supp_ht || sband->ht_cap.ht_supported;
supp_vht = supp_vht || sband->vht_cap.vht_supported;
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-@@ -817,6 +817,7 @@ int wiphy_register(struct wiphy *wiphy)
+@@ -819,6 +819,7 @@ int wiphy_register(struct wiphy *wiphy)
/* sanity check supported bands/channels */
for (band = 0; band < NUM_NL80211_BANDS; band++) {
u16 types = 0;
bool have_he = false;
-@@ -873,14 +874,11 @@ int wiphy_register(struct wiphy *wiphy)
+@@ -875,14 +876,11 @@ int wiphy_register(struct wiphy *wiphy)
return -EINVAL;
}
if (WARN_ON(types & iftd->types_mask))
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
-@@ -1906,20 +1906,20 @@ static int nl80211_send_band_rateinfo(st
+@@ -1907,20 +1907,20 @@ static int nl80211_send_band_rateinfo(st
struct nlattr *nl_iftype_data =
nla_nest_start_noflag(msg,
NL80211_BAND_ATTR_IFTYPE_DATA);
u32 center_freq, u32 bandwidth,
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
-@@ -469,29 +469,12 @@ int cfg80211_scan(struct cfg80211_regist
+@@ -476,29 +476,12 @@ int cfg80211_scan(struct cfg80211_regist
extern struct work_struct cfg80211_disconnect_work;
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
-@@ -911,6 +911,7 @@ static int sta_info_insert_finish(struct
+@@ -914,6 +914,7 @@ static int sta_info_insert_finish(struct
if (ieee80211_vif_is_mesh(&sdata->vif))
mesh_accept_plinks_update(sdata);
out_remove:
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
-@@ -3033,7 +3033,7 @@ void ieee80211_check_fast_xmit(struct st
+@@ -3034,7 +3034,7 @@ void ieee80211_check_fast_xmit(struct st
sdata->vif.type == NL80211_IFTYPE_STATION)
goto out;
{
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
-@@ -474,6 +474,8 @@ void cfg80211_set_dfs_state(struct wiphy
+@@ -481,6 +481,8 @@ void cfg80211_set_dfs_state(struct wiphy
enum nl80211_dfs_state dfs_state);
void cfg80211_dfs_channels_update_work(struct work_struct *work);
--- a/net/wireless/mlme.c
+++ b/net/wireless/mlme.c
-@@ -915,6 +915,8 @@ void cfg80211_dfs_channels_update_work(s
+@@ -930,6 +930,8 @@ void cfg80211_dfs_channels_update_work(s
if (c->dfs_state == NL80211_DFS_UNAVAILABLE) {
time_dfs_update = IEEE80211_DFS_MIN_NOP_TIME_MS;
radar_event = NL80211_RADAR_NOP_FINISHED;
} else {
if (regulatory_pre_cac_allowed(wiphy) ||
cfg80211_any_wiphy_oper_chan(wiphy, c))
-@@ -922,11 +924,10 @@ void cfg80211_dfs_channels_update_work(s
+@@ -937,11 +939,10 @@ void cfg80211_dfs_channels_update_work(s
time_dfs_update = REG_PRE_CAC_EXPIRY_GRACE_MS;
radar_event = NL80211_RADAR_PRE_CAC_EXPIRED;
--- a/net/wireless/core.c
+++ b/net/wireless/core.c
-@@ -649,21 +649,6 @@ static int wiphy_verify_combinations(str
+@@ -651,21 +651,6 @@ static int wiphy_verify_combinations(str
c->limits[j].max > 1))
return -EINVAL;
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
-@@ -2423,6 +2423,13 @@ static void sta_stats_decode_rate(struct
+@@ -2426,6 +2426,13 @@ static void sta_stats_decode_rate(struct
sband = local->hw.wiphy->bands[band];