diff options
author | Nimrod Andy <B38611@freescale.com> | 2014-06-11 20:16:20 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-06-12 14:01:57 -0400 |
commit | 09d1e541fd906861805446af4bb6236a0d2cf09b (patch) | |
tree | 522493d2a7659a0bd21ff9218787c7619efdf274 | |
parent | 96c50caa5148e0e0a077672574785700885c6764 (diff) |
net: fec: Factorize feature setting
In order to enhance the code readable, let's factorize the
feature list.
Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/freescale/fec_main.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 55b55d2f73bc..f943cd142ef7 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c | |||
@@ -2087,21 +2087,19 @@ static int fec_enet_init(struct net_device *ndev) | |||
2087 | writel(FEC_RX_DISABLED_IMASK, fep->hwp + FEC_IMASK); | 2087 | writel(FEC_RX_DISABLED_IMASK, fep->hwp + FEC_IMASK); |
2088 | netif_napi_add(ndev, &fep->napi, fec_enet_rx_napi, NAPI_POLL_WEIGHT); | 2088 | netif_napi_add(ndev, &fep->napi, fec_enet_rx_napi, NAPI_POLL_WEIGHT); |
2089 | 2089 | ||
2090 | if (id_entry->driver_data & FEC_QUIRK_HAS_VLAN) { | 2090 | if (id_entry->driver_data & FEC_QUIRK_HAS_VLAN) |
2091 | /* enable hw VLAN support */ | 2091 | /* enable hw VLAN support */ |
2092 | ndev->features |= NETIF_F_HW_VLAN_CTAG_RX; | 2092 | ndev->features |= NETIF_F_HW_VLAN_CTAG_RX; |
2093 | ndev->hw_features |= NETIF_F_HW_VLAN_CTAG_RX; | ||
2094 | } | ||
2095 | 2093 | ||
2096 | if (id_entry->driver_data & FEC_QUIRK_HAS_CSUM) { | 2094 | if (id_entry->driver_data & FEC_QUIRK_HAS_CSUM) { |
2097 | /* enable hw accelerator */ | 2095 | /* enable hw accelerator */ |
2098 | ndev->features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | 2096 | ndev->features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
2099 | | NETIF_F_RXCSUM); | 2097 | | NETIF_F_RXCSUM); |
2100 | ndev->hw_features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | ||
2101 | | NETIF_F_RXCSUM); | ||
2102 | fep->csum_flags |= FLAG_RX_CSUM_ENABLED; | 2098 | fep->csum_flags |= FLAG_RX_CSUM_ENABLED; |
2103 | } | 2099 | } |
2104 | 2100 | ||
2101 | ndev->hw_features = ndev->features; | ||
2102 | |||
2105 | fec_restart(ndev, 0); | 2103 | fec_restart(ndev, 0); |
2106 | 2104 | ||
2107 | return 0; | 2105 | return 0; |