diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2014-03-31 15:49:50 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2014-10-17 14:35:26 +0100 |
commit | 493ee26814f2bda27e7075e789d4e6045561f675 (patch) | |
tree | 9b41dadc682be2865588426fa5857f120f1d6fc5 | |
parent | 3793558b231361dc545e9e0e345b21cd9660e738 (diff) |
net: fec: move vlan receive flag into our private flags
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | drivers/net/ethernet/freescale/fec_main.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 7f99cc6bd868..cc8ad8134bc6 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -260,6 +260,7 @@ MODULE_PARM_DESC(macaddr, "FEC Ethernet MAC address"); /* flags */ #define FEC_FLAG_BUFDESC_EX BIT(0) #define FEC_FLAG_RX_CSUM BIT(1) +#define FEC_FLAG_RX_VLAN BIT(2) #define TSO_HEADER_SIZE 128 /* Max number of allowed TCP segments for software TSO */ @@ -1288,7 +1289,7 @@ fec_enet_rx(struct net_device *ndev, int budget) /* If this is a VLAN packet remove the VLAN Tag */ vlan_packet_rcvd = false; - if (ndev->features & NETIF_F_HW_VLAN_CTAG_RX && + if (fep->flags & FEC_FLAG_RX_VLAN && fep->flags & FEC_FLAG_BUFDESC_EX && bdp->ebd.cbd_esc & BD_ENET_RX_VLAN) { /* Push and remove the vlan tag */ @@ -2534,6 +2535,13 @@ static int fec_set_features(struct net_device *netdev, fep->flags &= ~FEC_FLAG_RX_CSUM; } + if (changed & NETIF_F_HW_VLAN_CTAG_RX) { + if (features & NETIF_F_HW_VLAN_CTAG_RX) + fep->flags |= FEC_FLAG_RX_VLAN; + else + fep->flags &= ~FEC_FLAG_RX_VLAN; + } + /* Set the appropriate minimum transmit ring free threshold */ if (features & NETIF_F_SG) { fep->tx_min = MAX_SKB_FRAGS + 1; @@ -2644,9 +2652,11 @@ 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) + 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; |