aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ramips/files
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2010-01-31 12:48:53 +0000
committerGabor Juhos <juhosg@openwrt.org>2010-01-31 12:48:53 +0000
commita0de90ddb367c26c6d1f8853083a7a7c106fd4bf (patch)
treeffefb40088742dbb3354056d992a6de408a8d0dc /target/linux/ramips/files
parent162e987f391ebb12c9d7fa2472ebaf20e9e1fda2 (diff)
downloadupstream-a0de90ddb367c26c6d1f8853083a7a7c106fd4bf.tar.gz
upstream-a0de90ddb367c26c6d1f8853083a7a7c106fd4bf.tar.bz2
upstream-a0de90ddb367c26c6d1f8853083a7a7c106fd4bf.zip
ramips_eth: add helper functions to {ed,dis}able interrupts
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19446 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ramips/files')
-rw-r--r--target/linux/ramips/files/drivers/net/ramips.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/target/linux/ramips/files/drivers/net/ramips.c b/target/linux/ramips/files/drivers/net/ramips.c
index 34d5b3e69e..d8be97c7a7 100644
--- a/target/linux/ramips/files/drivers/net/ramips.c
+++ b/target/linux/ramips/files/drivers/net/ramips.c
@@ -51,6 +51,24 @@ ramips_fe_rr(unsigned reg)
return __raw_readl(ramips_fe_base + reg);
}
+static inline void
+ramips_fe_int_disable(u32 mask)
+{
+ ramips_fe_wr(ramips_fe_rr(RAMIPS_FE_INT_ENABLE) & ~mask,
+ RAMIPS_FE_INT_ENABLE);
+ /* flush write */
+ ramips_fe_rr(RAMIPS_FE_INT_ENABLE);
+}
+
+static inline void
+ramips_fe_int_enable(u32 mask)
+{
+ ramips_fe_wr(ramips_fe_rr(RAMIPS_FE_INT_ENABLE) | mask,
+ RAMIPS_FE_INT_ENABLE);
+ /* flush write */
+ ramips_fe_rr(RAMIPS_FE_INT_ENABLE);
+}
+
static void
ramips_cleanup_dma(struct raeth_priv *re)
{
@@ -229,8 +247,7 @@ ramips_eth_rx_hw(unsigned long ptr)
if (max_rx == 0)
tasklet_schedule(&priv->rx_tasklet);
else
- ramips_fe_wr(ramips_fe_rr(RAMIPS_FE_INT_ENABLE) | RAMIPS_RX_DLY_INT,
- RAMIPS_FE_INT_ENABLE);
+ ramips_fe_int_enable(RAMIPS_RX_DLY_INT);
}
static void
@@ -248,8 +265,7 @@ ramips_eth_tx_housekeeping(unsigned long ptr)
priv->skb_free_idx = 0;
}
- ramips_fe_wr(ramips_fe_rr(RAMIPS_FE_INT_ENABLE) | RAMIPS_TX_DLY_INT,
- RAMIPS_FE_INT_ENABLE);
+ ramips_fe_int_enable(RAMIPS_TX_DLY_INT);
}
static int
@@ -284,8 +300,7 @@ ramips_eth_irq(int irq, void *dev)
ramips_fe_wr(0xFFFFFFFF, RAMIPS_FE_INT_STATUS);
if (fe_int & RAMIPS_RX_DLY_INT) {
- ramips_fe_wr(ramips_fe_rr(RAMIPS_FE_INT_ENABLE) & ~(RAMIPS_RX_DLY_INT),
- RAMIPS_FE_INT_ENABLE);
+ ramips_fe_int_disable(RAMIPS_RX_DLY_INT);
tasklet_schedule(&priv->rx_tasklet);
}