46 lines
1.3 KiB
Diff
46 lines
1.3 KiB
Diff
--- a/src/r8126_n.c
|
|
+++ b/src/r8126_n.c
|
|
@@ -44,6 +44,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>
|
|
@@ -11910,6 +11911,25 @@ rtl8126_setup_mqs_reg(struct rtl8126_pri
|
|
tp->imr_reg[i] = (u16)(IMR1_8125 + (i - 1) * 4);
|
|
}
|
|
|
|
+static int
|
|
+rtl8126_led_configuration(struct rtl8126_private *tp)
|
|
+{
|
|
+ const int led_regs[] = { 0x18, 0x86, 0x84, 0x96 }; /* LEDSEL 0-3 */
|
|
+ u32 led_data[4];
|
|
+ int ret, i;
|
|
+
|
|
+ ret = of_property_read_u32_array(tp->pci_dev->dev.of_node,
|
|
+ "realtek,led-data", led_data, 4);
|
|
+
|
|
+ if (ret)
|
|
+ return ret;
|
|
+
|
|
+ for (i = 0; i < 4; i++)
|
|
+ RTL_W16(tp, led_regs[i], led_data[i]);
|
|
+
|
|
+ return 0;
|
|
+}
|
|
+
|
|
static void
|
|
rtl8126_init_software_variable(struct net_device *dev)
|
|
{
|
|
@@ -12188,6 +12208,8 @@ rtl8126_init_software_variable(struct ne
|
|
else if (tp->InitRxDescType == RX_DESC_RING_TYPE_4)
|
|
tp->rtl8126_rx_config &= ~EnableRxDescV4_1;
|
|
|
|
+ rtl8126_led_configuration(tp);
|
|
+
|
|
tp->NicCustLedValue = RTL_R16(tp, CustomLED);
|
|
|
|
tp->wol_opts = rtl8126_get_hw_wol(tp);
|