mirror of
https://github.com/FUjr/gl-infra-builder.git
synced 2025-12-16 17:15:08 +00:00
60 lines
2.2 KiB
Diff
60 lines
2.2 KiB
Diff
From aa487fa14318de14da3281023b8f45e7b6e7b0ff Mon Sep 17 00:00:00 2001
|
|
From: "GL.iNet-Hongjian.Zhang" <hongjian.zhang@gl-inet.com>
|
|
Date: Sat, 18 Sep 2021 16:40:41 +0800
|
|
Subject: [PATCH 6/8] led netdev trigger by wwanx
|
|
|
|
---
|
|
target/linux/ath79/dts/qca953x.dtsi | 2 +-
|
|
.../931-fix-led-netdev-trigger-by-wwanx.patch | 26 +++++++++++++++++++
|
|
2 files changed, 27 insertions(+), 1 deletion(-)
|
|
create mode 100644 target/linux/ath79/patches-5.4/931-fix-led-netdev-trigger-by-wwanx.patch
|
|
|
|
diff --git a/target/linux/ath79/dts/qca953x.dtsi b/target/linux/ath79/dts/qca953x.dtsi
|
|
index 943e42437a..7774d073e7 100644
|
|
--- a/target/linux/ath79/dts/qca953x.dtsi
|
|
+++ b/target/linux/ath79/dts/qca953x.dtsi
|
|
@@ -240,7 +240,7 @@
|
|
builtin-switch;
|
|
|
|
builtin_switch: switch0@1f {
|
|
- compatible = "qca,ar8229";
|
|
+ compatible = "qca,ar8229-builtin";
|
|
|
|
reg = <0x1f>;
|
|
resets = <&rst 8>;
|
|
diff --git a/target/linux/ath79/patches-5.4/931-fix-led-netdev-trigger-by-wwanx.patch b/target/linux/ath79/patches-5.4/931-fix-led-netdev-trigger-by-wwanx.patch
|
|
new file mode 100644
|
|
index 0000000000..e4b5950faf
|
|
--- /dev/null
|
|
+++ b/target/linux/ath79/patches-5.4/931-fix-led-netdev-trigger-by-wwanx.patch
|
|
@@ -0,0 +1,26 @@
|
|
+Index: b/drivers/leds/trigger/ledtrig-netdev.c
|
|
+===================================================================
|
|
+--- a/drivers/leds/trigger/ledtrig-netdev.c 2021-08-26 20:55:22.000000000 +0800
|
|
++++ b/drivers/leds/trigger/ledtrig-netdev.c 2021-09-18 16:00:16.427666394 +0800
|
|
+@@ -109,6 +109,7 @@ static ssize_t device_name_store(struct
|
|
+ size_t size)
|
|
+ {
|
|
+ struct led_netdev_data *trigger_data = led_trigger_get_drvdata(dev);
|
|
++ unsigned int flags;
|
|
+
|
|
+ if (size >= IFNAMSIZ)
|
|
+ return -EINVAL;
|
|
+@@ -132,9 +133,11 @@ static ssize_t device_name_store(struct
|
|
+ dev_get_by_name(&init_net, trigger_data->device_name);
|
|
+
|
|
+ clear_bit(NETDEV_LED_MODE_LINKUP, &trigger_data->mode);
|
|
+- if (trigger_data->net_dev != NULL)
|
|
+- if (netif_carrier_ok(trigger_data->net_dev))
|
|
++ if (trigger_data->net_dev != NULL){
|
|
++ flags = dev_get_flags(trigger_data->net_dev);
|
|
++ if (flags & IFF_LOWER_UP)
|
|
+ set_bit(NETDEV_LED_MODE_LINKUP, &trigger_data->mode);
|
|
++ }
|
|
+
|
|
+ trigger_data->last_activity = 0;
|
|
+
|
|
--
|
|
2.17.1
|
|
|