source: trunk/target/linux/generic/patches-3.3/831-ledtrig_netdev.patch @ 31645

Last change on this file since 31645 was 31645, checked in by juhosg, 5 years ago

kernel: update linux 3.3 to 3.3.5

File size: 1.6 KB
  • drivers/leds/Kconfig

    a b config LEDS_TRIGGER_MORSE 
    484484        tristate "LED Morse Trigger" 
    485485        depends on LEDS_TRIGGERS 
    486486 
     487config LEDS_TRIGGER_NETDEV 
     488        tristate "LED Netdev Trigger" 
     489        depends on NET && LEDS_TRIGGERS 
     490        help 
     491          This allows LEDs to be controlled by network device activity. 
     492          If unsure, say Y. 
     493 
    487494endif # NEW_LEDS 
  • drivers/leds/Makefile

    a b obj-$(CONFIG_LEDS_TRIGGER_BACKLIGHT) += 
    5858obj-$(CONFIG_LEDS_TRIGGER_GPIO)         += ledtrig-gpio.o 
    5959obj-$(CONFIG_LEDS_TRIGGER_DEFAULT_ON)   += ledtrig-default-on.o 
    6060obj-$(CONFIG_LEDS_TRIGGER_MORSE)        += ledtrig-morse.o 
     61obj-$(CONFIG_LEDS_TRIGGER_NETDEV)       += ledtrig-netdev.o 
  • drivers/leds/ledtrig-netdev.c

    a b  
    2222#include <linux/list.h> 
    2323#include <linux/spinlock.h> 
    2424#include <linux/device.h> 
    25 #include <linux/sysdev.h> 
    2625#include <linux/netdevice.h> 
    2726#include <linux/timer.h> 
    2827#include <linux/ctype.h> 
    done: 
    307306static void netdev_trig_timer(unsigned long arg) 
    308307{ 
    309308        struct led_netdev_data *trigger_data = (struct led_netdev_data *)arg; 
    310         const struct net_device_stats *dev_stats; 
     309        struct rtnl_link_stats64 *dev_stats; 
    311310        unsigned new_activity; 
     311        struct rtnl_link_stats64 temp; 
    312312 
    313313        write_lock(&trigger_data->lock); 
    314314 
    static void netdev_trig_timer(unsigned l 
    318318                goto no_restart; 
    319319        } 
    320320 
    321         dev_stats = dev_get_stats(trigger_data->net_dev); 
     321        dev_stats = dev_get_stats(trigger_data->net_dev, &temp); 
    322322        new_activity = 
    323323                ((trigger_data->mode & MODE_TX) ? dev_stats->tx_packets : 0) + 
    324324                ((trigger_data->mode & MODE_RX) ? dev_stats->rx_packets : 0); 
Note: See TracBrowser for help on using the repository browser.