aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/mv643xx_eth.c
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2008-06-01 15:59:27 -0400
committerLennert Buytenhek <buytenh@wantstofly.org>2008-06-12 02:40:35 -0400
commitffd86bbe1c744a25efad5bddd08f1c5b1dbcd9ac (patch)
treef8d9d11fcee4626f5aca95d45dc29bbeb5441b21 /drivers/net/mv643xx_eth.c
parent13d6428538feaefa6c796f76b9918de165ae69f8 (diff)
mv643xx_eth: remove write-only interrupt coalescing variables
Remove the write-only ->[rt]x_int_coal members from struct mv643xx_eth_private. In the process, tweak the RX/TX interrupt mitigation code so that it is compiled by default, and set the default coalescing delays to 0 usec. Signed-off-by: Lennert Buytenhek <buytenh@marvell.com> Acked-by: Dale Farnsworth <dale@farnsworth.org>
Diffstat (limited to 'drivers/net/mv643xx_eth.c')
-rw-r--r--drivers/net/mv643xx_eth.c29
1 files changed, 4 insertions, 25 deletions
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index 2ef71c48ef47..ff6460124307 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -60,12 +60,6 @@ static char mv643xx_eth_driver_version[] = "1.0";
60#define MV643XX_ETH_CHECKSUM_OFFLOAD_TX 60#define MV643XX_ETH_CHECKSUM_OFFLOAD_TX
61#define MV643XX_ETH_NAPI 61#define MV643XX_ETH_NAPI
62#define MV643XX_ETH_TX_FAST_REFILL 62#define MV643XX_ETH_TX_FAST_REFILL
63#undef MV643XX_ETH_COAL
64
65#define MV643XX_ETH_TX_COAL 100
66#ifdef MV643XX_ETH_COAL
67#define MV643XX_ETH_RX_COAL 100
68#endif
69 63
70#ifdef MV643XX_ETH_CHECKSUM_OFFLOAD_TX 64#ifdef MV643XX_ETH_CHECKSUM_OFFLOAD_TX
71#define MAX_DESCS_PER_SKB (MAX_SKB_FRAGS + 1) 65#define MAX_DESCS_PER_SKB (MAX_SKB_FRAGS + 1)
@@ -322,8 +316,6 @@ struct mv643xx_eth_private {
322 struct mib_counters mib_counters; 316 struct mib_counters mib_counters;
323 spinlock_t lock; 317 spinlock_t lock;
324 318
325 u32 rx_int_coal;
326 u32 tx_int_coal;
327 struct mii_if_info mii; 319 struct mii_if_info mii;
328 320
329 /* 321 /*
@@ -1681,9 +1673,7 @@ static void port_start(struct net_device *dev)
1681 } 1673 }
1682} 1674}
1683 1675
1684#ifdef MV643XX_ETH_COAL 1676static void set_rx_coal(struct mv643xx_eth_private *mp, unsigned int delay)
1685static unsigned int set_rx_coal(struct mv643xx_eth_private *mp,
1686 unsigned int delay)
1687{ 1677{
1688 unsigned int port_num = mp->port_num; 1678 unsigned int port_num = mp->port_num;
1689 unsigned int coal = ((mp->shared->t_clk / 1000000) * delay) / 64; 1679 unsigned int coal = ((mp->shared->t_clk / 1000000) * delay) / 64;
@@ -1693,20 +1683,14 @@ static unsigned int set_rx_coal(struct mv643xx_eth_private *mp,
1693 ((coal & 0x3fff) << 8) | 1683 ((coal & 0x3fff) << 8) |
1694 (rdl(mp, SDMA_CONFIG(port_num)) 1684 (rdl(mp, SDMA_CONFIG(port_num))
1695 & 0xffc000ff)); 1685 & 0xffc000ff));
1696
1697 return coal;
1698} 1686}
1699#endif
1700 1687
1701static unsigned int set_tx_coal(struct mv643xx_eth_private *mp, 1688static void set_tx_coal(struct mv643xx_eth_private *mp, unsigned int delay)
1702 unsigned int delay)
1703{ 1689{
1704 unsigned int coal = ((mp->shared->t_clk / 1000000) * delay) / 64; 1690 unsigned int coal = ((mp->shared->t_clk / 1000000) * delay) / 64;
1705 1691
1706 /* Set TX Coalescing mechanism */ 1692 /* Set TX Coalescing mechanism */
1707 wrl(mp, TX_FIFO_URGENT_THRESHOLD(mp->port_num), coal << 4); 1693 wrl(mp, TX_FIFO_URGENT_THRESHOLD(mp->port_num), coal << 4);
1708
1709 return coal;
1710} 1694}
1711 1695
1712static void port_init(struct mv643xx_eth_private *mp) 1696static void port_init(struct mv643xx_eth_private *mp)
@@ -1752,13 +1736,8 @@ static int mv643xx_eth_open(struct net_device *dev)
1752 1736
1753 port_start(dev); 1737 port_start(dev);
1754 1738
1755 /* Interrupt Coalescing */ 1739 set_rx_coal(mp, 0);
1756 1740 set_tx_coal(mp, 0);
1757#ifdef MV643XX_ETH_COAL
1758 mp->rx_int_coal = set_rx_coal(mp, MV643XX_ETH_RX_COAL);
1759#endif
1760
1761 mp->tx_int_coal = set_tx_coal(mp, MV643XX_ETH_TX_COAL);
1762 1741
1763 /* Unmask phy and link status changes interrupts */ 1742 /* Unmask phy and link status changes interrupts */
1764 wrl(mp, INT_MASK_EXT(port_num), INT_EXT_LINK | INT_EXT_PHY | INT_EXT_TX); 1743 wrl(mp, INT_MASK_EXT(port_num), INT_EXT_LINK | INT_EXT_PHY | INT_EXT_TX);