OSDN Git Service

r8168: bump to 8.050.00
[immortalwrt/immortalwrt.git] / package / kernel / r8168 / patches / 001-r8168-add-LED-configuration-from-OF.patch
1 --- a/src/r8168_n.c
2 +++ b/src/r8168_n.c
3 @@ -47,6 +47,7 @@
4  #include <linux/etherdevice.h>
5  #include <linux/delay.h>
6  #include <linux/mii.h>
7 +#include <linux/of.h>
8  #include <linux/if_vlan.h>
9  #include <linux/crc32.h>
10  #include <linux/interrupt.h>
11 @@ -24605,6 +24606,22 @@ rtl8168_set_bios_setting(struct net_devi
12          }
13  }
14  
15 +static int rtl8168_led_configuration(struct rtl8168_private *tp)
16 +{
17 +        u32 led_data;
18 +        int ret;
19 +
20 +        ret = of_property_read_u32(tp->pci_dev->dev.of_node,
21 +                                  "realtek,led-data", &led_data);
22 +
23 +        if (ret)
24 +                return ret;
25 +
26 +        RTL_W16(tp, CustomLED, led_data);
27 +
28 +        return 0;
29 +}
30 +
31  static void
32  rtl8168_init_software_variable(struct net_device *dev)
33  {
34 @@ -25164,6 +25181,8 @@ rtl8168_init_software_variable(struct ne
35                  tp->NotWrMcuPatchCode = TRUE;
36          }
37  
38 +        rtl8168_led_configuration(tp);
39 +
40          tp->NicCustLedValue = RTL_R16(tp, CustomLED);
41  
42          rtl8168_get_hw_wol(dev);