Merge mainline v2.6.27-rc2 tree into linux-omap tree
[pandora-kernel.git] / drivers / net / smc91x.c
index 34bfc60..d2c4939 100644 (file)
@@ -448,6 +448,11 @@ static inline void  smc_rcv(struct net_device *dev)
                dev->name, packet_number, status,
                packet_len, packet_len);
 
+       if (unlikely(packet_len == 0 && !(status & RS_ERRORS))) {
+               printk(KERN_ERR "%s: bad memory timings: rxlen %u status %x\n",
+                       dev->name, packet_len, status);
+               status |= RS_TOOSHORT;
+       }
        back:
        if (unlikely(packet_len < 6 || status & RS_ERRORS)) {
                if (status & RS_TOOLONG && packet_len <= (1514 + 4 + 6)) {
@@ -1939,8 +1944,11 @@ static int __init smc_probe(struct net_device *dev, void __iomem *ioaddr,
        if (retval)
                goto err_out;
 
-#ifdef SMC_USE_PXA_DMA
-       {
+#ifdef CONFIG_ARCH_PXA
+#  ifdef SMC_USE_PXA_DMA
+       lp->cfg.flags |= SMC91X_USE_DMA;
+#  endif
+       if (lp->cfg.flags & SMC91X_USE_DMA) {
                int dma = pxa_request_dma(dev->name, DMA_PRIO_LOW,
                                          smc_pxa_dma_irq, NULL);
                if (dma >= 0)
@@ -1980,7 +1988,7 @@ static int __init smc_probe(struct net_device *dev, void __iomem *ioaddr,
        }
 
 err_out:
-#ifdef SMC_USE_PXA_DMA
+#ifdef CONFIG_ARCH_PXA
        if (retval && dev->dma != (unsigned char)-1)
                pxa_free_dma(dev->dma);
 #endif
@@ -2198,7 +2206,7 @@ static int smc_drv_probe(struct platform_device *pdev)
                goto out_release_attrib;
        }
 
-#ifdef SMC_USE_PXA_DMA
+#ifdef CONFIG_ARCH_PXA
        {
                struct smc_local *lp = netdev_priv(ndev);
                lp->device = &pdev->dev;
@@ -2241,7 +2249,7 @@ static int smc_drv_remove(struct platform_device *pdev)
 
        free_irq(ndev->irq, ndev);
 
-#ifdef SMC_USE_PXA_DMA
+#ifdef CONFIG_ARCH_PXA
        if (ndev->dma != (unsigned char)-1)
                pxa_free_dma(ndev->dma);
 #endif