ag71xx driver: NAPI poll cleanup

SVN-Revision: 13538
This commit is contained in:
Gabor Juhos 2008-12-07 09:46:41 +00:00
parent 398ff859da
commit c33682316e
2 changed files with 16 additions and 8 deletions

View file

@ -38,7 +38,7 @@
#define ETH_FCS_LEN 4 #define ETH_FCS_LEN 4
#define AG71XX_DRV_NAME "ag71xx" #define AG71XX_DRV_NAME "ag71xx"
#define AG71XX_DRV_VERSION "0.5.11" #define AG71XX_DRV_VERSION "0.5.12"
#define AG71XX_NAPI_WEIGHT 64 #define AG71XX_NAPI_WEIGHT 64

View file

@ -687,9 +687,16 @@ static int ag71xx_poll(struct napi_struct *napi, int limit)
ag71xx_wr(ag, AG71XX_REG_RX_CTRL, RX_CTRL_RXE); ag71xx_wr(ag, AG71XX_REG_RX_CTRL, RX_CTRL_RXE);
} }
if ((done < limit) && ((status & RX_STATUS_PR) == 0)) { if (done < limit) {
DBG("%s: disable polling mode, done=%d, status=%x\n", if (status & RX_STATUS_PR)
dev->name, done, status); goto more;
status = ag71xx_rr(ag, AG71XX_REG_TX_STATUS);
if (status & TX_STATUS_PS)
goto more;
DBG("%s: disable polling mode, done=%d, limit=%d\n",
dev->name, done, limit);
netif_rx_complete(dev, napi); netif_rx_complete(dev, napi);
@ -697,12 +704,13 @@ static int ag71xx_poll(struct napi_struct *napi, int limit)
spin_lock_irqsave(&ag->lock, flags); spin_lock_irqsave(&ag->lock, flags);
ag71xx_int_enable(ag, AG71XX_INT_POLL); ag71xx_int_enable(ag, AG71XX_INT_POLL);
spin_unlock_irqrestore(&ag->lock, flags); spin_unlock_irqrestore(&ag->lock, flags);
return 0; return done;
} }
DBG("%s: stay in polling mode, done=%d, status=%x\n", more:
dev->name, done, status); DBG("%s: stay in polling mode, done=%d, limit=%d\n",
return 1; dev->name, done, limit);
return done;
} }
static irqreturn_t ag71xx_interrupt(int irq, void *dev_id) static irqreturn_t ag71xx_interrupt(int irq, void *dev_id)