@@ -1388,7 +1388,8 @@ static int temac_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, ndev);
SET_NETDEV_DEV(ndev, &pdev->dev);
- ndev->features = NETIF_F_SG;
+ netdev_feature_zero(&ndev->features);
+ netdev_feature_set_bit(NETIF_F_SG_BIT, &ndev->features);
ndev->netdev_ops = &temac_netdev_ops;
ndev->ethtool_ops = &temac_ethtool_ops;
#if 0
@@ -1472,7 +1473,7 @@ static int temac_probe(struct platform_device *pdev)
}
if (lp->temac_features & TEMAC_FEATURE_TX_CSUM)
/* Can checksum TCP/UDP over IPv4. */
- ndev->features |= NETIF_F_IP_CSUM;
+ netdev_feature_set_bit(NETIF_F_IP_CSUM_BIT, &ndev->features);
/* Defaults for IRQ delay/coalescing setup. These are
* configuration values, so does not belong in device-tree.
@@ -1859,7 +1859,8 @@ static int axienet_probe(struct platform_device *pdev)
SET_NETDEV_DEV(ndev, &pdev->dev);
ndev->flags &= ~IFF_MULTICAST; /* clear multicast */
- ndev->features = NETIF_F_SG;
+ netdev_feature_zero(&ndev->features);
+ netdev_feature_set_bit(NETIF_F_SG_BIT, &ndev->features);
ndev->netdev_ops = &axienet_netdev_ops;
ndev->ethtool_ops = &axienet_ethtool_ops;
@@ -1922,14 +1923,16 @@ static int axienet_probe(struct platform_device *pdev)
XAE_FEATURE_PARTIAL_TX_CSUM;
lp->features |= XAE_FEATURE_PARTIAL_TX_CSUM;
/* Can checksum TCP/UDP over IPv4. */
- ndev->features |= NETIF_F_IP_CSUM;
+ netdev_feature_set_bit(NETIF_F_IP_CSUM_BIT,
+ &ndev->features);
break;
case 2:
lp->csum_offload_on_tx_path =
XAE_FEATURE_FULL_TX_CSUM;
lp->features |= XAE_FEATURE_FULL_TX_CSUM;
/* Can checksum TCP/UDP over IPv4. */
- ndev->features |= NETIF_F_IP_CSUM;
+ netdev_feature_set_bit(NETIF_F_IP_CSUM_BIT,
+ &ndev->features);
break;
default:
lp->csum_offload_on_tx_path = XAE_NO_CSUM_OFFLOAD;
Use netdev_feature_xxx helpers to replace the logical operation for netdev features. Signed-off-by: Jian Shen <shenjian15@huawei.com> --- drivers/net/ethernet/xilinx/ll_temac_main.c | 5 +++-- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 9 ++++++--- 2 files changed, 9 insertions(+), 5 deletions(-)