Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 111806
b: refs/heads/master
c: 523a609
h: refs/heads/master
v: v3
  • Loading branch information
Francois Romieu authored and Jeff Garzik committed Sep 24, 2008
1 parent 41d5f2d commit 57bf32d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e93dcb11dd6468000f2f018bd887e94b074ce931
refs/heads/master: 523a609496dbc3897e530db2a2f27650d125ea00
25 changes: 14 additions & 11 deletions trunk/drivers/net/r8169.c
Original file line number Diff line number Diff line change
Expand Up @@ -2286,8 +2286,6 @@ static void rtl_hw_start_8168(struct net_device *dev)

RTL_R8(IntrMask);

RTL_W32(RxMissed, 0);

rtl_set_rx_mode(dev);

RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb);
Expand Down Expand Up @@ -2412,8 +2410,6 @@ static void rtl_hw_start_8101(struct net_device *dev)

RTL_R8(IntrMask);

RTL_W32(RxMissed, 0);

rtl_set_rx_mode(dev);

RTL_W8(ChipCmd, CmdTxEnb | CmdRxEnb);
Expand Down Expand Up @@ -3191,6 +3187,17 @@ static int rtl8169_poll(struct napi_struct *napi, int budget)
return work_done;
}

static void rtl8169_rx_missed(struct net_device *dev, void __iomem *ioaddr)
{
struct rtl8169_private *tp = netdev_priv(dev);

if (tp->mac_version > RTL_GIGA_MAC_VER_06)
return;

dev->stats.rx_missed_errors += (RTL_R32(RxMissed) & 0xffffff);
RTL_W32(RxMissed, 0);
}

static void rtl8169_down(struct net_device *dev)
{
struct rtl8169_private *tp = netdev_priv(dev);
Expand All @@ -3208,9 +3215,7 @@ static void rtl8169_down(struct net_device *dev)

rtl8169_asic_down(ioaddr);

/* Update the error counts. */
dev->stats.rx_missed_errors += RTL_R32(RxMissed);
RTL_W32(RxMissed, 0);
rtl8169_rx_missed(dev, ioaddr);

spin_unlock_irq(&tp->lock);

Expand Down Expand Up @@ -3332,8 +3337,7 @@ static struct net_device_stats *rtl8169_get_stats(struct net_device *dev)

if (netif_running(dev)) {
spin_lock_irqsave(&tp->lock, flags);
dev->stats.rx_missed_errors += RTL_R32(RxMissed);
RTL_W32(RxMissed, 0);
rtl8169_rx_missed(dev, ioaddr);
spin_unlock_irqrestore(&tp->lock, flags);
}

Expand All @@ -3358,8 +3362,7 @@ static int rtl8169_suspend(struct pci_dev *pdev, pm_message_t state)

rtl8169_asic_down(ioaddr);

dev->stats.rx_missed_errors += RTL_R32(RxMissed);
RTL_W32(RxMissed, 0);
rtl8169_rx_missed(dev, ioaddr);

spin_unlock_irq(&tp->lock);

Expand Down

0 comments on commit 57bf32d

Please sign in to comment.