mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-15 18:03:30 +00:00
44 lines
1.1 KiB
Diff
44 lines
1.1 KiB
Diff
--- a/src/r8125_n.c
|
|
+++ b/src/r8125_n.c
|
|
@@ -43,6 +43,7 @@
|
|
#include <linux/etherdevice.h>
|
|
#include <linux/delay.h>
|
|
#include <linux/mii.h>
|
|
+#include <linux/of.h>
|
|
#include <linux/if_vlan.h>
|
|
#include <linux/crc32.h>
|
|
#include <linux/interrupt.h>
|
|
@@ -11479,6 +11480,23 @@ rtl8125_setup_mqs_reg(struct rtl8125_private *tp)
|
|
}
|
|
}
|
|
|
|
+static int
|
|
+rtl8125_led_configuration(struct rtl8125_private *tp)
|
|
+{
|
|
+ u32 led_data;
|
|
+ int ret;
|
|
+
|
|
+ ret = of_property_read_u32(tp->pci_dev->dev.of_node,
|
|
+ "realtek,led-data", &led_data);
|
|
+
|
|
+ if (ret)
|
|
+ return ret;
|
|
+
|
|
+ RTL_W16(tp, CustomLED, led_data);
|
|
+
|
|
+ return 0;
|
|
+}
|
|
+
|
|
static void
|
|
rtl8125_init_software_variable(struct net_device *dev)
|
|
{
|
|
@@ -11957,6 +11975,8 @@ rtl8125_init_software_variable(struct net_device *dev)
|
|
if (tp->InitRxDescType == RX_DESC_RING_TYPE_3)
|
|
tp->rtl8125_rx_config |= EnableRxDescV3;
|
|
|
|
+ rtl8125_led_configuration(tp);
|
|
+
|
|
tp->NicCustLedValue = RTL_R16(tp, CustomLED);
|
|
|
|
tp->wol_opts = rtl8125_get_hw_wol(tp);
|