mirror of
https://github.com/openwrt/openwrt.git
synced 2026-10-13 04:38:14 +04:00
mac80211: update to version 7.2
Refresh all patches. Drop the ones that are upstream now. Adapt the ath9k channel bandwidth debugfs patch to the removal of WIPHY_FLAG_SUPPORTS_5_10_MHZ, and the ath11k QCN6122 hw params to .max_tx_ring moving into struct ath11k_hw_hal_params as .num_tx_rings. Add build fixes for mwlwifi and mt76: the action code moved out of the per-type action frame structs into the common part of struct ieee80211_mgmt and the union lost its 'u' name, ieee80211_get_fils_discovery_tmpl() and ieee80211_get_unsol_bcast_probe_resp_tmpl() take a link id, and the EML capability defines were renamed. Signed-off-by: Felix Fietkau <nbd@nbd.name>
This commit is contained in:
1 parent
93cf01b0b6
commit
bf44cb5fb0
115 files changed
+705
-2918
No files matched your search
@@ -10,13 +10,13 @@ include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=mac80211
|
||||
|
||||
PKG_VERSION:=6.18.39
|
||||
PKG_RELEASE:=3
|
||||
PKG_VERSION:=7.2
|
||||
PKG_RELEASE:=1
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=COPYING
|
||||
|
||||
PKG_SOURCE_URL:=https://github.com/openwrt/backports/releases/download/backports-v$(PKG_VERSION)
|
||||
PKG_HASH:=8951c1e270d7c311432377bd50951cd1d5dee2b5fedf33d30db41aa8e428aeb0
|
||||
PKG_HASH:=6ec76a4cb0988b5382b2fc5053610a56ada90b8ef6a5a4f2807cd433badb9454
|
||||
|
||||
PKG_SOURCE:=backports-$(PKG_VERSION).tar.zst
|
||||
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/$(if $(BUILD_VARIANT),$(PKG_NAME)-$(BUILD_VARIANT)/)backports-$(PKG_VERSION)
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
help
|
||||
--- a/local-symbols
|
||||
+++ b/local-symbols
|
||||
@@ -91,6 +91,7 @@ ADM8211=
|
||||
@@ -93,6 +93,7 @@ ADM8211=
|
||||
ATH_COMMON=
|
||||
WLAN_VENDOR_ATH=
|
||||
ATH_DEBUG=
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/wireless/reg.c
|
||||
+++ b/net/wireless/reg.c
|
||||
@@ -3336,6 +3336,8 @@ void regulatory_hint_country_ie(struct w
|
||||
@@ -3352,6 +3352,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;
|
||||
@@ -3585,6 +3587,7 @@ static bool is_wiphy_all_set_reg_flag(en
|
||||
@@ -3601,6 +3603,7 @@ static bool is_wiphy_all_set_reg_flag(en
|
||||
|
||||
void regulatory_hint_disconnect(void)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/drivers/net/wireless/ath/ath10k/Kconfig
|
||||
+++ b/drivers/net/wireless/ath/ath10k/Kconfig
|
||||
@@ -94,6 +94,12 @@ config ATH10K_TRACING
|
||||
@@ -95,6 +95,12 @@ config ATH10K_TRACING
|
||||
help
|
||||
Select this to ath10k use tracing infrastructure.
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
void ath10k_thermal_event_temperature(struct ath10k *ar, int temperature);
|
||||
--- a/local-symbols
|
||||
+++ b/local-symbols
|
||||
@@ -151,6 +151,7 @@ ATH10K_DEBUG=
|
||||
@@ -153,6 +153,7 @@ ATH10K_DEBUG=
|
||||
ATH10K_DEBUGFS=
|
||||
ATH10K_LEDS=
|
||||
ATH10K_SPECTRAL=
|
||||
|
||||
@@ -14,7 +14,7 @@ Signed-off-by: Sven Eckelmann <sven@open-mesh.com>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath10k/core.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/core.c
|
||||
@@ -3583,6 +3583,16 @@ int ath10k_core_register(struct ath10k *
|
||||
@@ -3579,6 +3579,16 @@ int ath10k_core_register(struct ath10k *
|
||||
|
||||
queue_work(ar->workqueue, &ar->register_work);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/drivers/net/wireless/ath/ath10k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/mac.c
|
||||
@@ -9970,6 +9970,21 @@ static int ath10k_mac_init_rd(struct ath
|
||||
@@ -9968,6 +9968,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[] = {
|
||||
@@ -10332,6 +10347,12 @@ int ath10k_mac_register(struct ath10k *a
|
||||
@@ -10330,6 +10345,12 @@ int ath10k_mac_register(struct ath10k *a
|
||||
|
||||
ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER;
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ Signed-off-by: Mathias Kresin <dev@kresin.me>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath10k/core.h
|
||||
+++ b/drivers/net/wireless/ath/ath10k/core.h
|
||||
@@ -1320,6 +1320,10 @@ struct ath10k {
|
||||
@@ -1323,6 +1323,10 @@ struct ath10k {
|
||||
s32 tx_power_2g_limit;
|
||||
s32 tx_power_5g_limit;
|
||||
|
||||
@@ -29,18 +29,17 @@ Signed-off-by: Mathias Kresin <dev@kresin.me>
|
||||
};
|
||||
--- a/drivers/net/wireless/ath/ath10k/leds.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/leds.c
|
||||
@@ -69,7 +69,7 @@ int ath10k_leds_register(struct ath10k *
|
||||
@@ -64,6 +64,7 @@ int ath10k_leds_register(struct ath10k *
|
||||
|
||||
ar->leds.cdev.name = ar->leds.label;
|
||||
ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking;
|
||||
- ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger;
|
||||
+ ar->leds.cdev.default_trigger = ar->led_default_trigger;
|
||||
|
||||
ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &ar->leds.cdev);
|
||||
if (ret)
|
||||
--- a/drivers/net/wireless/ath/ath10k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/mac.c
|
||||
@@ -10348,7 +10348,7 @@ int ath10k_mac_register(struct ath10k *a
|
||||
@@ -10346,7 +10346,7 @@ int ath10k_mac_register(struct ath10k *a
|
||||
ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER;
|
||||
|
||||
#ifdef CPTCFG_MAC80211_LEDS
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
#include <linux/property.h>
|
||||
#include <linux/dmi.h>
|
||||
#include <linux/ctype.h>
|
||||
@@ -3455,6 +3456,8 @@ static int ath10k_core_probe_fw(struct a
|
||||
@@ -3451,6 +3452,8 @@ static int ath10k_core_probe_fw(struct a
|
||||
|
||||
device_get_mac_address(ar->dev, ar->mac_addr);
|
||||
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath10k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/mac.c
|
||||
@@ -10140,7 +10140,6 @@ int ath10k_mac_register(struct ath10k *a
|
||||
@@ -10138,7 +10138,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);
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
#define HTT_RX_RING_FILL_LEVEL_DUAL_MAC (HTT_RX_RING_SIZE - 1)
|
||||
--- a/drivers/net/wireless/ath/ath10k/pci.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/pci.c
|
||||
@@ -133,7 +133,11 @@ static const struct ce_attr pci_host_ce_
|
||||
@@ -132,7 +132,11 @@ static const struct ce_attr pci_host_ce_
|
||||
.flags = CE_ATTR_FLAGS,
|
||||
.src_nentries = 0,
|
||||
.src_sz_max = 2048,
|
||||
@@ -26,7 +26,7 @@
|
||||
.recv_cb = ath10k_pci_htt_htc_rx_cb,
|
||||
},
|
||||
|
||||
@@ -142,7 +146,11 @@ static const struct ce_attr pci_host_ce_
|
||||
@@ -141,7 +145,11 @@ static const struct ce_attr pci_host_ce_
|
||||
.flags = CE_ATTR_FLAGS,
|
||||
.src_nentries = 0,
|
||||
.src_sz_max = 2048,
|
||||
@@ -38,7 +38,7 @@
|
||||
.recv_cb = ath10k_pci_htc_rx_cb,
|
||||
},
|
||||
|
||||
@@ -169,7 +177,11 @@ static const struct ce_attr pci_host_ce_
|
||||
@@ -168,7 +176,11 @@ static const struct ce_attr pci_host_ce_
|
||||
.flags = CE_ATTR_FLAGS,
|
||||
.src_nentries = 0,
|
||||
.src_sz_max = 512,
|
||||
@@ -50,7 +50,7 @@
|
||||
.recv_cb = ath10k_pci_htt_rx_cb,
|
||||
},
|
||||
|
||||
@@ -194,7 +206,11 @@ static const struct ce_attr pci_host_ce_
|
||||
@@ -193,7 +205,11 @@ static const struct ce_attr pci_host_ce_
|
||||
.flags = CE_ATTR_FLAGS,
|
||||
.src_nentries = 0,
|
||||
.src_sz_max = 2048,
|
||||
|
||||
@@ -29,7 +29,7 @@ Tested-by: Florian Maurer <maurer@fh-aachen.de>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath10k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/mac.c
|
||||
@@ -8180,6 +8180,20 @@ static void ath10k_flush(struct ieee8021
|
||||
@@ -8179,6 +8179,20 @@ static void ath10k_flush(struct ieee8021
|
||||
mutex_unlock(&ar->conf_mutex);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ Tested-by: Florian Maurer <maurer@fh-aachen.de>
|
||||
/* TODO: Implement this function properly
|
||||
* For now it is needed to reply to Probe Requests in IBSS mode.
|
||||
* Probably we need this information from FW.
|
||||
@@ -9532,6 +9546,7 @@ static const struct ieee80211_ops ath10k
|
||||
@@ -9530,6 +9544,7 @@ static const struct ieee80211_ops ath10k
|
||||
.set_rts_threshold = ath10k_set_rts_threshold,
|
||||
.set_frag_threshold = ath10k_mac_op_set_frag_threshold,
|
||||
.flush = ath10k_flush,
|
||||
@@ -58,7 +58,7 @@ Tested-by: Florian Maurer <maurer@fh-aachen.de>
|
||||
.tx_last_beacon = ath10k_tx_last_beacon,
|
||||
.set_antenna = ath10k_set_antenna,
|
||||
.get_antenna = ath10k_get_antenna,
|
||||
@@ -10353,6 +10368,9 @@ int ath10k_mac_register(struct ath10k *a
|
||||
@@ -10351,6 +10366,9 @@ int ath10k_mac_register(struct ath10k *a
|
||||
if (!ar->hw_params.hw_ops->set_coverage_class)
|
||||
ar->ops->set_coverage_class = NULL;
|
||||
|
||||
|
||||
+4
-4
@@ -93,8 +93,8 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
default:
|
||||
return "UNKNOWN";
|
||||
}
|
||||
@@ -286,6 +316,9 @@ static void ath11k_mhi_op_status_cb(stru
|
||||
queue_work(ab->workqueue_aux, &ab->reset_work);
|
||||
@@ -288,6 +318,9 @@ static void ath11k_mhi_op_status_cb(stru
|
||||
spin_unlock_bh(&ab->base_lock);
|
||||
|
||||
break;
|
||||
+ case MHI_CB_EE_SBL_MODE:
|
||||
@@ -103,7 +103,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -293,22 +326,6 @@ static void ath11k_mhi_op_status_cb(stru
|
||||
@@ -295,22 +328,6 @@ static void ath11k_mhi_op_status_cb(stru
|
||||
ab_pci->mhi_pre_cb = cb;
|
||||
}
|
||||
|
||||
@@ -140,7 +140,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
int ath11k_mhi_register(struct ath11k_pci *ar_pci);
|
||||
--- a/drivers/net/wireless/ath/ath11k/pci.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/pci.c
|
||||
@@ -394,13 +394,20 @@ static void ath11k_pci_sw_reset(struct a
|
||||
@@ -398,13 +398,20 @@ static void ath11k_pci_sw_reset(struct a
|
||||
static void ath11k_pci_init_qmi_ce_config(struct ath11k_base *ab)
|
||||
{
|
||||
struct ath11k_qmi_ce_cfg *cfg = &ab->qmi.ce_cfg;
|
||||
|
||||
+2
-2
@@ -48,7 +48,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/qmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
|
||||
@@ -2039,8 +2039,8 @@ static int ath11k_qmi_alloc_target_mem_c
|
||||
@@ -2038,8 +2038,8 @@ static int ath11k_qmi_alloc_target_mem_c
|
||||
|
||||
static int ath11k_qmi_assign_target_mem_chunk(struct ath11k_base *ab)
|
||||
{
|
||||
@@ -58,7 +58,7 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
u32 host_ddr_sz;
|
||||
int i, idx, ret;
|
||||
|
||||
@@ -2086,7 +2086,7 @@ static int ath11k_qmi_assign_target_mem_
|
||||
@@ -2085,7 +2085,7 @@ static int ath11k_qmi_assign_target_mem_
|
||||
}
|
||||
|
||||
if (ath11k_core_coldboot_cal_support(ab)) {
|
||||
|
||||
+5
-5
@@ -10,7 +10,7 @@ Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/qmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
|
||||
@@ -2042,6 +2042,7 @@ static int ath11k_qmi_assign_target_mem_
|
||||
@@ -2041,6 +2041,7 @@ static int ath11k_qmi_assign_target_mem_
|
||||
struct resource res = DEFINE_RES_NAMED(0, 0, NULL, IORESOURCE_UNSET);
|
||||
struct device *dev = ab->dev;
|
||||
u32 host_ddr_sz;
|
||||
@@ -18,7 +18,7 @@ Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
|
||||
int i, idx, ret;
|
||||
|
||||
for (i = 0, idx = 0; i < ab->qmi.mem_seg_count; i++) {
|
||||
@@ -2073,7 +2074,9 @@ static int ath11k_qmi_assign_target_mem_
|
||||
@@ -2072,7 +2073,9 @@ static int ath11k_qmi_assign_target_mem_
|
||||
idx++;
|
||||
break;
|
||||
case BDF_MEM_REGION_TYPE:
|
||||
@@ -29,7 +29,7 @@ Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
|
||||
ab->qmi.target_mem[idx].iaddr = 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;
|
||||
@@ -2095,8 +2098,9 @@ static int ath11k_qmi_assign_target_mem_
|
||||
@@ -2094,8 +2097,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 <hzyitc@outlook.com>
|
||||
ab->qmi.target_mem[idx].iaddr = NULL;
|
||||
}
|
||||
} else {
|
||||
@@ -2302,6 +2306,7 @@ static int ath11k_qmi_load_file_target_m
|
||||
@@ -2301,6 +2305,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 <hzyitc@outlook.com>
|
||||
void __iomem *bdf_addr = NULL;
|
||||
int ret = 0;
|
||||
u32 remaining = len;
|
||||
@@ -2313,7 +2318,9 @@ static int ath11k_qmi_load_file_target_m
|
||||
@@ -2312,7 +2317,9 @@ static int ath11k_qmi_load_file_target_m
|
||||
memset(&resp, 0, sizeof(resp));
|
||||
|
||||
if (ab->hw_params.fixed_bdf_addr) {
|
||||
|
||||
+2
-2
@@ -31,7 +31,7 @@ Signed-off-by: Florian Maurer <f.maurer@outlook.de>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/mac.c
|
||||
@@ -8330,6 +8330,23 @@ static void ath11k_mac_op_flush(struct i
|
||||
@@ -8650,6 +8650,23 @@ static void ath11k_mac_op_flush(struct i
|
||||
ath11k_mac_flush_tx_complete(ar);
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ Signed-off-by: Florian Maurer <f.maurer@outlook.de>
|
||||
static bool
|
||||
ath11k_mac_has_single_legacy_rate(struct ath11k *ar,
|
||||
enum nl80211_band band,
|
||||
@@ -9920,6 +9937,7 @@ static const struct ieee80211_ops ath11k
|
||||
@@ -10100,6 +10117,7 @@ static const struct ieee80211_ops ath11k
|
||||
.set_bitrate_mask = ath11k_mac_op_set_bitrate_mask,
|
||||
.get_survey = ath11k_mac_op_get_survey,
|
||||
.flush = ath11k_mac_op_flush,
|
||||
|
||||
+8
-5
@@ -21,17 +21,20 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/Kconfig
|
||||
+++ b/drivers/net/wireless/ath/ath11k/Kconfig
|
||||
@@ -62,3 +62,10 @@ config ATH11K_SPECTRAL
|
||||
Enable ath11k spectral scan support
|
||||
@@ -62,6 +62,13 @@ config ATH11K_SPECTRAL
|
||||
|
||||
Say Y to enable access to the FFT/spectral data via debugfs.
|
||||
+
|
||||
|
||||
+config ATH11K_THERMAL
|
||||
+ bool "ath11k thermal sensors and throttling support"
|
||||
+ depends on ATH11K
|
||||
+ depends on THERMAL
|
||||
+ help
|
||||
+ Enable ath11k thermal sensors and throttling support.
|
||||
+
|
||||
config ATH11K_CFR
|
||||
bool "ath11k channel frequency response support"
|
||||
depends on ATH11K_DEBUGFS
|
||||
--- a/drivers/net/wireless/ath/ath11k/Makefile
|
||||
+++ b/drivers/net/wireless/ath/ath11k/Makefile
|
||||
@@ -24,7 +24,7 @@ ath11k-y += core.o \
|
||||
@@ -56,11 +59,11 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
int ath11k_thermal_set_throttling(struct ath11k *ar, u32 throttle_state);
|
||||
--- a/local-symbols
|
||||
+++ b/local-symbols
|
||||
@@ -163,6 +163,7 @@ ATH11K_DEBUG=
|
||||
@@ -165,6 +165,7 @@ ATH11K_DEBUG=
|
||||
ATH11K_DEBUGFS=
|
||||
ATH11K_TRACING=
|
||||
ATH11K_SPECTRAL=
|
||||
+ATH11K_THERMAL=
|
||||
ATH11K_CFR=
|
||||
ATH12K=
|
||||
ATH12K_AHB=
|
||||
ATH12K_DEBUG=
|
||||
+3
-3
@@ -22,7 +22,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/core.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/core.c
|
||||
@@ -39,7 +39,7 @@ bool ath11k_ftm_mode;
|
||||
@@ -38,7 +38,7 @@ bool ath11k_ftm_mode;
|
||||
module_param_named(ftm_mode, ath11k_ftm_mode, bool, 0444);
|
||||
MODULE_PARM_DESC(ftm_mode, "Boots up in factory test mode");
|
||||
|
||||
@@ -31,7 +31,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
{
|
||||
.hw_rev = ATH11K_HW_IPQ8074,
|
||||
.name = "ipq8074 hw2.0",
|
||||
@@ -2576,7 +2576,8 @@ static void ath11k_core_reset(struct wor
|
||||
@@ -2605,7 +2605,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 <robimarko@gmail.com>
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(ath11k_hw_params); i++) {
|
||||
hw_params = &ath11k_hw_params[i];
|
||||
@@ -2592,7 +2593,31 @@ static int ath11k_init_hw_params(struct
|
||||
@@ -2621,7 +2622,31 @@ static int ath11k_init_hw_params(struct
|
||||
|
||||
ab->hw_params = *hw_params;
|
||||
|
||||
|
||||
+9
-9
@@ -23,7 +23,7 @@ Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/reg.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/reg.c
|
||||
@@ -353,134 +353,6 @@ static u32 ath11k_map_fw_phy_flags(u32 p
|
||||
@@ -352,134 +352,6 @@ static u32 ath11k_map_fw_phy_flags(u32 p
|
||||
return flags;
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
|
||||
static const char *
|
||||
ath11k_reg_get_regdom_str(enum nl80211_dfs_regions dfs_region)
|
||||
{
|
||||
@@ -631,11 +503,11 @@ ath11k_reg_ap_pwr_convert(enum ieee80211
|
||||
@@ -630,11 +502,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 <quic_adisi@quicinc.com>
|
||||
struct cur_reg_rule *reg_rule, *reg_rule_6ghz;
|
||||
u8 i = 0, j = 0, k = 0;
|
||||
u8 num_rules;
|
||||
@@ -678,26 +550,26 @@ ath11k_reg_build_regd(struct ath11k_base
|
||||
@@ -677,26 +549,26 @@ ath11k_reg_build_regd(struct ath11k_base
|
||||
}
|
||||
|
||||
if (!num_rules)
|
||||
@@ -206,7 +206,7 @@ Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
|
||||
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)
|
||||
@@ -736,7 +608,7 @@ ath11k_reg_build_regd(struct ath11k_base
|
||||
@@ -735,7 +607,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 <quic_adisi@quicinc.com>
|
||||
reg_rule->start_freq,
|
||||
reg_rule->end_freq, max_bw,
|
||||
reg_rule->ant_gain, reg_rule->reg_power,
|
||||
@@ -751,7 +623,7 @@ ath11k_reg_build_regd(struct ath11k_base
|
||||
@@ -750,7 +622,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 <quic_adisi@quicinc.com>
|
||||
reg_rule, &i,
|
||||
flags, max_bw);
|
||||
continue;
|
||||
@@ -762,37 +634,20 @@ ath11k_reg_build_regd(struct ath11k_base
|
||||
@@ -761,37 +633,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,7 +265,7 @@ Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
|
||||
return new_regd;
|
||||
}
|
||||
|
||||
@@ -844,17 +699,6 @@ void ath11k_regd_update_chan_list_work(s
|
||||
@@ -843,17 +698,6 @@ void ath11k_regd_update_chan_list_work(s
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,7 +283,7 @@ Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
|
||||
static enum wmi_vdev_type ath11k_reg_get_ar_vdev_type(struct ath11k *ar)
|
||||
{
|
||||
struct ath11k_vif *arvif;
|
||||
@@ -877,7 +721,6 @@ int ath11k_reg_handle_chan_list(struct a
|
||||
@@ -876,7 +720,6 @@ int ath11k_reg_handle_chan_list(struct a
|
||||
enum ieee80211_ap_reg_power power_type)
|
||||
{
|
||||
struct ieee80211_regdomain *regd;
|
||||
@@ -291,7 +291,7 @@ Signed-off-by: Aditya Kumar Singh <quic_adisi@quicinc.com>
|
||||
int pdev_idx;
|
||||
struct ath11k *ar;
|
||||
enum wmi_vdev_type vdev_type;
|
||||
@@ -932,24 +775,14 @@ int ath11k_reg_handle_chan_list(struct a
|
||||
@@ -931,24 +774,14 @@ int ath11k_reg_handle_chan_list(struct a
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ Signed-off-by: Mantas Pucka <mantas@8devices.com>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/core.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/core.c
|
||||
@@ -173,8 +173,8 @@ static struct ath11k_hw_params ath11k_hw
|
||||
@@ -174,8 +174,8 @@ static struct ath11k_hw_params ath11k_hw
|
||||
.supports_shadow_regs = false,
|
||||
.idle_ps = false,
|
||||
.supports_sta_ps = false,
|
||||
|
||||
+2
-2
@@ -14,9 +14,9 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/core.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/core.c
|
||||
@@ -700,8 +700,8 @@ static struct ath11k_hw_params ath11k_hw
|
||||
@@ -712,8 +712,8 @@ static struct ath11k_hw_params ath11k_hw
|
||||
.supports_suspend = false,
|
||||
.hal_params = &ath11k_hw_hal_params_ipq8074,
|
||||
.hal_params = &ath11k_hw_hal_params_ipq5018,
|
||||
.single_pdev_only = false,
|
||||
- .coldboot_cal_mm = true,
|
||||
- .coldboot_cal_ftm = true,
|
||||
|
||||
+3
-3
@@ -65,7 +65,7 @@ Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
|
||||
if (ce_attr->src_nentries)
|
||||
--- a/drivers/net/wireless/ath/ath11k/hal.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/hal.c
|
||||
@@ -1274,20 +1274,16 @@ static int ath11k_hal_srng_create_config
|
||||
@@ -1273,20 +1273,16 @@ static int ath11k_hal_srng_create_config
|
||||
s->reg_start[1] = HAL_SEQ_WCSS_UMAC_TCL_REG + HAL_TCL_STATUS_RING_HP;
|
||||
|
||||
s = &hal->srng_config[HAL_CE_SRC];
|
||||
@@ -90,7 +90,7 @@ Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
|
||||
s->reg_size[0] = HAL_SEQ_WCSS_UMAC_CE1_DST_REG(ab) -
|
||||
HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab);
|
||||
s->reg_size[1] = HAL_SEQ_WCSS_UMAC_CE1_DST_REG(ab) -
|
||||
@@ -1295,9 +1291,8 @@ static int ath11k_hal_srng_create_config
|
||||
@@ -1294,9 +1290,8 @@ static int ath11k_hal_srng_create_config
|
||||
|
||||
s = &hal->srng_config[HAL_CE_DST_STATUS];
|
||||
s->reg_start[0] = HAL_SEQ_WCSS_UMAC_CE0_DST_REG(ab) +
|
||||
@@ -117,7 +117,7 @@ Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
|
||||
};
|
||||
|
||||
const struct ce_remap ath11k_ce_remap_ipq5018 = {
|
||||
@@ -2801,13 +2801,13 @@ const struct ath11k_hw_regs ipq5018_regs
|
||||
@@ -2809,13 +2809,13 @@ const struct ath11k_hw_regs ipq5018_regs
|
||||
.hal_reo_status_hp = 0x00003070,
|
||||
|
||||
/* WCSS relative address */
|
||||
|
||||
+6
-7
@@ -25,9 +25,9 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/core.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/core.c
|
||||
@@ -907,6 +907,67 @@ static struct ath11k_hw_params ath11k_hw
|
||||
.support_dual_stations = true,
|
||||
.pdev_suspend = false,
|
||||
@@ -926,6 +926,66 @@ static struct ath11k_hw_params ath11k_hw
|
||||
.cfr_num_stream_bufs = 255,
|
||||
.cfr_stream_buf_size = 8200,
|
||||
},
|
||||
+ {
|
||||
+ .hw_rev = ATH11K_HW_QCN6122_HW10,
|
||||
@@ -37,7 +37,7 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
|
||||
+ .board_size = 256 * 1024,
|
||||
+ .cal_offset = 128 * 1024,
|
||||
+ },
|
||||
+ .hal_params = &ath11k_hw_hal_params_ipq8074,
|
||||
+ .hal_params = &ath11k_hw_hal_params_ipq5018,
|
||||
+ .max_radios = MAX_RADIOS_5018,
|
||||
+ .bdf_addr = 0x4D200000,
|
||||
+ .hw_ops = &ipq5018_ops,
|
||||
@@ -54,7 +54,6 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
|
||||
+ .max_fft_bins = 1024,
|
||||
+ },
|
||||
+ .credit_flow = false,
|
||||
+ .max_tx_ring = 1,
|
||||
+ .supports_monitor = true,
|
||||
+ .supports_shadow_regs = false,
|
||||
+ .idle_ps = false,
|
||||
@@ -95,7 +94,7 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
|
||||
static const struct dmi_system_id ath11k_pm_quirk_table[] = {
|
||||
--- a/drivers/net/wireless/ath/ath11k/core.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/core.h
|
||||
@@ -152,6 +152,7 @@ enum ath11k_hw_rev {
|
||||
@@ -153,6 +153,7 @@ enum ath11k_hw_rev {
|
||||
ATH11K_HW_IPQ5018_HW10,
|
||||
ATH11K_HW_QCA2066_HW21,
|
||||
ATH11K_HW_QCA6698AQ_HW21,
|
||||
@@ -105,7 +104,7 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
|
||||
enum ath11k_firmware_mode {
|
||||
--- a/drivers/net/wireless/ath/ath11k/qmi.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/qmi.h
|
||||
@@ -22,10 +22,11 @@
|
||||
@@ -21,10 +21,11 @@
|
||||
#define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_IPQ8074 0x02
|
||||
#define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_QCN9074 0x07
|
||||
#define ATH11K_QMI_WLFW_SERVICE_INS_ID_V01_WCN6750 0x03
|
||||
|
||||
+4
-4
@@ -10,7 +10,7 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
|
||||
---
|
||||
--- a/drivers/net/wireless/ath/ath11k/core.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/core.c
|
||||
@@ -920,6 +920,7 @@ static struct ath11k_hw_params ath11k_hw
|
||||
@@ -939,6 +939,7 @@ static struct ath11k_hw_params ath11k_hw
|
||||
.bdf_addr = 0x4D200000,
|
||||
.hw_ops = &ipq5018_ops,
|
||||
.hal_desc_sz = sizeof(struct hal_rx_desc_qcn9074),
|
||||
@@ -20,8 +20,8 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
|
||||
BIT(NL80211_IFTYPE_AP) |
|
||||
--- a/drivers/net/wireless/ath/ath11k/hw.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/hw.c
|
||||
@@ -2822,6 +2822,81 @@ const struct ath11k_hw_regs ipq5018_regs
|
||||
.hal_wbm1_release_ring_base_lsb = 0x0000097c,
|
||||
@@ -2836,6 +2836,81 @@ const struct ath11k_hw_hal_params ath11k
|
||||
.num_tx_rings = ARRAY_SIZE(ath11k_hw_tcl2wbm_rbm_map_ipq5018),
|
||||
};
|
||||
|
||||
+const struct ath11k_hw_regs qcn6122_regs = {
|
||||
@@ -104,7 +104,7 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
|
||||
.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
|
||||
@@ -426,6 +426,7 @@ extern const struct ath11k_hw_regs qcn90
|
||||
@@ -430,6 +430,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;
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
|
||||
---
|
||||
--- a/drivers/net/wireless/ath/ath11k/core.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/core.c
|
||||
@@ -919,6 +919,7 @@ static struct ath11k_hw_params ath11k_hw
|
||||
@@ -938,6 +938,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 <george.moussalem@outlook.com>
|
||||
/* CE0: host->target HTC control and raw streams */
|
||||
--- a/drivers/net/wireless/ath/ath11k/hw.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/hw.h
|
||||
@@ -290,6 +290,7 @@ extern const struct ath11k_hw_ring_mask
|
||||
@@ -293,6 +293,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;
|
||||
|
||||
+2
-2
@@ -55,7 +55,7 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
|
||||
static int ath11k_core_get_rproc(struct ath11k_base *ab)
|
||||
{
|
||||
struct ath11k_ahb *ab_ahb = ath11k_ahb_priv(ab);
|
||||
@@ -1133,6 +1163,10 @@ static int ath11k_ahb_probe(struct platf
|
||||
@@ -1132,6 +1162,10 @@ static int ath11k_ahb_probe(struct platf
|
||||
hif_ops = &ath11k_ahb_hif_ops_wcn6750;
|
||||
pci_ops = &ath11k_ahb_pci_ops_wcn6750;
|
||||
break;
|
||||
@@ -91,7 +91,7 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
|
||||
#endif /* _HIF_H_ */
|
||||
--- a/drivers/net/wireless/ath/ath11k/qmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
|
||||
@@ -2194,6 +2194,8 @@ static int ath11k_qmi_request_device_inf
|
||||
@@ -2193,6 +2193,8 @@ static int ath11k_qmi_request_device_inf
|
||||
if (!ab->hw_params.ce_remap)
|
||||
ab->mem_ce = ab->mem;
|
||||
|
||||
|
||||
+7
-7
@@ -24,7 +24,7 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
|
||||
}
|
||||
|
||||
static void ath11k_ahb_free_ext_irq(struct ath11k_base *ab)
|
||||
@@ -1107,6 +1108,27 @@ err_unregister:
|
||||
@@ -1106,6 +1107,27 @@ err_unregister:
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
|
||||
static int ath11k_ahb_fw_resource_deinit(struct ath11k_base *ab)
|
||||
{
|
||||
struct ath11k_ahb *ab_ahb = ath11k_ahb_priv(ab);
|
||||
@@ -1148,7 +1170,7 @@ static int ath11k_ahb_probe(struct platf
|
||||
@@ -1147,7 +1169,7 @@ static int ath11k_ahb_probe(struct platf
|
||||
const struct ath11k_hif_ops *hif_ops;
|
||||
const struct ath11k_pci_ops *pci_ops;
|
||||
enum ath11k_hw_rev hw_rev;
|
||||
@@ -61,7 +61,7 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
|
||||
|
||||
hw_rev = (uintptr_t)device_get_match_data(&pdev->dev);
|
||||
|
||||
@@ -1172,6 +1194,7 @@ static int ath11k_ahb_probe(struct platf
|
||||
@@ -1171,6 +1193,7 @@ static int ath11k_ahb_probe(struct platf
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
|
||||
ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "failed to set 32-bit consistent dma\n");
|
||||
@@ -1188,6 +1211,7 @@ static int ath11k_ahb_probe(struct platf
|
||||
@@ -1187,6 +1210,7 @@ static int ath11k_ahb_probe(struct platf
|
||||
ab->hif.ops = hif_ops;
|
||||
ab->pdev = pdev;
|
||||
ab->hw_rev = hw_rev;
|
||||
@@ -79,7 +79,7 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/core.h
|
||||
+++ b/drivers/net/wireless/ath/ath11k/core.h
|
||||
@@ -48,6 +48,9 @@
|
||||
@@ -49,6 +49,9 @@
|
||||
#define ATH11K_INVALID_HW_MAC_ID 0xFF
|
||||
#define ATH11K_CONNECTION_LOSS_HZ (3 * HZ)
|
||||
|
||||
@@ -89,7 +89,7 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
|
||||
/* SMBIOS type containing Board Data File Name Extension */
|
||||
#define ATH11K_SMBIOS_BDF_EXT_TYPE 0xF8
|
||||
|
||||
@@ -969,6 +972,7 @@ struct ath11k_base {
|
||||
@@ -986,6 +989,7 @@ struct ath11k_base {
|
||||
struct list_head peers;
|
||||
wait_queue_head_t peer_mapping_wq;
|
||||
u8 mac_addr[ETH_ALEN];
|
||||
@@ -99,7 +99,7 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
|
||||
struct ath11k_targ_cap target_caps;
|
||||
--- a/drivers/net/wireless/ath/ath11k/pci.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/pci.c
|
||||
@@ -409,6 +409,8 @@ static void ath11k_pci_init_qmi_ce_confi
|
||||
@@ -413,6 +413,8 @@ static void ath11k_pci_init_qmi_ce_confi
|
||||
} else
|
||||
ab->qmi.service_ins_id = ab->hw_params.qmi_service_ins_id;
|
||||
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ Signed-off-by: George Moussalem <george.moussalem@outlook.com>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/pcic.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/pcic.c
|
||||
@@ -139,6 +139,15 @@ static const struct ath11k_msi_config at
|
||||
@@ -138,6 +138,15 @@ static const struct ath11k_msi_config at
|
||||
},
|
||||
.hw_rev = ATH11K_HW_QCA6698AQ_HW21,
|
||||
},
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ Signed-off-by: Ziyang Huang <hzyitc@outlook.com>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/qmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/qmi.c
|
||||
@@ -2111,6 +2111,18 @@ static int ath11k_qmi_assign_target_mem_
|
||||
@@ -2110,6 +2110,18 @@ static int ath11k_qmi_assign_target_mem_
|
||||
ab->qmi.target_mem[idx].type = ab->qmi.target_mem[i].type;
|
||||
idx++;
|
||||
break;
|
||||
|
||||
@@ -13,7 +13,7 @@ Signed-off-by: Paweł Owoc <frut3k7@gmail.com>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/wmi.c
|
||||
@@ -2688,7 +2688,7 @@ int ath11k_wmi_send_wmm_update_cmd_tlv(s
|
||||
@@ -2700,7 +2700,7 @@ int ath11k_wmi_send_wmm_update_cmd_tlv(s
|
||||
FIELD_PREP(WMI_TLV_LEN, sizeof(*cmd) - TLV_HDR_SIZE);
|
||||
|
||||
cmd->vdev_id = vdev_id;
|
||||
|
||||
@@ -24,7 +24,7 @@ to the monitor RX delivery path.
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
|
||||
@@ -4929,8 +4929,13 @@ ath11k_dp_rx_mon_merg_msdus(struct ath11
|
||||
@@ -4941,8 +4941,13 @@ ath11k_dp_rx_mon_merg_msdus(struct ath11
|
||||
}
|
||||
|
||||
prev_buf->next = NULL;
|
||||
@@ -39,7 +39,7 @@ to the monitor RX delivery path.
|
||||
} else if (decap_format == DP_RX_DECAP_TYPE_NATIVE_WIFI) {
|
||||
u8 qos_pkt = 0;
|
||||
|
||||
@@ -4956,10 +4961,13 @@ ath11k_dp_rx_mon_merg_msdus(struct ath11
|
||||
@@ -4968,10 +4973,13 @@ ath11k_dp_rx_mon_merg_msdus(struct ath11
|
||||
prev_buf = msdu;
|
||||
msdu = msdu->next;
|
||||
}
|
||||
@@ -57,7 +57,7 @@ to the monitor RX delivery path.
|
||||
ath11k_dbg(ab, ATH11K_DBG_DATA,
|
||||
"mpdu_buf %p mpdu_buf->len %u",
|
||||
prev_buf, prev_buf->len);
|
||||
@@ -5084,12 +5092,27 @@ static int ath11k_dp_rx_mon_deliver(stru
|
||||
@@ -5096,12 +5104,27 @@ static int ath11k_dp_rx_mon_deliver(stru
|
||||
|
||||
header = mon_skb;
|
||||
|
||||
|
||||
-380
@@ -1,380 +0,0 @@
|
||||
From 151322bccdbdb132f5a73cc8ad5d3ab89b90ed52 Mon Sep 17 00:00:00 2001
|
||||
From: Maharaja Kennadyrajan <maharaja.kennadyrajan@oss.qualcomm.com>
|
||||
Date: Mon, 23 Feb 2026 18:56:22 +0530
|
||||
Subject: wifi: ath12k: add basic hwmon temperature reporting
|
||||
|
||||
Add initial thermal support by wiring up a per-radio (pdev) hwmon temperature
|
||||
sensor backed by the existing WMI pdev temperature command and event.
|
||||
When userspace reads the sysfs file temp1_input, the driver sends
|
||||
WMI_PDEV_GET_TEMPERATURE_CMDID (tag WMI_TAG_PDEV_GET_TEMPERATURE_CMD) and waits
|
||||
for the corresponding WMI_PDEV_TEMPERATURE_EVENTID
|
||||
(tag WMI_TAG_PDEV_TEMPERATURE_EVENT) to get the temperature and pdev_id.
|
||||
|
||||
Export the reported value in millidegrees Celsius as required by hwmon.
|
||||
The temperature reported is per-radio (pdev). In a multi-radio wiphy under a
|
||||
single phy, a separate hwmon device is created for each radio.
|
||||
|
||||
Sample command and output:
|
||||
$ cat /sys/devices/pci0000:00/.../ieee80211/phyX/hwmonY/temp1_input
|
||||
$ 50000
|
||||
|
||||
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.6-01243-QCAHKSWPL_SILICONZ-1
|
||||
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.1.c5-00302-QCAHMTSWPL_V1.0_V2.0_SILICONZ-1.115823.3
|
||||
|
||||
Co-developed-by: Aishwarya R <aishwarya.r@oss.qualcomm.com>
|
||||
Signed-off-by: Aishwarya R <aishwarya.r@oss.qualcomm.com>
|
||||
Signed-off-by: Maharaja Kennadyrajan <maharaja.kennadyrajan@oss.qualcomm.com>
|
||||
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
|
||||
Link: https://patch.msgid.link/20260223132622.43464-1-maharaja.kennadyrajan@oss.qualcomm.com
|
||||
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
|
||||
---
|
||||
drivers/net/wireless/ath/ath12k/Makefile | 1 +
|
||||
drivers/net/wireless/ath/ath12k/core.c | 13 ++++
|
||||
drivers/net/wireless/ath/ath12k/core.h | 3 +
|
||||
drivers/net/wireless/ath/ath12k/mac.c | 4 +
|
||||
drivers/net/wireless/ath/ath12k/thermal.c | 124 ++++++++++++++++++++++++++++++
|
||||
drivers/net/wireless/ath/ath12k/thermal.h | 40 ++++++++++
|
||||
drivers/net/wireless/ath/ath12k/wmi.c | 57 +++++++-------
|
||||
7 files changed, 211 insertions(+), 31 deletions(-)
|
||||
create mode 100644 drivers/net/wireless/ath/ath12k/thermal.c
|
||||
create mode 100644 drivers/net/wireless/ath/ath12k/thermal.h
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath12k/core.c
|
||||
+++ b/drivers/net/wireless/ath/ath12k/core.c
|
||||
@@ -857,11 +857,22 @@ static int ath12k_core_pdev_create(struc
|
||||
return ret;
|
||||
}
|
||||
|
||||
+ ret = ath12k_thermal_register(ab);
|
||||
+ if (ret) {
|
||||
+ ath12k_err(ab, "could not register thermal device: %d\n", ret);
|
||||
+ goto err_dp_pdev_free;
|
||||
+ }
|
||||
+
|
||||
return 0;
|
||||
+
|
||||
+err_dp_pdev_free:
|
||||
+ ath12k_dp_pdev_free(ab);
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
static void ath12k_core_pdev_destroy(struct ath12k_base *ab)
|
||||
{
|
||||
+ ath12k_thermal_unregister(ab);
|
||||
ath12k_dp_pdev_free(ab);
|
||||
}
|
||||
|
||||
@@ -1350,6 +1361,7 @@ static int ath12k_core_reconfigure_on_cr
|
||||
int ret, total_vdev;
|
||||
|
||||
mutex_lock(&ab->core_lock);
|
||||
+ ath12k_thermal_unregister(ab);
|
||||
ath12k_dp_pdev_free(ab);
|
||||
ath12k_ce_cleanup_pipes(ab);
|
||||
ath12k_wmi_detach(ab);
|
||||
@@ -1491,6 +1503,7 @@ static void ath12k_core_pre_reconfigure_
|
||||
complete(&ar->vdev_delete_done);
|
||||
complete(&ar->bss_survey_done);
|
||||
complete_all(&ar->regd_update_completed);
|
||||
+ complete_all(&ar->thermal.wmi_sync);
|
||||
|
||||
wake_up(&ar->dp.tx_empty_waitq);
|
||||
idr_for_each(&ar->txmgmt_idr,
|
||||
--- a/drivers/net/wireless/ath/ath12k/core.h
|
||||
+++ b/drivers/net/wireless/ath/ath12k/core.h
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "wow.h"
|
||||
#include "debugfs_htt_stats.h"
|
||||
#include "coredump.h"
|
||||
+#include "thermal.h"
|
||||
|
||||
#define SM(_v, _f) (((_v) << _f##_LSB) & _f##_MASK)
|
||||
|
||||
@@ -846,6 +847,8 @@ struct ath12k {
|
||||
|
||||
s8 max_allowed_tx_power;
|
||||
struct ath12k_pdev_rssi_offsets rssi_info;
|
||||
+
|
||||
+ struct ath12k_thermal thermal;
|
||||
};
|
||||
|
||||
struct ath12k_hw {
|
||||
--- a/drivers/net/wireless/ath/ath12k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath12k/mac.c
|
||||
@@ -14063,6 +14063,10 @@ static void ath12k_mac_setup(struct ath1
|
||||
init_completion(&ar->mlo_setup_done);
|
||||
init_completion(&ar->completed_11d_scan);
|
||||
init_completion(&ar->regd_update_completed);
|
||||
+ init_completion(&ar->thermal.wmi_sync);
|
||||
+
|
||||
+ ar->thermal.temperature = 0;
|
||||
+ ar->thermal.hwmon_dev = NULL;
|
||||
|
||||
INIT_DELAYED_WORK(&ar->scan.timeout, ath12k_scan_timeout_work);
|
||||
wiphy_work_init(&ar->scan.vdev_clean_wk, ath12k_scan_vdev_clean_work);
|
||||
--- a/drivers/net/wireless/ath/ath12k/Makefile
|
||||
+++ b/drivers/net/wireless/ath/ath12k/Makefile
|
||||
@@ -30,6 +30,7 @@ ath12k-$(CPTCFG_ATH12K_TRACING) += trace
|
||||
ath12k-$(CONFIG_PM) += wow.o
|
||||
ath12k-$(CPTCFG_ATH12K_COREDUMP) += coredump.o
|
||||
ath12k-$(CPTCFG_NL80211_TESTMODE) += testmode.o
|
||||
+ath12k-$(CONFIG_THERMAL) += thermal.o
|
||||
|
||||
# for tracing framework to find trace.h
|
||||
CFLAGS_trace.o := -I$(src)
|
||||
--- /dev/null
|
||||
+++ b/drivers/net/wireless/ath/ath12k/thermal.c
|
||||
@@ -0,0 +1,124 @@
|
||||
+// SPDX-License-Identifier: BSD-3-Clause-Clear
|
||||
+/*
|
||||
+ * Copyright (c) 2020 The Linux Foundation. All rights reserved.
|
||||
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
|
||||
+ */
|
||||
+
|
||||
+#include <linux/device.h>
|
||||
+#include <linux/hwmon.h>
|
||||
+#include <linux/hwmon-sysfs.h>
|
||||
+#include <linux/sysfs.h>
|
||||
+#include <linux/thermal.h>
|
||||
+#include "core.h"
|
||||
+#include "debug.h"
|
||||
+
|
||||
+static ssize_t ath12k_thermal_temp_show(struct device *dev,
|
||||
+ struct device_attribute *attr,
|
||||
+ char *buf)
|
||||
+{
|
||||
+ struct ath12k *ar = dev_get_drvdata(dev);
|
||||
+ unsigned long time_left;
|
||||
+ int ret, temperature;
|
||||
+
|
||||
+ guard(wiphy)(ath12k_ar_to_hw(ar)->wiphy);
|
||||
+
|
||||
+ if (ar->ah->state != ATH12K_HW_STATE_ON)
|
||||
+ return -ENETDOWN;
|
||||
+
|
||||
+ reinit_completion(&ar->thermal.wmi_sync);
|
||||
+ ret = ath12k_wmi_send_pdev_temperature_cmd(ar);
|
||||
+ if (ret) {
|
||||
+ ath12k_warn(ar->ab, "failed to read temperature %d\n", ret);
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ if (test_bit(ATH12K_FLAG_CRASH_FLUSH, &ar->ab->dev_flags))
|
||||
+ return -ESHUTDOWN;
|
||||
+
|
||||
+ time_left = wait_for_completion_timeout(&ar->thermal.wmi_sync,
|
||||
+ ATH12K_THERMAL_SYNC_TIMEOUT_HZ);
|
||||
+ if (!time_left) {
|
||||
+ ath12k_warn(ar->ab, "failed to synchronize thermal read\n");
|
||||
+ return -ETIMEDOUT;
|
||||
+ }
|
||||
+
|
||||
+ spin_lock_bh(&ar->data_lock);
|
||||
+ temperature = ar->thermal.temperature;
|
||||
+ spin_unlock_bh(&ar->data_lock);
|
||||
+
|
||||
+ /* display in millidegree celsius */
|
||||
+ return sysfs_emit(buf, "%d\n", temperature * 1000);
|
||||
+}
|
||||
+
|
||||
+void ath12k_thermal_event_temperature(struct ath12k *ar, int temperature)
|
||||
+{
|
||||
+ spin_lock_bh(&ar->data_lock);
|
||||
+ ar->thermal.temperature = temperature;
|
||||
+ spin_unlock_bh(&ar->data_lock);
|
||||
+ complete_all(&ar->thermal.wmi_sync);
|
||||
+}
|
||||
+
|
||||
+static SENSOR_DEVICE_ATTR_RO(temp1_input, ath12k_thermal_temp, 0);
|
||||
+
|
||||
+static struct attribute *ath12k_hwmon_attrs[] = {
|
||||
+ &sensor_dev_attr_temp1_input.dev_attr.attr,
|
||||
+ NULL,
|
||||
+};
|
||||
+ATTRIBUTE_GROUPS(ath12k_hwmon);
|
||||
+
|
||||
+int ath12k_thermal_register(struct ath12k_base *ab)
|
||||
+{
|
||||
+ struct ath12k *ar;
|
||||
+ int i, j, ret;
|
||||
+
|
||||
+ if (!IS_REACHABLE(CONFIG_HWMON))
|
||||
+ return 0;
|
||||
+
|
||||
+ for (i = 0; i < ab->num_radios; i++) {
|
||||
+ ar = ab->pdevs[i].ar;
|
||||
+ if (!ar)
|
||||
+ continue;
|
||||
+
|
||||
+ ar->thermal.hwmon_dev =
|
||||
+ hwmon_device_register_with_groups(&ar->ah->hw->wiphy->dev,
|
||||
+ "ath12k_hwmon", ar,
|
||||
+ ath12k_hwmon_groups);
|
||||
+ if (IS_ERR(ar->thermal.hwmon_dev)) {
|
||||
+ ret = PTR_ERR(ar->thermal.hwmon_dev);
|
||||
+ ar->thermal.hwmon_dev = NULL;
|
||||
+ ath12k_err(ar->ab, "failed to register hwmon device: %d\n",
|
||||
+ ret);
|
||||
+ for (j = i - 1; j >= 0; j--) {
|
||||
+ ar = ab->pdevs[j].ar;
|
||||
+ if (!ar)
|
||||
+ continue;
|
||||
+
|
||||
+ hwmon_device_unregister(ar->thermal.hwmon_dev);
|
||||
+ ar->thermal.hwmon_dev = NULL;
|
||||
+ }
|
||||
+ return ret;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+void ath12k_thermal_unregister(struct ath12k_base *ab)
|
||||
+{
|
||||
+ struct ath12k *ar;
|
||||
+ int i;
|
||||
+
|
||||
+ if (!IS_REACHABLE(CONFIG_HWMON))
|
||||
+ return;
|
||||
+
|
||||
+ for (i = 0; i < ab->num_radios; i++) {
|
||||
+ ar = ab->pdevs[i].ar;
|
||||
+ if (!ar)
|
||||
+ continue;
|
||||
+
|
||||
+ if (ar->thermal.hwmon_dev) {
|
||||
+ hwmon_device_unregister(ar->thermal.hwmon_dev);
|
||||
+ ar->thermal.hwmon_dev = NULL;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
--- /dev/null
|
||||
+++ b/drivers/net/wireless/ath/ath12k/thermal.h
|
||||
@@ -0,0 +1,40 @@
|
||||
+/* SPDX-License-Identifier: BSD-3-Clause-Clear */
|
||||
+/*
|
||||
+ * Copyright (c) 2020 The Linux Foundation. All rights reserved.
|
||||
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
|
||||
+ */
|
||||
+
|
||||
+#ifndef _ATH12K_THERMAL_
|
||||
+#define _ATH12K_THERMAL_
|
||||
+
|
||||
+#define ATH12K_THERMAL_SYNC_TIMEOUT_HZ (5 * HZ)
|
||||
+
|
||||
+struct ath12k_thermal {
|
||||
+ struct completion wmi_sync;
|
||||
+
|
||||
+ /* temperature value in Celsius degree protected by data_lock. */
|
||||
+ int temperature;
|
||||
+ struct device *hwmon_dev;
|
||||
+};
|
||||
+
|
||||
+#if IS_REACHABLE(CONFIG_THERMAL)
|
||||
+int ath12k_thermal_register(struct ath12k_base *ab);
|
||||
+void ath12k_thermal_unregister(struct ath12k_base *ab);
|
||||
+void ath12k_thermal_event_temperature(struct ath12k *ar, int temperature);
|
||||
+#else
|
||||
+static inline int ath12k_thermal_register(struct ath12k_base *ab)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static inline void ath12k_thermal_unregister(struct ath12k_base *ab)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+static inline void ath12k_thermal_event_temperature(struct ath12k *ar,
|
||||
+ int temperature)
|
||||
+{
|
||||
+}
|
||||
+
|
||||
+#endif
|
||||
+#endif /* _ATH12K_THERMAL_ */
|
||||
--- a/drivers/net/wireless/ath/ath12k/wmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath12k/wmi.c
|
||||
@@ -6673,31 +6673,6 @@ static int ath12k_pull_peer_assoc_conf_e
|
||||
return 0;
|
||||
}
|
||||
|
||||
-static int
|
||||
-ath12k_pull_pdev_temp_ev(struct ath12k_base *ab, struct sk_buff *skb,
|
||||
- const struct wmi_pdev_temperature_event *ev)
|
||||
-{
|
||||
- const void **tb;
|
||||
- int ret;
|
||||
-
|
||||
- tb = ath12k_wmi_tlv_parse_alloc(ab, skb, GFP_ATOMIC);
|
||||
- if (IS_ERR(tb)) {
|
||||
- ret = PTR_ERR(tb);
|
||||
- ath12k_warn(ab, "failed to parse tlv: %d\n", ret);
|
||||
- return ret;
|
||||
- }
|
||||
-
|
||||
- ev = tb[WMI_TAG_PDEV_TEMPERATURE_EVENT];
|
||||
- if (!ev) {
|
||||
- ath12k_warn(ab, "failed to fetch pdev temp ev");
|
||||
- kfree(tb);
|
||||
- return -EPROTO;
|
||||
- }
|
||||
-
|
||||
- kfree(tb);
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
static void ath12k_wmi_op_ep_tx_credits(struct ath12k_base *ab)
|
||||
{
|
||||
/* try to send pending beacons first. they take priority */
|
||||
@@ -8712,25 +8687,45 @@ static void
|
||||
ath12k_wmi_pdev_temperature_event(struct ath12k_base *ab,
|
||||
struct sk_buff *skb)
|
||||
{
|
||||
+ const struct wmi_pdev_temperature_event *ev;
|
||||
struct ath12k *ar;
|
||||
- struct wmi_pdev_temperature_event ev = {};
|
||||
+ const void **tb;
|
||||
+ int temp;
|
||||
+ u32 pdev_id;
|
||||
|
||||
- if (ath12k_pull_pdev_temp_ev(ab, skb, &ev) != 0) {
|
||||
- ath12k_warn(ab, "failed to extract pdev temperature event");
|
||||
+ tb = ath12k_wmi_tlv_parse_alloc(ab, skb, GFP_ATOMIC);
|
||||
+ if (IS_ERR(tb)) {
|
||||
+ ath12k_warn(ab, "failed to parse tlv: %ld\n", PTR_ERR(tb));
|
||||
return;
|
||||
}
|
||||
|
||||
+ ev = tb[WMI_TAG_PDEV_TEMPERATURE_EVENT];
|
||||
+ if (!ev) {
|
||||
+ ath12k_warn(ab, "failed to fetch pdev temp ev\n");
|
||||
+ kfree(tb);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ temp = a_sle32_to_cpu(ev->temp);
|
||||
+ pdev_id = le32_to_cpu(ev->pdev_id);
|
||||
+
|
||||
+ kfree(tb);
|
||||
+
|
||||
ath12k_dbg(ab, ATH12K_DBG_WMI,
|
||||
- "pdev temperature ev temp %d pdev_id %d\n", ev.temp, ev.pdev_id);
|
||||
+ "pdev temperature ev temp %d pdev_id %u\n",
|
||||
+ temp, pdev_id);
|
||||
|
||||
rcu_read_lock();
|
||||
|
||||
- ar = ath12k_mac_get_ar_by_pdev_id(ab, le32_to_cpu(ev.pdev_id));
|
||||
+ ar = ath12k_mac_get_ar_by_pdev_id(ab, pdev_id);
|
||||
if (!ar) {
|
||||
- ath12k_warn(ab, "invalid pdev id in pdev temperature ev %d", ev.pdev_id);
|
||||
+ ath12k_warn(ab, "invalid pdev id %u in pdev temperature ev\n",
|
||||
+ pdev_id);
|
||||
goto exit;
|
||||
}
|
||||
|
||||
+ ath12k_thermal_event_temperature(ar, temp);
|
||||
+
|
||||
exit:
|
||||
rcu_read_unlock();
|
||||
}
|
||||
@@ -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
|
||||
@@ -297,6 +297,9 @@ static void ath12k_pci_enable_ltssm(stru
|
||||
@@ -249,6 +249,9 @@ static void ath12k_pci_enable_ltssm(stru
|
||||
u32 val;
|
||||
int i;
|
||||
|
||||
|
||||
+4
-4
@@ -130,19 +130,19 @@ Best regards,
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath12k/wmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath12k/wmi.c
|
||||
@@ -2900,6 +2900,9 @@ int ath12k_wmi_send_scan_chan_list_cmd(s
|
||||
@@ -2872,6 +2872,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);
|
||||
|
||||
+ if (max_chan_limit > WMI_MAX_NUM_CHAN_PER_WMI_CMD)
|
||||
+ max_chan_limit = WMI_MAX_NUM_CHAN_PER_WMI_CMD;
|
||||
+
|
||||
num_send_chans = min(arg->nallchans, max_chan_limit);
|
||||
num_send_chans = min3(arg->nallchans, max_chan_limit,
|
||||
ATH12K_WMI_MAX_NUM_CHAN_PER_CMD);
|
||||
|
||||
arg->nallchans -= num_send_chans;
|
||||
--- a/drivers/net/wireless/ath/ath12k/wmi.h
|
||||
+++ b/drivers/net/wireless/ath/ath12k/wmi.h
|
||||
@@ -4004,6 +4004,8 @@ struct wmi_stop_scan_cmd {
|
||||
@@ -4035,6 +4035,8 @@ struct wmi_stop_scan_cmd {
|
||||
__le32 pdev_id;
|
||||
} __packed;
|
||||
|
||||
|
||||
+1
-1
@@ -124,7 +124,7 @@ Best regards,
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath12k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath12k/mac.c
|
||||
@@ -7727,9 +7727,7 @@ static void ath12k_mac_setup_ht_vht_cap(
|
||||
@@ -8600,9 +8600,7 @@ static void ath12k_mac_setup_ht_vht_cap(
|
||||
rate_cap_rx_chainmask);
|
||||
}
|
||||
|
||||
|
||||
+7
-7
@@ -12,7 +12,7 @@ This reverts commit cdad737160571a98cc4933a62c9f2728e965ab27.
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath12k/ce.h
|
||||
+++ b/drivers/net/wireless/ath/ath12k/ce.h
|
||||
@@ -159,7 +159,7 @@ struct ath12k_ce_pipe {
|
||||
@@ -165,7 +165,7 @@ struct ath12k_ce_pipe {
|
||||
void (*send_cb)(struct ath12k_ce_pipe *pipe);
|
||||
void (*recv_cb)(struct ath12k_base *ab, struct sk_buff *skb);
|
||||
|
||||
@@ -23,7 +23,7 @@ This reverts commit cdad737160571a98cc4933a62c9f2728e965ab27.
|
||||
struct ath12k_ce_ring *status_ring;
|
||||
--- a/drivers/net/wireless/ath/ath12k/pci.c
|
||||
+++ b/drivers/net/wireless/ath/ath12k/pci.c
|
||||
@@ -448,9 +448,9 @@ static void ath12k_pci_sync_ce_irqs(stru
|
||||
@@ -400,9 +400,9 @@ static void ath12k_pci_sync_ce_irqs(stru
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ This reverts commit cdad737160571a98cc4933a62c9f2728e965ab27.
|
||||
int irq_idx = ATH12K_PCI_IRQ_CE0_OFFSET + ce_pipe->pipe_num;
|
||||
|
||||
ath12k_ce_per_engine_service(ce_pipe->ab, ce_pipe->pipe_num);
|
||||
@@ -472,7 +472,7 @@ static irqreturn_t ath12k_pci_ce_interru
|
||||
@@ -424,7 +424,7 @@ static irqreturn_t ath12k_pci_ce_interru
|
||||
|
||||
disable_irq_nosync(ab->irq_num[irq_idx]);
|
||||
|
||||
@@ -44,7 +44,7 @@ This reverts commit cdad737160571a98cc4933a62c9f2728e965ab27.
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
@@ -702,7 +702,7 @@ static int ath12k_pci_config_irq(struct
|
||||
@@ -655,7 +655,7 @@ static int ath12k_pci_config_irq(struct
|
||||
|
||||
irq_idx = ATH12K_PCI_IRQ_CE0_OFFSET + i;
|
||||
|
||||
@@ -53,7 +53,7 @@ This reverts commit cdad737160571a98cc4933a62c9f2728e965ab27.
|
||||
|
||||
ret = request_irq(irq, ath12k_pci_ce_interrupt_handler,
|
||||
ab_pci->irq_flags, irq_name[irq_idx],
|
||||
@@ -985,7 +985,7 @@ static void ath12k_pci_aspm_restore(stru
|
||||
@@ -938,7 +938,7 @@ static void ath12k_pci_aspm_restore(stru
|
||||
PCI_EXP_LNKCTL_ASPMC);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ This reverts commit cdad737160571a98cc4933a62c9f2728e965ab27.
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -995,7 +995,7 @@ static void ath12k_pci_cancel_workqueue(
|
||||
@@ -948,7 +948,7 @@ static void ath12k_pci_cancel_workqueue(
|
||||
if (ath12k_ce_get_attr_flags(ab, i) & CE_ATTR_DIS_INTR)
|
||||
continue;
|
||||
|
||||
@@ -71,7 +71,7 @@ This reverts commit cdad737160571a98cc4933a62c9f2728e965ab27.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1003,7 +1003,7 @@ static void ath12k_pci_ce_irq_disable_sy
|
||||
@@ -956,7 +956,7 @@ static void ath12k_pci_ce_irq_disable_sy
|
||||
{
|
||||
ath12k_pci_ce_irqs_disable(ab);
|
||||
ath12k_pci_sync_ce_irqs(ab);
|
||||
|
||||
+5
-5
@@ -17,7 +17,7 @@ Signed-off-by: Matt Merhar <mattmerhar@protonmail.com>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath12k/Kconfig
|
||||
+++ b/drivers/net/wireless/ath/ath12k/Kconfig
|
||||
@@ -61,3 +61,10 @@ config ATH12K_COREDUMP
|
||||
@@ -60,3 +60,10 @@ config ATH12K_COREDUMP
|
||||
|
||||
If unsure, say Y to make it easier to debug problems. But if
|
||||
dump collection not required choose N.
|
||||
@@ -30,7 +30,7 @@ Signed-off-by: Matt Merhar <mattmerhar@protonmail.com>
|
||||
+ Enable ath12k thermal sensor support.
|
||||
--- a/drivers/net/wireless/ath/ath12k/Makefile
|
||||
+++ b/drivers/net/wireless/ath/ath12k/Makefile
|
||||
@@ -30,7 +30,7 @@ ath12k-$(CPTCFG_ATH12K_TRACING) += trace
|
||||
@@ -32,7 +32,7 @@ ath12k-$(CPTCFG_ATH12K_TRACING) += trace
|
||||
ath12k-$(CONFIG_PM) += wow.o
|
||||
ath12k-$(CPTCFG_ATH12K_COREDUMP) += coredump.o
|
||||
ath12k-$(CPTCFG_NL80211_TESTMODE) += testmode.o
|
||||
@@ -41,8 +41,8 @@ Signed-off-by: Matt Merhar <mattmerhar@protonmail.com>
|
||||
CFLAGS_trace.o := -I$(src)
|
||||
--- a/drivers/net/wireless/ath/ath12k/thermal.h
|
||||
+++ b/drivers/net/wireless/ath/ath12k/thermal.h
|
||||
@@ -17,7 +17,7 @@ struct ath12k_thermal {
|
||||
struct device *hwmon_dev;
|
||||
@@ -35,7 +35,7 @@ struct ath12k_thermal {
|
||||
u32 throttle_state;
|
||||
};
|
||||
|
||||
-#if IS_REACHABLE(CONFIG_THERMAL)
|
||||
@@ -52,7 +52,7 @@ Signed-off-by: Matt Merhar <mattmerhar@protonmail.com>
|
||||
void ath12k_thermal_event_temperature(struct ath12k *ar, int temperature);
|
||||
--- a/local-symbols
|
||||
+++ b/local-symbols
|
||||
@@ -170,6 +170,7 @@ ATH12K_DEBUG=
|
||||
@@ -173,6 +173,7 @@ ATH12K_DEBUG=
|
||||
ATH12K_DEBUGFS=
|
||||
ATH12K_TRACING=
|
||||
ATH12K_COREDUMP=
|
||||
|
||||
+2
-2
@@ -32,7 +32,7 @@ Changes in v2:
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath12k/core.c
|
||||
+++ b/drivers/net/wireless/ath/ath12k/core.c
|
||||
@@ -806,6 +806,28 @@ int ath12k_core_check_smbios(struct ath1
|
||||
@@ -812,6 +812,28 @@ int ath12k_core_check_smbios(struct ath1
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ Changes in v2:
|
||||
int ret;
|
||||
--- a/drivers/net/wireless/ath/ath12k/qmi.c
|
||||
+++ b/drivers/net/wireless/ath/ath12k/qmi.c
|
||||
@@ -2903,6 +2903,10 @@ int ath12k_qmi_request_target_cap(struct
|
||||
@@ -2945,6 +2945,10 @@ int ath12k_qmi_request_target_cap(struct
|
||||
if (r)
|
||||
ath12k_dbg(ab, ATH12K_DBG_QMI, "SMBIOS bdf variant name not set.\n");
|
||||
|
||||
|
||||
@@ -1,273 +0,0 @@
|
||||
From patchwork Tue Apr 23 12:12:33 2024
|
||||
Content-Type: text/plain; charset="utf-8"
|
||||
MIME-Version: 1.0
|
||||
Content-Transfer-Encoding: 7bit
|
||||
X-Patchwork-Submitter: Linus Walleij <linus.walleij@linaro.org>
|
||||
X-Patchwork-Id: 1926515
|
||||
Return-Path:
|
||||
<linux-gpio+bounces-5755-incoming=patchwork.ozlabs.org@vger.kernel.org>
|
||||
X-Original-To: incoming@patchwork.ozlabs.org
|
||||
Delivered-To: patchwork-incoming@legolas.ozlabs.org
|
||||
Authentication-Results: legolas.ozlabs.org;
|
||||
dkim=pass (2048-bit key;
|
||||
unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256
|
||||
header.s=google header.b=qX99TQMM;
|
||||
dkim-atps=neutral
|
||||
Authentication-Results: legolas.ozlabs.org;
|
||||
spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org
|
||||
(client-ip=2604:1380:45e3:2400::1; helo=sv.mirrors.kernel.org;
|
||||
envelope-from=linux-gpio+bounces-5755-incoming=patchwork.ozlabs.org@vger.kernel.org;
|
||||
receiver=patchwork.ozlabs.org)
|
||||
Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org
|
||||
[IPv6:2604:1380:45e3:2400::1])
|
||||
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
|
||||
key-exchange X25519 server-signature ECDSA (secp384r1))
|
||||
(No client certificate requested)
|
||||
by legolas.ozlabs.org (Postfix) with ESMTPS id 4VP1Gc6RZKz1yZP
|
||||
for <incoming@patchwork.ozlabs.org>; Tue, 23 Apr 2024 22:12:56 +1000 (AEST)
|
||||
Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org
|
||||
[52.25.139.140])
|
||||
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
|
||||
(No client certificate requested)
|
||||
by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5BB9C28522A
|
||||
for <incoming@patchwork.ozlabs.org>; Tue, 23 Apr 2024 12:12:55 +0000 (UTC)
|
||||
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
|
||||
by smtp.subspace.kernel.org (Postfix) with ESMTP id 2F83B8563D;
|
||||
Tue, 23 Apr 2024 12:12:41 +0000 (UTC)
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org
|
||||
header.b="qX99TQMM"
|
||||
X-Original-To: linux-gpio@vger.kernel.org
|
||||
Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com
|
||||
[209.85.208.179])
|
||||
(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
|
||||
(No client certificate requested)
|
||||
by smtp.subspace.kernel.org (Postfix) with ESMTPS id A8F3C82865
|
||||
for <linux-gpio@vger.kernel.org>; Tue, 23 Apr 2024 12:12:37 +0000 (UTC)
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
arc=none smtp.client-ip=209.85.208.179
|
||||
ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
|
||||
t=1713874361; cv=none;
|
||||
b=d6RcvcAu8hBYAK8Io489ZHQpJVXPwuokP6iMcAkbvElCerbXD6jAdqdi+RjDlo5C49GHGO4FQ19UwQn/VE//qSwiK1ulTSBp3OkvAmyb7yYAFnDs9AVNWRw+5/NxeFNn3fj5PyvqVymIbaJKabfrOVNwkz/5JMHxEIJtr6Crmog=
|
||||
ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
|
||||
s=arc-20240116; t=1713874361; c=relaxed/simple;
|
||||
bh=0eXJ5AIjzz1TBGZ8SlshIPrEHZaZwZfYEdof+dSpu4Y=;
|
||||
h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:To:Cc;
|
||||
b=EfFtruUxRIGy+jylEiJ2rPEyPCjGCc8ptT9FVxe6s0O/kW38Y6196xVQeiSV2tSKVCEOIO+9HoqmpgdKsJE7gU9++EcrasP96MYpsklYpc2zsWW3b8QEhfxfZ9Ai/idyYihE2u9dQ7a143P/Ij/twDrZTt24wO/mtHDrE5XcCFI=
|
||||
ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
|
||||
dmarc=pass (p=none dis=none) header.from=linaro.org;
|
||||
spf=pass smtp.mailfrom=linaro.org;
|
||||
dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org
|
||||
header.b=qX99TQMM; arc=none smtp.client-ip=209.85.208.179
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
dmarc=pass (p=none dis=none) header.from=linaro.org
|
||||
Authentication-Results: smtp.subspace.kernel.org;
|
||||
spf=pass smtp.mailfrom=linaro.org
|
||||
Received: by mail-lj1-f179.google.com with SMTP id
|
||||
38308e7fff4ca-2dd041acff1so40839131fa.1
|
||||
for <linux-gpio@vger.kernel.org>;
|
||||
Tue, 23 Apr 2024 05:12:37 -0700 (PDT)
|
||||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||||
d=linaro.org; s=google; t=1713874356; x=1714479156;
|
||||
darn=vger.kernel.org;
|
||||
h=cc:to:message-id:content-transfer-encoding:mime-version:subject
|
||||
:date:from:from:to:cc:subject:date:message-id:reply-to;
|
||||
bh=vysJsMiH5IVqdTs4yMwZxZ7nUmt2aG7eBhkn8qm8hvI=;
|
||||
b=qX99TQMMdHbskFYUaw8c93sIJsUhKmj/WPdyahHcupUhwn5wol4aVoPczkOKYwJZhE
|
||||
eoInxzjAHIl3UNKyvPPrD4MrbLcSoFT6mTFMsgRQYUghsLattmGcqIebu9XT556dBhsf
|
||||
DydmpqGgnTOIa+IEknFxg24mo8Xn2LVmDC7LSGEYykUy1xLHd1NSq56YEaYXC7641xeZ
|
||||
9TOL0rZszeGld5cCS3013EmEeXQGCC3lAP83Eb48vbFXjPojkN0s40rZ2s8YpVsGT0iP
|
||||
LeLVtP/E8XJqi4YipKryKSgbgOvQ1Bclle5+s+2qcJQNnSEjekMwR59BIRs3OZH2SRfN
|
||||
gQdQ==
|
||||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||||
d=1e100.net; s=20230601; t=1713874356; x=1714479156;
|
||||
h=cc:to:message-id:content-transfer-encoding:mime-version:subject
|
||||
:date:from:x-gm-message-state:from:to:cc:subject:date:message-id
|
||||
:reply-to;
|
||||
bh=vysJsMiH5IVqdTs4yMwZxZ7nUmt2aG7eBhkn8qm8hvI=;
|
||||
b=jEBH4NQ7SzFi2tnb1lgL06IchnBJoscNgKesjlorvou6X/9wDE/VbgxNFKR0zWwdTk
|
||||
BEjG/ifFJxLmM9jdaCKu5cJc4yiDNXp7yZd48D71V34zJ4aINAGAx4hcOKqf95neFknx
|
||||
nsFPpBFnTYFEpCLF0TebVoL6h6ehPzSojmkArzsrMppNvW2cwJ5gDlkqy2y4SezLanmM
|
||||
6iU0ksnwE0bb2iLkahhgo00Ejt33yqxwa+3xBfhOe9oYKSSZYnY7qVq055SSwt9IAq+H
|
||||
REGyJN+GrvupTHagiioYe3LPXDPdOui9ZixXXDllw1t1yGUy+TkJu8xSqtvHEfg81FHP
|
||||
AxtA==
|
||||
X-Forwarded-Encrypted: i=1;
|
||||
AJvYcCUbxzPklfPYrLgyY1I0ycuj7Dh04dcGVonYocA2mzxzlAEV107o0ELlFqr3O9Td+tV/t0eV9ly9YAbTY6n1XPnFXS5dsYYAZw6RHw==
|
||||
X-Gm-Message-State: AOJu0YxsC7zdakTzntbiRFnN2A7yTrR0x+IpR6ce6eGn5kHeqIBi1km+
|
||||
zTVpRulbch3JsmzVDbCbbAAYoBkNgEA568YL6zdjVARnvFwNz1cqatOrR1AXUm0=
|
||||
X-Google-Smtp-Source:
|
||||
AGHT+IHBRMGvaJM98f86Z6m/RfVhK2XejjNGF3EvcRq/4x3oGM0DKpd2PbeCJdgmzHjLPVVbdsNzJg==
|
||||
X-Received: by 2002:a2e:9852:0:b0:2d8:a98d:18e with SMTP id
|
||||
e18-20020a2e9852000000b002d8a98d018emr7955886ljj.8.1713874355700;
|
||||
Tue, 23 Apr 2024 05:12:35 -0700 (PDT)
|
||||
Received: from [192.168.1.140] ([85.235.12.238])
|
||||
by smtp.gmail.com with ESMTPSA id
|
||||
x6-20020a2e7c06000000b002da179d8d25sm1628982ljc.64.2024.04.23.05.12.33
|
||||
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
|
||||
Tue, 23 Apr 2024 05:12:35 -0700 (PDT)
|
||||
From: Linus Walleij <linus.walleij@linaro.org>
|
||||
Date: Tue, 23 Apr 2024 14:12:33 +0200
|
||||
Subject: [PATCH v2] wifi: ath9k: Obtain system GPIOS from descriptors
|
||||
Precedence: bulk
|
||||
X-Mailing-List: linux-gpio@vger.kernel.org
|
||||
List-Id: <linux-gpio.vger.kernel.org>
|
||||
List-Subscribe: <mailto:linux-gpio+subscribe@vger.kernel.org>
|
||||
List-Unsubscribe: <mailto:linux-gpio+unsubscribe@vger.kernel.org>
|
||||
MIME-Version: 1.0
|
||||
Message-Id: <20240423-descriptors-wireless-v2-1-6d1d03b30bfa@linaro.org>
|
||||
X-B4-Tracking: v=1; b=H4sIALClJ2YC/22Nyw6CMBBFf4XM2hpanrLyPwyL0o4wCaFkxqCG9
|
||||
N+txKXLc5Nz7g6CTCjQZTswbiQUlgTmlIGb7DKiIp8YTG7KXBujPIpjWh+BRT2JcUYRNbTeXir
|
||||
v7FBUkNSV8U6vI3vrE08kSXgfL5v+rr9gof8HN61yhdo1rvJ125T1dabFcjgHHqGPMX4Ao4iiN
|
||||
LkAAAA=
|
||||
To: Kalle Valo <kvalo@kernel.org>,
|
||||
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
|
||||
Arnd Bergmann <arnd@arndb.de>, Alban Bedel <albeu@free.fr>,
|
||||
Bartosz Golaszewski <brgl@bgdev.pl>, =?utf-8?q?Toke_H=C3=B8iland-J=C3=B8rg?=
|
||||
=?utf-8?q?ensen?= <toke@toke.dk>
|
||||
Cc: linux-wireless@vger.kernel.org, brcm80211-dev-list.pdl@broadcom.com,
|
||||
linux-gpio@vger.kernel.org, Linus Walleij <linus.walleij@linaro.org>
|
||||
X-Mailer: b4 0.13.0
|
||||
|
||||
The ath9k has an odd use of system-wide GPIOs: if the chip
|
||||
does not have internal GPIO capability, it will try to obtain a
|
||||
GPIO line from the system GPIO controller:
|
||||
|
||||
if (BIT(gpio) & ah->caps.gpio_mask)
|
||||
ath9k_hw_gpio_cfg_wmac(...);
|
||||
else if (AR_SREV_SOC(ah))
|
||||
ath9k_hw_gpio_cfg_soc(ah, gpio, out, label);
|
||||
|
||||
Where ath9k_hw_gpio_cfg_soc() will attempt to issue
|
||||
gpio_request_one() passing the local GPIO number of the controller
|
||||
(0..31) to gpio_request_one().
|
||||
|
||||
This is somewhat peculiar and possibly even dangerous: there is
|
||||
nowadays no guarantee of the numbering of these system-wide
|
||||
GPIOs, and assuming that GPIO 0..31 as used by ath9k would
|
||||
correspond to GPIOs 0..31 on the system as a whole seems a bit
|
||||
wild.
|
||||
|
||||
Register all 32 GPIOs at index 0..31 directly in the ATH79K
|
||||
GPIO driver and associate with WIFI if and only if we are probing
|
||||
ATH79K wifi from the AHB bus (used for SoCs).
|
||||
|
||||
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
|
||||
---
|
||||
Changes in v2:
|
||||
- Define all the descriptors directly in the ATH79K
|
||||
GPIO driver in case the driver want to request them directly.
|
||||
- Link to v1: https://lore.kernel.org/r/20240131-descriptors-wireless-v1-0-e1c7c5d68746@linaro.org
|
||||
---
|
||||
drivers/net/wireless/ath/ath9k/hw.c | 29 ++++++++++++-----------
|
||||
drivers/net/wireless/ath/ath9k/hw.h | 3 ++-
|
||||
2 files changed, 32 insertions(+), 15 deletions(-)
|
||||
|
||||
|
||||
---
|
||||
base-commit: 4cece764965020c22cff7665b18a012006359095
|
||||
change-id: 20240122-descriptors-wireless-b8da95dcab35
|
||||
|
||||
Best regards,
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/hw.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/hw.c
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <linux/time.h>
|
||||
#include <linux/bitops.h>
|
||||
#include <linux/etherdevice.h>
|
||||
-#include <linux/gpio.h>
|
||||
+#include <linux/gpio/consumer.h>
|
||||
#include <linux/unaligned.h>
|
||||
|
||||
#include "hw.h"
|
||||
@@ -2719,19 +2719,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)
|
||||
{
|
||||
+ enum gpiod_flags flags = out ? GPIOD_OUT_LOW : GPIOD_IN;
|
||||
+ struct gpio_desc *gpiod;
|
||||
int err;
|
||||
|
||||
- if (ah->caps.gpio_requested & BIT(gpio))
|
||||
+ if (ah->gpiods[gpio])
|
||||
return;
|
||||
|
||||
- err = devm_gpio_request_one(ah->dev, gpio, out ? GPIOF_OUT_INIT_LOW : GPIOF_IN, label);
|
||||
- if (err) {
|
||||
+ /* Obtains a system specific GPIO descriptor from another GPIO controller */
|
||||
+ gpiod = gpiod_get_index(NULL, "ath9k", gpio, flags);
|
||||
+
|
||||
+ if (IS_ERR(gpiod)) {
|
||||
+ err = PTR_ERR(gpiod);
|
||||
ath_err(ath9k_hw_common(ah), "request GPIO%d failed:%d\n",
|
||||
gpio, err);
|
||||
return;
|
||||
}
|
||||
|
||||
- ah->caps.gpio_requested |= BIT(gpio);
|
||||
+ gpiod_set_consumer_name(gpiod, label);
|
||||
+ ah->gpiods[gpio] = gpiod;
|
||||
}
|
||||
|
||||
static void ath9k_hw_gpio_cfg_wmac(struct ath_hw *ah, u32 gpio, bool out,
|
||||
@@ -2793,8 +2799,10 @@ void ath9k_hw_gpio_free(struct ath_hw *a
|
||||
|
||||
WARN_ON(gpio >= ah->caps.num_gpio_pins);
|
||||
|
||||
- if (ah->caps.gpio_requested & BIT(gpio))
|
||||
- ah->caps.gpio_requested &= ~BIT(gpio);
|
||||
+ if (ah->gpiods[gpio]) {
|
||||
+ gpiod_put(ah->gpiods[gpio]);
|
||||
+ ah->gpiods[gpio] = NULL;
|
||||
+ }
|
||||
}
|
||||
EXPORT_SYMBOL(ath9k_hw_gpio_free);
|
||||
|
||||
@@ -2822,8 +2830,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);
|
||||
- } else if (BIT(gpio) & ah->caps.gpio_requested) {
|
||||
- val = gpio_get_value(gpio) & BIT(gpio);
|
||||
+ } else if (ah->gpiods[gpio]) {
|
||||
+ val = gpiod_get_value(ah->gpiods[gpio]);
|
||||
} else {
|
||||
WARN_ON(1);
|
||||
}
|
||||
@@ -2846,8 +2854,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));
|
||||
- } else if (BIT(gpio) & ah->caps.gpio_requested) {
|
||||
- gpio_set_value(gpio, val);
|
||||
+ } else if (ah->gpiods[gpio]) {
|
||||
+ gpiod_set_value(ah->gpiods[gpio], val);
|
||||
} else {
|
||||
WARN_ON(1);
|
||||
}
|
||||
--- a/drivers/net/wireless/ath/ath9k/hw.h
|
||||
+++ b/drivers/net/wireless/ath/ath9k/hw.h
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <linux/if_ether.h>
|
||||
#include <linux/delay.h>
|
||||
+#include <linux/gpio/consumer.h>
|
||||
#include <linux/io.h>
|
||||
#include <linux/firmware.h>
|
||||
|
||||
@@ -302,7 +303,6 @@ struct ath9k_hw_capabilities {
|
||||
u8 max_rxchains;
|
||||
u8 num_gpio_pins;
|
||||
u32 gpio_mask;
|
||||
- u32 gpio_requested;
|
||||
u8 rx_hp_qdepth;
|
||||
u8 rx_lp_qdepth;
|
||||
u8 rx_status_len;
|
||||
@@ -783,6 +783,7 @@ struct ath_hw {
|
||||
struct ath9k_hw_capabilities caps;
|
||||
struct ath9k_channel channels[ATH9K_NUM_CHANNELS];
|
||||
struct ath9k_channel *curchan;
|
||||
+ struct gpio_desc *gpiods[32];
|
||||
|
||||
union {
|
||||
struct ar5416_eeprom_def def;
|
||||
+2
-2
@@ -8,7 +8,7 @@ This reverts commit 71f5137bf010c6faffab50c0ec15374c59c4a411.
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/hw.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/hw.c
|
||||
@@ -2975,7 +2975,8 @@ void ath9k_hw_apply_txpower(struct ath_h
|
||||
@@ -2970,7 +2970,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)
|
||||
@@ -2987,9 +2988,14 @@ void ath9k_hw_apply_txpower(struct ath_h
|
||||
@@ -2982,9 +2983,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);
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/hw.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/hw.c
|
||||
@@ -2994,6 +2994,10 @@ void ath9k_hw_apply_txpower(struct ath_h
|
||||
@@ -2989,6 +2989,10 @@ void ath9k_hw_apply_txpower(struct ath_h
|
||||
if (ant_gain > max_gain)
|
||||
ant_reduction = ant_gain - max_gain;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/drivers/net/wireless/ath/ath9k/init.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/init.c
|
||||
@@ -836,6 +836,7 @@ static const struct ieee80211_iface_limi
|
||||
@@ -835,6 +835,7 @@ static const struct ieee80211_iface_limi
|
||||
BIT(NL80211_IFTYPE_AP) },
|
||||
{ .max = 1, .types = BIT(NL80211_IFTYPE_P2P_CLIENT) |
|
||||
BIT(NL80211_IFTYPE_P2P_GO) },
|
||||
|
||||
+2
-2
@@ -14,7 +14,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/init.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/init.c
|
||||
@@ -917,6 +917,7 @@ static void ath9k_set_hw_capab(struct at
|
||||
@@ -916,6 +916,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 <mail@david-bauer.net>
|
||||
|
||||
if (ath9k_ps_enable)
|
||||
ieee80211_hw_set(hw, SUPPORTS_PS);
|
||||
@@ -929,9 +930,6 @@ static void ath9k_set_hw_capab(struct at
|
||||
@@ -928,9 +929,6 @@ static void ath9k_set_hw_capab(struct at
|
||||
IEEE80211_RADIOTAP_MCS_HAVE_STBC;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/drivers/net/wireless/ath/ath9k/init.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/init.c
|
||||
@@ -1132,25 +1132,25 @@ static int __init ath9k_init(void)
|
||||
@@ -1130,25 +1130,25 @@ static int __init ath9k_init(void)
|
||||
{
|
||||
int error;
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@
|
||||
common->ops = &ah->reg_ops;
|
||||
common->ps_ops = &ath9k_htc_ps_ops;
|
||||
common->bus_ops = &ath9k_usb_bus_ops;
|
||||
@@ -746,9 +747,9 @@ static void ath9k_set_hw_capab(struct at
|
||||
@@ -746,9 +747,8 @@ static void ath9k_set_hw_capab(struct at
|
||||
|
||||
hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN |
|
||||
WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL |
|
||||
@@ -174,14 +174,13 @@
|
||||
-
|
||||
- hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS;
|
||||
+ WIPHY_FLAG_HAS_CHANNEL_SWITCH |
|
||||
+ WIPHY_FLAG_SUPPORTS_5_10_MHZ |
|
||||
+ WIPHY_FLAG_SUPPORTS_TDLS;
|
||||
|
||||
hw->queues = 4;
|
||||
hw->max_listen_interval = 1;
|
||||
--- a/drivers/net/wireless/ath/ath9k/init.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/init.c
|
||||
@@ -691,6 +691,7 @@ static int ath9k_init_softc(u16 devid, s
|
||||
@@ -690,6 +690,7 @@ static int ath9k_init_softc(u16 devid, s
|
||||
if (!ath9k_is_chanctx_enabled())
|
||||
sc->cur_chan->hw_queue_base = 0;
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/init.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/init.c
|
||||
@@ -1043,7 +1043,7 @@ int ath9k_init_device(u16 devid, struct
|
||||
@@ -1041,7 +1041,7 @@ int ath9k_init_device(u16 devid, struct
|
||||
|
||||
#ifdef CPTCFG_MAC80211_LEDS
|
||||
/* must be initialized before ieee80211_register_hw */
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
bool reset_power_on;
|
||||
bool htc_reset_init;
|
||||
|
||||
@@ -1080,6 +1088,7 @@ void ath9k_hw_check_nav(struct ath_hw *a
|
||||
@@ -1078,6 +1086,7 @@ void ath9k_hw_check_nav(struct ath_hw *a
|
||||
bool ath9k_hw_check_alive(struct ath_hw *ah);
|
||||
|
||||
bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode);
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
/**************************/
|
||||
/* Initialization */
|
||||
/**************************/
|
||||
@@ -626,6 +706,7 @@ static int ath9k_of_init(struct ath_soft
|
||||
@@ -625,6 +705,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))
|
||||
@@ -633,6 +714,46 @@ static int ath9k_of_init(struct ath_soft
|
||||
@@ -632,6 +713,46 @@ static int ath9k_of_init(struct ath_soft
|
||||
|
||||
ath_dbg(common, CONFIG, "parsing configuration from OF node\n");
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
if (of_property_read_bool(np, "qca,no-eeprom")) {
|
||||
/* ath9k-eeprom-<bus>-<id>.bin */
|
||||
scnprintf(eeprom_name, sizeof(eeprom_name),
|
||||
@@ -651,6 +772,17 @@ static int ath9k_of_init(struct ath_soft
|
||||
@@ -650,6 +771,17 @@ static int ath9k_of_init(struct ath_soft
|
||||
if (ret == -EPROBE_DEFER)
|
||||
return ret;
|
||||
|
||||
|
||||
@@ -374,7 +374,7 @@
|
||||
|
||||
--- a/local-symbols
|
||||
+++ b/local-symbols
|
||||
@@ -118,6 +118,7 @@ ATH9K_WOW=
|
||||
@@ -120,6 +120,7 @@ ATH9K_WOW=
|
||||
ATH9K_RFKILL=
|
||||
ATH9K_CHANNEL_CONTEXT=
|
||||
ATH9K_PCOEM=
|
||||
|
||||
-108
@@ -1,108 +0,0 @@
|
||||
From 3e14d832e30b10478d2b0945ff2651f6784385a7 Mon Sep 17 00:00:00 2001
|
||||
From: Rosen Penev <rosenp@gmail.com>
|
||||
Date: Sat, 16 May 2026 16:43:10 -0700
|
||||
Subject: [PATCH] wifi: ath9k: Clear DMA descriptors without memset
|
||||
|
||||
Clear ath9k DMA descriptors with explicit status word stores instead of
|
||||
memset(). The descriptor rings are coherent DMA memory, which may be
|
||||
mapped uncached on 32-bit powerpc. The optimized memset() path can use
|
||||
dcbz there and trigger an alignment warning.
|
||||
|
||||
Use WRITE_ONCE() for the descriptor status words so the compiler keeps
|
||||
the clears as ordinary stores instead of folding them back into bulk
|
||||
memset(). This covers AR9003 TX status descriptors as well as the RX
|
||||
status area cleared when setting up RX descriptors.
|
||||
|
||||
Assisted-by: Codex:GPT-5.5
|
||||
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
||||
---
|
||||
drivers/net/wireless/ath/ath9k/ar9002_mac.c | 15 +++++++++++++-
|
||||
drivers/net/wireless/ath/ath9k/ar9003_mac.c | 23 +++++++++++++++++----
|
||||
2 files changed, 33 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/ar9002_mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/ar9002_mac.c
|
||||
@@ -403,6 +403,19 @@ static int ar9002_hw_get_duration(struct
|
||||
}
|
||||
}
|
||||
|
||||
+static void ath9k_hw_clear_rxdesc_status(struct ar5416_desc *ads)
|
||||
+{
|
||||
+ WRITE_ONCE(ads->u.rx.status0, 0);
|
||||
+ WRITE_ONCE(ads->u.rx.status1, 0);
|
||||
+ WRITE_ONCE(ads->u.rx.status2, 0);
|
||||
+ WRITE_ONCE(ads->u.rx.status3, 0);
|
||||
+ WRITE_ONCE(ads->u.rx.status4, 0);
|
||||
+ WRITE_ONCE(ads->u.rx.status5, 0);
|
||||
+ WRITE_ONCE(ads->u.rx.status6, 0);
|
||||
+ WRITE_ONCE(ads->u.rx.status7, 0);
|
||||
+ WRITE_ONCE(ads->u.rx.status8, 0);
|
||||
+}
|
||||
+
|
||||
void ath9k_hw_setuprxdesc(struct ath_hw *ah, struct ath_desc *ds,
|
||||
u32 size, u32 flags)
|
||||
{
|
||||
@@ -412,7 +425,7 @@ void ath9k_hw_setuprxdesc(struct ath_hw
|
||||
if (flags & ATH9K_RXDESC_INTREQ)
|
||||
ads->ds_ctl1 |= AR_RxIntrReq;
|
||||
|
||||
- memset(&ads->u.rx, 0, sizeof(ads->u.rx));
|
||||
+ ath9k_hw_clear_rxdesc_status(ads);
|
||||
}
|
||||
EXPORT_SYMBOL(ath9k_hw_setuprxdesc);
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c
|
||||
@@ -352,6 +352,19 @@ static bool ar9003_hw_get_isr(struct ath
|
||||
return true;
|
||||
}
|
||||
|
||||
+static void ath9k_hw_clear_txstatus(struct ar9003_txs *ads)
|
||||
+{
|
||||
+ WRITE_ONCE(ads->ds_info, 0);
|
||||
+ WRITE_ONCE(ads->status1, 0);
|
||||
+ WRITE_ONCE(ads->status2, 0);
|
||||
+ WRITE_ONCE(ads->status3, 0);
|
||||
+ WRITE_ONCE(ads->status4, 0);
|
||||
+ WRITE_ONCE(ads->status5, 0);
|
||||
+ WRITE_ONCE(ads->status6, 0);
|
||||
+ WRITE_ONCE(ads->status7, 0);
|
||||
+ WRITE_ONCE(ads->status8, 0);
|
||||
+}
|
||||
+
|
||||
static int ar9003_hw_proc_txdesc(struct ath_hw *ah, void *ds,
|
||||
struct ath_tx_status *ts)
|
||||
{
|
||||
@@ -370,7 +383,7 @@ static int ar9003_hw_proc_txdesc(struct
|
||||
(MS(ads->ds_info, AR_TxRxDesc) != 1)) {
|
||||
ath_dbg(ath9k_hw_common(ah), XMIT,
|
||||
"Tx Descriptor error %x\n", ads->ds_info);
|
||||
- memset(ads, 0, sizeof(*ads));
|
||||
+ ath9k_hw_clear_txstatus(ads);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
@@ -427,7 +440,7 @@ static int ar9003_hw_proc_txdesc(struct
|
||||
ts->ts_rssi_ext1 = MS(status, AR_TxRSSIAnt11);
|
||||
ts->ts_rssi_ext2 = MS(status, AR_TxRSSIAnt12);
|
||||
|
||||
- memset(ads, 0, sizeof(*ads));
|
||||
+ ath9k_hw_clear_txstatus(ads);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -591,10 +604,12 @@ EXPORT_SYMBOL(ath9k_hw_process_rxdesc_ed
|
||||
|
||||
void ath9k_hw_reset_txstatus_ring(struct ath_hw *ah)
|
||||
{
|
||||
+ int i;
|
||||
+
|
||||
ah->ts_tail = 0;
|
||||
|
||||
- memset((void *) ah->ts_ring, 0,
|
||||
- ah->ts_size * sizeof(struct ar9003_txs));
|
||||
+ for (i = 0; i < ah->ts_size; i++)
|
||||
+ ath9k_hw_clear_txstatus(&ah->ts_ring[i]);
|
||||
|
||||
ath_dbg(ath9k_hw_common(ah), XMIT,
|
||||
"TS Start 0x%x End 0x%x Virt %p, Size %d\n",
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
From 0da0cfb0840f7fe7df34bde4f787d3435e3db674 Mon Sep 17 00:00:00 2001
|
||||
From: Rosen Penev <rosenp@gmail.com>
|
||||
Date: Sat, 16 May 2026 20:28:16 -0700
|
||||
Subject: [PATCH] wifi: ath9k: remove TX99 power array zero init
|
||||
|
||||
This array is fully initialized in the loop itself. No need to zero
|
||||
initialize and then overwrite.
|
||||
|
||||
Remove static from the array. This was a holdover from when the array
|
||||
was a static global variable. It no longer confers any benefit.
|
||||
|
||||
Also add a min() call to avoid the manual if/ternary operation.
|
||||
|
||||
Assisted-by: Codex:GPT-5.5
|
||||
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
||||
---
|
||||
drivers/net/wireless/ath/ath9k/ar9003_phy.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
|
||||
@@ -1737,10 +1737,10 @@ static void ar9003_hw_tx99_stop(struct a
|
||||
|
||||
static void ar9003_hw_tx99_set_txpower(struct ath_hw *ah, u8 txpower)
|
||||
{
|
||||
- static u8 p_pwr_array[ar9300RateSize] = { 0 };
|
||||
+ u8 p_pwr_array[ar9300RateSize];
|
||||
unsigned int i;
|
||||
|
||||
- txpower = txpower <= MAX_RATE_POWER ? txpower : MAX_RATE_POWER;
|
||||
+ txpower = min(txpower, MAX_RATE_POWER);
|
||||
for (i = 0; i < ar9300RateSize; i++)
|
||||
p_pwr_array[i] = txpower;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
static int modparam_bad_frames_preempt;
|
||||
module_param_named(bad_frames_preempt, modparam_bad_frames_preempt, int, 0444);
|
||||
MODULE_PARM_DESC(bad_frames_preempt,
|
||||
@@ -2870,10 +2875,10 @@ static int b43_gpio_init(struct b43_wlde
|
||||
@@ -2879,10 +2884,10 @@ static int b43_gpio_init(struct b43_wlde
|
||||
u32 mask, set;
|
||||
|
||||
b43_maskset32(dev, B43_MMIO_MACCTL, ~B43_MACCTL_GPOUTSMSK, 0);
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
b43-$(CPTCFG_B43_LEDS) += leds.o
|
||||
--- a/drivers/net/wireless/broadcom/b43/main.c
|
||||
+++ b/drivers/net/wireless/broadcom/b43/main.c
|
||||
@@ -2001,10 +2001,12 @@ static void b43_do_interrupt_thread(stru
|
||||
@@ -2002,10 +2002,12 @@ static void b43_do_interrupt_thread(stru
|
||||
dma_reason[0], dma_reason[1],
|
||||
dma_reason[2], dma_reason[3],
|
||||
dma_reason[4], dma_reason[5]);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/drivers/net/wireless/broadcom/b43/main.c
|
||||
+++ b/drivers/net/wireless/broadcom/b43/main.c
|
||||
@@ -1643,7 +1643,7 @@ static void b43_write_beacon_template(st
|
||||
@@ -1644,7 +1644,7 @@ static void b43_write_beacon_template(st
|
||||
len, ram_offset, shm_size_offset, rate);
|
||||
|
||||
/* Write the PHY TX control parameters. */
|
||||
@@ -9,7 +9,7 @@
|
||||
antenna = b43_antenna_to_phyctl(antenna);
|
||||
ctl = b43_shm_read16(dev, B43_SHM_SHARED, B43_SHM_SH_BEACPHYCTL);
|
||||
/* We can't send beacons with short preamble. Would get PHY errors. */
|
||||
@@ -3285,8 +3285,8 @@ static int b43_chip_init(struct b43_wlde
|
||||
@@ -3294,8 +3294,8 @@ static int b43_chip_init(struct b43_wlde
|
||||
|
||||
/* Select the antennae */
|
||||
if (phy->ops->set_rx_antenna)
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
if (phy->type == B43_PHYTYPE_B) {
|
||||
value16 = b43_read16(dev, 0x005E);
|
||||
@@ -3988,7 +3988,6 @@ static int b43_op_config(struct ieee8021
|
||||
@@ -3997,7 +3997,6 @@ static int b43_op_config(struct ieee8021
|
||||
struct b43_wldev *dev = wl->current_dev;
|
||||
struct b43_phy *phy = &dev->phy;
|
||||
struct ieee80211_conf *conf = &hw->conf;
|
||||
@@ -28,7 +28,7 @@
|
||||
int err = 0;
|
||||
|
||||
mutex_lock(&wl->mutex);
|
||||
@@ -4031,11 +4030,9 @@ static int b43_op_config(struct ieee8021
|
||||
@@ -4040,11 +4039,9 @@ static int b43_op_config(struct ieee8021
|
||||
}
|
||||
|
||||
/* Antennas for RX and management frame TX. */
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
if (wl->radio_enabled != phy->radio_on) {
|
||||
if (wl->radio_enabled) {
|
||||
@@ -5178,6 +5175,49 @@ static int b43_op_get_survey(struct ieee
|
||||
@@ -5192,6 +5189,49 @@ static int b43_op_get_survey(struct ieee
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
static const struct ieee80211_ops b43_hw_ops = {
|
||||
.add_chanctx = ieee80211_emulate_add_chanctx,
|
||||
.remove_chanctx = ieee80211_emulate_remove_chanctx,
|
||||
@@ -5204,6 +5244,8 @@ static const struct ieee80211_ops b43_hw
|
||||
@@ -5218,6 +5258,8 @@ static const struct ieee80211_ops b43_hw
|
||||
.sw_scan_complete = b43_op_sw_scan_complete_notifier,
|
||||
.get_survey = b43_op_get_survey,
|
||||
.rfkill_poll = b43_rfkill_poll,
|
||||
@@ -101,7 +101,7 @@
|
||||
};
|
||||
|
||||
/* Hard-reset the chip. Do not call this directly.
|
||||
@@ -5505,6 +5547,8 @@ static int b43_one_core_attach(struct b4
|
||||
@@ -5519,6 +5561,8 @@ static int b43_one_core_attach(struct b4
|
||||
if (!wldev)
|
||||
goto out;
|
||||
|
||||
@@ -110,7 +110,7 @@
|
||||
wldev->use_pio = b43_modparam_pio;
|
||||
wldev->dev = dev;
|
||||
wldev->wl = wl;
|
||||
@@ -5596,6 +5640,9 @@ static struct b43_wl *b43_wireless_init(
|
||||
@@ -5610,6 +5654,9 @@ static struct b43_wl *b43_wireless_init(
|
||||
|
||||
wiphy_ext_feature_set(hw->wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/drivers/net/wireless/broadcom/b43/main.c
|
||||
+++ b/drivers/net/wireless/broadcom/b43/main.c
|
||||
@@ -2887,6 +2887,14 @@ static int b43_gpio_init(struct b43_wlde
|
||||
@@ -2896,6 +2896,14 @@ static int b43_gpio_init(struct b43_wlde
|
||||
} else if (dev->dev->chip_id == 0x5354) {
|
||||
/* Don't allow overtaking buttons GPIOs */
|
||||
set &= 0x2; /* 0x2 is LED GPIO on BCM5354 */
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
#include <net/cfg80211.h>
|
||||
#include <net/netlink.h>
|
||||
#include <uapi/linux/if_arp.h>
|
||||
@@ -8270,31 +8271,45 @@ static void brcmf_cfg80211_reg_notifier(
|
||||
@@ -8272,31 +8273,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;
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ Signed-off-by: Phil Elwell <phil@raspberrypi.com>
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
@@ -3360,6 +3360,7 @@ brcmf_cfg80211_set_power_mgmt(struct wip
|
||||
@@ -3361,6 +3361,7 @@ brcmf_cfg80211_set_power_mgmt(struct wip
|
||||
bphy_err(drvr, "error (%d)\n", err);
|
||||
}
|
||||
|
||||
|
||||
+9
-9
@@ -39,7 +39,7 @@ JIRA: SWWLAN-136577
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h
|
||||
@@ -298,7 +298,7 @@ void brcmf_rx_event(struct device *dev,
|
||||
@@ -304,7 +304,7 @@ void brcmf_rx_event(struct device *dev,
|
||||
|
||||
int brcmf_alloc(struct device *dev, struct brcmf_mp_device *settings);
|
||||
/* Indication from bus module regarding presence/insertion of dongle. */
|
||||
@@ -59,7 +59,7 @@ JIRA: SWWLAN-136577
|
||||
|
||||
MODULE_AUTHOR("Broadcom Corporation");
|
||||
MODULE_DESCRIPTION("Broadcom 802.11 wireless LAN fullmac driver.");
|
||||
@@ -274,6 +276,8 @@ int brcmf_c_preinit_dcmds(struct brcmf_i
|
||||
@@ -273,6 +275,8 @@ int brcmf_c_preinit_dcmds(struct brcmf_i
|
||||
char *clmver;
|
||||
char *ptr;
|
||||
s32 err;
|
||||
@@ -68,7 +68,7 @@ JIRA: SWWLAN-136577
|
||||
|
||||
if (is_valid_ether_addr(ifp->mac_addr)) {
|
||||
/* set mac address */
|
||||
@@ -433,6 +437,41 @@ int brcmf_c_preinit_dcmds(struct brcmf_i
|
||||
@@ -432,6 +436,41 @@ int brcmf_c_preinit_dcmds(struct brcmf_i
|
||||
goto done;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
@@ -1327,7 +1327,7 @@ int brcmf_alloc(struct device *dev, stru
|
||||
@@ -1356,7 +1356,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;
|
||||
@@ -1370,10 +1370,13 @@ int brcmf_attach(struct device *dev)
|
||||
@@ -1399,10 +1399,13 @@ int brcmf_attach(struct device *dev)
|
||||
|
||||
brcmf_fwvid_get_cfg80211_ops(drvr);
|
||||
|
||||
@@ -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
|
||||
@@ -2214,7 +2214,7 @@ static void brcmf_pcie_setup(struct devi
|
||||
@@ -2217,7 +2217,7 @@ static void brcmf_pcie_setup(struct devi
|
||||
|
||||
init_waitqueue_head(&devinfo->mbdata_resp_wait);
|
||||
|
||||
@@ -518,7 +518,7 @@ JIRA: SWWLAN-136577
|
||||
/* ready */
|
||||
return;
|
||||
|
||||
@@ -4652,3 +4863,40 @@ int brcmf_sdio_sleep(struct brcmf_sdio *
|
||||
@@ -4658,3 +4869,40 @@ int brcmf_sdio_sleep(struct brcmf_sdio *
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -606,7 +606,7 @@ JIRA: SWWLAN-136577
|
||||
};
|
||||
|
||||
/* sdio core registers */
|
||||
@@ -367,4 +398,83 @@ void brcmf_sdio_wowl_config(struct devic
|
||||
@@ -368,4 +399,83 @@ void brcmf_sdio_wowl_config(struct devic
|
||||
int brcmf_sdio_sleep(struct brcmf_sdio *bus, bool sleep);
|
||||
void brcmf_sdio_trigger_dpc(struct brcmf_sdio *bus);
|
||||
|
||||
@@ -701,7 +701,7 @@ JIRA: SWWLAN-136577
|
||||
if (ret)
|
||||
goto error;
|
||||
|
||||
@@ -1288,7 +1288,7 @@ static int brcmf_usb_probe_cb(struct brc
|
||||
@@ -1289,7 +1289,7 @@ static int brcmf_usb_probe_cb(struct brc
|
||||
ret = brcmf_alloc(devinfo->dev, devinfo->settings);
|
||||
if (ret)
|
||||
goto fail;
|
||||
|
||||
+2
-2
@@ -108,7 +108,7 @@ Signed-off-by: Chi-hsien Lin <chi-hsien.lin@cypress.com>
|
||||
*/
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/p2p.c
|
||||
@@ -1281,6 +1281,10 @@ static s32 brcmf_p2p_abort_action_frame(
|
||||
@@ -1283,6 +1283,10 @@ static s32 brcmf_p2p_abort_action_frame(
|
||||
brcmf_dbg(TRACE, "Enter\n");
|
||||
|
||||
vif = p2p->bss_idx[P2PAPI_BSSCFG_DEVICE].vif;
|
||||
@@ -119,7 +119,7 @@ Signed-off-by: Chi-hsien Lin <chi-hsien.lin@cypress.com>
|
||||
err = brcmf_fil_bsscfg_data_set(vif->ifp, "actframe_abort", &int_val,
|
||||
sizeof(s32));
|
||||
if (err)
|
||||
@@ -1817,6 +1821,7 @@ bool brcmf_p2p_send_action_frame(struct
|
||||
@@ -1819,6 +1823,7 @@ bool brcmf_p2p_send_action_frame(struct
|
||||
/* validate channel and p2p ies */
|
||||
if (config_af_params.search_channel &&
|
||||
IS_P2P_SOCIAL_CHANNEL(le32_to_cpu(af_params->channel)) &&
|
||||
|
||||
+3
-3
@@ -9,7 +9,7 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
|
||||
@@ -8049,6 +8049,7 @@ static s32 brcmf_translate_country_code(
|
||||
@@ -8051,6 +8051,7 @@ static s32 brcmf_translate_country_code(
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
static int
|
||||
brcmf_parse_dump_obss(char *buf, struct brcmf_dump_survey *survey)
|
||||
{
|
||||
@@ -8271,6 +8272,7 @@ exit:
|
||||
@@ -8273,6 +8274,7 @@ exit:
|
||||
brcmf_set_mpc(ifp, 1);
|
||||
return err;
|
||||
}
|
||||
@@ -25,7 +25,7 @@ Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
|
||||
|
||||
static void brcmf_cfg80211_reg_notifier(struct wiphy *wiphy,
|
||||
struct regulatory_request *req)
|
||||
@@ -8437,8 +8439,10 @@ struct brcmf_cfg80211_info *brcmf_cfg802
|
||||
@@ -8439,8 +8441,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
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
--- a/compat/lib-crypto-aes.c
|
||||
+++ b/compat/lib-crypto-aes.c
|
||||
@@ -515,7 +515,7 @@ void aes_decrypt(const struct aes_key *k
|
||||
}
|
||||
EXPORT_SYMBOL(aes_decrypt);
|
||||
|
||||
-#if IS_ENABLED(CONFIG_CRYPTO_LIB_AES_CBC_MACS)
|
||||
+#if IS_ENABLED(CPTCFG_BACKPORTED_BPAUTO_CRYPTO_LIB_AES_CBC_MACS)
|
||||
|
||||
#ifndef aes_cbcmac_blocks_arch
|
||||
static bool aes_cbcmac_blocks_arch(u8 h[AES_BLOCK_SIZE],
|
||||
@@ -710,49 +710,8 @@ void aes_cbcmac_final(struct aes_cbcmac_
|
||||
}
|
||||
EXPORT_SYMBOL_NS_GPL(aes_cbcmac_final, "CRYPTO_INTERNAL");
|
||||
|
||||
-/*
|
||||
- * FIPS cryptographic algorithm self-test for AES-CMAC. As per the FIPS 140-3
|
||||
- * Implementation Guidance, a cryptographic algorithm self-test for at least one
|
||||
- * of AES-GCM, AES-CCM, AES-CMAC, or AES-GMAC is required if any of those modes
|
||||
- * is implemented. This fulfills that requirement via AES-CMAC.
|
||||
- *
|
||||
- * This is just for FIPS. The full tests are in the KUnit test suite.
|
||||
- */
|
||||
-static void __init aes_cmac_fips_test(void)
|
||||
-{
|
||||
- struct aes_cmac_key key;
|
||||
- u8 mac[AES_BLOCK_SIZE];
|
||||
-
|
||||
- if (aes_cmac_preparekey(&key, fips_test_key, sizeof(fips_test_key)) !=
|
||||
- 0)
|
||||
- panic("aes: CMAC FIPS self-test failed (preparekey)\n");
|
||||
- aes_cmac(&key, fips_test_data, sizeof(fips_test_data), mac);
|
||||
- if (memcmp(fips_test_aes_cmac_value, mac, sizeof(mac)) != 0)
|
||||
- panic("aes: CMAC FIPS self-test failed (wrong MAC)\n");
|
||||
- memzero_explicit(&key, sizeof(key));
|
||||
-}
|
||||
-#else /* CONFIG_CRYPTO_LIB_AES_CBC_MACS */
|
||||
-static inline void aes_cmac_fips_test(void)
|
||||
-{
|
||||
-}
|
||||
#endif /* !CONFIG_CRYPTO_LIB_AES_CBC_MACS */
|
||||
|
||||
-static int __init aes_mod_init(void)
|
||||
-{
|
||||
-#ifdef aes_mod_init_arch
|
||||
- aes_mod_init_arch();
|
||||
-#endif
|
||||
- if (fips_enabled)
|
||||
- aes_cmac_fips_test();
|
||||
- return 0;
|
||||
-}
|
||||
-subsys_initcall(aes_mod_init);
|
||||
-
|
||||
-static void __exit aes_mod_exit(void)
|
||||
-{
|
||||
-}
|
||||
-module_exit(aes_mod_exit);
|
||||
-
|
||||
MODULE_DESCRIPTION("AES block cipher");
|
||||
MODULE_AUTHOR("Ard Biesheuvel <ard.biesheuvel@linaro.org>");
|
||||
MODULE_AUTHOR("Eric Biggers <ebiggers@kernel.org>");
|
||||
@@ -32,7 +32,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
source "$BACKPORT_DIR/drivers/net/usb/Kconfig"
|
||||
--- a/Makefile.kernel
|
||||
+++ b/Makefile.kernel
|
||||
@@ -38,9 +38,7 @@ obj-y += compat/
|
||||
@@ -43,9 +43,7 @@ obj-y += compat/
|
||||
|
||||
obj-$(CPTCFG_CFG80211) += net/wireless/
|
||||
obj-$(CPTCFG_MAC80211) += net/mac80211/
|
||||
@@ -44,7 +44,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath11k/Kconfig
|
||||
+++ b/drivers/net/wireless/ath/ath11k/Kconfig
|
||||
@@ -25,9 +25,9 @@ config ATH11K_PCI
|
||||
@@ -24,9 +24,9 @@ config ATH11K_PCI
|
||||
tristate "Atheros ath11k PCI support"
|
||||
depends on m
|
||||
depends on ATH11K && PCI
|
||||
@@ -59,7 +59,7 @@ Signed-off-by: Robert Marko <robimarko@gmail.com>
|
||||
This module adds support for PCIE bus
|
||||
--- a/local-symbols
|
||||
+++ b/local-symbols
|
||||
@@ -53,14 +53,6 @@ MAC80211_MESH_PS_DEBUG=
|
||||
@@ -55,14 +55,6 @@ MAC80211_MESH_PS_DEBUG=
|
||||
MAC80211_TDLS_DEBUG=
|
||||
MAC80211_DEBUG_COUNTERS=
|
||||
MAC80211_STA_HASH_MAX_SIZE=
|
||||
|
||||
@@ -680,7 +680,7 @@
|
||||
|
||||
--- a/net/wireless/trace.h
|
||||
+++ b/net/wireless/trace.h
|
||||
@@ -478,7 +478,11 @@ TRACE_EVENT(rdev_add_virtual_intf,
|
||||
@@ -488,7 +488,11 @@ TRACE_EVENT(rdev_add_virtual_intf,
|
||||
),
|
||||
TP_fast_assign(
|
||||
WIPHY_ASSIGN;
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
--- a/net/wireless/sysfs.c
|
||||
+++ b/net/wireless/sysfs.c
|
||||
@@ -160,12 +160,21 @@ static SIMPLE_DEV_PM_OPS(wiphy_pm_ops, w
|
||||
#define WIPHY_PM_OPS NULL
|
||||
#endif
|
||||
|
||||
+#if LINUX_VERSION_IS_GEQ(7,0,0)
|
||||
static const struct ns_common *wiphy_namespace(const struct device *d)
|
||||
{
|
||||
struct wiphy *wiphy = container_of(d, struct wiphy, dev);
|
||||
|
||||
return to_ns_common(wiphy_net(wiphy));
|
||||
}
|
||||
+#else
|
||||
+static const void *wiphy_namespace(const struct device *d)
|
||||
+{
|
||||
+ struct wiphy *wiphy = container_of(d, struct wiphy, dev);
|
||||
+
|
||||
+ return wiphy_net(wiphy);
|
||||
+}
|
||||
+#endif
|
||||
|
||||
struct class ieee80211_class = {
|
||||
.name = "ieee80211",
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/wireless/core.c
|
||||
+++ b/net/wireless/core.c
|
||||
@@ -162,11 +162,19 @@ int cfg80211_switch_netns(struct cfg8021
|
||||
@@ -165,11 +165,19 @@ int cfg80211_switch_netns(struct cfg8021
|
||||
list_for_each_entry(wdev, &rdev->wiphy.wdev_list, list) {
|
||||
if (!wdev->netdev)
|
||||
continue;
|
||||
@@ -20,7 +20,7 @@
|
||||
}
|
||||
|
||||
if (err) {
|
||||
@@ -178,11 +186,19 @@ int cfg80211_switch_netns(struct cfg8021
|
||||
@@ -181,11 +189,19 @@ int cfg80211_switch_netns(struct cfg8021
|
||||
list) {
|
||||
if (!wdev->netdev)
|
||||
continue;
|
||||
@@ -40,7 +40,7 @@
|
||||
}
|
||||
|
||||
return err;
|
||||
@@ -1549,7 +1565,11 @@ static int cfg80211_netdev_notifier_call
|
||||
@@ -1721,7 +1737,11 @@ static int cfg80211_netdev_notifier_call
|
||||
SET_NETDEV_DEVTYPE(dev, &wiphy_type);
|
||||
wdev->netdev = dev;
|
||||
/* can only change netns with wiphy */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c
|
||||
@@ -1585,7 +1585,11 @@ static int brcmf_usb_reset_device(struct
|
||||
@@ -1588,7 +1588,11 @@ static int brcmf_usb_reset_device(struct
|
||||
|
||||
void brcmf_usb_exit(void)
|
||||
{
|
||||
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
--- a/drivers/net/wireless/virtual/mac80211_hwsim.c
|
||||
+++ b/drivers/net/wireless/virtual/mac80211_hwsim.c
|
||||
@@ -6926,6 +6926,7 @@ static void hwsim_virtio_rx_done(struct
|
||||
|
||||
static int init_vqs(struct virtio_device *vdev)
|
||||
{
|
||||
+#if LINUX_VERSION_IS_GEQ(6,11,0)
|
||||
struct virtqueue_info vqs_info[HWSIM_NUM_VQS] = {
|
||||
[HWSIM_VQ_TX] = { "tx", hwsim_virtio_tx_done },
|
||||
[HWSIM_VQ_RX] = { "rx", hwsim_virtio_rx_done },
|
||||
@@ -6933,6 +6934,19 @@ static int init_vqs(struct virtio_device
|
||||
|
||||
return virtio_find_vqs(vdev, HWSIM_NUM_VQS,
|
||||
hwsim_vqs, vqs_info, NULL);
|
||||
+#else /* Using the old ABI, copied from kernel 6.6 */
|
||||
+ vq_callback_t *callbacks[HWSIM_NUM_VQS] = {
|
||||
+ [HWSIM_VQ_TX] = hwsim_virtio_tx_done,
|
||||
+ [HWSIM_VQ_RX] = hwsim_virtio_rx_done,
|
||||
+ };
|
||||
+ const char *names[HWSIM_NUM_VQS] = {
|
||||
+ [HWSIM_VQ_TX] = "tx",
|
||||
+ [HWSIM_VQ_RX] = "rx",
|
||||
+ };
|
||||
+
|
||||
+ return virtio_find_vqs(vdev, HWSIM_NUM_VQS,
|
||||
+ hwsim_vqs, callbacks, names, NULL);
|
||||
+#endif
|
||||
}
|
||||
|
||||
static int fill_vq(struct virtqueue *vq)
|
||||
@@ -1,14 +0,0 @@
|
||||
--- a/drivers/net/wireless/realtek/rtw88/usb.c
|
||||
+++ b/drivers/net/wireless/realtek/rtw88/usb.c
|
||||
@@ -974,7 +974,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;
|
||||
@@ -124,7 +124,7 @@
|
||||
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);
|
||||
+#if LINUX_VERSION_IS_GEQ(6,14,0)
|
||||
+#if LINUX_VERSION_IS_LESS(6,14,0)
|
||||
+ struct file_operations fops;
|
||||
+#endif
|
||||
/* Offset of struct b43_dfs_file in struct b43_dfsentry */
|
||||
@@ -218,7 +218,7 @@
|
||||
|
||||
B43_DEBUGFS_FOPS(shm16read, shm16read__read_file, shm16read__write_file);
|
||||
B43_DEBUGFS_FOPS(shm16write, NULL, shm16write__write_file);
|
||||
@@ -698,12 +737,21 @@ void b43_debugfs_add_device(struct b43_w
|
||||
@@ -697,12 +736,21 @@ void b43_debugfs_add_device(struct b43_w
|
||||
e->shm32read_routing_next = 0xFFFFFFFF; /* invalid routing */
|
||||
e->shm32read_addr_next = 0xFFFFFFFF; /* invalid address */
|
||||
|
||||
|
||||
+6
-6
@@ -58,7 +58,7 @@
|
||||
.llseek = default_llseek,
|
||||
};
|
||||
|
||||
@@ -344,9 +349,10 @@ static ssize_t aql_enable_write(struct f
|
||||
@@ -335,9 +340,10 @@ static ssize_t aql_enable_write(struct f
|
||||
return count;
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
.llseek = default_llseek,
|
||||
};
|
||||
|
||||
@@ -394,9 +400,10 @@ static ssize_t force_tx_status_write(str
|
||||
@@ -373,9 +379,10 @@ static ssize_t force_tx_status_write(str
|
||||
return count;
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
.llseek = default_llseek,
|
||||
};
|
||||
|
||||
@@ -421,8 +428,9 @@ static ssize_t reset_write(struct file *
|
||||
@@ -400,8 +407,9 @@ static ssize_t reset_write(struct file *
|
||||
return count;
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
.llseek = noop_llseek,
|
||||
};
|
||||
#endif
|
||||
@@ -649,8 +657,9 @@ static ssize_t stats_ ##name## _read(str
|
||||
@@ -629,8 +637,9 @@ static ssize_t stats_ ##name## _read(str
|
||||
print_devstats_##name); \
|
||||
} \
|
||||
\
|
||||
@@ -139,7 +139,7 @@
|
||||
|
||||
--- a/net/mac80211/debugfs_netdev.c
|
||||
+++ b/net/mac80211/debugfs_netdev.c
|
||||
@@ -221,9 +221,10 @@ static ssize_t ieee80211_if_fmt_##name(
|
||||
@@ -222,9 +222,10 @@ static ssize_t ieee80211_if_fmt_##name(
|
||||
}
|
||||
|
||||
#define _IEEE80211_IF_FILE_OPS(name, _read, _write) \
|
||||
@@ -186,7 +186,7 @@
|
||||
|
||||
--- a/net/mac80211/rate.c
|
||||
+++ b/net/mac80211/rate.c
|
||||
@@ -252,8 +252,9 @@ static ssize_t rcname_read(struct file *
|
||||
@@ -250,8 +250,9 @@ static ssize_t rcname_read(struct file *
|
||||
ref->ops->name, len);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
--- a/backport-include/linux/net.h
|
||||
+++ b/backport-include/linux/net.h
|
||||
@@ -3,12 +3,4 @@
|
||||
#include_next <linux/net.h>
|
||||
#include <linux/static_key.h>
|
||||
|
||||
-
|
||||
-#ifndef SOCKWQ_ASYNC_NOSPACE
|
||||
-#define SOCKWQ_ASYNC_NOSPACE SOCK_ASYNC_NOSPACE
|
||||
-#endif
|
||||
-#ifndef SOCKWQ_ASYNC_WAITDATA
|
||||
-#define SOCKWQ_ASYNC_WAITDATA SOCK_ASYNC_WAITDATA
|
||||
-#endif
|
||||
-
|
||||
#endif /* __BACKPORT_LINUX_NET_H */
|
||||
@@ -50,6 +50,6 @@ base-commit: 0d9b41daa5907756a31772d8af8ac5ff25cf17c1
|
||||
|
||||
-#define MT7601U_FIRMWARE "mt7601u.bin"
|
||||
+#define MT7601U_FIRMWARE "mediatek/mt7601u.bin"
|
||||
#define MT7601U_FIRMWARE_PATHS ARRAY_SIZE(mt7601u_fw_paths)
|
||||
|
||||
#define MT_VEND_REQ_MAX_RETRY 10
|
||||
#define MT_VEND_REQ_TOUT_MS 300
|
||||
-66
@@ -1,66 +0,0 @@
|
||||
From 27882f047c76a7c48988952df5515df13be2fd72 Mon Sep 17 00:00:00 2001
|
||||
From: Georgi Valkov <gvalkov@gmail.com>
|
||||
Date: Sat, 11 Jul 2026 01:17:00 +0300
|
||||
Subject: [PATCH] wifi: mwifiex: fix freeze for 60 seconds caused by
|
||||
request_firmware
|
||||
|
||||
Fix regression in rgpower table loading, caused by using
|
||||
request_firmware(): when the requested firmware does not exist, e.g.
|
||||
nxp/rgpower_WW.bin does not exist on OpenWRT builds for WRT3200ACM,
|
||||
request_firmware() falls back to firmware_fallback_sysfs(), which expects
|
||||
the firmware to be provided by user space using SYSFS. No such utility is
|
||||
provided in this configuration, so the entire system locks up for 60
|
||||
seconds, until the request times out. During this time, no other log
|
||||
messages are observed, and the device does not respond to commands over
|
||||
UART.
|
||||
|
||||
The request_firmware() call is performed in the following context:
|
||||
current->comm kworker/1:2 in_task 1 irqs_disabled 0 in_atomic 0
|
||||
|
||||
Fixed by using request_firmware_direct(). This prevents fallback to SYSFS,
|
||||
and avoids delay. The rgpower table is optional. The driver falls back
|
||||
to the device tree power table if the firmware is not present.
|
||||
|
||||
The error code is printed for debugging and returned to the caller,
|
||||
which only cares for success or failure, so there are no side effects.
|
||||
|
||||
Fixes: 7b6f16a25806 ("wifi: mwifiex: add rgpower table loading support")
|
||||
Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
|
||||
---
|
||||
drivers/net/wireless/marvell/mwifiex/sta_ioctl.c | 14 ++++++++------
|
||||
1 file changed, 8 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
|
||||
+++ b/drivers/net/wireless/marvell/mwifiex/sta_ioctl.c
|
||||
@@ -196,6 +196,7 @@ static int mwifiex_request_rgpower_table
|
||||
struct mwifiex_adapter *adapter = priv->adapter;
|
||||
char rgpower_table_name[30];
|
||||
char country_code[3];
|
||||
+ int ret;
|
||||
|
||||
strscpy(country_code, domain_info->country_code, sizeof(country_code));
|
||||
|
||||
@@ -214,16 +215,17 @@ static int mwifiex_request_rgpower_table
|
||||
adapter->rgpower_data = NULL;
|
||||
}
|
||||
|
||||
- if ((request_firmware(&adapter->rgpower_data, rgpower_table_name,
|
||||
- adapter->dev))) {
|
||||
+ ret = request_firmware_direct(&adapter->rgpower_data, rgpower_table_name,
|
||||
+ adapter->dev);
|
||||
+
|
||||
+ if (ret) {
|
||||
mwifiex_dbg(
|
||||
adapter, INFO,
|
||||
- "info: %s: failed to request regulatory power table\n",
|
||||
- __func__);
|
||||
- return -EIO;
|
||||
+ "info: %s: failed to request regulatory power table: %d\n",
|
||||
+ __func__, ret);
|
||||
}
|
||||
|
||||
- return 0;
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
static int mwifiex_dnld_rgpower_table(struct mwifiex_private *priv)
|
||||
-131
@@ -1,131 +0,0 @@
|
||||
From 1cb5845a58d8e1f85d5766c6fbcbfddf96c212a1 Mon Sep 17 00:00:00 2001
|
||||
From: Georgi Valkov <gvalkov@gmail.com>
|
||||
Date: Thu, 16 Jul 2026 03:17:28 +0300
|
||||
Subject: [PATCH] wifi: mwifiex: replace one-element arrays with flexible array
|
||||
members
|
||||
|
||||
Replace deprecated one-element arrays with flexible array members.
|
||||
CONFIG_FORTIFY_SOURCE reports the following warning when
|
||||
one-element arrays are used as variable-length buffers:
|
||||
|
||||
sta_cmd.c:1033 mwifiex_sta_prepare_cmd
|
||||
memcpy: detected field-spanning write (size 84) of single field
|
||||
"domain->triplet" at .../marvell/mwifiex/sta_cmd.c:1033 (size 3)
|
||||
|
||||
Convert affected structs to use flexible array members.
|
||||
- Preserve existing wire layouts.
|
||||
- Use DECLARE_FLEX_ARRAY() for structs inside affected unions.
|
||||
|
||||
Tested-on: WRT3200ACM, OpenWrt
|
||||
Signed-off-by: Georgi Valkov <gvalkov@gmail.com>
|
||||
Reviewed-by: Francesco Dolcini <francesco.dolcini@toradex.com>
|
||||
Link: https://patch.msgid.link/20260716001728.57799-1-gvalkov@gmail.com
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
drivers/net/wireless/marvell/mwifiex/fw.h | 18 +++++++++---------
|
||||
drivers/net/wireless/marvell/mwifiex/join.c | 8 ++++----
|
||||
drivers/net/wireless/marvell/mwifiex/sta_cmd.c | 2 +-
|
||||
3 files changed, 14 insertions(+), 14 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/marvell/mwifiex/fw.h
|
||||
+++ b/drivers/net/wireless/marvell/mwifiex/fw.h
|
||||
@@ -823,7 +823,7 @@ struct chan_band_param_set {
|
||||
|
||||
struct mwifiex_ie_types_chan_band_list_param_set {
|
||||
struct mwifiex_ie_types_header header;
|
||||
- struct chan_band_param_set chan_band_param[1];
|
||||
+ struct chan_band_param_set chan_band_param[];
|
||||
} __packed;
|
||||
|
||||
struct mwifiex_ie_types_rates_param_set {
|
||||
@@ -886,7 +886,7 @@ struct mwifiex_ie_types_wildcard_ssid_pa
|
||||
#define TSF_DATA_SIZE 8
|
||||
struct mwifiex_ie_types_tsf_timestamp {
|
||||
struct mwifiex_ie_types_header header;
|
||||
- u8 tsf_data[1];
|
||||
+ u8 tsf_data[];
|
||||
} __packed;
|
||||
|
||||
struct mwifiex_cf_param_set {
|
||||
@@ -903,8 +903,8 @@ struct mwifiex_ibss_param_set {
|
||||
struct mwifiex_ie_types_ss_param_set {
|
||||
struct mwifiex_ie_types_header header;
|
||||
union {
|
||||
- struct mwifiex_cf_param_set cf_param_set[1];
|
||||
- struct mwifiex_ibss_param_set ibss_param_set[1];
|
||||
+ DECLARE_FLEX_ARRAY(struct mwifiex_cf_param_set, cf_param_set);
|
||||
+ DECLARE_FLEX_ARRAY(struct mwifiex_ibss_param_set, ibss_param_set);
|
||||
} cf_ibss;
|
||||
} __packed;
|
||||
|
||||
@@ -922,8 +922,8 @@ struct mwifiex_ds_param_set {
|
||||
struct mwifiex_ie_types_phy_param_set {
|
||||
struct mwifiex_ie_types_header header;
|
||||
union {
|
||||
- struct mwifiex_fh_param_set fh_param_set[1];
|
||||
- struct mwifiex_ds_param_set ds_param_set[1];
|
||||
+ DECLARE_FLEX_ARRAY(struct mwifiex_fh_param_set, fh_param_set);
|
||||
+ DECLARE_FLEX_ARRAY(struct mwifiex_ds_param_set, ds_param_set);
|
||||
} fh_ds;
|
||||
} __packed;
|
||||
|
||||
@@ -1383,7 +1383,7 @@ struct host_cmd_ds_802_11_snmp_mib {
|
||||
__le16 query_type;
|
||||
__le16 oid;
|
||||
__le16 buf_size;
|
||||
- u8 value[1];
|
||||
+ u8 value[];
|
||||
} __packed;
|
||||
|
||||
struct mwifiex_rate_scope {
|
||||
@@ -1551,7 +1551,7 @@ struct mwifiex_scan_cmd_config {
|
||||
* TLV_TYPE_CHANLIST, mwifiex_ie_types_chan_list_param_set
|
||||
* WLAN_EID_SSID, mwifiex_ie_types_ssid_param_set
|
||||
*/
|
||||
- u8 tlv_buf[1]; /* SSID TLV(s) and ChanList TLVs are stored
|
||||
+ u8 tlv_buf[]; /* SSID TLV(s) and ChanList TLVs are stored
|
||||
here */
|
||||
} __packed;
|
||||
|
||||
@@ -1683,7 +1683,7 @@ struct host_cmd_ds_802_11_bg_scan_query_
|
||||
struct mwifiex_ietypes_domain_param_set {
|
||||
struct mwifiex_ie_types_header header;
|
||||
u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
|
||||
- struct ieee80211_country_ie_triplet triplet[1];
|
||||
+ struct ieee80211_country_ie_triplet triplet[];
|
||||
} __packed;
|
||||
|
||||
struct host_cmd_ds_802_11d_domain_info {
|
||||
--- a/drivers/net/wireless/marvell/mwifiex/join.c
|
||||
+++ b/drivers/net/wireless/marvell/mwifiex/join.c
|
||||
@@ -421,15 +421,15 @@ int mwifiex_cmd_802_11_associate(struct
|
||||
|
||||
phy_tlv = (struct mwifiex_ie_types_phy_param_set *) pos;
|
||||
phy_tlv->header.type = cpu_to_le16(WLAN_EID_DS_PARAMS);
|
||||
- phy_tlv->header.len = cpu_to_le16(sizeof(phy_tlv->fh_ds.ds_param_set));
|
||||
- memcpy(&phy_tlv->fh_ds.ds_param_set,
|
||||
+ phy_tlv->header.len = cpu_to_le16(sizeof(*phy_tlv->fh_ds.ds_param_set));
|
||||
+ memcpy(phy_tlv->fh_ds.ds_param_set,
|
||||
&bss_desc->phy_param_set.ds_param_set.current_chan,
|
||||
- sizeof(phy_tlv->fh_ds.ds_param_set));
|
||||
+ sizeof(*phy_tlv->fh_ds.ds_param_set));
|
||||
pos += sizeof(phy_tlv->header) + le16_to_cpu(phy_tlv->header.len);
|
||||
|
||||
ss_tlv = (struct mwifiex_ie_types_ss_param_set *) pos;
|
||||
ss_tlv->header.type = cpu_to_le16(WLAN_EID_CF_PARAMS);
|
||||
- ss_tlv->header.len = cpu_to_le16(sizeof(ss_tlv->cf_ibss.cf_param_set));
|
||||
+ ss_tlv->header.len = cpu_to_le16(sizeof(*ss_tlv->cf_ibss.cf_param_set));
|
||||
pos += sizeof(ss_tlv->header) + le16_to_cpu(ss_tlv->header.len);
|
||||
|
||||
/* Get the common rates supported between the driver and the BSS Desc */
|
||||
--- a/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
|
||||
+++ b/drivers/net/wireless/marvell/mwifiex/sta_cmd.c
|
||||
@@ -108,7 +108,7 @@ static int mwifiex_cmd_802_11_snmp_mib(s
|
||||
"cmd: SNMP_CMD: cmd_oid = 0x%x\n", cmd_oid);
|
||||
cmd->command = cpu_to_le16(HostCmd_CMD_802_11_SNMP_MIB);
|
||||
cmd->size = cpu_to_le16(sizeof(struct host_cmd_ds_802_11_snmp_mib)
|
||||
- - 1 + S_DS_GEN);
|
||||
+ + S_DS_GEN);
|
||||
|
||||
snmp_mib->oid = cpu_to_le16((u16)cmd_oid);
|
||||
if (cmd_action == HostCmd_ACT_GEN_GET) {
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
From: Rosen Penev <rosenp@gmail.com>
|
||||
Date: Wed, 18 Feb 2026 16:17:47 -0800
|
||||
Subject: [PATCH] wifi: rt2800: add support for eeprom file
|
||||
|
||||
Allows loading through ralink,eeprom.
|
||||
|
||||
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
||||
---
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/nvmem-consumer.h>
|
||||
+#include <linux/property.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
#include "rt2x00.h"
|
||||
@@ -10963,6 +10964,47 @@ int rt2800_read_eeprom_efuse(struct rt2x
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(rt2800_read_eeprom_efuse);
|
||||
|
||||
+int rt2800_read_eeprom_file(struct rt2x00_dev *rt2x00dev)
|
||||
+{
|
||||
+ struct device *dev = rt2x00dev->dev;
|
||||
+ const struct firmware *ee;
|
||||
+ const char *ee_name;
|
||||
+ int retval;
|
||||
+
|
||||
+ if (device_property_read_string(dev, "ralink,eeprom", &ee_name)) {
|
||||
+ rt2x00_err(rt2x00dev, "Required EEPROM name is missing.");
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ rt2x00_info(rt2x00dev, "Loading EEPROM data from '%s'.\n", ee_name);
|
||||
+
|
||||
+ retval = request_firmware(&ee, ee_name, rt2x00dev->dev);
|
||||
+ if (retval) {
|
||||
+ rt2x00_err(rt2x00dev, "Failed to request EEPROM.\n");
|
||||
+ return retval;
|
||||
+ }
|
||||
+
|
||||
+ if (!ee || !ee->size || !ee->data) {
|
||||
+ rt2x00_err(rt2x00dev, "Failed to read EEPROM file.\n");
|
||||
+ return -ENOENT;
|
||||
+ }
|
||||
+
|
||||
+ if (ee->size != rt2x00dev->ops->eeprom_size) {
|
||||
+ rt2x00_err(rt2x00dev,
|
||||
+ "EEPROM file size is invalid, it should be %d bytes\n",
|
||||
+ rt2x00dev->ops->eeprom_size);
|
||||
+ retval = -EINVAL;
|
||||
+ goto err_release_ee;
|
||||
+ }
|
||||
+
|
||||
+ memcpy(rt2x00dev->eeprom, ee->data, rt2x00dev->ops->eeprom_size);
|
||||
+
|
||||
+err_release_ee:
|
||||
+ release_firmware(ee);
|
||||
+ return retval;
|
||||
+}
|
||||
+EXPORT_SYMBOL_GPL(rt2800_read_eeprom_file);
|
||||
+
|
||||
int rt2800_read_eeprom_nvmem(struct rt2x00_dev *rt2x00dev)
|
||||
{
|
||||
struct device *dev = rt2x00dev->dev;
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
|
||||
@@ -248,6 +248,7 @@ void rt2800_disable_radio(struct rt2x00_
|
||||
int rt2800_efuse_detect(struct rt2x00_dev *rt2x00dev);
|
||||
int rt2800_read_eeprom_efuse(struct rt2x00_dev *rt2x00dev);
|
||||
|
||||
+int rt2800_read_eeprom_file(struct rt2x00_dev *rt2x00dev);
|
||||
int rt2800_read_eeprom_nvmem(struct rt2x00_dev *rt2x00dev);
|
||||
|
||||
int rt2800_probe_hw(struct rt2x00_dev *rt2x00dev);
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800soc.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800soc.c
|
||||
@@ -97,6 +97,9 @@ static int rt2800soc_read_eeprom(struct
|
||||
if (!rt2800_read_eeprom_nvmem(rt2x00dev))
|
||||
return 0;
|
||||
|
||||
+ if (!rt2800_read_eeprom_file(rt2x00dev))
|
||||
+ return 0;
|
||||
+
|
||||
base_addr = ioremap(0x1F040000, EEPROM_SIZE);
|
||||
if (!base_addr)
|
||||
return -ENOMEM;
|
||||
-225
@@ -1,225 +0,0 @@
|
||||
From 1046fc9e98936991aeb0b0656c84833d96a63c0f Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Sun, 15 Oct 2023 14:22:49 +0200
|
||||
Subject: [PATCH 1/5] wifi: rt2x00: Add support for loading EEPROM from
|
||||
userspace
|
||||
|
||||
Add support for loading EEPROM from userspace.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
---
|
||||
drivers/net/wireless/ralink/rt2x00/Kconfig | 5 ++
|
||||
drivers/net/wireless/ralink/rt2x00/Makefile | 1 +
|
||||
.../net/wireless/ralink/rt2x00/rt2800soc.c | 15 +---
|
||||
drivers/net/wireless/ralink/rt2x00/rt2x00.h | 1 +
|
||||
.../net/wireless/ralink/rt2x00/rt2x00dev.c | 9 +++
|
||||
.../net/wireless/ralink/rt2x00/rt2x00eeprom.c | 75 +++++++++++++++++++
|
||||
.../net/wireless/ralink/rt2x00/rt2800soc.c | 1 +
|
||||
.../net/wireless/ralink/rt2x00/rt2800soc.h | 9 +++
|
||||
8 files changed, 102 insertions(+), 14 deletions(-)
|
||||
create mode 100644 drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c
|
||||
|
||||
--- a/local-symbols
|
||||
+++ b/local-symbols
|
||||
@@ -337,6 +337,7 @@ RT2X00_LIB_FIRMWARE=
|
||||
RT2X00_LIB_CRYPTO=
|
||||
RT2X00_LIB_LEDS=
|
||||
RT2X00_LIB_DEBUGFS=
|
||||
+RT2X00_LIB_EEPROM=
|
||||
RT2X00_DEBUG=
|
||||
WLAN_VENDOR_REALTEK=
|
||||
RTL8180=
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/Kconfig
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/Kconfig
|
||||
@@ -70,6 +70,7 @@ config RT2800PCI
|
||||
select RT2X00_LIB_MMIO
|
||||
select RT2X00_LIB_PCI
|
||||
select RT2X00_LIB_FIRMWARE
|
||||
+ select RT2X00_LIB_EEPROM
|
||||
select RT2X00_LIB_CRYPTO
|
||||
depends on EEPROM_93CX6
|
||||
help
|
||||
@@ -213,6 +214,7 @@ config RT2800SOC
|
||||
select RT2X00_LIB_MMIO
|
||||
select RT2X00_LIB_CRYPTO
|
||||
select RT2X00_LIB_FIRMWARE
|
||||
+ select RT2X00_LIB_EEPROM
|
||||
select RT2800_LIB
|
||||
select RT2800_LIB_MMIO
|
||||
help
|
||||
@@ -259,6 +261,9 @@ config RT2X00_LIB_FIRMWARE
|
||||
config RT2X00_LIB_CRYPTO
|
||||
bool
|
||||
|
||||
+config RT2X00_LIB_EEPROM
|
||||
+ bool
|
||||
+
|
||||
config RT2X00_LIB_LEDS
|
||||
bool
|
||||
default y if (RT2X00_LIB=y && LEDS_CLASS=y) || (RT2X00_LIB=m && LEDS_CLASS!=n)
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/Makefile
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/Makefile
|
||||
@@ -8,6 +8,7 @@ rt2x00lib-$(CPTCFG_RT2X00_LIB_DEBUGFS) +
|
||||
rt2x00lib-$(CPTCFG_RT2X00_LIB_CRYPTO) += rt2x00crypto.o
|
||||
rt2x00lib-$(CPTCFG_RT2X00_LIB_FIRMWARE) += rt2x00firmware.o
|
||||
rt2x00lib-$(CPTCFG_RT2X00_LIB_LEDS) += rt2x00leds.o
|
||||
+rt2x00lib-$(CPTCFG_RT2X00_LIB_EEPROM) += rt2x00eeprom.o
|
||||
|
||||
obj-$(CPTCFG_RT2X00_LIB) += rt2x00lib.o
|
||||
obj-$(CPTCFG_RT2X00_LIB_MMIO) += rt2x00mmio.o
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800soc.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800soc.c
|
||||
@@ -90,19 +90,6 @@ static int rt2800soc_set_device_state(st
|
||||
return retval;
|
||||
}
|
||||
|
||||
-static int rt2800soc_read_eeprom(struct rt2x00_dev *rt2x00dev)
|
||||
-{
|
||||
- void __iomem *base_addr = ioremap(0x1F040000, EEPROM_SIZE);
|
||||
-
|
||||
- if (!base_addr)
|
||||
- return -ENOMEM;
|
||||
-
|
||||
- memcpy_fromio(rt2x00dev->eeprom, base_addr, EEPROM_SIZE);
|
||||
-
|
||||
- iounmap(base_addr);
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
/* Firmware functions */
|
||||
static char *rt2800soc_get_firmware_name(struct rt2x00_dev *rt2x00dev)
|
||||
{
|
||||
@@ -190,7 +177,7 @@ static const struct rt2800_ops rt2800soc
|
||||
.register_multiread = rt2x00mmio_register_multiread,
|
||||
.register_multiwrite = rt2x00mmio_register_multiwrite,
|
||||
.regbusy_read = rt2x00mmio_regbusy_read,
|
||||
- .read_eeprom = rt2800soc_read_eeprom,
|
||||
+ .read_eeprom = rt2x00lib_read_eeprom,
|
||||
.hwcrypt_disabled = rt2800soc_hwcrypt_disabled,
|
||||
.drv_write_firmware = rt2800soc_write_firmware,
|
||||
.drv_init_registers = rt2800mmio_init_registers,
|
||||
@@ -304,6 +291,7 @@ static int rt2x00soc_probe(struct platfo
|
||||
rt2x00dev->name = pdev->dev.driver->name;
|
||||
rt2x00dev->csr.base = mem;
|
||||
|
||||
+ set_bit(REQUIRE_EEPROM_FILE, &rt2x00dev->cap_flags);
|
||||
rt2x00_set_chip_intf(rt2x00dev, RT2X00_CHIP_INTF_SOC);
|
||||
|
||||
retval = rt2x00lib_probe_dev(rt2x00dev);
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00.h
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00.h
|
||||
@@ -692,6 +692,7 @@ enum rt2x00_capability_flags {
|
||||
REQUIRE_HT_TX_DESC,
|
||||
REQUIRE_PS_AUTOWAKE,
|
||||
REQUIRE_DELAYED_RFKILL,
|
||||
+ REQUIRE_EEPROM_FILE,
|
||||
|
||||
/*
|
||||
* Capabilities
|
||||
@@ -1506,4 +1507,13 @@ void rt2x00lib_remove_dev(struct rt2x00_
|
||||
int rt2x00lib_suspend(struct rt2x00_dev *rt2x00dev);
|
||||
int rt2x00lib_resume(struct rt2x00_dev *rt2x00dev);
|
||||
|
||||
+/*
|
||||
+ * EEPROM file handlers.
|
||||
+ */
|
||||
+#ifdef CPTCFG_RT2X00_LIB_EEPROM
|
||||
+int rt2x00lib_read_eeprom(struct rt2x00_dev *rt2x00dev);
|
||||
+#else
|
||||
+#define rt2x00lib_read_eeprom NULL
|
||||
+#endif /* CPTCFG_RT2X00_LIB_EEPROM */
|
||||
+
|
||||
#endif /* RT2X00_H */
|
||||
--- /dev/null
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c
|
||||
@@ -0,0 +1,78 @@
|
||||
+// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
+/* Copyright (C) 2004 - 2009 Ivo van Doorn <IvDoorn@gmail.com>
|
||||
+ * Copyright (C) 2004 - 2009 Gertjan van Wingerde <gwingerde@gmail.com>
|
||||
+ * <http://rt2x00.serialmonkey.com>
|
||||
+ */
|
||||
+
|
||||
+/* Module: rt2x00lib
|
||||
+ * Abstract: rt2x00 eeprom file loading routines.
|
||||
+ */
|
||||
+
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/of.h>
|
||||
+
|
||||
+#include "rt2x00.h"
|
||||
+
|
||||
+static const char *
|
||||
+rt2x00lib_get_eeprom_file_name(struct rt2x00_dev *rt2x00dev)
|
||||
+{
|
||||
+ struct device_node *np = rt2x00dev->dev->of_node;
|
||||
+ const char *eep;
|
||||
+
|
||||
+ if (np && !of_property_read_string(np, "ralink,eeprom", &eep))
|
||||
+ return eep;
|
||||
+
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+static int rt2x00lib_read_eeprom_file(struct rt2x00_dev *rt2x00dev)
|
||||
+{
|
||||
+ const struct firmware *ee;
|
||||
+ const char *ee_name;
|
||||
+ int retval;
|
||||
+
|
||||
+ ee_name = rt2x00lib_get_eeprom_file_name(rt2x00dev);
|
||||
+ if (!ee_name && test_bit(REQUIRE_EEPROM_FILE, &rt2x00dev->cap_flags)) {
|
||||
+ rt2x00_err(rt2x00dev, "Required EEPROM name is missing.");
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ if (!ee_name)
|
||||
+ return -ENOENT;
|
||||
+
|
||||
+ rt2x00_info(rt2x00dev, "Loading EEPROM data from '%s'.\n", ee_name);
|
||||
+
|
||||
+ retval = request_firmware(&ee, ee_name, rt2x00dev->dev);
|
||||
+ if (retval) {
|
||||
+ rt2x00_err(rt2x00dev, "Failed to request EEPROM.\n");
|
||||
+ return retval;
|
||||
+ }
|
||||
+
|
||||
+ if (!ee || !ee->size || !ee->data) {
|
||||
+ rt2x00_err(rt2x00dev, "Failed to read EEPROM file.\n");
|
||||
+ retval = -ENOENT;
|
||||
+ goto err_exit;
|
||||
+ }
|
||||
+
|
||||
+ if (ee->size != rt2x00dev->ops->eeprom_size) {
|
||||
+ rt2x00_err(rt2x00dev,
|
||||
+ "EEPROM file size is invalid, it should be %d bytes\n",
|
||||
+ rt2x00dev->ops->eeprom_size);
|
||||
+ retval = -EINVAL;
|
||||
+ goto err_release_ee;
|
||||
+ }
|
||||
+
|
||||
+ memcpy(rt2x00dev->eeprom, ee->data, rt2x00dev->ops->eeprom_size);
|
||||
+
|
||||
+err_release_ee:
|
||||
+ release_firmware(ee);
|
||||
+err_exit:
|
||||
+ return retval;
|
||||
+}
|
||||
+
|
||||
+int rt2x00lib_read_eeprom(struct rt2x00_dev *rt2x00dev)
|
||||
+{
|
||||
+ return rt2x00lib_read_eeprom_file(rt2x00dev);
|
||||
+}
|
||||
+EXPORT_SYMBOL_GPL(rt2x00lib_read_eeprom);
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800pci.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800pci.c
|
||||
@@ -278,6 +278,9 @@ static int rt2800pci_read_eeprom(struct
|
||||
{
|
||||
int retval;
|
||||
|
||||
+ if (!rt2x00lib_read_eeprom(rt2x00dev))
|
||||
+ return 0;
|
||||
+
|
||||
if (rt2800pci_efuse_detect(rt2x00dev))
|
||||
retval = rt2800pci_read_eeprom_efuse(rt2x00dev);
|
||||
else
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
From: Rosen Penev <rosenp@gmail.com>
|
||||
Date: Wed, 18 Feb 2026 21:23:23 -0800
|
||||
Subject: [PATCH] wifi: rt2x00: add eeprom-data binding
|
||||
|
||||
Useful for embedding eeprom data in dts instead of relying on an
|
||||
external file.
|
||||
|
||||
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
||||
---
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -10953,6 +10953,16 @@ static void rt2800_efuse_read(struct rt2
|
||||
mutex_unlock(&rt2x00dev->csr_mutex);
|
||||
}
|
||||
|
||||
+int rt2800_read_eeprom_data(struct rt2x00_dev *rt2x00dev)
|
||||
+{
|
||||
+ size_t len = rt2x00dev->ops->eeprom_size / sizeof(u16);
|
||||
+ struct device *dev = rt2x00dev->dev;
|
||||
+
|
||||
+ return device_property_read_u16_array(dev, "ralink,eeprom-data",
|
||||
+ rt2x00dev->eeprom, len);
|
||||
+}
|
||||
+EXPORT_SYMBOL_GPL(rt2800_read_eeprom_data);
|
||||
+
|
||||
int rt2800_read_eeprom_efuse(struct rt2x00_dev *rt2x00dev)
|
||||
{
|
||||
unsigned int i;
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
|
||||
@@ -248,6 +248,7 @@ void rt2800_disable_radio(struct rt2x00_
|
||||
int rt2800_efuse_detect(struct rt2x00_dev *rt2x00dev);
|
||||
int rt2800_read_eeprom_efuse(struct rt2x00_dev *rt2x00dev);
|
||||
|
||||
+int rt2800_read_eeprom_data(struct rt2x00_dev *rt2x00dev);
|
||||
int rt2800_read_eeprom_file(struct rt2x00_dev *rt2x00dev);
|
||||
int rt2800_read_eeprom_nvmem(struct rt2x00_dev *rt2x00dev);
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800pci.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800pci.c
|
||||
@@ -281,6 +281,9 @@ static int rt2800pci_read_eeprom(struct
|
||||
if (!rt2800_read_eeprom_nvmem(rt2x00dev))
|
||||
return 0;
|
||||
|
||||
+ if (!rt2800_read_eeprom_data(rt2x00dev))
|
||||
+ return 0;
|
||||
+
|
||||
if (rt2800pci_efuse_detect(rt2x00dev))
|
||||
retval = rt2800pci_read_eeprom_efuse(rt2x00dev);
|
||||
else
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800soc.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800soc.c
|
||||
@@ -100,6 +100,9 @@ static int rt2800soc_read_eeprom(struct
|
||||
if (!rt2800_read_eeprom_file(rt2x00dev))
|
||||
return 0;
|
||||
|
||||
+ if (!rt2800_read_eeprom_data(rt2x00dev))
|
||||
+ return 0;
|
||||
+
|
||||
base_addr = ioremap(0x1F040000, EEPROM_SIZE);
|
||||
if (!base_addr)
|
||||
return -ENOMEM;
|
||||
+46
-29
@@ -14,29 +14,22 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/Kconfig
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/Kconfig
|
||||
@@ -217,6 +217,7 @@ config RT2800SOC
|
||||
select RT2X00_LIB_EEPROM
|
||||
@@ -215,6 +215,7 @@ config RT2800SOC
|
||||
select RT2X00_LIB_FIRMWARE
|
||||
select RT2800_LIB
|
||||
select RT2800_LIB_MMIO
|
||||
+ select MTD if SOC_RT288X || SOC_RT305X
|
||||
help
|
||||
This adds support for Ralink WiSoC devices.
|
||||
Supported chips: RT2880, RT3050, RT3052, RT3350, RT3352.
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c
|
||||
@@ -11,9 +11,65 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
+#if IS_ENABLED(CONFIG_MTD)
|
||||
+#include <linux/mtd/mtd.h>
|
||||
+#include <linux/mtd/partitions.h>
|
||||
+#endif
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -11015,6 +11015,59 @@ err_release_ee:
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(rt2800_read_eeprom_file);
|
||||
|
||||
#include "rt2x00.h"
|
||||
|
||||
+#if IS_ENABLED(CONFIG_MTD)
|
||||
+static int rt2800lib_read_eeprom_mtd(struct rt2x00_dev *rt2x00dev)
|
||||
+#if IS_ENABLED(CONFIG_SOC_RT288X) || IS_ENABLED(CONFIG_SOC_RT305X)
|
||||
+int rt2800_read_eeprom_mtd(struct rt2x00_dev *rt2x00dev)
|
||||
+{
|
||||
+ struct device_node *np = rt2x00dev->dev->of_node, *mtd_np = NULL;
|
||||
+ int size, offset = 0;
|
||||
@@ -85,23 +78,47 @@ Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+EXPORT_SYMBOL_GPL(rt2800_read_eeprom_mtd);
|
||||
+#endif
|
||||
+
|
||||
static const char *
|
||||
rt2x00lib_get_eeprom_file_name(struct rt2x00_dev *rt2x00dev)
|
||||
int rt2800_read_eeprom_nvmem(struct rt2x00_dev *rt2x00dev)
|
||||
{
|
||||
@@ -73,6 +129,14 @@ err_exit:
|
||||
struct device *dev = rt2x00dev->dev;
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
|
||||
@@ -250,6 +250,7 @@ int rt2800_read_eeprom_efuse(struct rt2x
|
||||
|
||||
int rt2x00lib_read_eeprom(struct rt2x00_dev *rt2x00dev)
|
||||
{
|
||||
+ int ret;
|
||||
+
|
||||
+#if IS_ENABLED(CONFIG_MTD)
|
||||
+ ret = rt2800lib_read_eeprom_mtd(rt2x00dev);
|
||||
+ if (!ret)
|
||||
int rt2800_read_eeprom_data(struct rt2x00_dev *rt2x00dev);
|
||||
int rt2800_read_eeprom_file(struct rt2x00_dev *rt2x00dev);
|
||||
+int rt2800_read_eeprom_mtd(struct rt2x00_dev *rt2x00dev);
|
||||
int rt2800_read_eeprom_nvmem(struct rt2x00_dev *rt2x00dev);
|
||||
|
||||
int rt2800_probe_hw(struct rt2x00_dev *rt2x00dev);
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800pci.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800pci.c
|
||||
@@ -281,6 +281,11 @@ static int rt2800pci_read_eeprom(struct
|
||||
if (!rt2800_read_eeprom_nvmem(rt2x00dev))
|
||||
return 0;
|
||||
|
||||
+#if IS_ENABLED(CONFIG_SOC_RT288X) || IS_ENABLED(CONFIG_SOC_RT305X)
|
||||
+ if (!rt2800_read_eeprom_mtd(rt2x00dev))
|
||||
+ return 0;
|
||||
+#endif
|
||||
+
|
||||
return rt2x00lib_read_eeprom_file(rt2x00dev);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(rt2x00lib_read_eeprom);
|
||||
if (!rt2800_read_eeprom_data(rt2x00dev))
|
||||
return 0;
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800soc.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800soc.c
|
||||
@@ -97,6 +97,11 @@ static int rt2800soc_read_eeprom(struct
|
||||
if (!rt2800_read_eeprom_nvmem(rt2x00dev))
|
||||
return 0;
|
||||
|
||||
+#if IS_ENABLED(CONFIG_SOC_RT288X) || IS_ENABLED(CONFIG_SOC_RT305X)
|
||||
+ if (!rt2800_read_eeprom_mtd(rt2x00dev))
|
||||
+ return 0;
|
||||
+#endif
|
||||
+
|
||||
if (!rt2800_read_eeprom_file(rt2x00dev))
|
||||
return 0;
|
||||
|
||||
-81
@@ -1,81 +0,0 @@
|
||||
From 9008cdacdc41f8233f4444b86cf3a17201686e2d Mon Sep 17 00:00:00 2001
|
||||
From: Shiji Yang <yangshiji66@outlook.com>
|
||||
Date: Tue, 18 Jul 2023 20:18:16 +0800
|
||||
Subject: [PATCH 5/5] wifi: rt2x00: support loading eeprom from NVMEM cells
|
||||
|
||||
This patch allows rt2x00 to load eeprom from "eeprom" NVMEM cell.
|
||||
|
||||
Example:
|
||||
|
||||
/* load eeprom from NVMEM provider 'eep' */
|
||||
&wmac {
|
||||
nvmem-cells = <&eep>;
|
||||
nvmem-cell-names = "eeprom";
|
||||
};
|
||||
|
||||
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
---
|
||||
.../net/wireless/ralink/rt2x00/rt2x00eeprom.c | 41 ++++++++++++++++++-
|
||||
1 file changed, 40 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c
|
||||
@@ -15,6 +15,7 @@
|
||||
#include <linux/mtd/mtd.h>
|
||||
#include <linux/mtd/partitions.h>
|
||||
#endif
|
||||
+#include <linux/nvmem-consumer.h>
|
||||
|
||||
#include "rt2x00.h"
|
||||
|
||||
@@ -70,6 +71,38 @@ static int rt2800lib_read_eeprom_mtd(str
|
||||
}
|
||||
#endif
|
||||
|
||||
+static int rt2800lib_read_eeprom_nvmem(struct rt2x00_dev *rt2x00dev)
|
||||
+{
|
||||
+ struct device_node *np = rt2x00dev->dev->of_node;
|
||||
+ unsigned int len = rt2x00dev->ops->eeprom_size;
|
||||
+ struct nvmem_cell *cell;
|
||||
+ const void *data;
|
||||
+ size_t retlen;
|
||||
+ int ret = 0;
|
||||
+
|
||||
+ cell = of_nvmem_cell_get(np, "eeprom");
|
||||
+ if (IS_ERR(cell))
|
||||
+ return PTR_ERR(cell);
|
||||
+
|
||||
+ data = nvmem_cell_read(cell, &retlen);
|
||||
+ nvmem_cell_put(cell);
|
||||
+
|
||||
+ if (IS_ERR(data))
|
||||
+ return PTR_ERR(data);
|
||||
+
|
||||
+ if (retlen != len) {
|
||||
+ dev_err(rt2x00dev->dev, "invalid eeprom size, required: 0x%04x\n", len);
|
||||
+ ret = -EINVAL;
|
||||
+ goto exit;
|
||||
+ }
|
||||
+
|
||||
+ memcpy(rt2x00dev->eeprom, data, len);
|
||||
+
|
||||
+exit:
|
||||
+ kfree(data);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
static const char *
|
||||
rt2x00lib_get_eeprom_file_name(struct rt2x00_dev *rt2x00dev)
|
||||
{
|
||||
@@ -137,6 +170,10 @@ int rt2x00lib_read_eeprom(struct rt2x00_
|
||||
return 0;
|
||||
#endif
|
||||
|
||||
+ ret = rt2800lib_read_eeprom_nvmem(rt2x00dev);
|
||||
+ if (!ret)
|
||||
+ return 0;
|
||||
+
|
||||
return rt2x00lib_read_eeprom_file(rt2x00dev);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(rt2x00lib_read_eeprom);
|
||||
-76
@@ -1,76 +0,0 @@
|
||||
From adf957124a115bdf3e4728e1ea8c70a632648cf0 Mon Sep 17 00:00:00 2001
|
||||
From: Coia Prant <coiaprant@gmail.com>
|
||||
Date: Fri, 14 Feb 2025 15:49:55 +0800
|
||||
Subject: [PATCH] wifi: rt2x00: Add support for loading EEPROM from devicetree
|
||||
embedded data
|
||||
|
||||
This patch allows rt2x00 to load eeprom from devicetree embedded data.
|
||||
|
||||
Example:
|
||||
|
||||
/* load eeprom from embedded data 'eeprom-data' */
|
||||
&wmac {
|
||||
ralink,eeprom-data = <0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff
|
||||
0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff
|
||||
0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff
|
||||
0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff
|
||||
0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff
|
||||
0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff
|
||||
0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff
|
||||
0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff
|
||||
0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff
|
||||
0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff
|
||||
0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff
|
||||
0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff
|
||||
0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff
|
||||
0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff
|
||||
0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff
|
||||
0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff 0xffffffff>;
|
||||
};
|
||||
|
||||
Signed-off-by: Coia Prant <coiaprant@gmail.com>
|
||||
---
|
||||
.../net/wireless/ralink/rt2x00/rt2x00eeprom.c | 25 +++++++++++++++++++
|
||||
1 file changed, 25 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00eeprom.c
|
||||
@@ -19,6 +19,27 @@
|
||||
|
||||
#include "rt2x00.h"
|
||||
|
||||
+static int rt2800lib_read_eeprom_data(struct rt2x00_dev *rt2x00dev)
|
||||
+{
|
||||
+ struct device_node *np = rt2x00dev->dev->of_node;
|
||||
+ unsigned int len = rt2x00dev->ops->eeprom_size;
|
||||
+ const void *data;
|
||||
+ int size;
|
||||
+
|
||||
+ data = of_get_property(np, "ralink,eeprom-data", &size);
|
||||
+ if (!data)
|
||||
+ return -ENOENT;
|
||||
+
|
||||
+ if (size != len) {
|
||||
+ dev_err(rt2x00dev->dev, "invalid eeprom size, required: 0x%04x\n", len);
|
||||
+ return -EINVAL;
|
||||
+ }
|
||||
+
|
||||
+ memcpy(rt2x00dev->eeprom, data, size);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
#if IS_ENABLED(CONFIG_MTD)
|
||||
static int rt2800lib_read_eeprom_mtd(struct rt2x00_dev *rt2x00dev)
|
||||
{
|
||||
@@ -164,6 +185,10 @@ int rt2x00lib_read_eeprom(struct rt2x00_
|
||||
{
|
||||
int ret;
|
||||
|
||||
+ ret = rt2800lib_read_eeprom_data(rt2x00dev);
|
||||
+ if (!ret)
|
||||
+ return 0;
|
||||
+
|
||||
#if IS_ENABLED(CONFIG_MTD)
|
||||
ret = rt2800lib_read_eeprom_mtd(rt2x00dev);
|
||||
if (!ret)
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
|
||||
@@ -1007,6 +1007,14 @@ static int rt2x00lib_probe_hw_modes(stru
|
||||
@@ -1013,6 +1013,14 @@ static int rt2x00lib_probe_hw_modes(stru
|
||||
struct ieee80211_rate *rates;
|
||||
unsigned int num_rates;
|
||||
unsigned int i;
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
@@ -27,6 +27,7 @@
|
||||
#include <linux/nvmem-consumer.h>
|
||||
#include <linux/property.h>
|
||||
#include <linux/slab.h>
|
||||
+#include <linux/of.h>
|
||||
|
||||
#include "rt2x00.h"
|
||||
#include "rt2800lib.h"
|
||||
@@ -11276,6 +11277,17 @@ static int rt2800_init_eeprom(struct rt2
|
||||
@@ -11414,6 +11415,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);
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2x00dev.c
|
||||
@@ -1338,7 +1338,7 @@ static inline void rt2x00lib_set_if_comb
|
||||
@@ -1344,7 +1344,7 @@ static inline void rt2x00lib_set_if_comb
|
||||
*/
|
||||
if_limit = &rt2x00dev->if_limits_ap;
|
||||
if_limit->max = rt2x00dev->ops->max_ap_intf;
|
||||
|
||||
+6
-6
@@ -82,7 +82,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
#define WMM_CWMAX_CFG_CWMAX0 FIELD32(0x0000000f)
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -835,7 +835,8 @@ void rt2800_write_tx_data(struct queue_e
|
||||
@@ -837,7 +837,8 @@ void rt2800_write_tx_data(struct queue_e
|
||||
txdesc->key_idx : txdesc->u.ht.wcid);
|
||||
rt2x00_set_field32(&word, TXWI_W1_MPDU_TOTAL_BYTE_COUNT,
|
||||
txdesc->length);
|
||||
@@ -92,7 +92,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
rt2x00_set_field32(&word, TXWI_W1_PACKETID_ENTRY, (entry->entry_idx % 3) + 1);
|
||||
rt2x00_desc_write(txwi, 1, word);
|
||||
|
||||
@@ -1125,6 +1126,12 @@ void rt2800_txdone(struct rt2x00_dev *rt
|
||||
@@ -1127,6 +1128,12 @@ void rt2800_txdone(struct rt2x00_dev *rt
|
||||
u32 reg;
|
||||
u8 qid;
|
||||
bool match;
|
||||
@@ -105,7 +105,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
|
||||
while (quota-- > 0 && kfifo_get(&rt2x00dev->txstatus_fifo, ®)) {
|
||||
/*
|
||||
@@ -1132,6 +1139,8 @@ void rt2800_txdone(struct rt2x00_dev *rt
|
||||
@@ -1134,6 +1141,8 @@ void rt2800_txdone(struct rt2x00_dev *rt
|
||||
* guaranteed to be one of the TX QIDs .
|
||||
*/
|
||||
qid = rt2x00_get_field32(reg, TX_STA_FIFO_PID_QUEUE);
|
||||
@@ -114,7 +114,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
queue = rt2x00queue_get_tx_queue(rt2x00dev, qid);
|
||||
|
||||
if (unlikely(rt2x00queue_empty(queue))) {
|
||||
@@ -12182,8 +12191,9 @@ int rt2800_conf_tx(struct ieee80211_hw *
|
||||
@@ -12319,8 +12328,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 <yangshiji66@outlook.com>
|
||||
field.bit_mask = 0xffff << field.bit_offset;
|
||||
|
||||
reg = rt2800_register_read(rt2x00dev, offset);
|
||||
@@ -12191,7 +12201,7 @@ int rt2800_conf_tx(struct ieee80211_hw *
|
||||
@@ -12328,7 +12338,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 <yangshiji66@outlook.com>
|
||||
field.bit_mask = 0xf << field.bit_offset;
|
||||
|
||||
reg = rt2800_register_read(rt2x00dev, WMM_AIFSN_CFG);
|
||||
@@ -12207,7 +12217,7 @@ int rt2800_conf_tx(struct ieee80211_hw *
|
||||
@@ -12344,7 +12354,7 @@ int rt2800_conf_tx(struct ieee80211_hw *
|
||||
rt2800_register_write(rt2x00dev, WMM_CWMAX_CFG, reg);
|
||||
|
||||
/* Update EDCA registers */
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -1320,26 +1320,45 @@ static bool rt2800_watchdog_hung(struct
|
||||
@@ -1322,26 +1322,45 @@ static bool rt2800_watchdog_hung(struct
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -13,7 +13,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -5704,6 +5704,9 @@ static void rt2800_config_ps(struct rt2x
|
||||
@@ -5706,6 +5706,9 @@ static void rt2800_config_ps(struct rt2x
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
void rt2800_config(struct rt2x00_dev *rt2x00dev,
|
||||
struct rt2x00lib_conf *libconf,
|
||||
const unsigned int flags)
|
||||
@@ -5718,10 +5721,18 @@ void rt2800_config(struct rt2x00_dev *rt
|
||||
@@ -5720,10 +5723,18 @@ void rt2800_config(struct rt2x00_dev *rt
|
||||
*/
|
||||
rt2800_update_survey(rt2x00dev);
|
||||
|
||||
@@ -42,7 +42,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
}
|
||||
if (flags & IEEE80211_CONF_CHANGE_POWER)
|
||||
rt2800_config_txpower(rt2x00dev, libconf->conf->chandef.chan,
|
||||
@@ -10421,15 +10432,19 @@ static void rt2800_restore_rf_bbp_rt6352
|
||||
@@ -10423,15 +10434,19 @@ static void rt2800_restore_rf_bbp_rt6352
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
rt2800_rf_self_txdc_cal(rt2x00dev);
|
||||
rt2800_rxdcoc_calibration(rt2x00dev);
|
||||
rt2800_bw_filter_calibration(rt2x00dev, true);
|
||||
@@ -10760,9 +10775,6 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
@@ -10762,9 +10777,6 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
|
||||
rt2800_rfcsr_write_dccal(rt2x00dev, 5, 0x00);
|
||||
rt2800_rfcsr_write_dccal(rt2x00dev, 17, 0x7C);
|
||||
|
||||
+3
-3
@@ -13,7 +13,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -5561,6 +5561,9 @@ static void rt2800_config_txpower(struct
|
||||
@@ -5563,6 +5563,9 @@ static void rt2800_config_txpower(struct
|
||||
|
||||
void rt2800_gain_calibration(struct rt2x00_dev *rt2x00dev)
|
||||
{
|
||||
@@ -23,7 +23,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
rt2800_config_txpower(rt2x00dev, rt2x00dev->hw->conf.chandef.chan,
|
||||
rt2x00dev->tx_power);
|
||||
}
|
||||
@@ -5773,9 +5776,10 @@ static u8 rt2800_get_default_vgc(struct
|
||||
@@ -5775,9 +5778,10 @@ static u8 rt2800_get_default_vgc(struct
|
||||
rt2x00_rt(rt2x00dev, RT3593) ||
|
||||
rt2x00_rt(rt2x00dev, RT5390) ||
|
||||
rt2x00_rt(rt2x00dev, RT5392) ||
|
||||
@@ -36,7 +36,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
else
|
||||
vgc = 0x2e + rt2x00dev->lna_gain;
|
||||
} else { /* 5GHZ band */
|
||||
@@ -5828,7 +5832,8 @@ void rt2800_link_tuner(struct rt2x00_dev
|
||||
@@ -5830,7 +5834,8 @@ void rt2800_link_tuner(struct rt2x00_dev
|
||||
{
|
||||
u8 vgc;
|
||||
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -3848,7 +3848,7 @@ static void rt2800_config_channel_rf7620
|
||||
@@ -3850,7 +3850,7 @@ static void rt2800_config_channel_rf7620
|
||||
|
||||
/* Default: XO=20MHz , SDM mode */
|
||||
rfcsr = rt2800_rfcsr_read(rt2x00dev, 16);
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -8846,7 +8846,7 @@ static void rt2800_rxiq_calibration(stru
|
||||
@@ -8848,7 +8848,7 @@ static void rt2800_rxiq_calibration(stru
|
||||
rt2x00_warn(rt2x00dev, "Timeout waiting for MAC status in RXIQ calibration\n");
|
||||
|
||||
bbpval = bbp4 & (~0x18);
|
||||
|
||||
+9
-9
@@ -13,7 +13,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -3576,9 +3576,8 @@ static void rt2800_config_channel_rf55xx
|
||||
@@ -3578,9 +3578,8 @@ static void rt2800_config_channel_rf55xx
|
||||
|
||||
/* TODO RF27 <- tssi */
|
||||
|
||||
@@ -25,7 +25,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
|
||||
if (is_11b) {
|
||||
/* CCK */
|
||||
@@ -3599,7 +3598,7 @@ static void rt2800_config_channel_rf55xx
|
||||
@@ -3601,7 +3600,7 @@ static void rt2800_config_channel_rf55xx
|
||||
power_bound = POWER_BOUND;
|
||||
ep_reg = 0x2;
|
||||
} else {
|
||||
@@ -34,7 +34,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
/* FIMXE: RF11 overwrite */
|
||||
rt2800_rfcsr_write(rt2x00dev, 11, 0x40);
|
||||
rt2800_rfcsr_write(rt2x00dev, 25, 0xBF);
|
||||
@@ -3608,13 +3607,15 @@ static void rt2800_config_channel_rf55xx
|
||||
@@ -3610,13 +3609,15 @@ static void rt2800_config_channel_rf55xx
|
||||
rt2800_rfcsr_write(rt2x00dev, 37, 0x04);
|
||||
rt2800_rfcsr_write(rt2x00dev, 38, 0x85);
|
||||
rt2800_rfcsr_write(rt2x00dev, 40, 0x42);
|
||||
@@ -52,7 +52,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
|
||||
/* TODO RF27 <- tssi */
|
||||
|
||||
@@ -3623,82 +3624,59 @@ static void rt2800_config_channel_rf55xx
|
||||
@@ -3625,82 +3626,59 @@ static void rt2800_config_channel_rf55xx
|
||||
rt2800_rfcsr_write(rt2x00dev, 12, 0x2E);
|
||||
rt2800_rfcsr_write(rt2x00dev, 13, 0x22);
|
||||
rt2800_rfcsr_write(rt2x00dev, 22, 0x60);
|
||||
@@ -170,7 +170,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
}
|
||||
|
||||
power_bound = POWER_BOUND_5G;
|
||||
@@ -3710,7 +3688,7 @@ static void rt2800_config_channel_rf55xx
|
||||
@@ -3712,7 +3690,7 @@ static void rt2800_config_channel_rf55xx
|
||||
rt2x00_set_field8(&rfcsr, RFCSR49_TX, power_bound);
|
||||
else
|
||||
rt2x00_set_field8(&rfcsr, RFCSR49_TX, info->default_power1);
|
||||
@@ -179,7 +179,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
rt2x00_set_field8(&rfcsr, RFCSR49_EP, ep_reg);
|
||||
rt2800_rfcsr_write(rt2x00dev, 49, rfcsr);
|
||||
|
||||
@@ -3719,7 +3697,7 @@ static void rt2800_config_channel_rf55xx
|
||||
@@ -3721,7 +3699,7 @@ static void rt2800_config_channel_rf55xx
|
||||
rt2x00_set_field8(&rfcsr, RFCSR50_TX, power_bound);
|
||||
else
|
||||
rt2x00_set_field8(&rfcsr, RFCSR50_TX, info->default_power2);
|
||||
@@ -188,7 +188,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
rt2x00_set_field8(&rfcsr, RFCSR50_EP, ep_reg);
|
||||
rt2800_rfcsr_write(rt2x00dev, 50, rfcsr);
|
||||
|
||||
@@ -3740,7 +3718,6 @@ static void rt2800_config_channel_rf55xx
|
||||
@@ -3742,7 +3720,6 @@ static void rt2800_config_channel_rf55xx
|
||||
rt2x00_set_field8(&rfcsr, RFCSR1_RX2_PD, 0);
|
||||
|
||||
rt2800_rfcsr_write(rt2x00dev, 1, rfcsr);
|
||||
@@ -196,7 +196,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
|
||||
if (conf_is_ht40(conf))
|
||||
rt2800_rfcsr_write(rt2x00dev, 30, 0x16);
|
||||
@@ -8505,12 +8482,15 @@ static void rt2800_init_rfcsr_5392(struc
|
||||
@@ -8507,12 +8484,15 @@ static void rt2800_init_rfcsr_5392(struc
|
||||
|
||||
static void rt2800_init_rfcsr_5592(struct rt2x00_dev *rt2x00dev)
|
||||
{
|
||||
@@ -213,7 +213,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
rt2800_rfcsr_write(rt2x00dev, 7, 0x00);
|
||||
rt2800_rfcsr_write(rt2x00dev, 14, 0x00);
|
||||
rt2800_rfcsr_write(rt2x00dev, 15, 0x00);
|
||||
@@ -8526,9 +8506,13 @@ static void rt2800_init_rfcsr_5592(struc
|
||||
@@ -8528,9 +8508,13 @@ static void rt2800_init_rfcsr_5592(struc
|
||||
rt2800_rfcsr_write(rt2x00dev, 34, 0x07);
|
||||
rt2800_rfcsr_write(rt2x00dev, 35, 0x12);
|
||||
rt2800_rfcsr_write(rt2x00dev, 47, 0x0C);
|
||||
|
||||
+9
-9
@@ -13,7 +13,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -3746,6 +3746,7 @@ static void rt2800_config_channel_rf55xx
|
||||
@@ -3748,6 +3748,7 @@ static void rt2800_config_channel_rf55xx
|
||||
rt2800_bbp_write(rt2x00dev, 80, (rf->channel <= 14) ? 0x0E : 0x08);
|
||||
rt2800_bbp_write(rt2x00dev, 81, (rf->channel <= 14) ? 0x3A : 0x38);
|
||||
rt2800_bbp_write(rt2x00dev, 82, (rf->channel <= 14) ? 0x62 : 0x92);
|
||||
@@ -21,7 +21,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
|
||||
/* GLRT band configuration */
|
||||
rt2800_bbp_write(rt2x00dev, 195, 128);
|
||||
@@ -3758,7 +3759,7 @@ static void rt2800_config_channel_rf55xx
|
||||
@@ -3760,7 +3761,7 @@ static void rt2800_config_channel_rf55xx
|
||||
rt2800_bbp_write(rt2x00dev, 196, (rf->channel <= 14) ? 0x32 : 0x20);
|
||||
rt2800_bbp_write(rt2x00dev, 195, 133);
|
||||
rt2800_bbp_write(rt2x00dev, 196, (rf->channel <= 14) ? 0x28 : 0x7F);
|
||||
@@ -30,7 +30,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
rt2800_bbp_write(rt2x00dev, 196, (rf->channel <= 14) ? 0x19 : 0x7F);
|
||||
}
|
||||
|
||||
@@ -4304,7 +4305,8 @@ static void rt2800_config_channel(struct
|
||||
@@ -4306,7 +4307,8 @@ static void rt2800_config_channel(struct
|
||||
rt2800_bbp_write(rt2x00dev, 62, 0x37 - rt2x00dev->lna_gain);
|
||||
rt2800_bbp_write(rt2x00dev, 63, 0x37 - rt2x00dev->lna_gain);
|
||||
rt2800_bbp_write(rt2x00dev, 64, 0x37 - rt2x00dev->lna_gain);
|
||||
@@ -40,7 +40,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
rt2800_bbp_write(rt2x00dev, 86, 0x38);
|
||||
else
|
||||
rt2800_bbp_write(rt2x00dev, 86, 0);
|
||||
@@ -4313,6 +4315,7 @@ static void rt2800_config_channel(struct
|
||||
@@ -4315,6 +4317,7 @@ static void rt2800_config_channel(struct
|
||||
if (rf->channel <= 14) {
|
||||
if (!rt2x00_rt(rt2x00dev, RT5390) &&
|
||||
!rt2x00_rt(rt2x00dev, RT5392) &&
|
||||
@@ -48,7 +48,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
!rt2x00_rt(rt2x00dev, RT6352)) {
|
||||
if (rt2x00_has_cap_external_lna_bg(rt2x00dev)) {
|
||||
rt2800_bbp_write(rt2x00dev, 82, 0x62);
|
||||
@@ -4336,17 +4339,20 @@ static void rt2800_config_channel(struct
|
||||
@@ -4338,17 +4341,20 @@ static void rt2800_config_channel(struct
|
||||
else if (rt2x00_rt(rt2x00dev, RT3593) ||
|
||||
rt2x00_rt(rt2x00dev, RT3883))
|
||||
rt2800_bbp_write(rt2x00dev, 82, 0x82);
|
||||
@@ -74,7 +74,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
}
|
||||
|
||||
reg = rt2800_register_read(rt2x00dev, TX_BAND_CFG);
|
||||
@@ -5783,12 +5789,10 @@ static inline void rt2800_set_vgc(struct
|
||||
@@ -5785,12 +5791,10 @@ static inline void rt2800_set_vgc(struct
|
||||
if (rt2x00_rt(rt2x00dev, RT3572) ||
|
||||
rt2x00_rt(rt2x00dev, RT3593) ||
|
||||
rt2x00_rt(rt2x00dev, RT3883) ||
|
||||
@@ -88,7 +88,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
} else {
|
||||
rt2800_bbp_write(rt2x00dev, 66, vgc_level);
|
||||
}
|
||||
@@ -7016,7 +7020,6 @@ static void rt2800_init_bbp_5592(struct
|
||||
@@ -7018,7 +7022,6 @@ static void rt2800_init_bbp_5592(struct
|
||||
rt2800_bbp_write(rt2x00dev, 88, 0x90);
|
||||
rt2800_bbp_write(rt2x00dev, 91, 0x04);
|
||||
rt2800_bbp_write(rt2x00dev, 92, 0x02);
|
||||
@@ -96,7 +96,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
rt2800_bbp_write(rt2x00dev, 98, 0x12);
|
||||
rt2800_bbp_write(rt2x00dev, 103, 0xC0);
|
||||
rt2800_bbp_write(rt2x00dev, 104, 0x92);
|
||||
@@ -7027,6 +7030,7 @@ static void rt2800_init_bbp_5592(struct
|
||||
@@ -7029,6 +7032,7 @@ static void rt2800_init_bbp_5592(struct
|
||||
rt2800_bbp_write(rt2x00dev, 134, 0xD0);
|
||||
rt2800_bbp_write(rt2x00dev, 135, 0xF6);
|
||||
rt2800_bbp_write(rt2x00dev, 137, 0x0F);
|
||||
@@ -104,7 +104,7 @@ Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
|
||||
|
||||
/* Initialize GLRT (Generalized Likehood Radio Test) */
|
||||
rt2800_init_bbp_5592_glrt(rt2x00dev);
|
||||
@@ -7051,12 +7055,6 @@ static void rt2800_init_bbp_5592(struct
|
||||
@@ -7053,12 +7057,6 @@ static void rt2800_init_bbp_5592(struct
|
||||
rt2x00_set_field8(&value, BBP254_BIT7, 1);
|
||||
rt2800_bbp_write(rt2x00dev, 254, value);
|
||||
}
|
||||
|
||||
+8
-8
@@ -27,7 +27,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -305,6 +305,24 @@ static void rt2800_rf_write(struct rt2x0
|
||||
@@ -307,6 +307,24 @@ static void rt2800_rf_write(struct rt2x0
|
||||
mutex_unlock(&rt2x00dev->csr_mutex);
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
static const unsigned int rt2800_eeprom_map[EEPROM_WORD_COUNT] = {
|
||||
[EEPROM_CHIP_ID] = 0x0000,
|
||||
[EEPROM_VERSION] = 0x0001,
|
||||
@@ -10422,8 +10440,10 @@ static void rt2800_restore_rf_bbp_rt6352
|
||||
@@ -10424,8 +10442,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 <daniel@makrotopia.org>
|
||||
|
||||
rt2800_r_calibration(rt2x00dev);
|
||||
}
|
||||
@@ -10447,6 +10467,8 @@ static void rt2800_calibration_rt6352_st
|
||||
@@ -10449,6 +10469,8 @@ static void rt2800_calibration_rt6352_st
|
||||
!rt2x00_has_cap_external_lna_bg(rt2x00dev))
|
||||
return;
|
||||
|
||||
@@ -83,21 +83,21 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
|
||||
|
||||
#include <net/mac80211.h>
|
||||
|
||||
@@ -1015,6 +1016,11 @@ struct rt2x00_dev {
|
||||
|
||||
@@ -1014,6 +1015,11 @@ struct rt2x00_dev {
|
||||
/* Clock for System On Chip devices. */
|
||||
struct clk *clk;
|
||||
+
|
||||
|
||||
+ /* pinctrl and states for System On Chip devices with PA/LNA. */
|
||||
+ struct pinctrl *pinctrl;
|
||||
+ struct pinctrl_state *pins_default;
|
||||
+ struct pinctrl_state *pins_pa_gpio;
|
||||
+
|
||||
struct usb_anchor anchor[];
|
||||
};
|
||||
|
||||
struct rt2x00_bar_list_entry {
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800soc.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800soc.c
|
||||
@@ -298,6 +298,21 @@ static int rt2x00soc_probe(struct platfo
|
||||
@@ -325,6 +325,21 @@ static int rt2x00soc_probe(struct platfo
|
||||
if (retval)
|
||||
goto exit_free_device;
|
||||
|
||||
|
||||
+4
-4
@@ -40,7 +40,7 @@
|
||||
const u8 arg0, const u8 arg1);
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800pci.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800pci.c
|
||||
@@ -289,6 +289,10 @@ static int rt2800pci_read_eeprom(struct
|
||||
@@ -297,6 +297,10 @@ static int rt2800pci_read_eeprom(struct
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
static const struct ieee80211_ops rt2800pci_mac80211_ops = {
|
||||
.add_chanctx = ieee80211_emulate_add_chanctx,
|
||||
.remove_chanctx = ieee80211_emulate_remove_chanctx,
|
||||
@@ -336,6 +340,9 @@ static const struct rt2800_ops rt2800pci
|
||||
@@ -344,6 +348,9 @@ static const struct rt2800_ops rt2800pci
|
||||
.drv_init_registers = rt2800mmio_init_registers,
|
||||
.drv_get_txwi = rt2800mmio_get_txwi,
|
||||
.drv_get_dma_done = rt2800mmio_get_dma_done,
|
||||
@@ -76,7 +76,7 @@
|
||||
/* Allow hardware encryption to be disabled. */
|
||||
static bool modparam_nohwcrypt;
|
||||
module_param_named(nohwcrypt, modparam_nohwcrypt, bool, 0444);
|
||||
@@ -136,6 +142,27 @@ static int rt2800soc_resume(struct platf
|
||||
@@ -164,6 +170,27 @@ static int rt2800soc_resume(struct platf
|
||||
}
|
||||
#endif /* CONFIG_PM */
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
static const struct ieee80211_ops rt2800soc_mac80211_ops = {
|
||||
.add_chanctx = ieee80211_emulate_add_chanctx,
|
||||
.remove_chanctx = ieee80211_emulate_remove_chanctx,
|
||||
@@ -183,6 +210,9 @@ static const struct rt2800_ops rt2800soc
|
||||
@@ -211,6 +238,9 @@ static const struct rt2800_ops rt2800soc
|
||||
.drv_init_registers = rt2800mmio_init_registers,
|
||||
.drv_get_txwi = rt2800mmio_get_txwi,
|
||||
.drv_get_dma_done = rt2800mmio_get_dma_done,
|
||||
|
||||
+11
-11
@@ -14,7 +14,7 @@
|
||||
*/
|
||||
--- a/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
+++ b/drivers/net/wireless/ralink/rt2x00/rt2800lib.c
|
||||
@@ -3842,14 +3842,16 @@ static void rt2800_config_channel_rf7620
|
||||
@@ -3844,14 +3844,16 @@ static void rt2800_config_channel_rf7620
|
||||
rt2x00_set_field8(&rfcsr, RFCSR19_K, rf->rf4);
|
||||
rt2800_rfcsr_write(rt2x00dev, 19, rfcsr);
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
rfcsr = rt2800_rfcsr_read(rt2x00dev, 1);
|
||||
rt2x00_set_field8(&rfcsr, RFCSR1_TX2_EN_MT7620,
|
||||
@@ -3883,18 +3885,23 @@ static void rt2800_config_channel_rf7620
|
||||
@@ -3885,18 +3887,23 @@ static void rt2800_config_channel_rf7620
|
||||
rt2800_rfcsr_write_dccal(rt2x00dev, 59, 0x20);
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
|
||||
if (!test_bit(DEVICE_STATE_SCANNING, &rt2x00dev->flags)) {
|
||||
if (conf_is_ht40(conf)) {
|
||||
@@ -4008,25 +4015,29 @@ static void rt2800_config_alc_rt6352(str
|
||||
@@ -4010,25 +4017,29 @@ static void rt2800_config_alc_rt6352(str
|
||||
if (unlikely(rt2800_wait_bbp_rf_ready(rt2x00dev, MAC_STATUS_CFG_BBP_RF_BUSY)))
|
||||
rt2x00_warn(rt2x00dev, "RF busy while configuring ALC\n");
|
||||
|
||||
@@ -121,7 +121,7 @@
|
||||
rt2800_register_write(rt2x00dev, MAC_SYS_CTRL, mac_sys_ctrl);
|
||||
|
||||
rt2800_vco_calibration(rt2x00dev);
|
||||
@@ -4524,7 +4535,8 @@ static void rt2800_config_channel(struct
|
||||
@@ -4526,7 +4537,8 @@ static void rt2800_config_channel(struct
|
||||
if (rt2x00_rt(rt2x00dev, RT6352)) {
|
||||
/* BBP for GLRT BW */
|
||||
bbp = conf_is_ht40(conf) ?
|
||||
@@ -131,7 +131,7 @@
|
||||
0x15 : 0x1a;
|
||||
rt2800_bbp_glrt_write(rt2x00dev, 141, bbp);
|
||||
|
||||
@@ -6042,18 +6054,34 @@ static int rt2800_init_registers(struct
|
||||
@@ -6044,18 +6056,34 @@ static int rt2800_init_registers(struct
|
||||
} else if (rt2x00_rt(rt2x00dev, RT5350)) {
|
||||
rt2800_register_write(rt2x00dev, TX_SW_CFG0, 0x00000404);
|
||||
} else if (rt2x00_rt(rt2x00dev, RT6352)) {
|
||||
@@ -178,7 +178,7 @@
|
||||
reg = rt2800_register_read(rt2x00dev, TX_ALC_CFG_1);
|
||||
rt2x00_set_field32(®, TX_ALC_CFG_1_ROS_BUSY_EN, 0);
|
||||
rt2800_register_write(rt2x00dev, TX_ALC_CFG_1, reg);
|
||||
@@ -7160,14 +7188,16 @@ static void rt2800_init_bbp_6352(struct
|
||||
@@ -7162,14 +7190,16 @@ static void rt2800_init_bbp_6352(struct
|
||||
rt2800_bbp_write(rt2x00dev, 188, 0x00);
|
||||
rt2800_bbp_write(rt2x00dev, 189, 0x00);
|
||||
|
||||
@@ -203,7 +203,7 @@
|
||||
|
||||
/* BBP for G band GLRT function (BBP_128 ~ BBP_221) */
|
||||
rt2800_bbp_glrt_write(rt2x00dev, 0, 0x00);
|
||||
@@ -10398,6 +10428,9 @@ static void rt2800_restore_rf_bbp_rt6352
|
||||
@@ -10400,6 +10430,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);
|
||||
@@ -10479,6 +10512,9 @@ static void rt2800_calibration_rt6352_st
|
||||
@@ -10481,6 +10514,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);
|
||||
@@ -10569,31 +10605,36 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
@@ -10571,31 +10607,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);
|
||||
@@ -10659,63 +10700,71 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
@@ -10661,63 +10702,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);
|
||||
@@ -10778,12 +10827,17 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
@@ -10780,12 +10829,17 @@ static void rt2800_init_rfcsr_6352(struc
|
||||
rt2800_rfcsr_write_dccal(rt2x00dev, 62, 0x00);
|
||||
rt2800_rfcsr_write_dccal(rt2x00dev, 63, 0x00);
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -1883,12 +1883,6 @@ static int ieee80211_stop_ap(struct wiph
|
||||
ieee80211_link_info_change_notify(sdata, link,
|
||||
BSS_CHANGED_BEACON_ENABLED);
|
||||
@@ -2101,12 +2101,6 @@ static int ieee80211_stop_ap(struct wiph
|
||||
clear_bit(SDATA_STATE_OFFCHANNEL_BEACON_STOPPED, &sdata->state);
|
||||
ieee80211_link_info_change_notify(sdata, link, changes);
|
||||
|
||||
- ieee80211_remove_link_keys(link, &keys);
|
||||
- if (!list_empty(&keys)) {
|
||||
@@ -21,4 +21,4 @@ Used for AP+STA support in OpenWrt - preserve AP mode keys across STA reconnect
|
||||
-
|
||||
if (sdata->wdev.links[link_id].cac_started) {
|
||||
chandef = link_conf->chanreq.oper;
|
||||
wiphy_delayed_work_cancel(wiphy, &link->dfs_cac_timer_work);
|
||||
wiphy_hrtimer_work_cancel(wiphy, &link->dfs_cac_timer_work);
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/net/mac80211/main.c
|
||||
+++ b/net/mac80211/main.c
|
||||
@@ -1597,24 +1597,6 @@ int ieee80211_register_hw(struct ieee802
|
||||
@@ -1633,24 +1633,6 @@ int ieee80211_register_hw(struct ieee802
|
||||
|
||||
ieee80211_check_wbrf_support(local);
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -3121,6 +3121,8 @@ static int ieee80211_scan(struct wiphy *
|
||||
@@ -3508,6 +3508,8 @@ static int ieee80211_scan(struct wiphy *
|
||||
*/
|
||||
fallthrough;
|
||||
case NL80211_IFTYPE_AP:
|
||||
|
||||
@@ -16,7 +16,7 @@ and we should ignore this.
|
||||
|
||||
--- a/net/wireless/core.c
|
||||
+++ b/net/wireless/core.c
|
||||
@@ -675,21 +675,6 @@ int wiphy_verify_iface_combinations(stru
|
||||
@@ -778,21 +778,6 @@ int wiphy_verify_iface_combinations(stru
|
||||
c->limits[j].max > 1))
|
||||
return -EINVAL;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ Signed-off-by: David Bauer <mail@david-bauer.net>
|
||||
|
||||
--- a/net/mac80211/sta_info.c
|
||||
+++ b/net/mac80211/sta_info.c
|
||||
@@ -2527,6 +2527,13 @@ static void sta_stats_decode_rate(struct
|
||||
@@ -2587,6 +2587,13 @@ static void sta_stats_decode_rate(struct
|
||||
|
||||
sband = local->hw.wiphy->bands[band];
|
||||
|
||||
|
||||
+2
-2
@@ -28,11 +28,11 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
|
||||
--- a/net/mac80211/sta_info.c
|
||||
+++ b/net/mac80211/sta_info.c
|
||||
@@ -630,6 +630,7 @@ __sta_info_alloc(struct ieee80211_sub_if
|
||||
@@ -665,6 +665,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);
|
||||
+ sta->ampdu_mlme.dialog_token_allocator = get_random_u32_below(U8_MAX);
|
||||
#ifdef CPTCFG_MAC80211_MESH
|
||||
if (ieee80211_vif_is_mesh(&sdata->vif)) {
|
||||
sta->mesh = kzalloc(sizeof(*sta->mesh), gfp);
|
||||
sta->mesh = kzalloc_obj(*sta->mesh, gfp);
|
||||
+4
-4
@@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/net/mac80211/ieee80211_i.h
|
||||
+++ b/net/mac80211/ieee80211_i.h
|
||||
@@ -111,6 +111,8 @@ ieee80211_sta_keep_active(struct sta_inf
|
||||
@@ -112,6 +112,8 @@ ieee80211_sta_keep_active(struct sta_inf
|
||||
return time_before_eq(jiffies, sta->airtime[ac].last_active + HZ / 10);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/net/mac80211/tx.c
|
||||
+++ b/net/mac80211/tx.c
|
||||
@@ -4090,7 +4090,7 @@ struct ieee80211_txq *ieee80211_next_txq
|
||||
@@ -4153,7 +4153,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 <nbd@nbd.name>
|
||||
|
||||
if (deficit < 0 || !aql_check) {
|
||||
list_move_tail(&txqi->schedule_order,
|
||||
@@ -4235,7 +4235,8 @@ bool ieee80211_txq_may_transmit(struct i
|
||||
@@ -4298,7 +4298,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 <nbd@nbd.name>
|
||||
list_move_tail(&iter->schedule_order, &local->active_txqs[ac]);
|
||||
}
|
||||
|
||||
@@ -4243,7 +4244,7 @@ bool ieee80211_txq_may_transmit(struct i
|
||||
@@ -4306,7 +4307,7 @@ bool ieee80211_txq_may_transmit(struct i
|
||||
if (sta->airtime[ac].deficit >= 0)
|
||||
goto out;
|
||||
|
||||
|
||||
Loaded 100 of 115 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user