@@ -966,12 +966,14 @@ static int rhine_init_one_common(struct device *hwdev, u32 quirks,
netif_napi_add(dev, &rp->napi, rhine_napipoll, 64);
if (rp->quirks & rqRhineI)
- dev->features |= NETIF_F_SG|NETIF_F_HW_CSUM;
+ netdev_feature_set_bits(NETIF_F_SG | NETIF_F_HW_CSUM,
+ &dev->features);
if (rp->quirks & rqMgmt)
- dev->features |= NETIF_F_HW_VLAN_CTAG_TX |
- NETIF_F_HW_VLAN_CTAG_RX |
- NETIF_F_HW_VLAN_CTAG_FILTER;
+ netdev_feature_set_bits(NETIF_F_HW_VLAN_CTAG_TX |
+ NETIF_F_HW_VLAN_CTAG_RX |
+ NETIF_F_HW_VLAN_CTAG_FILTER,
+ &dev->features);
/* dev->name not defined before register_netdev()! */
rc = register_netdev(dev);
@@ -2847,11 +2847,15 @@ static int velocity_probe(struct device *dev, int irq,
netif_napi_add(netdev, &vptr->napi, velocity_poll,
VELOCITY_NAPI_WEIGHT);
- netdev->hw_features = NETIF_F_IP_CSUM | NETIF_F_SG |
- NETIF_F_HW_VLAN_CTAG_TX;
- netdev->features |= NETIF_F_HW_VLAN_CTAG_TX |
- NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_VLAN_CTAG_RX |
- NETIF_F_IP_CSUM;
+ netdev_feature_zero(&netdev->hw_features);
+ netdev_feature_set_bits(NETIF_F_IP_CSUM | NETIF_F_SG |
+ NETIF_F_HW_VLAN_CTAG_TX,
+ &netdev->hw_features);
+ netdev_feature_set_bits(NETIF_F_HW_VLAN_CTAG_TX |
+ NETIF_F_HW_VLAN_CTAG_FILTER |
+ NETIF_F_HW_VLAN_CTAG_RX |
+ NETIF_F_IP_CSUM,
+ &netdev->features);
/* MTU range: 64 - 9000 */
netdev->min_mtu = VELOCITY_MIN_MTU;
Use netdev_feature_xxx helpers to replace the logical operation for netdev features. Signed-off-by: Jian Shen <shenjian15@huawei.com> --- drivers/net/ethernet/via/via-rhine.c | 10 ++++++---- drivers/net/ethernet/via/via-velocity.c | 14 +++++++++----- 2 files changed, 15 insertions(+), 9 deletions(-)