Skip to content

Commit

Permalink
r8168: refresh patches
Browse files Browse the repository at this point in the history
Fixes: #9480
  • Loading branch information
aiamadeus committed Jun 4, 2022
1 parent 78b1611 commit 98f703f
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 92 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,42 +1,42 @@
--- a/src/r8168_n.c
+++ b/src/r8168_n.c
@@ -47,6 +47,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>
@@ -23482,6 +23483,22 @@ rtl8168_set_bios_setting(struct net_devi
}
}

+static int 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)
+ return ret;
+
+ RTL_W16(tp, CustomLED, led_data);
+
+ return 0;
+}
+
static void
rtl8168_init_software_variable(struct net_device *dev)
{
@@ -24000,6 +24017,8 @@ rtl8168_init_software_variable(struct ne
tp->NotWrMcuPatchCode = TRUE;
}

+ rtl8168_led_configuration(tp);
+
tp->NicCustLedValue = RTL_R16(tp, CustomLED);

rtl8168_get_hw_wol(dev);
--- a/src/r8168_n.c
+++ b/src/r8168_n.c
@@ -47,6 +47,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>
@@ -24607,6 +24608,22 @@ rtl8168_set_bios_setting(struct net_devi
}
}

+static int 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)
+ return ret;
+
+ RTL_W16(tp, CustomLED, led_data);
+
+ return 0;
+}
+
static void
rtl8168_init_software_variable(struct net_device *dev)
{
@@ -25169,6 +25186,8 @@ rtl8168_init_software_variable(struct ne
tp->NotWrMcuPatchCode = TRUE;
}

+ rtl8168_led_configuration(tp);
+
tp->NicCustLedValue = RTL_R16(tp, CustomLED);

rtl8168_get_hw_wol(dev);

0 comments on commit 98f703f

Please sign in to comment.