From dfeb8560400126ece53da06c24fc25c53eed44f0 Mon Sep 17 00:00:00 2001 From: Russell King Date: Mon, 31 Mar 2014 14:30:45 +0100 Subject: net: fec: only enable CTAG_RX and IP checksumming if we have enhanced buffer descriptors Only set the vlan tag and ip checksumming options if we have enhanced buffer descriptors - enhanced descriptors are required for these features. Signed-off-by: Russell King --- drivers/net/ethernet/freescale/fec_main.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index cc8ad8134bc6..2c8187950491 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -2652,19 +2652,22 @@ static int fec_enet_init(struct net_device *ndev) writel(FEC_RX_DISABLED_IMASK, fep->hwp + FEC_IMASK); netif_napi_add(ndev, &fep->napi, fec_enet_rx_napi, NAPI_POLL_WEIGHT); - if (id_entry->driver_data & FEC_QUIRK_HAS_VLAN) { - /* enable hw VLAN support */ - ndev->features |= NETIF_F_HW_VLAN_CTAG_RX; - fep->flags |= FEC_FLAG_RX_VLAN; - } + if (fep->flags & FEC_FLAG_BUFDESC_EX) { + if (id_entry->driver_data & FEC_QUIRK_HAS_VLAN) { + /* enable hw VLAN support */ + ndev->features |= NETIF_F_HW_VLAN_CTAG_RX; + fep->flags |= FEC_FLAG_RX_VLAN; + } - if (id_entry->driver_data & FEC_QUIRK_HAS_CSUM) { - ndev->gso_max_segs = FEC_MAX_TSO_SEGS; + if (id_entry->driver_data & FEC_QUIRK_HAS_CSUM) { + ndev->gso_max_segs = FEC_MAX_TSO_SEGS; - /* enable hw accelerator */ - ndev->features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM - | NETIF_F_RXCSUM | NETIF_F_SG | NETIF_F_TSO); - fep->flags |= FEC_FLAG_RX_CSUM; + /* enable hw accelerator */ + ndev->features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM + | NETIF_F_RXCSUM | NETIF_F_SG | + NETIF_F_TSO); + fep->flags |= FEC_FLAG_RX_CSUM; + } } if (ndev->features & NETIF_F_SG) { -- cgit