led.c (1da177e4c3f41524e886b7f1b8a0c1fc7321cac2) led.c (e5ed639913eea3e4783a550291775ab78dd84966)
1/*
2 * Chassis LCD/LED driver for HP-PARISC workstations
3 *
4 * (c) Copyright 2000 Red Hat Software
5 * (c) Copyright 2000 Helge Deller <hdeller@redhat.com>
6 * (c) Copyright 2001-2004 Helge Deller <deller@gmx.de>
7 * (c) Copyright 2001 Randolph Chung <tausq@debian.org>
8 *

--- 23 unchanged lines hidden (view full) ---

32#include <linux/inetdevice.h>
33#include <linux/in.h>
34#include <linux/interrupt.h>
35#include <linux/kernel_stat.h>
36#include <linux/reboot.h>
37#include <linux/proc_fs.h>
38#include <linux/ctype.h>
39#include <linux/blkdev.h>
1/*
2 * Chassis LCD/LED driver for HP-PARISC workstations
3 *
4 * (c) Copyright 2000 Red Hat Software
5 * (c) Copyright 2000 Helge Deller <hdeller@redhat.com>
6 * (c) Copyright 2001-2004 Helge Deller <deller@gmx.de>
7 * (c) Copyright 2001 Randolph Chung <tausq@debian.org>
8 *

--- 23 unchanged lines hidden (view full) ---

32#include <linux/inetdevice.h>
33#include <linux/in.h>
34#include <linux/interrupt.h>
35#include <linux/kernel_stat.h>
36#include <linux/reboot.h>
37#include <linux/proc_fs.h>
38#include <linux/ctype.h>
39#include <linux/blkdev.h>
40#include <linux/rcupdate.h>
40#include <asm/io.h>
41#include <asm/processor.h>
42#include <asm/hardware.h>
43#include <asm/param.h> /* HZ */
44#include <asm/led.h>
45#include <asm/pdc.h>
46#include <asm/uaccess.h>
47

--- 305 unchanged lines hidden (view full) ---

353 struct net_device *dev;
354 int retval;
355
356 rx_total = tx_total = 0;
357
358 /* we are running as tasklet, so locking dev_base
359 * for reading should be OK */
360 read_lock(&dev_base_lock);
41#include <asm/io.h>
42#include <asm/processor.h>
43#include <asm/hardware.h>
44#include <asm/param.h> /* HZ */
45#include <asm/led.h>
46#include <asm/pdc.h>
47#include <asm/uaccess.h>
48

--- 305 unchanged lines hidden (view full) ---

354 struct net_device *dev;
355 int retval;
356
357 rx_total = tx_total = 0;
358
359 /* we are running as tasklet, so locking dev_base
360 * for reading should be OK */
361 read_lock(&dev_base_lock);
362 rcu_read_lock();
361 for (dev = dev_base; dev; dev = dev->next) {
362 struct net_device_stats *stats;
363 for (dev = dev_base; dev; dev = dev->next) {
364 struct net_device_stats *stats;
363 struct in_device *in_dev = __in_dev_get(dev);
365 struct in_device *in_dev = __in_dev_get_rcu(dev);
364 if (!in_dev || !in_dev->ifa_list)
365 continue;
366 if (LOOPBACK(in_dev->ifa_list->ifa_local))
367 continue;
368 if (!dev->get_stats)
369 continue;
370 stats = dev->get_stats(dev);
371 rx_total += stats->rx_packets;
372 tx_total += stats->tx_packets;
373 }
366 if (!in_dev || !in_dev->ifa_list)
367 continue;
368 if (LOOPBACK(in_dev->ifa_list->ifa_local))
369 continue;
370 if (!dev->get_stats)
371 continue;
372 stats = dev->get_stats(dev);
373 rx_total += stats->rx_packets;
374 tx_total += stats->tx_packets;
375 }
376 rcu_read_unlock();
374 read_unlock(&dev_base_lock);
375
376 retval = 0;
377
378 if (rx_total != rx_total_last) {
379 rx_total_last = rx_total;
380 retval |= LED_LAN_RCV;
381 }

--- 379 unchanged lines hidden ---
377 read_unlock(&dev_base_lock);
378
379 retval = 0;
380
381 if (rx_total != rx_total_last) {
382 rx_total_last = rx_total;
383 retval |= LED_LAN_RCV;
384 }

--- 379 unchanged lines hidden ---