source: trunk/target/linux/generic/patches-2.6.37/831-ledtrig_netdev.patch @ 26955

Last change on this file since 26955 was 26955, checked in by florian, 6 years ago

[kernel] refresh 2.6.37 patches

File size: 1.4 KB
  • drivers/leds/Kconfig

    a b config LEDS_TRIGGER_MORSE 
    443443        tristate "LED Morse Trigger" 
    444444        depends on LEDS_TRIGGERS 
    445445 
     446config LEDS_TRIGGER_NETDEV 
     447        tristate "LED Netdev Trigger" 
     448        depends on NET && LEDS_TRIGGERS 
     449        help 
     450          This allows LEDs to be controlled by network device activity. 
     451          If unsure, say Y. 
     452 
    446453endif # NEW_LEDS 
  • drivers/leds/Makefile

    a b obj-$(CONFIG_LEDS_TRIGGER_BACKLIGHT) += 
    5353obj-$(CONFIG_LEDS_TRIGGER_GPIO)         += ledtrig-gpio.o 
    5454obj-$(CONFIG_LEDS_TRIGGER_DEFAULT_ON)   += ledtrig-default-on.o 
    5555obj-$(CONFIG_LEDS_TRIGGER_MORSE)        += ledtrig-morse.o 
     56obj-$(CONFIG_LEDS_TRIGGER_NETDEV)       += ledtrig-netdev.o 
  • drivers/leds/ledtrig-netdev.c

    a b done: 
    307307static void netdev_trig_timer(unsigned long arg) 
    308308{ 
    309309        struct led_netdev_data *trigger_data = (struct led_netdev_data *)arg; 
    310         const struct net_device_stats *dev_stats; 
     310        struct rtnl_link_stats64 *dev_stats; 
    311311        unsigned new_activity; 
     312        struct rtnl_link_stats64 temp; 
    312313 
    313314        write_lock(&trigger_data->lock); 
    314315 
    static void netdev_trig_timer(unsigned l 
    318319                goto no_restart; 
    319320        } 
    320321 
    321         dev_stats = dev_get_stats(trigger_data->net_dev); 
     322        dev_stats = dev_get_stats(trigger_data->net_dev, &temp); 
    322323        new_activity = 
    323324                ((trigger_data->mode & MODE_TX) ? dev_stats->tx_packets : 0) + 
    324325                ((trigger_data->mode & MODE_RX) ? dev_stats->rx_packets : 0); 
Note: See TracBrowser for help on using the repository browser.