Skip to content

Commit

Permalink
net: fec: Factorize feature setting
Browse files Browse the repository at this point in the history
In order to enhance the code readable, let's factorize the
feature list.

Signed-off-by: Fugang Duan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Nimrod Andy authored and davem330 committed Jun 12, 2014
1 parent 96c50ca commit 09d1e54
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions drivers/net/ethernet/freescale/fec_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2087,21 +2087,19 @@ 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;
ndev->hw_features |= NETIF_F_HW_VLAN_CTAG_RX;
}

if (id_entry->driver_data & FEC_QUIRK_HAS_CSUM) {
/* enable hw accelerator */
ndev->features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM
| NETIF_F_RXCSUM);
ndev->hw_features |= (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM
| NETIF_F_RXCSUM);
fep->csum_flags |= FLAG_RX_CSUM_ENABLED;
}

ndev->hw_features = ndev->features;

fec_restart(ndev, 0);

return 0;
Expand Down

0 comments on commit 09d1e54

Please sign in to comment.