radeonfb: Fix resume from D3Cold on some platforms
[safe/jmp/linux-2.6] / drivers / net / fec_mpc52xx.c
index 4e4f683..cd8e98b 100644 (file)
@@ -216,7 +216,7 @@ static int mpc52xx_fec_init_phy(struct net_device *dev)
        struct phy_device *phydev;
        char phy_id[BUS_ID_SIZE];
 
-       snprintf(phy_id, BUS_ID_SIZE, "%x:%02x",
+       snprintf(phy_id, sizeof(phy_id), "%x:%02x",
                        (unsigned int)dev->base_addr, priv->phy_addr);
 
        priv->link = PHY_DOWN;
@@ -401,6 +401,21 @@ static int mpc52xx_fec_hard_start_xmit(struct sk_buff *skb, struct net_device *d
        return 0;
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void mpc52xx_fec_poll_controller(struct net_device *dev)
+{
+       struct mpc52xx_fec_priv *priv = netdev_priv(dev);
+
+       disable_irq(priv->t_irq);
+       mpc52xx_fec_tx_interrupt(priv->t_irq, dev);
+       enable_irq(priv->t_irq);
+       disable_irq(priv->r_irq);
+       mpc52xx_fec_rx_interrupt(priv->r_irq, dev);
+       enable_irq(priv->r_irq);
+}
+#endif
+
+
 /* This handles BestComm transmit task interrupts
  */
 static irqreturn_t mpc52xx_fec_tx_interrupt(int irq, void *dev_id)
@@ -472,7 +487,6 @@ static irqreturn_t mpc52xx_fec_rx_interrupt(int irq, void *dev_id)
                        rskb->protocol = eth_type_trans(rskb, dev);
 
                        netif_rx(rskb);
-                       dev->last_rx = jiffies;
                } else {
                        /* Can't get a new one : reuse the same & drop pkt */
                        dev_notice(&dev->dev, "Memory squeeze, dropping packet.\n");
@@ -926,6 +940,9 @@ mpc52xx_fec_probe(struct of_device *op, const struct of_device_id *match)
        ndev->tx_timeout        = mpc52xx_fec_tx_timeout;
        ndev->watchdog_timeo    = FEC_WATCHDOG_TIMEOUT;
        ndev->base_addr         = mem.start;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+       ndev->poll_controller = mpc52xx_fec_poll_controller;
+#endif
 
        priv->t_irq = priv->r_irq = ndev->irq = NO_IRQ; /* IRQ are free for now */