]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/net/macb.c
Merge branch 'fix/hda' into topic/hda
[linux-2.6-omap-h63xx.git] / drivers / net / macb.c
index 261b9507124b695e0ecf8fe91a5ea5cfae8e7f59..f6c4936e2fa8e368ca1f2fdbdb09ad75d990562e 100644 (file)
@@ -321,6 +321,10 @@ static void macb_tx(struct macb *bp)
                printk(KERN_ERR "%s: TX underrun, resetting buffers\n",
                        bp->dev->name);
 
+               /* Transfer ongoing, disable transmitter, to avoid confusion */
+               if (status & MACB_BIT(TGO))
+                       macb_writel(bp, NCR, macb_readl(bp, NCR) & ~MACB_BIT(TE));
+
                head = bp->tx_head;
 
                /*Mark all the buffer as used to avoid sending a lost buffer*/
@@ -343,6 +347,10 @@ static void macb_tx(struct macb *bp)
                }
 
                bp->tx_head = bp->tx_tail = 0;
+
+               /* Enable the transmitter again */
+               if (status & MACB_BIT(TGO))
+                       macb_writel(bp, NCR, macb_readl(bp, NCR) | MACB_BIT(TE));
        }
 
        if (!(status & MACB_BIT(COMP)))
@@ -519,7 +527,7 @@ static int macb_poll(struct napi_struct *napi, int budget)
                 * this function was called last time, and no packets
                 * have been received since.
                 */
-               netif_rx_complete(dev, napi);
+               netif_rx_complete(napi);
                goto out;
        }
 
@@ -530,13 +538,13 @@ static int macb_poll(struct napi_struct *napi, int budget)
                dev_warn(&bp->pdev->dev,
                         "No RX buffers complete, status = %02lx\n",
                         (unsigned long)status);
-               netif_rx_complete(dev, napi);
+               netif_rx_complete(napi);
                goto out;
        }
 
        work_done = macb_rx(bp, budget);
        if (work_done < budget)
-               netif_rx_complete(dev, napi);
+               netif_rx_complete(napi);
 
        /*
         * We've done what we can to clean the buffers. Make sure we
@@ -571,7 +579,7 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id)
                }
 
                if (status & MACB_RX_INT_FLAGS) {
-                       if (netif_rx_schedule_prep(dev, &bp->napi)) {
+                       if (netif_rx_schedule_prep(&bp->napi)) {
                                /*
                                 * There's no point taking any more interrupts
                                 * until we have processed the buffers
@@ -579,7 +587,7 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id)
                                macb_writel(bp, IDR, MACB_RX_INT_FLAGS);
                                dev_dbg(&bp->pdev->dev,
                                        "scheduling RX softirq\n");
-                               __netif_rx_schedule(dev, &bp->napi);
+                               __netif_rx_schedule(&bp->napi);
                        }
                }