summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2014-03-31 14:30:45 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2014-10-17 14:35:27 +0100
commitdfeb8560400126ece53da06c24fc25c53eed44f0 (patch)
treefd7e40ad176d285100d9ebe8b9ad9fcd1d1de7ce
parent493ee26814f2bda27e7075e789d4e6045561f675 (diff)
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 <rmk+kernel@arm.linux.org.uk>
-rw-r--r--drivers/net/ethernet/freescale/fec_main.c25
1 files 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) {