[openwrt/openwrt] mac80211: ath10k: replace LEDs patch with upstream patch
LEDE Commits
lede-commits at lists.infradead.org
Mon Jun 17 09:41:19 PDT 2024
ansuel pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/dc9c5d1ee72564d97b7d76ab4db239e038916d31
commit dc9c5d1ee72564d97b7d76ab4db239e038916d31
Author: Christian Marangi <ansuelsmth at gmail.com>
AuthorDate: Mon Jun 17 18:23:44 2024 +0200
mac80211: ath10k: replace LEDs patch with upstream patch
LEDs support for ath10k has finally merged upstream hence replace it
with the upstream version.
Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
---
...O-controlling-support-for.patch:Zone.Identifier | 0
...add-LED-and-GPIO-controlling-support-for.patch} | 374 +++++++++++----------
...add-LED-and-GPIO-controlling-support-for.patch} | 291 ++++++++--------
.../975-ath10k-use-tpt-trigger-by-default.patch | 4 +-
...84-ath10k-Try-to-get-mac-address-from-dts.patch | 2 +-
5 files changed, 361 insertions(+), 310 deletions(-)
diff --git a/package/kernel/ath10k-ct/patches/0001-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch:Zone.Identifier b/package/kernel/ath10k-ct/patches/0001-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch:Zone.Identifier
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch b/package/kernel/ath10k-ct/patches/201-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch
similarity index 58%
copy from package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
copy to package/kernel/ath10k-ct/patches/201-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch
index 2465470a57..c8d74f0e4a 100644
--- a/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
+++ b/package/kernel/ath10k-ct/patches/201-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch
@@ -1,130 +1,75 @@
-From: Sebastian Gottschall <s.gottschall at newmedia-net.de>
-
-Adds LED and GPIO Control support for 988x, 9887, 9888, 99x0, 9984 based
-chipsets with on chipset connected led's using WMI Firmware API. The LED
-device will get available named as "ath10k-phyX" at sysfs and can be controlled
-with various triggers. adds also debugfs interface for gpio control.
-
-This patch is specific for OpenWRt base, as is use old backported package
-with old wireless source. Support for QCA9984 is removed and a simbol
-is added to local-simbol file to export the actually compile the code
-with the ATH10K_LEDS simbol.
+From 8e1debd82466a3fe711784ab37e6b54e56011267 Mon Sep 17 00:00:00 2001
+From: Sebastian Gottschall <s.gottschall at dd-wrt.com>
+Date: Mon, 13 May 2024 17:22:25 +0300
+Subject: [PATCH] wifi: ath10k: add LED and GPIO controlling support for
+ various chipsets
+Adds LED and GPIO Control support for 988x, 9887, 9888, 99x0, 9984
+based chipsets with on chipset connected led's using WMI Firmware API.
+The LED device will get available named as "ath10k-phyX" at sysfs and
+can be controlled with various triggers.
+Adds also debugfs interface for gpio control.
Signed-off-by: Sebastian Gottschall <s.gottschall at dd-wrt.com>
Reviewed-by: Steve deRosier <derosier at cal-sierra.com>
[kvalo: major reorg and cleanup]
Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
-Signed-off-by: Ansuel Smith <ansuelsmth at gmail.com>
+[ansuel: rebase and small cleanup]
+Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
+Tested-by: Stefan Lippers-Hollmann <s.l-h at gmx.de>
+Signed-off-by: Kalle Valo <quic_kvalo at quicinc.com>
+Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com
---
-
-v13:
-
-* only compile tested!
-
-* fix all checkpatch warnings
-
-* fix commit log
-
-* sizeof(struct ath10k_gpiocontrol) -> sizeof(*gpio)
-
-* unsigned -> unsigned int
-
-* remove GPIOLIB code, that should be added in a separate patch
-
-* rename gpio.c to leds.c
-
-* add leds.h
-
-* rename some functions:
-
- ath10k_attach_led() -> ath10k_leds_register()
- ath10k_unregister_led() -> ath10k_leds_unregister()
- ath10k_reset_led_pin() -> ath10k_leds_start()
-
-* call ath10k_leds_unregister() before ath10k_thermal_unregister() to preserve ordering
-
-* call ath10k_leds_start() only from ath10k_core_start() and not from mac.c
-
-* rename struct ath10k_gpiocontrol as anonymous function under struct
- ath10k::leds, no need for memory allocation
-
-* merge ath10k_add_led() to ath10k_attach_led(), which is it's only caller
-
-* remove #if IS_ENABLED() checks from most of places, memory savings from those were not worth it
-
-* Kconfig help text improvement and move it lower in the menu, also don't enable it by default
-
-* switch to set_brightness_blocking() so that the callback can sleep,
- then no need to use ath10k_wmi_cmd_send_nowait() and can take mutex
- to access ar->state
-
-* don't touch ath10k_wmi_pdev_get_temperature()
-
-* as QCA6174/QCA9377 are not (yet) supported don't add the command to WMI-TLV interface
-
-* remove debugfs interface, that should be added in another patch
-
-* cleanup includes
-
-
- drivers/net/wireless/ath/ath10k/Kconfig | 10 +++
- drivers/net/wireless/ath/ath10k/Makefile | 1 +
- drivers/net/wireless/ath/ath10k/core.c | 22 +++++++
- drivers/net/wireless/ath/ath10k/core.h | 9 ++-
- drivers/net/wireless/ath/ath10k/hw.h | 1 +
- drivers/net/wireless/ath/ath10k/leds.c | 103 ++++++++++++++++++++++++++++++
- drivers/net/wireless/ath/ath10k/leds.h | 45 +++++++++++++
- drivers/net/wireless/ath/ath10k/mac.c | 1 +
- drivers/net/wireless/ath/ath10k/wmi-ops.h | 32 ++++++++++
- drivers/net/wireless/ath/ath10k/wmi-tlv.c | 2 +
- drivers/net/wireless/ath/ath10k/wmi.c | 54 ++++++++++++++++
- drivers/net/wireless/ath/ath10k/wmi.h | 35 ++++++++++
- 12 files changed, 314 insertions(+), 1 deletion(-)
+ drivers/net/wireless/ath/ath10k/Kconfig | 6 ++
+ drivers/net/wireless/ath/ath10k/Makefile | 1 +
+ drivers/net/wireless/ath/ath10k/core.c | 32 ++++++++
+ drivers/net/wireless/ath/ath10k/core.h | 8 ++
+ drivers/net/wireless/ath/ath10k/hw.h | 1 +
+ drivers/net/wireless/ath/ath10k/leds.c | 90 +++++++++++++++++++++++
+ drivers/net/wireless/ath/ath10k/leds.h | 34 +++++++++
+ drivers/net/wireless/ath/ath10k/mac.c | 1 +
+ drivers/net/wireless/ath/ath10k/wmi-ops.h | 32 ++++++++
+ drivers/net/wireless/ath/ath10k/wmi-tlv.c | 2 +
+ drivers/net/wireless/ath/ath10k/wmi.c | 54 ++++++++++++++
+ drivers/net/wireless/ath/ath10k/wmi.h | 35 +++++++++
+ 12 files changed, 296 insertions(+)
create mode 100644 drivers/net/wireless/ath/ath10k/leds.c
create mode 100644 drivers/net/wireless/ath/ath10k/leds.h
+
+diff --git a/drivers/net/wireless/ath/ath10k/Kconfig b/drivers/net/wireless/ath/ath10k/Kconfig
+index e6ea884cafc1..76572cd2e1ba 100644
--- a/drivers/net/wireless/ath/ath10k/Kconfig
+++ b/drivers/net/wireless/ath/ath10k/Kconfig
-@@ -72,6 +72,16 @@ config ATH10K_DEBUGFS
+@@ -67,6 +67,12 @@ config ATH10K_DEBUGFS
If unsure, say Y to make it easier to debug problems.
+config ATH10K_LEDS
-+ bool "Atheros ath10k LED support"
++ bool
+ depends on ATH10K
-+ select MAC80211_LEDS
-+ select LEDS_CLASS
-+ select NEW_LEDS
++ depends on LEDS_CLASS=y || LEDS_CLASS=MAC80211
+ default y
-+ ---help---
-+ This option is necessary, if you want LED support for chipset connected led pins. If unsure, say N.
+
config ATH10K_SPECTRAL
bool "Atheros ath10k spectral scan support"
depends on ATH10K_DEBUGFS
+diff --git a/drivers/net/wireless/ath/ath10k/Makefile b/drivers/net/wireless/ath/ath10k/Makefile
+index 142c777b287f..02bf9b629038 100644
--- a/drivers/net/wireless/ath/ath10k/Makefile
+++ b/drivers/net/wireless/ath/ath10k/Makefile
-@@ -19,6 +19,7 @@ ath10k_core-$(CPTCFG_ATH10K_SPECTRAL) +=
- ath10k_core-$(CPTCFG_NL80211_TESTMODE) += testmode.o
- ath10k_core-$(CPTCFG_ATH10K_TRACING) += trace.o
- ath10k_core-$(CPTCFG_ATH10K_THERMAL) += thermal.o
-+ath10k_core-$(CPTCFG_ATH10K_LEDS) += leds.o
- ath10k_core-$(CPTCFG_MAC80211_DEBUGFS) += debugfs_sta.o
+@@ -19,6 +19,7 @@ ath10k_core-$(CONFIG_ATH10K_SPECTRAL) += spectral.o
+ ath10k_core-$(CONFIG_NL80211_TESTMODE) += testmode.o
+ ath10k_core-$(CONFIG_ATH10K_TRACING) += trace.o
+ ath10k_core-$(CONFIG_THERMAL) += thermal.o
++ath10k_core-$(CONFIG_ATH10K_LEDS) += leds.o
+ ath10k_core-$(CONFIG_MAC80211_DEBUGFS) += debugfs_sta.o
ath10k_core-$(CONFIG_PM) += wow.o
ath10k_core-$(CONFIG_DEV_COREDUMP) += coredump.o
---- a/local-symbols
-+++ b/local-symbols
-@@ -161,6 +161,7 @@ ATH10K_DEBUG=
- ATH10K_DEBUGFS=
- ATH10K_SPECTRAL=
- ATH10K_THERMAL=
-+ATH10K_LEDS=
- ATH10K_TRACING=
- ATH10K_DFS_CERTIFIED=
- WCN36XX=
+diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c
+index bdf0552cd1c3..b3294287bce1 100644
--- a/drivers/net/wireless/ath/ath10k/core.c
+++ b/drivers/net/wireless/ath/ath10k/core.c
-@@ -26,6 +26,7 @@
+@@ -27,6 +27,7 @@
#include "testmode.h"
#include "wmi-ops.h"
#include "coredump.h"
@@ -132,47 +77,135 @@ v13:
unsigned int ath10k_debug_mask;
EXPORT_SYMBOL(ath10k_debug_mask);
-@@ -65,6 +66,7 @@ static const struct ath10k_hw_params ath
- .dev_id = QCA988X_2_0_DEVICE_ID,
- .bus = ATH10K_BUS_PCI,
+@@ -68,6 +69,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.name = "qca988x hw2.0",
+ .patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR,
+ .uart_pin = 7,
+ .led_pin = 1,
+ .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
+ .otp_exe_param = 0,
+ .channel_counters_freq_hz = 88000,
+@@ -108,6 +110,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
+ .name = "qca988x hw2.0 ubiquiti",
.patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
++ .led_pin = 0,
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
-@@ -146,6 +148,7 @@ static const struct ath10k_hw_params ath
- .dev_id = QCA9887_1_0_DEVICE_ID,
- .bus = ATH10K_BUS_PCI,
+ .otp_exe_param = 0,
+ .channel_counters_freq_hz = 88000,
+@@ -149,6 +152,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.name = "qca9887 hw1.0",
-+ .led_pin = 1,
.patch_load_addr = QCA9887_HW_1_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
++ .led_pin = 1,
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
-@@ -387,6 +390,7 @@ static const struct ath10k_hw_params ath
- .dev_id = QCA99X0_2_0_DEVICE_ID,
- .bus = ATH10K_BUS_PCI,
+ .otp_exe_param = 0,
+ .channel_counters_freq_hz = 88000,
+@@ -190,6 +194,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
+ .name = "qca6174 hw3.2 sdio",
+ .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR,
+ .uart_pin = 19,
++ .led_pin = 0,
+ .otp_exe_param = 0,
+ .channel_counters_freq_hz = 88000,
+ .max_probe_resp_desc_thres = 0,
+@@ -226,6 +231,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
+ .name = "qca6164 hw2.1",
+ .patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR,
+ .uart_pin = 6,
++ .led_pin = 0,
+ .otp_exe_param = 0,
+ .channel_counters_freq_hz = 88000,
+ .max_probe_resp_desc_thres = 0,
+@@ -266,6 +272,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
+ .name = "qca6174 hw2.1",
+ .patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR,
+ .uart_pin = 6,
++ .led_pin = 0,
+ .otp_exe_param = 0,
+ .channel_counters_freq_hz = 88000,
+ .max_probe_resp_desc_thres = 0,
+@@ -306,6 +313,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
+ .name = "qca6174 hw3.0",
+ .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR,
+ .uart_pin = 6,
++ .led_pin = 0,
+ .otp_exe_param = 0,
+ .channel_counters_freq_hz = 88000,
+ .max_probe_resp_desc_thres = 0,
+@@ -346,6 +354,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
+ .name = "qca6174 hw3.2",
+ .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR,
+ .uart_pin = 6,
++ .led_pin = 0,
+ .otp_exe_param = 0,
+ .channel_counters_freq_hz = 88000,
+ .max_probe_resp_desc_thres = 0,
+@@ -390,6 +399,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.name = "qca99x0 hw2.0",
-+ .led_pin = 17,
.patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
++ .led_pin = 17,
.otp_exe_param = 0x00000700,
-@@ -433,6 +437,7 @@ static const struct ath10k_hw_params ath
- .dev_id = QCA9984_1_0_DEVICE_ID,
- .bus = ATH10K_BUS_PCI,
+ .continuous_frag_desc = true,
+ .cck_rate_map_rev2 = true,
+@@ -436,6 +446,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.name = "qca9984/qca9994 hw1.0",
-+ .led_pin = 17,
.patch_load_addr = QCA9984_HW_1_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
++ .led_pin = 17,
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
-@@ -486,6 +491,7 @@ static const struct ath10k_hw_params ath
- .dev_id = QCA9888_2_0_DEVICE_ID,
- .bus = ATH10K_BUS_PCI,
+ .otp_exe_param = 0x00000700,
+ .continuous_frag_desc = true,
+@@ -488,6 +499,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
.name = "qca9888 hw2.0",
-+ .led_pin = 17,
.patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
++ .led_pin = 17,
+ .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
+ .otp_exe_param = 0x00000700,
+ .continuous_frag_desc = true,
+@@ -538,6 +550,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
+ .name = "qca9377 hw1.0",
+ .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR,
+ .uart_pin = 6,
++ .led_pin = 0,
+ .otp_exe_param = 0,
+ .channel_counters_freq_hz = 88000,
+ .max_probe_resp_desc_thres = 0,
+@@ -578,6 +591,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
+ .name = "qca9377 hw1.1",
+ .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR,
+ .uart_pin = 6,
++ .led_pin = 0,
+ .otp_exe_param = 0,
+ .channel_counters_freq_hz = 88000,
+ .max_probe_resp_desc_thres = 0,
+@@ -620,6 +634,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
+ .name = "qca9377 hw1.1 sdio",
+ .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR,
+ .uart_pin = 19,
++ .led_pin = 0,
+ .otp_exe_param = 0,
+ .channel_counters_freq_hz = 88000,
+ .max_probe_resp_desc_thres = 0,
+@@ -653,6 +668,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
+ .name = "qca4019 hw1.0",
+ .patch_load_addr = QCA4019_HW_1_0_PATCH_LOAD_ADDR,
+ .uart_pin = 7,
++ .led_pin = 0,
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
-@@ -3222,6 +3228,10 @@ int ath10k_core_start(struct ath10k *ar,
+ .otp_exe_param = 0x0010000,
+ .continuous_frag_desc = true,
+@@ -698,6 +714,7 @@ static const struct ath10k_hw_params ath10k_hw_params_list[] = {
+ .dev_id = 0,
+ .bus = ATH10K_BUS_SNOC,
+ .name = "wcn3990 hw1.0",
++ .led_pin = 0,
+ .continuous_frag_desc = true,
+ .tx_chain_mask = 0x7,
+ .rx_chain_mask = 0x7,
+@@ -3224,6 +3241,10 @@ int ath10k_core_start(struct ath10k *ar, enum ath10k_firmware_mode mode,
goto err_hif_stop;
}
@@ -183,7 +216,7 @@ v13:
return 0;
err_hif_stop:
-@@ -3480,9 +3490,18 @@ static void ath10k_core_register_work(st
+@@ -3482,9 +3503,18 @@ static void ath10k_core_register_work(struct work_struct *work)
goto err_spectral_destroy;
}
@@ -202,7 +235,7 @@ v13:
err_spectral_destroy:
ath10k_spectral_destroy(ar);
err_debug_destroy:
-@@ -3528,6 +3547,8 @@ void ath10k_core_unregister(struct ath10
+@@ -3520,6 +3550,8 @@ void ath10k_core_unregister(struct ath10k *ar)
if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags))
return;
@@ -211,9 +244,11 @@ v13:
ath10k_thermal_unregister(ar);
/* Stop spectral before unregistering from mac80211 to remove the
* relayfs debugfs file cleanly. Otherwise the parent debugfs tree
+diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h
+index b00099f0b24e..446dca74f06a 100644
--- a/drivers/net/wireless/ath/ath10k/core.h
+++ b/drivers/net/wireless/ath/ath10k/core.h
-@@ -14,6 +14,7 @@
+@@ -15,6 +15,7 @@
#include <linux/pci.h>
#include <linux/uuid.h>
#include <linux/time.h>
@@ -221,23 +256,25 @@ v13:
#include "htt.h"
#include "htc.h"
-@@ -1256,6 +1257,13 @@ struct ath10k {
+@@ -1258,6 +1259,13 @@ struct ath10k {
+ bool utf_monitor;
} testmode;
- struct {
++ struct {
+ struct gpio_led wifi_led;
+ struct led_classdev cdev;
+ char label[48];
+ u32 gpio_state_pin;
+ } leds;
+
-+ struct {
+ struct {
/* protected by data_lock */
u32 rx_crc_err_drop;
- u32 fw_crash_counter;
+diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h
+index 48897e5eca06..442091c6dfd2 100644
--- a/drivers/net/wireless/ath/ath10k/hw.h
+++ b/drivers/net/wireless/ath/ath10k/hw.h
-@@ -519,6 +519,7 @@ struct ath10k_hw_params {
+@@ -512,6 +512,7 @@ struct ath10k_hw_params {
const char *name;
u32 patch_load_addr;
int uart_pin;
@@ -245,26 +282,18 @@ v13:
u32 otp_exe_param;
/* Type of hw cycle counter wraparound logic, for more info
+diff --git a/drivers/net/wireless/ath/ath10k/leds.c b/drivers/net/wireless/ath/ath10k/leds.c
+new file mode 100644
+index 000000000000..9b1d04eb4265
--- /dev/null
+++ b/drivers/net/wireless/ath/ath10k/leds.c
-@@ -0,0 +1,103 @@
+@@ -0,0 +1,90 @@
++// SPDX-License-Identifier: ISC
+/*
+ * Copyright (c) 2005-2011 Atheros Communications Inc.
+ * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
+ * Copyright (c) 2018 Sebastian Gottschall <s.gottschall at dd-wrt.com>
-+ * Copyright (c) 2018, The Linux Foundation. All rights reserved.
-+ *
-+ * Permission to use, copy, modify, and/or distribute this software for any
-+ * purpose with or without fee is hereby granted, provided that the above
-+ * copyright notice and this permission notice appear in all copies.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ * Copyright (c) 2018 The Linux Foundation. All rights reserved.
+ */
+
+#include <linux/leds.h>
@@ -331,8 +360,6 @@ v13:
+
+ ar->leds.cdev.name = ar->leds.label;
+ ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking;
-+
-+ /* FIXME: this assignment doesn't make sense as it's NULL, remove it? */
+ ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger;
+
+ ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &ar->leds.cdev);
@@ -351,30 +378,26 @@ v13:
+ led_classdev_unregister(&ar->leds.cdev);
+}
+
+diff --git a/drivers/net/wireless/ath/ath10k/leds.h b/drivers/net/wireless/ath/ath10k/leds.h
+new file mode 100644
+index 000000000000..56325b0875e5
--- /dev/null
+++ b/drivers/net/wireless/ath/ath10k/leds.h
-@@ -0,0 +1,41 @@
+@@ -0,0 +1,34 @@
++/* SPDX-License-Identifier: ISC */
+/*
-+ * Copyright (c) 2018, The Linux Foundation. All rights reserved.
-+ *
-+ * Permission to use, copy, modify, and/or distribute this software for any
-+ * purpose with or without fee is hereby granted, provided that the above
-+ * copyright notice and this permission notice appear in all copies.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ * Copyright (c) 2005-2011 Atheros Communications Inc.
++ * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
++ * Copyright (c) 2018 Sebastian Gottschall <s.gottschall at dd-wrt.com>
++ * Copyright (c) 2018 The Linux Foundation. All rights reserved.
+ */
++
+#ifndef _LEDS_H_
+#define _LEDS_H_
+
+#include "core.h"
+
-+#ifdef CPTCFG_ATH10K_LEDS
++#ifdef CONFIG_ATH10K_LEDS
+void ath10k_leds_unregister(struct ath10k *ar);
+int ath10k_leds_start(struct ath10k *ar);
+int ath10k_leds_register(struct ath10k *ar);
@@ -395,9 +418,11 @@ v13:
+
+#endif
+#endif /* _LEDS_H_ */
+diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
+index e322b528baaf..3bf67b2ecd6d 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
-@@ -24,6 +24,7 @@
+@@ -25,6 +25,7 @@
#include "wmi-tlv.h"
#include "wmi-ops.h"
#include "wow.h"
@@ -405,6 +430,8 @@ v13:
/*********/
/* Rates */
+diff --git a/drivers/net/wireless/ath/ath10k/wmi-ops.h b/drivers/net/wireless/ath/ath10k/wmi-ops.h
+index aa57d807491c..f3f6b5954b27 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-ops.h
+++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h
@@ -226,7 +226,10 @@ struct wmi_ops {
@@ -418,7 +445,7 @@ v13:
};
int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
-@@ -1122,6 +1125,35 @@ ath10k_wmi_force_fw_hang(struct ath10k *
+@@ -1122,6 +1125,35 @@ ath10k_wmi_force_fw_hang(struct ath10k *ar,
return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->force_fw_hang_cmdid);
}
@@ -454,9 +481,11 @@ v13:
static inline int
ath10k_wmi_dbglog_cfg(struct ath10k *ar, u64 module_enable, u32 log_level)
{
+diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
+index aed97fd121ba..dbaf26d6a7a6 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
-@@ -4601,6 +4601,8 @@ static const struct wmi_ops wmi_tlv_ops
+@@ -4606,6 +4606,8 @@ static const struct wmi_ops wmi_tlv_ops = {
.gen_echo = ath10k_wmi_tlv_op_gen_echo,
.gen_vdev_spectral_conf = ath10k_wmi_tlv_op_gen_vdev_spectral_conf,
.gen_vdev_spectral_enable = ath10k_wmi_tlv_op_gen_vdev_spectral_enable,
@@ -465,9 +494,11 @@ v13:
};
static const struct wmi_peer_flags_map wmi_tlv_peer_flags_map = {
+diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c
+index 80d255aaff1b..fe2344598364 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.c
+++ b/drivers/net/wireless/ath/ath10k/wmi.c
-@@ -7472,6 +7472,49 @@ ath10k_wmi_op_gen_peer_set_param(struct
+@@ -7493,6 +7493,49 @@ ath10k_wmi_op_gen_peer_set_param(struct ath10k *ar, u32 vdev_id,
return skb;
}
@@ -517,7 +548,7 @@ v13:
static struct sk_buff *
ath10k_wmi_op_gen_set_psmode(struct ath10k *ar, u32 vdev_id,
enum wmi_sta_ps_mode psmode)
-@@ -9138,6 +9181,9 @@ static const struct wmi_ops wmi_ops = {
+@@ -9157,6 +9200,9 @@ static const struct wmi_ops wmi_ops = {
.fw_stats_fill = ath10k_wmi_main_op_fw_stats_fill,
.get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
.gen_echo = ath10k_wmi_op_gen_echo,
@@ -527,7 +558,7 @@ v13:
/* .gen_bcn_tmpl not implemented */
/* .gen_prb_tmpl not implemented */
/* .gen_p2p_go_bcn_ie not implemented */
-@@ -9208,6 +9254,8 @@ static const struct wmi_ops wmi_10_1_ops
+@@ -9227,6 +9273,8 @@ static const struct wmi_ops wmi_10_1_ops = {
.fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill,
.get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
.gen_echo = ath10k_wmi_op_gen_echo,
@@ -536,7 +567,7 @@ v13:
/* .gen_bcn_tmpl not implemented */
/* .gen_prb_tmpl not implemented */
/* .gen_p2p_go_bcn_ie not implemented */
-@@ -9280,6 +9328,8 @@ static const struct wmi_ops wmi_10_2_ops
+@@ -9299,6 +9347,8 @@ static const struct wmi_ops wmi_10_2_ops = {
.gen_delba_send = ath10k_wmi_op_gen_delba_send,
.fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill,
.get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
@@ -545,7 +576,7 @@ v13:
/* .gen_pdev_enable_adaptive_cca not implemented */
};
-@@ -9351,6 +9401,8 @@ static const struct wmi_ops wmi_10_2_4_o
+@@ -9370,6 +9420,8 @@ static const struct wmi_ops wmi_10_2_4_ops = {
ath10k_wmi_op_gen_pdev_enable_adaptive_cca,
.get_vdev_subtype = ath10k_wmi_10_2_4_op_get_vdev_subtype,
.gen_bb_timing = ath10k_wmi_10_2_4_op_gen_bb_timing,
@@ -554,7 +585,7 @@ v13:
/* .gen_bcn_tmpl not implemented */
/* .gen_prb_tmpl not implemented */
/* .gen_p2p_go_bcn_ie not implemented */
-@@ -9432,6 +9484,8 @@ static const struct wmi_ops wmi_10_4_ops
+@@ -9451,6 +9503,8 @@ static const struct wmi_ops wmi_10_4_ops = {
.gen_pdev_bss_chan_info_req = ath10k_wmi_10_2_op_gen_pdev_bss_chan_info,
.gen_echo = ath10k_wmi_op_gen_echo,
.gen_pdev_get_tpc_config = ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config,
@@ -563,9 +594,11 @@ v13:
};
int ath10k_wmi_attach(struct ath10k *ar)
+diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h
+index 2379501225a4..0faefc0a9a40 100644
--- a/drivers/net/wireless/ath/ath10k/wmi.h
+++ b/drivers/net/wireless/ath/ath10k/wmi.h
-@@ -3030,6 +3030,41 @@ enum wmi_10_4_feature_mask {
+@@ -3034,6 +3034,41 @@ enum wmi_10_4_feature_mask {
};
@@ -607,3 +640,6 @@ v13:
struct wmi_ext_resource_config_10_4_cmd {
/* contains enum wmi_host_platform_type */
__le32 host_platform_config;
+--
+2.43.0
+
diff --git a/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch b/package/kernel/mac80211/patches/ath10k/974-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch
similarity index 70%
rename from package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
rename to package/kernel/mac80211/patches/ath10k/974-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch
index 2465470a57..05e3b2a28d 100644
--- a/package/kernel/mac80211/patches/ath10k/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch
+++ b/package/kernel/mac80211/patches/ath10k/974-wifi-ath10k-add-LED-and-GPIO-controlling-support-for.patch
@@ -1,103 +1,52 @@
-From: Sebastian Gottschall <s.gottschall at newmedia-net.de>
-
-Adds LED and GPIO Control support for 988x, 9887, 9888, 99x0, 9984 based
-chipsets with on chipset connected led's using WMI Firmware API. The LED
-device will get available named as "ath10k-phyX" at sysfs and can be controlled
-with various triggers. adds also debugfs interface for gpio control.
-
-This patch is specific for OpenWRt base, as is use old backported package
-with old wireless source. Support for QCA9984 is removed and a simbol
-is added to local-simbol file to export the actually compile the code
-with the ATH10K_LEDS simbol.
+From 8e1debd82466a3fe711784ab37e6b54e56011267 Mon Sep 17 00:00:00 2001
+From: Sebastian Gottschall <s.gottschall at dd-wrt.com>
+Date: Mon, 13 May 2024 17:22:25 +0300
+Subject: [PATCH] wifi: ath10k: add LED and GPIO controlling support for
+ various chipsets
+Adds LED and GPIO Control support for 988x, 9887, 9888, 99x0, 9984
+based chipsets with on chipset connected led's using WMI Firmware API.
+The LED device will get available named as "ath10k-phyX" at sysfs and
+can be controlled with various triggers.
+Adds also debugfs interface for gpio control.
Signed-off-by: Sebastian Gottschall <s.gottschall at dd-wrt.com>
Reviewed-by: Steve deRosier <derosier at cal-sierra.com>
[kvalo: major reorg and cleanup]
Signed-off-by: Kalle Valo <kvalo at codeaurora.org>
-Signed-off-by: Ansuel Smith <ansuelsmth at gmail.com>
+[ansuel: rebase and small cleanup]
+Signed-off-by: Christian Marangi <ansuelsmth at gmail.com>
+Tested-by: Stefan Lippers-Hollmann <s.l-h at gmx.de>
+Signed-off-by: Kalle Valo <quic_kvalo at quicinc.com>
+Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com
---
-
-v13:
-
-* only compile tested!
-
-* fix all checkpatch warnings
-
-* fix commit log
-
-* sizeof(struct ath10k_gpiocontrol) -> sizeof(*gpio)
-
-* unsigned -> unsigned int
-
-* remove GPIOLIB code, that should be added in a separate patch
-
-* rename gpio.c to leds.c
-
-* add leds.h
-
-* rename some functions:
-
- ath10k_attach_led() -> ath10k_leds_register()
- ath10k_unregister_led() -> ath10k_leds_unregister()
- ath10k_reset_led_pin() -> ath10k_leds_start()
-
-* call ath10k_leds_unregister() before ath10k_thermal_unregister() to preserve ordering
-
-* call ath10k_leds_start() only from ath10k_core_start() and not from mac.c
-
-* rename struct ath10k_gpiocontrol as anonymous function under struct
- ath10k::leds, no need for memory allocation
-
-* merge ath10k_add_led() to ath10k_attach_led(), which is it's only caller
-
-* remove #if IS_ENABLED() checks from most of places, memory savings from those were not worth it
-
-* Kconfig help text improvement and move it lower in the menu, also don't enable it by default
-
-* switch to set_brightness_blocking() so that the callback can sleep,
- then no need to use ath10k_wmi_cmd_send_nowait() and can take mutex
- to access ar->state
-
-* don't touch ath10k_wmi_pdev_get_temperature()
-
-* as QCA6174/QCA9377 are not (yet) supported don't add the command to WMI-TLV interface
-
-* remove debugfs interface, that should be added in another patch
-
-* cleanup includes
-
-
- drivers/net/wireless/ath/ath10k/Kconfig | 10 +++
- drivers/net/wireless/ath/ath10k/Makefile | 1 +
- drivers/net/wireless/ath/ath10k/core.c | 22 +++++++
- drivers/net/wireless/ath/ath10k/core.h | 9 ++-
- drivers/net/wireless/ath/ath10k/hw.h | 1 +
- drivers/net/wireless/ath/ath10k/leds.c | 103 ++++++++++++++++++++++++++++++
- drivers/net/wireless/ath/ath10k/leds.h | 45 +++++++++++++
- drivers/net/wireless/ath/ath10k/mac.c | 1 +
- drivers/net/wireless/ath/ath10k/wmi-ops.h | 32 ++++++++++
- drivers/net/wireless/ath/ath10k/wmi-tlv.c | 2 +
- drivers/net/wireless/ath/ath10k/wmi.c | 54 ++++++++++++++++
- drivers/net/wireless/ath/ath10k/wmi.h | 35 ++++++++++
- 12 files changed, 314 insertions(+), 1 deletion(-)
+ drivers/net/wireless/ath/ath10k/Kconfig | 6 ++
+ drivers/net/wireless/ath/ath10k/Makefile | 1 +
+ drivers/net/wireless/ath/ath10k/core.c | 32 ++++++++
+ drivers/net/wireless/ath/ath10k/core.h | 8 ++
+ drivers/net/wireless/ath/ath10k/hw.h | 1 +
+ drivers/net/wireless/ath/ath10k/leds.c | 90 +++++++++++++++++++++++
+ drivers/net/wireless/ath/ath10k/leds.h | 34 +++++++++
+ drivers/net/wireless/ath/ath10k/mac.c | 1 +
+ drivers/net/wireless/ath/ath10k/wmi-ops.h | 32 ++++++++
+ drivers/net/wireless/ath/ath10k/wmi-tlv.c | 2 +
+ drivers/net/wireless/ath/ath10k/wmi.c | 54 ++++++++++++++
+ drivers/net/wireless/ath/ath10k/wmi.h | 35 +++++++++
+ 12 files changed, 296 insertions(+)
create mode 100644 drivers/net/wireless/ath/ath10k/leds.c
create mode 100644 drivers/net/wireless/ath/ath10k/leds.h
+
--- a/drivers/net/wireless/ath/ath10k/Kconfig
+++ b/drivers/net/wireless/ath/ath10k/Kconfig
-@@ -72,6 +72,16 @@ config ATH10K_DEBUGFS
+@@ -72,6 +72,12 @@ config ATH10K_DEBUGFS
If unsure, say Y to make it easier to debug problems.
+config ATH10K_LEDS
-+ bool "Atheros ath10k LED support"
++ bool
+ depends on ATH10K
-+ select MAC80211_LEDS
-+ select LEDS_CLASS
-+ select NEW_LEDS
++ depends on LEDS_CLASS=y || LEDS_CLASS=MAC80211
+ default y
-+ ---help---
-+ This option is necessary, if you want LED support for chipset connected led pins. If unsure, say N.
+
config ATH10K_SPECTRAL
bool "Atheros ath10k spectral scan support"
@@ -132,47 +81,135 @@ v13:
unsigned int ath10k_debug_mask;
EXPORT_SYMBOL(ath10k_debug_mask);
-@@ -65,6 +66,7 @@ static const struct ath10k_hw_params ath
- .dev_id = QCA988X_2_0_DEVICE_ID,
- .bus = ATH10K_BUS_PCI,
+@@ -67,6 +68,7 @@ static const struct ath10k_hw_params ath
.name = "qca988x hw2.0",
+ .patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR,
+ .uart_pin = 7,
+ .led_pin = 1,
+ .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
+ .otp_exe_param = 0,
+ .channel_counters_freq_hz = 88000,
+@@ -107,6 +109,7 @@ static const struct ath10k_hw_params ath
+ .name = "qca988x hw2.0 ubiquiti",
.patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
++ .led_pin = 0,
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
-@@ -146,6 +148,7 @@ static const struct ath10k_hw_params ath
- .dev_id = QCA9887_1_0_DEVICE_ID,
- .bus = ATH10K_BUS_PCI,
+ .otp_exe_param = 0,
+ .channel_counters_freq_hz = 88000,
+@@ -148,6 +151,7 @@ static const struct ath10k_hw_params ath
.name = "qca9887 hw1.0",
-+ .led_pin = 1,
.patch_load_addr = QCA9887_HW_1_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
++ .led_pin = 1,
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
-@@ -387,6 +390,7 @@ static const struct ath10k_hw_params ath
- .dev_id = QCA99X0_2_0_DEVICE_ID,
- .bus = ATH10K_BUS_PCI,
+ .otp_exe_param = 0,
+ .channel_counters_freq_hz = 88000,
+@@ -189,6 +193,7 @@ static const struct ath10k_hw_params ath
+ .name = "qca6174 hw3.2 sdio",
+ .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR,
+ .uart_pin = 19,
++ .led_pin = 0,
+ .otp_exe_param = 0,
+ .channel_counters_freq_hz = 88000,
+ .max_probe_resp_desc_thres = 0,
+@@ -225,6 +230,7 @@ static const struct ath10k_hw_params ath
+ .name = "qca6164 hw2.1",
+ .patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR,
+ .uart_pin = 6,
++ .led_pin = 0,
+ .otp_exe_param = 0,
+ .channel_counters_freq_hz = 88000,
+ .max_probe_resp_desc_thres = 0,
+@@ -265,6 +271,7 @@ static const struct ath10k_hw_params ath
+ .name = "qca6174 hw2.1",
+ .patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR,
+ .uart_pin = 6,
++ .led_pin = 0,
+ .otp_exe_param = 0,
+ .channel_counters_freq_hz = 88000,
+ .max_probe_resp_desc_thres = 0,
+@@ -305,6 +312,7 @@ static const struct ath10k_hw_params ath
+ .name = "qca6174 hw3.0",
+ .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR,
+ .uart_pin = 6,
++ .led_pin = 0,
+ .otp_exe_param = 0,
+ .channel_counters_freq_hz = 88000,
+ .max_probe_resp_desc_thres = 0,
+@@ -345,6 +353,7 @@ static const struct ath10k_hw_params ath
+ .name = "qca6174 hw3.2",
+ .patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR,
+ .uart_pin = 6,
++ .led_pin = 0,
+ .otp_exe_param = 0,
+ .channel_counters_freq_hz = 88000,
+ .max_probe_resp_desc_thres = 0,
+@@ -389,6 +398,7 @@ static const struct ath10k_hw_params ath
.name = "qca99x0 hw2.0",
-+ .led_pin = 17,
.patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
++ .led_pin = 17,
.otp_exe_param = 0x00000700,
-@@ -433,6 +437,7 @@ static const struct ath10k_hw_params ath
- .dev_id = QCA9984_1_0_DEVICE_ID,
- .bus = ATH10K_BUS_PCI,
+ .continuous_frag_desc = true,
+ .cck_rate_map_rev2 = true,
+@@ -435,6 +445,7 @@ static const struct ath10k_hw_params ath
.name = "qca9984/qca9994 hw1.0",
-+ .led_pin = 17,
.patch_load_addr = QCA9984_HW_1_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
++ .led_pin = 17,
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
-@@ -486,6 +491,7 @@ static const struct ath10k_hw_params ath
- .dev_id = QCA9888_2_0_DEVICE_ID,
- .bus = ATH10K_BUS_PCI,
+ .otp_exe_param = 0x00000700,
+ .continuous_frag_desc = true,
+@@ -488,6 +499,7 @@ static const struct ath10k_hw_params ath
.name = "qca9888 hw2.0",
-+ .led_pin = 17,
.patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
++ .led_pin = 17,
+ .cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
+ .otp_exe_param = 0x00000700,
+ .continuous_frag_desc = true,
+@@ -538,6 +550,7 @@ static const struct ath10k_hw_params ath
+ .name = "qca9377 hw1.0",
+ .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR,
+ .uart_pin = 6,
++ .led_pin = 0,
+ .otp_exe_param = 0,
+ .channel_counters_freq_hz = 88000,
+ .max_probe_resp_desc_thres = 0,
+@@ -578,6 +591,7 @@ static const struct ath10k_hw_params ath
+ .name = "qca9377 hw1.1",
+ .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR,
+ .uart_pin = 6,
++ .led_pin = 0,
+ .otp_exe_param = 0,
+ .channel_counters_freq_hz = 88000,
+ .max_probe_resp_desc_thres = 0,
+@@ -620,6 +634,7 @@ static const struct ath10k_hw_params ath
+ .name = "qca9377 hw1.1 sdio",
+ .patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR,
+ .uart_pin = 19,
++ .led_pin = 0,
+ .otp_exe_param = 0,
+ .channel_counters_freq_hz = 88000,
+ .max_probe_resp_desc_thres = 0,
+@@ -653,6 +668,7 @@ static const struct ath10k_hw_params ath
+ .name = "qca4019 hw1.0",
+ .patch_load_addr = QCA4019_HW_1_0_PATCH_LOAD_ADDR,
+ .uart_pin = 7,
++ .led_pin = 0,
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
-@@ -3222,6 +3228,10 @@ int ath10k_core_start(struct ath10k *ar,
+ .otp_exe_param = 0x0010000,
+ .continuous_frag_desc = true,
+@@ -698,6 +714,7 @@ static const struct ath10k_hw_params ath
+ .dev_id = 0,
+ .bus = ATH10K_BUS_SNOC,
+ .name = "wcn3990 hw1.0",
++ .led_pin = 0,
+ .continuous_frag_desc = true,
+ .tx_chain_mask = 0x7,
+ .rx_chain_mask = 0x7,
+@@ -3222,6 +3239,10 @@ int ath10k_core_start(struct ath10k *ar,
goto err_hif_stop;
}
@@ -183,7 +220,7 @@ v13:
return 0;
err_hif_stop:
-@@ -3480,9 +3490,18 @@ static void ath10k_core_register_work(st
+@@ -3480,9 +3501,18 @@ static void ath10k_core_register_work(st
goto err_spectral_destroy;
}
@@ -202,7 +239,7 @@ v13:
err_spectral_destroy:
ath10k_spectral_destroy(ar);
err_debug_destroy:
-@@ -3528,6 +3547,8 @@ void ath10k_core_unregister(struct ath10
+@@ -3528,6 +3558,8 @@ void ath10k_core_unregister(struct ath10
if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags))
return;
@@ -247,24 +284,13 @@ v13:
/* Type of hw cycle counter wraparound logic, for more info
--- /dev/null
+++ b/drivers/net/wireless/ath/ath10k/leds.c
-@@ -0,0 +1,103 @@
+@@ -0,0 +1,90 @@
++// SPDX-License-Identifier: ISC
+/*
+ * Copyright (c) 2005-2011 Atheros Communications Inc.
+ * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
+ * Copyright (c) 2018 Sebastian Gottschall <s.gottschall at dd-wrt.com>
-+ * Copyright (c) 2018, The Linux Foundation. All rights reserved.
-+ *
-+ * Permission to use, copy, modify, and/or distribute this software for any
-+ * purpose with or without fee is hereby granted, provided that the above
-+ * copyright notice and this permission notice appear in all copies.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ * Copyright (c) 2018 The Linux Foundation. All rights reserved.
+ */
+
+#include <linux/leds.h>
@@ -331,8 +357,6 @@ v13:
+
+ ar->leds.cdev.name = ar->leds.label;
+ ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking;
-+
-+ /* FIXME: this assignment doesn't make sense as it's NULL, remove it? */
+ ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger;
+
+ ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &ar->leds.cdev);
@@ -353,22 +377,15 @@ v13:
+
--- /dev/null
+++ b/drivers/net/wireless/ath/ath10k/leds.h
-@@ -0,0 +1,41 @@
+@@ -0,0 +1,34 @@
++/* SPDX-License-Identifier: ISC */
+/*
-+ * Copyright (c) 2018, The Linux Foundation. All rights reserved.
-+ *
-+ * Permission to use, copy, modify, and/or distribute this software for any
-+ * purpose with or without fee is hereby granted, provided that the above
-+ * copyright notice and this permission notice appear in all copies.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ * Copyright (c) 2005-2011 Atheros Communications Inc.
++ * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
++ * Copyright (c) 2018 Sebastian Gottschall <s.gottschall at dd-wrt.com>
++ * Copyright (c) 2018 The Linux Foundation. All rights reserved.
+ */
++
+#ifndef _LEDS_H_
+#define _LEDS_H_
+
@@ -569,7 +586,7 @@ v13:
};
-+/* WMI_GPIO_CONFIG_CMDID */
++/* WMI_GPIO_CPTCFG_CMDID */
+enum {
+ WMI_GPIO_PULL_NONE,
+ WMI_GPIO_PULL_UP,
@@ -585,7 +602,7 @@ v13:
+ WMI_GPIO_INTTYPE_LEVEL_HIGH
+};
+
-+/* WMI_GPIO_CONFIG_CMDID */
++/* WMI_GPIO_CPTCFG_CMDID */
+struct wmi_gpio_config_cmd {
+ __le32 gpio_num; /* GPIO number to be setup */
+ __le32 input; /* 0 - Output/ 1 - Input */
diff --git a/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch b/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch
index 95bd48f923..2e598199c4 100644
--- a/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch
+++ b/package/kernel/mac80211/patches/ath10k/975-ath10k-use-tpt-trigger-by-default.patch
@@ -29,12 +29,10 @@ Signed-off-by: Mathias Kresin <dev at kresin.me>
};
--- a/drivers/net/wireless/ath/ath10k/leds.c
+++ b/drivers/net/wireless/ath/ath10k/leds.c
-@@ -81,9 +81,7 @@ int ath10k_leds_register(struct ath10k *
+@@ -70,7 +70,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;
--
-- /* FIXME: this assignment doesn't make sense as it's NULL, remove it? */
- ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger;
+ ar->leds.cdev.default_trigger = ar->led_default_trigger;
diff --git a/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch b/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch
index cfa0f9108a..6439ff9803 100644
--- a/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch
+++ b/package/kernel/mac80211/patches/ath10k/984-ath10k-Try-to-get-mac-address-from-dts.patch
@@ -26,7 +26,7 @@ Signed-off-by: Ansuel Smith <ansuelsmth at gmail.com>
#include <linux/property.h>
#include <linux/dmi.h>
#include <linux/ctype.h>
-@@ -3398,6 +3399,8 @@ static int ath10k_core_probe_fw(struct a
+@@ -3409,6 +3410,8 @@ static int ath10k_core_probe_fw(struct a
device_get_mac_address(ar->dev, ar->mac_addr);
More information about the lede-commits
mailing list