@@ -914,7 +914,9 @@ static int greth_rx_gbit(struct net_device *dev, int limit)
skb_put(skb, pkt_len);
- if (dev->features & NETIF_F_RXCSUM && hw_checksummed(status))
+ if (netdev_feature_test_bit(NETIF_F_RXCSUM_BIT,
+ dev->features) &&
+ hw_checksummed(status))
skb->ip_summed = CHECKSUM_UNNECESSARY;
else
skb_checksum_none_assert(skb);
@@ -1483,9 +1485,11 @@ static int greth_of_probe(struct platform_device *ofdev)
GRETH_REGSAVE(regs->status, 0xFF);
if (greth->gbit_mac) {
- dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM |
- NETIF_F_RXCSUM;
- dev->features = dev->hw_features | NETIF_F_HIGHDMA;
+ netdev_feature_zero(&dev->hw_features);
+ netdev_feature_set_bits(NETIF_F_SG | NETIF_F_IP_CSUM |
+ NETIF_F_RXCSUM, &dev->hw_features);
+ netdev_feature_copy(&dev->features, dev->hw_features);
+ netdev_feature_set_bit(NETIF_F_HIGHDMA_BIT, &dev->features);
greth_netdev_ops.ndo_start_xmit = greth_start_xmit_gbit;
}
Use netdev_feature_xxx helpers to replace the logical operation for netdev features. Signed-off-by: Jian Shen <shenjian15@huawei.com> --- drivers/net/ethernet/aeroflex/greth.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)