mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-08-20 02:22:04 +03:00
[ar71xx] ag71xx driver: improve poll routine
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@13525 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
9e34f77266
commit
856587688e
@ -37,7 +37,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.8"
|
#define AG71XX_DRV_VERSION "0.5.9"
|
||||||
|
|
||||||
#define AG71XX_NAPI_TX 1
|
#define AG71XX_NAPI_TX 1
|
||||||
|
|
||||||
|
@ -624,6 +624,8 @@ static int ag71xx_rx_packets(struct ag71xx *ag, int limit)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ag71xx_wr(ag, AG71XX_REG_RX_STATUS, RX_STATUS_PR);
|
||||||
|
|
||||||
skb = ring->buf[i].skb;
|
skb = ring->buf[i].skb;
|
||||||
pktlen = ag71xx_desc_pktlen(desc);
|
pktlen = ag71xx_desc_pktlen(desc);
|
||||||
pktlen -= ETH_FCS_LEN;
|
pktlen -= ETH_FCS_LEN;
|
||||||
@ -643,8 +645,6 @@ static int ag71xx_rx_packets(struct ag71xx *ag, int limit)
|
|||||||
ring->buf[i].skb = NULL;
|
ring->buf[i].skb = NULL;
|
||||||
done++;
|
done++;
|
||||||
|
|
||||||
ag71xx_wr(ag, AG71XX_REG_RX_STATUS, RX_STATUS_PR);
|
|
||||||
|
|
||||||
ring->curr++;
|
ring->curr++;
|
||||||
if ((ring->curr - ring->dirty) > (AG71XX_RX_RING_SIZE / 4))
|
if ((ring->curr - ring->dirty) > (AG71XX_RX_RING_SIZE / 4))
|
||||||
ag71xx_ring_rx_refill(ag);
|
ag71xx_ring_rx_refill(ag);
|
||||||
@ -679,10 +679,16 @@ static int ag71xx_poll(struct napi_struct *napi, int limit)
|
|||||||
|
|
||||||
/* TODO: add OOM handler */
|
/* TODO: add OOM handler */
|
||||||
|
|
||||||
status = ag71xx_rr(ag, AG71XX_REG_INT_STATUS);
|
status = ag71xx_rr(ag, AG71XX_REG_RX_STATUS);
|
||||||
status &= AG71XX_INT_POLL;
|
if (unlikely(status & RX_STATUS_OF)) {
|
||||||
|
ag71xx_wr(ag, AG71XX_REG_RX_STATUS, RX_STATUS_OF);
|
||||||
|
dev->stats.rx_fifo_errors++;
|
||||||
|
|
||||||
if ((done < limit) && (!status)) {
|
/* restart RX */
|
||||||
|
ag71xx_wr(ag, AG71XX_REG_RX_CTRL, RX_CTRL_RXE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((done < limit) && ((status & RX_STATUS_PR) == 0)) {
|
||||||
DBG("%s: disable polling mode, done=%d, status=%x\n",
|
DBG("%s: disable polling mode, done=%d, status=%x\n",
|
||||||
dev->name, done, status);
|
dev->name, done, status);
|
||||||
|
|
||||||
@ -695,17 +701,6 @@ static int ag71xx_poll(struct napi_struct *napi, int limit)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status & AG71XX_INT_RX_OF) {
|
|
||||||
if (netif_msg_rx_err(ag))
|
|
||||||
printk(KERN_ALERT "%s: rx owerflow, restarting dma\n",
|
|
||||||
dev->name);
|
|
||||||
|
|
||||||
/* ack interrupt */
|
|
||||||
ag71xx_wr(ag, AG71XX_REG_RX_STATUS, RX_STATUS_OF);
|
|
||||||
/* restart RX */
|
|
||||||
ag71xx_wr(ag, AG71XX_REG_RX_CTRL, RX_CTRL_RXE);
|
|
||||||
}
|
|
||||||
|
|
||||||
DBG("%s: stay in polling mode, done=%d, status=%x\n",
|
DBG("%s: stay in polling mode, done=%d, status=%x\n",
|
||||||
dev->name, done, status);
|
dev->name, done, status);
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user