diff options
Diffstat (limited to 'drivers/net/fec_mpc52xx.c')
-rw-r--r-- | drivers/net/fec_mpc52xx.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c index 9f81b1ac130..cb4416e591f 100644 --- a/drivers/net/fec_mpc52xx.c +++ b/drivers/net/fec_mpc52xx.c @@ -14,6 +14,7 @@ * */ +#include <linux/dma-mapping.h> #include <linux/module.h> #include <linux/kernel.h> @@ -22,6 +23,7 @@ #include <linux/slab.h> #include <linux/errno.h> #include <linux/init.h> +#include <linux/interrupt.h> #include <linux/crc32.h> #include <linux/hardirq.h> #include <linux/delay.h> @@ -335,6 +337,7 @@ static int mpc52xx_fec_start_xmit(struct sk_buff *skb, struct net_device *dev) bd->skb_pa = dma_map_single(dev->dev.parent, skb->data, skb->len, DMA_TO_DEVICE); + skb_tx_timestamp(skb); bcom_submit_next_buffer(priv->tx_dmatsk, skb); spin_unlock_irqrestore(&priv->lock, flags); @@ -434,7 +437,8 @@ static irqreturn_t mpc52xx_fec_rx_interrupt(int irq, void *dev_id) length = status & BCOM_FEC_RX_BD_LEN_MASK; skb_put(rskb, length - 4); /* length without CRC32 */ rskb->protocol = eth_type_trans(rskb, dev); - netif_rx(rskb); + if (!skb_defer_rx_timestamp(skb)) + netif_rx(rskb); spin_lock(&priv->lock); } @@ -867,10 +871,11 @@ static int __devinit mpc52xx_fec_probe(struct platform_device *op) "Error while parsing device node resource\n" ); goto err_netdev; } - if ((mem.end - mem.start + 1) < sizeof(struct mpc52xx_fec)) { + if (resource_size(&mem) < sizeof(struct mpc52xx_fec)) { printk(KERN_ERR DRIVER_NAME - " - invalid resource size (%lx < %x), check mpc52xx_devices.c\n", - (unsigned long)(mem.end - mem.start + 1), sizeof(struct mpc52xx_fec)); + " - invalid resource size (%lx < %x), check mpc52xx_devices.c\n", + (unsigned long)resource_size(&mem), + sizeof(struct mpc52xx_fec)); rv = -EINVAL; goto err_netdev; } |