diff options
Diffstat (limited to 'drivers/net/gianfar.c')
-rw-r--r-- | drivers/net/gianfar.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index 46c69cd06553..28b53d1cd4f1 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c | |||
@@ -381,10 +381,14 @@ static void gfar_init_mac(struct net_device *ndev) | |||
381 | /* Insert receive time stamps into padding alignment bytes */ | 381 | /* Insert receive time stamps into padding alignment bytes */ |
382 | if (priv->device_flags & FSL_GIANFAR_DEV_HAS_TIMER) { | 382 | if (priv->device_flags & FSL_GIANFAR_DEV_HAS_TIMER) { |
383 | rctrl &= ~RCTRL_PAL_MASK; | 383 | rctrl &= ~RCTRL_PAL_MASK; |
384 | rctrl |= RCTRL_PRSDEP_INIT | RCTRL_TS_ENABLE | RCTRL_PADDING(8); | 384 | rctrl |= RCTRL_PADDING(8); |
385 | priv->padding = 8; | 385 | priv->padding = 8; |
386 | } | 386 | } |
387 | 387 | ||
388 | /* Enable HW time stamping if requested from user space */ | ||
389 | if (priv->hwts_rx_en) | ||
390 | rctrl |= RCTRL_PRSDEP_INIT | RCTRL_TS_ENABLE; | ||
391 | |||
388 | /* keep vlan related bits if it's enabled */ | 392 | /* keep vlan related bits if it's enabled */ |
389 | if (priv->vlgrp) { | 393 | if (priv->vlgrp) { |
390 | rctrl |= RCTRL_VLEX | RCTRL_PRSDEP_INIT; | 394 | rctrl |= RCTRL_VLEX | RCTRL_PRSDEP_INIT; |
@@ -747,7 +751,8 @@ static int gfar_of_init(struct of_device *ofdev, struct net_device **pdev) | |||
747 | FSL_GIANFAR_DEV_HAS_CSUM | | 751 | FSL_GIANFAR_DEV_HAS_CSUM | |
748 | FSL_GIANFAR_DEV_HAS_VLAN | | 752 | FSL_GIANFAR_DEV_HAS_VLAN | |
749 | FSL_GIANFAR_DEV_HAS_MAGIC_PACKET | | 753 | FSL_GIANFAR_DEV_HAS_MAGIC_PACKET | |
750 | FSL_GIANFAR_DEV_HAS_EXTENDED_HASH; | 754 | FSL_GIANFAR_DEV_HAS_EXTENDED_HASH | |
755 | FSL_GIANFAR_DEV_HAS_TIMER; | ||
751 | 756 | ||
752 | ctype = of_get_property(np, "phy-connection-type", NULL); | 757 | ctype = of_get_property(np, "phy-connection-type", NULL); |
753 | 758 | ||
@@ -805,12 +810,20 @@ static int gfar_hwtstamp_ioctl(struct net_device *netdev, | |||
805 | 810 | ||
806 | switch (config.rx_filter) { | 811 | switch (config.rx_filter) { |
807 | case HWTSTAMP_FILTER_NONE: | 812 | case HWTSTAMP_FILTER_NONE: |
808 | priv->hwts_rx_en = 0; | 813 | if (priv->hwts_rx_en) { |
814 | stop_gfar(netdev); | ||
815 | priv->hwts_rx_en = 0; | ||
816 | startup_gfar(netdev); | ||
817 | } | ||
809 | break; | 818 | break; |
810 | default: | 819 | default: |
811 | if (!(priv->device_flags & FSL_GIANFAR_DEV_HAS_TIMER)) | 820 | if (!(priv->device_flags & FSL_GIANFAR_DEV_HAS_TIMER)) |
812 | return -ERANGE; | 821 | return -ERANGE; |
813 | priv->hwts_rx_en = 1; | 822 | if (!priv->hwts_rx_en) { |
823 | stop_gfar(netdev); | ||
824 | priv->hwts_rx_en = 1; | ||
825 | startup_gfar(netdev); | ||
826 | } | ||
814 | config.rx_filter = HWTSTAMP_FILTER_ALL; | 827 | config.rx_filter = HWTSTAMP_FILTER_ALL; |
815 | break; | 828 | break; |
816 | } | 829 | } |
@@ -2642,6 +2655,10 @@ int gfar_clean_rx_ring(struct gfar_priv_rx_q *rx_queue, int rx_work_limit) | |||
2642 | dma_unmap_single(&priv->ofdev->dev, bdp->bufPtr, | 2655 | dma_unmap_single(&priv->ofdev->dev, bdp->bufPtr, |
2643 | priv->rx_buffer_size, DMA_FROM_DEVICE); | 2656 | priv->rx_buffer_size, DMA_FROM_DEVICE); |
2644 | 2657 | ||
2658 | if (unlikely(!(bdp->status & RXBD_ERR) && | ||
2659 | bdp->length > priv->rx_buffer_size)) | ||
2660 | bdp->status = RXBD_LARGE; | ||
2661 | |||
2645 | /* We drop the frame if we failed to allocate a new buffer */ | 2662 | /* We drop the frame if we failed to allocate a new buffer */ |
2646 | if (unlikely(!newskb || !(bdp->status & RXBD_LAST) || | 2663 | if (unlikely(!newskb || !(bdp->status & RXBD_LAST) || |
2647 | bdp->status & RXBD_ERR)) { | 2664 | bdp->status & RXBD_ERR)) { |