aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2008-12-06 10:03:36 +0000
committerGabor Juhos <juhosg@openwrt.org>2008-12-06 10:03:36 +0000
commitd6382555f4cfcdaddc9f4ef8738501d82aef034d (patch)
tree1c1726e937145118045ed1b3339f318a676e5595 /target
parent4992a87aeb5879141a6475642e62c6d7922ff614 (diff)
downloadupstream-d6382555f4cfcdaddc9f4ef8738501d82aef034d.tar.gz
upstream-d6382555f4cfcdaddc9f4ef8738501d82aef034d.tar.bz2
upstream-d6382555f4cfcdaddc9f4ef8738501d82aef034d.zip
ag71xx driver: always use NAPI to transmit packets
SVN-Revision: 13529
Diffstat (limited to 'target')
-rw-r--r--target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx.h9
-rw-r--r--target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c24
2 files changed, 1 insertions, 32 deletions
diff --git a/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx.h b/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx.h
index c4a7044af4..7e3da8178e 100644
--- a/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx.h
+++ b/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx.h
@@ -37,9 +37,7 @@
#define ETH_FCS_LEN 4
#define AG71XX_DRV_NAME "ag71xx"
-#define AG71XX_DRV_VERSION "0.5.9"
-
-#define AG71XX_NAPI_TX 1
+#define AG71XX_DRV_VERSION "0.5.10"
#define AG71XX_NAPI_WEIGHT 64
@@ -47,13 +45,8 @@
#define AG71XX_INT_TX (AG71XX_INT_TX_PS)
#define AG71XX_INT_RX (AG71XX_INT_RX_PR | AG71XX_INT_RX_OF)
-#ifdef AG71XX_NAPI_TX
#define AG71XX_INT_POLL (AG71XX_INT_RX | AG71XX_INT_TX)
#define AG71XX_INT_INIT (AG71XX_INT_ERR | AG71XX_INT_POLL)
-#else
-#define AG71XX_INT_POLL (AG71XX_INT_RX)
-#define AG71XX_INT_INIT (AG71XX_INT_ERR | AG71XX_INT_POLL | AG71XX_INT_TX)
-#endif
#define AG71XX_TX_FIFO_LEN 2048
#define AG71XX_TX_MTU_LEN 1536
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 5e31438b30..87f83d0cd1 100644
--- a/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c
+++ b/target/linux/ar71xx/files/drivers/net/ag71xx/ag71xx_main.c
@@ -553,16 +553,11 @@ static int ag71xx_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
static void ag71xx_tx_packets(struct ag71xx *ag)
{
- struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
struct ag71xx_ring *ring = &ag->tx_ring;
unsigned int sent;
DBG("%s: processing TX ring\n", ag->dev->name);
-#ifdef AG71XX_NAPI_TX
- pdata->ddr_flush();
-#endif
-
sent = 0;
while (ring->dirty != ring->curr) {
unsigned int i = ring->dirty % AG71XX_TX_RING_SIZE;
@@ -595,18 +590,8 @@ static int ag71xx_rx_packets(struct ag71xx *ag, int limit)
{
struct net_device *dev = ag->dev;
struct ag71xx_ring *ring = &ag->rx_ring;
-#ifndef AG71XX_NAPI_TX
- struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
- unsigned long flags;
-#endif
int done = 0;
-#ifndef AG71XX_NAPI_TX
- spin_lock_irqsave(&ag->lock, flags);
- pdata->ddr_flush();
- spin_unlock_irqrestore(&ag->lock, flags);
-#endif
-
DBG("%s: rx packets, limit=%d, curr=%u, dirty=%u\n",
dev->name, limit, ring->curr, ring->dirty);
@@ -661,18 +646,14 @@ static int ag71xx_rx_packets(struct ag71xx *ag, int limit)
static int ag71xx_poll(struct napi_struct *napi, int limit)
{
struct ag71xx *ag = container_of(napi, struct ag71xx, napi);
-#ifdef AG71XX_NAPI_TX
struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
-#endif
struct net_device *dev = ag->dev;
unsigned long flags;
u32 status;
int done;
-#ifdef AG71XX_NAPI_TX
pdata->ddr_flush();
ag71xx_tx_packets(ag);
-#endif
DBG("%s: processing RX ring\n", dev->name);
done = ag71xx_rx_packets(ag, limit);
@@ -738,11 +719,6 @@ static irqreturn_t ag71xx_interrupt(int irq, void *dev_id)
}
#endif
-#ifndef AG71XX_NAPI_TX
- if (likely(status & AG71XX_INT_TX_PS))
- ag71xx_tx_packets(ag);
-#endif
-
if (likely(status & AG71XX_INT_POLL)) {
ag71xx_int_disable(ag, AG71XX_INT_POLL);
DBG("%s: enable polling mode\n", dev->name);