aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2008-12-02 08:46:37 +0000
committerGabor Juhos <juhosg@openwrt.org>2008-12-02 08:46:37 +0000
commitf5dc8e6efe61f08a5b1005ce36e4519e561805a1 (patch)
tree966e73020873772d0c5b134c44952246a2455d3b /target
parentb1f31c9121038ee7c999c9081ebaed6434e9c3ca (diff)
downloadupstream-f5dc8e6efe61f08a5b1005ce36e4519e561805a1.tar.gz
upstream-f5dc8e6efe61f08a5b1005ce36e4519e561805a1.tar.bz2
upstream-f5dc8e6efe61f08a5b1005ce36e4519e561805a1.zip
[ar71xx] ag71xx driver: add some debug stuff
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@13462 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target')
-rw-r--r--target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c b/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c
index 81ebe8db0a..882b108e88 100644
--- a/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c
+++ b/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c
@@ -69,6 +69,18 @@ static void ag71xx_dump_regs(struct ag71xx *ag)
ag71xx_rr(ag, AG71XX_REG_FIFO_CFG5));
}
+static inline void ag71xx_dump_intr(struct ag71xx *ag, char *label, u32 intr)
+{
+ DBG("%s: %s intr=%08x %s%s%s%s%s%s\n",
+ ag->dev->name, label, intr,
+ (intr & AG71XX_INT_TX_PS) ? "TXPS " : "",
+ (intr & AG71XX_INT_TX_UR) ? "TXUR " : "",
+ (intr & AG71XX_INT_TX_BE) ? "TXBE " : "",
+ (intr & AG71XX_INT_RX_PR) ? "RXPR " : "",
+ (intr & AG71XX_INT_RX_OF) ? "RXOF " : "",
+ (intr & AG71XX_INT_RX_BE) ? "RXBE " : "");
+}
+
static void ag71xx_ring_free(struct ag71xx_ring *ring)
{
kfree(ring->buf);
@@ -315,6 +327,14 @@ static void ag71xx_dma_reset(struct ag71xx *ag)
ag71xx_wr(ag, AG71XX_REG_RX_STATUS, RX_STATUS_BE | RX_STATUS_OF);
ag71xx_wr(ag, AG71XX_REG_TX_STATUS, TX_STATUS_BE | TX_STATUS_UR);
+ if (ag71xx_rr(ag, AG71XX_REG_RX_STATUS))
+ printk(KERN_ALERT "%s: unable to clear DMA Rx status\n",
+ ag->dev->name);
+
+ if (ag71xx_rr(ag, AG71XX_REG_TX_STATUS))
+ printk(KERN_ALERT "%s: unable to clear DMA Tx status\n",
+ ag->dev->name);
+
ag71xx_dump_dma_regs(ag);
}
@@ -693,7 +713,9 @@ static irqreturn_t ag71xx_interrupt(int irq, void *dev_id)
u32 status;
status = ag71xx_rr(ag, AG71XX_REG_INT_STATUS);
+ ag71xx_dump_intr(ag, "raw", status);
status &= ag71xx_rr(ag, AG71XX_REG_INT_ENABLE);
+ ag71xx_dump_intr(ag, "masked", status);
if (unlikely(!status))
return IRQ_NONE;