xgmac.c (a402eae64d0ad12b1c4a411f250d6c161e67f623) xgmac.c (bc1f44709cf27fb2a5766cadafe7e2ad5e9cb221)
1/*
2 * Copyright 2010-2011 Calxeda, Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT

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

1441static void xgmac_poll_controller(struct net_device *dev)
1442{
1443 disable_irq(dev->irq);
1444 xgmac_interrupt(dev->irq, dev);
1445 enable_irq(dev->irq);
1446}
1447#endif
1448
1/*
2 * Copyright 2010-2011 Calxeda, Inc.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT

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

1441static void xgmac_poll_controller(struct net_device *dev)
1442{
1443 disable_irq(dev->irq);
1444 xgmac_interrupt(dev->irq, dev);
1445 enable_irq(dev->irq);
1446}
1447#endif
1448
1449static struct rtnl_link_stats64 *
1449static void
1450xgmac_get_stats64(struct net_device *dev,
1450xgmac_get_stats64(struct net_device *dev,
1451 struct rtnl_link_stats64 *storage)
1451 struct rtnl_link_stats64 *storage)
1452{
1453 struct xgmac_priv *priv = netdev_priv(dev);
1454 void __iomem *base = priv->base;
1455 u32 count;
1456
1457 spin_lock_bh(&priv->stats_lock);
1458 writel(XGMAC_MMC_CTRL_CNT_FRZ, base + XGMAC_MMC_CTRL);
1459

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

1471
1472 count = readl(base + XGMAC_MMC_TXFRAME_GB_LO);
1473 storage->tx_errors = count - readl(base + XGMAC_MMC_TXFRAME_G_LO);
1474 storage->tx_packets = count;
1475 storage->tx_fifo_errors = readl(base + XGMAC_MMC_TXUNDERFLOW);
1476
1477 writel(0, base + XGMAC_MMC_CTRL);
1478 spin_unlock_bh(&priv->stats_lock);
1452{
1453 struct xgmac_priv *priv = netdev_priv(dev);
1454 void __iomem *base = priv->base;
1455 u32 count;
1456
1457 spin_lock_bh(&priv->stats_lock);
1458 writel(XGMAC_MMC_CTRL_CNT_FRZ, base + XGMAC_MMC_CTRL);
1459

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

1471
1472 count = readl(base + XGMAC_MMC_TXFRAME_GB_LO);
1473 storage->tx_errors = count - readl(base + XGMAC_MMC_TXFRAME_G_LO);
1474 storage->tx_packets = count;
1475 storage->tx_fifo_errors = readl(base + XGMAC_MMC_TXUNDERFLOW);
1476
1477 writel(0, base + XGMAC_MMC_CTRL);
1478 spin_unlock_bh(&priv->stats_lock);
1479 return storage;
1480}
1481
1482static int xgmac_set_mac_address(struct net_device *dev, void *p)
1483{
1484 struct xgmac_priv *priv = netdev_priv(dev);
1485 void __iomem *ioaddr = priv->base;
1486 struct sockaddr *addr = p;
1487

--- 451 unchanged lines hidden ---
1479}
1480
1481static int xgmac_set_mac_address(struct net_device *dev, void *p)
1482{
1483 struct xgmac_priv *priv = netdev_priv(dev);
1484 void __iomem *ioaddr = priv->base;
1485 struct sockaddr *addr = p;
1486

--- 451 unchanged lines hidden ---