|
@@ -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)
|
|
static void ag71xx_tx_packets(struct ag71xx *ag)
|
|
|
{
|
|
{
|
|
|
- struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
|
|
|
|
|
struct ag71xx_ring *ring = &ag->tx_ring;
|
|
struct ag71xx_ring *ring = &ag->tx_ring;
|
|
|
unsigned int sent;
|
|
unsigned int sent;
|
|
|
|
|
|
|
|
DBG("%s: processing TX ring\n", ag->dev->name);
|
|
DBG("%s: processing TX ring\n", ag->dev->name);
|
|
|
|
|
|
|
|
-#ifdef AG71XX_NAPI_TX
|
|
|
|
|
- pdata->ddr_flush();
|
|
|
|
|
-#endif
|
|
|
|
|
-
|
|
|
|
|
sent = 0;
|
|
sent = 0;
|
|
|
while (ring->dirty != ring->curr) {
|
|
while (ring->dirty != ring->curr) {
|
|
|
unsigned int i = ring->dirty % AG71XX_TX_RING_SIZE;
|
|
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 net_device *dev = ag->dev;
|
|
|
struct ag71xx_ring *ring = &ag->rx_ring;
|
|
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;
|
|
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",
|
|
DBG("%s: rx packets, limit=%d, curr=%u, dirty=%u\n",
|
|
|
dev->name, limit, ring->curr, ring->dirty);
|
|
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)
|
|
static int ag71xx_poll(struct napi_struct *napi, int limit)
|
|
|
{
|
|
{
|
|
|
struct ag71xx *ag = container_of(napi, struct ag71xx, napi);
|
|
struct ag71xx *ag = container_of(napi, struct ag71xx, napi);
|
|
|
-#ifdef AG71XX_NAPI_TX
|
|
|
|
|
struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
|
|
struct ag71xx_platform_data *pdata = ag71xx_get_pdata(ag);
|
|
|
-#endif
|
|
|
|
|
struct net_device *dev = ag->dev;
|
|
struct net_device *dev = ag->dev;
|
|
|
unsigned long flags;
|
|
unsigned long flags;
|
|
|
u32 status;
|
|
u32 status;
|
|
|
int done;
|
|
int done;
|
|
|
|
|
|
|
|
-#ifdef AG71XX_NAPI_TX
|
|
|
|
|
pdata->ddr_flush();
|
|
pdata->ddr_flush();
|
|
|
ag71xx_tx_packets(ag);
|
|
ag71xx_tx_packets(ag);
|
|
|
-#endif
|
|
|
|
|
|
|
|
|
|
DBG("%s: processing RX ring\n", dev->name);
|
|
DBG("%s: processing RX ring\n", dev->name);
|
|
|
done = ag71xx_rx_packets(ag, limit);
|
|
done = ag71xx_rx_packets(ag, limit);
|
|
@@ -738,11 +719,6 @@ static irqreturn_t ag71xx_interrupt(int irq, void *dev_id)
|
|
|
}
|
|
}
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
-#ifndef AG71XX_NAPI_TX
|
|
|
|
|
- if (likely(status & AG71XX_INT_TX_PS))
|
|
|
|
|
- ag71xx_tx_packets(ag);
|
|
|
|
|
-#endif
|
|
|
|
|
-
|
|
|
|
|
if (likely(status & AG71XX_INT_POLL)) {
|
|
if (likely(status & AG71XX_INT_POLL)) {
|
|
|
ag71xx_int_disable(ag, AG71XX_INT_POLL);
|
|
ag71xx_int_disable(ag, AG71XX_INT_POLL);
|
|
|
DBG("%s: enable polling mode\n", dev->name);
|
|
DBG("%s: enable polling mode\n", dev->name);
|