1 --- a/drivers/leds/Kconfig
2 +++ b/drivers/leds/Kconfig
3 @@ -443,4 +443,11 @@ config LEDS_TRIGGER_MORSE
4 tristate "LED Morse Trigger"
5 depends on LEDS_TRIGGERS
7 +config LEDS_TRIGGER_NETDEV
8 + tristate "LED Netdev Trigger"
9 + depends on NET && LEDS_TRIGGERS
11 + This allows LEDs to be controlled by network device activity.
15 --- a/drivers/leds/Makefile
16 +++ b/drivers/leds/Makefile
17 @@ -53,3 +53,4 @@ obj-$(CONFIG_LEDS_TRIGGER_BACKLIGHT) +=
18 obj-$(CONFIG_LEDS_TRIGGER_GPIO) += ledtrig-gpio.o
19 obj-$(CONFIG_LEDS_TRIGGER_DEFAULT_ON) += ledtrig-default-on.o
20 obj-$(CONFIG_LEDS_TRIGGER_MORSE) += ledtrig-morse.o
21 +obj-$(CONFIG_LEDS_TRIGGER_NETDEV) += ledtrig-netdev.o
22 --- a/drivers/leds/ledtrig-netdev.c
23 +++ b/drivers/leds/ledtrig-netdev.c
24 @@ -307,8 +307,9 @@ done:
25 static void netdev_trig_timer(unsigned long arg)
27 struct led_netdev_data *trigger_data = (struct led_netdev_data *)arg;
28 - const struct net_device_stats *dev_stats;
29 + struct rtnl_link_stats64 *dev_stats;
30 unsigned new_activity;
31 + struct rtnl_link_stats64 temp;
33 write_lock(&trigger_data->lock);
35 @@ -318,7 +319,7 @@ static void netdev_trig_timer(unsigned l
39 - dev_stats = dev_get_stats(trigger_data->net_dev);
40 + dev_stats = dev_get_stats(trigger_data->net_dev, &temp);
42 ((trigger_data->mode & MODE_TX) ? dev_stats->tx_packets : 0) +
43 ((trigger_data->mode & MODE_RX) ? dev_stats->rx_packets : 0);