1 diff -Nur linux/drivers/net/r8169.c.orig linux/drivers/net/r8169.c
2 --- linux/drivers/net/r8169.c.orig 2003-12-02 20:36:07.000000000 -0200
3 +++ linux/drivers/net/r8169.c 2003-12-02 20:52:19.000000000 -0200
5 static int rtl8169_close(struct net_device *dev);
6 static void rtl8169_set_rx_mode(struct net_device *dev);
7 static void rtl8169_tx_timeout(struct net_device *dev);
8 -static struct net_device_stats *rtl8169_get_stats(struct net_device *netdev);
9 +static struct net_device_stats *rtl8169_get_stats(struct net_device *ethernet_device);
11 static const u16 rtl8169_intr_mask =
12 SYSErr | PCSTimeout | RxUnderrun | RxOverflow | RxFIFOOver | TxErr | TxOK |
13 @@ -1113,11 +1113,26 @@
14 spin_unlock_irqrestore(&tp->lock, flags);
18 + * rtl8169_get_stats: - Get rtl8169 read/write statistics
19 + * @ethernet_device: The Ethernet Device to get statistics for
21 + * Get TX/RX statistics for rtl8169
23 struct net_device_stats *
24 -rtl8169_get_stats(struct net_device *dev)
25 +rtl8169_get_stats(struct net_device *ethernet_device)
27 - struct rtl8169_private *tp = dev->priv;
28 + struct rtl8169_private *tp = ethernet_device->priv;
29 + void *ioaddr = tp->mmio_addr;
30 + unsigned long flags;
32 + if (netif_running(ethernet_device)) {
33 + spin_lock_irqsave (&tp->lock, flags);
34 + tp->stats.rx_missed_errors += RTL_R32 (RxMissed);
35 + RTL_W32 (RxMissed, 0);
36 + spin_unlock_irqrestore (&tp->lock, flags);