aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/8139cp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c
index ca7746dd164f..e4b3c5c88542 100644
--- a/drivers/net/8139cp.c
+++ b/drivers/net/8139cp.c
@@ -1516,22 +1516,22 @@ static void cp_get_ethtool_stats (struct net_device *dev,
1516 struct ethtool_stats *estats, u64 *tmp_stats) 1516 struct ethtool_stats *estats, u64 *tmp_stats)
1517{ 1517{
1518 struct cp_private *cp = netdev_priv(dev); 1518 struct cp_private *cp = netdev_priv(dev);
1519 unsigned int work = 100;
1520 int i; 1519 int i;
1521 1520
1521 memset(cp->nic_stats, 0, sizeof(struct cp_dma_stats));
1522
1522 /* begin NIC statistics dump */ 1523 /* begin NIC statistics dump */
1523 cpw32(StatsAddr + 4, (cp->nic_stats_dma >> 16) >> 16); 1524 cpw32(StatsAddr + 4, (cp->nic_stats_dma >> 16) >> 16);
1524 cpw32(StatsAddr, (cp->nic_stats_dma & 0xffffffff) | DumpStats); 1525 cpw32(StatsAddr, (cp->nic_stats_dma & 0xffffffff) | DumpStats);
1525 cpr32(StatsAddr); 1526 cpr32(StatsAddr);
1526 1527
1527 while (work-- > 0) { 1528 for (i = 0; i < 1000; i++) {
1528 if ((cpr32(StatsAddr) & DumpStats) == 0) 1529 if ((cpr32(StatsAddr) & DumpStats) == 0)
1529 break; 1530 break;
1530 cpu_relax(); 1531 udelay(10);
1531 } 1532 }
1532 1533 cpw32(StatsAddr, 0);
1533 if (cpr32(StatsAddr) & DumpStats) 1534 cpw32(StatsAddr + 4, 0);
1534 return /* -EIO */;
1535 1535
1536 i = 0; 1536 i = 0;
1537 tmp_stats[i++] = le64_to_cpu(cp->nic_stats->tx_ok); 1537 tmp_stats[i++] = le64_to_cpu(cp->nic_stats->tx_ok);