blackfin: Fix tty compile error in PIO mode
[safe/jmp/linux-2.6] / drivers / net / macb.c
index e00c896..f505010 100644 (file)
@@ -211,10 +211,10 @@ static int macb_mii_probe(struct net_device *dev)
 
        /* attach the mac to the phy */
        if (pdata && pdata->is_rmii) {
-               phydev = phy_connect(dev, phydev->dev.bus_id,
+               phydev = phy_connect(dev, dev_name(&phydev->dev),
                        &macb_handle_link_change, 0, PHY_INTERFACE_MODE_RMII);
        } else {
-               phydev = phy_connect(dev, phydev->dev.bus_id,
+               phydev = phy_connect(dev, dev_name(&phydev->dev),
                        &macb_handle_link_change, 0, PHY_INTERFACE_MODE_MII);
        }
 
@@ -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)))
@@ -435,7 +443,6 @@ static int macb_rx_frame(struct macb *bp, unsigned int first_frag,
 
        bp->stats.rx_packets++;
        bp->stats.rx_bytes += len;
-       bp->dev->last_rx = jiffies;
        dev_dbg(&bp->pdev->dev, "received skb of length %u, csum: %08x\n",
                skb->len, skb->csum);
        netif_receive_skb(skb);
@@ -506,7 +513,6 @@ static int macb_rx(struct macb *bp, int budget)
 static int macb_poll(struct napi_struct *napi, int budget)
 {
        struct macb *bp = container_of(napi, struct macb, napi);
-       struct net_device *dev = bp->dev;
        int work_done;
        u32 status;
 
@@ -520,7 +526,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);
+               napi_complete(napi);
                goto out;
        }
 
@@ -531,13 +537,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);
+               napi_complete(napi);
                goto out;
        }
 
        work_done = macb_rx(bp, budget);
        if (work_done < budget)
-               netif_rx_complete(dev, napi);
+               napi_complete(napi);
 
        /*
         * We've done what we can to clean the buffers. Make sure we
@@ -572,7 +578,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 (napi_schedule_prep(&bp->napi)) {
                                /*
                                 * There's no point taking any more interrupts
                                 * until we have processed the buffers
@@ -580,7 +586,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);
+                               __napi_schedule(&bp->napi);
                        }
                }
 
@@ -1070,7 +1076,7 @@ static void macb_get_drvinfo(struct net_device *dev,
 
        strcpy(info->driver, bp->pdev->dev.driver->name);
        strcpy(info->version, "$Revision: 1.14 $");
-       strcpy(info->bus_info, bp->pdev->dev.bus_id);
+       strcpy(info->bus_info, dev_name(&bp->pdev->dev));
 }
 
 static struct ethtool_ops macb_ethtool_ops = {
@@ -1227,8 +1233,8 @@ static int __init macb_probe(struct platform_device *pdev)
 
        phydev = bp->phy_dev;
        printk(KERN_INFO "%s: attached PHY driver [%s] "
-               "(mii_bus:phy_addr=%s, irq=%d)\n",
-               dev->name, phydev->drv->name, phydev->dev.bus_id, phydev->irq);
+               "(mii_bus:phy_addr=%s, irq=%d)\n", dev->name,
+               phydev->drv->name, dev_name(&phydev->dev), phydev->irq);
 
        return 0;