lede/package/kernel/r8168/patches/300-r8168-add-LED-configuration-from-OF.patch
=?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= 0061cb8a1f package: add kmod-r8168 ethernet driver
r8168 is an out of tree driver provided by Realtek for RTL8168 devices.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
[Refresh our patch]
Signed-off-by: AnYun <amadeus@openjmu.xyz>
2024-08-21 20:40:21 +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>
@@ -25984,6 +25985,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);
@@ -26678,6 +26691,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);