lede/package/kernel/r8168/patches/300-r8168-add-LED-configuration-from-OF.patch
Álvaro Fernández Rojas a5eeb5700e kernel: r8168: update to v8.054.00
Changelog: https://github.com/openwrt/rtl8168/compare/8.053.00...8.054.00

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2024-11-08 23:06:03 +08:00

38 lines
1.0 KiB
Diff

--- a/src/r8168_n.c
+++ b/src/r8168_n.c
@@ -48,6 +48,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>
@@ -26098,6 +26099,18 @@ rtl8168_setup_mqs_reg(struct rtl8168_pri
}
static void
+rtl8168_led_configuration(struct rtl8168_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)
+ RTL_W16(tp, CustomLED, led_data);
+}
+
+static void
rtl8168_init_software_variable(struct net_device *dev)
{
struct rtl8168_private *tp = netdev_priv(dev);
@@ -26792,6 +26805,7 @@ err1:
if (tp->InitRxDescType == RX_DESC_RING_TYPE_2)
tp->RxDescLength = RX_DESC_LEN_TYPE_2;
+ rtl8168_led_configuration(tp);
tp->NicCustLedValue = RTL_R16(tp, CustomLED);
rtl8168_get_hw_wol(dev);