@@ -354,7 +354,9 @@ static inline void tse_rx_vlan(struct net_device *dev, struct sk_buff *skb)
{
struct ethhdr *eth_hdr;
u16 vid;
- if ((dev->features & NETIF_F_HW_VLAN_CTAG_RX) &&
+
+ if (netdev_feature_test_bit(NETIF_F_HW_VLAN_CTAG_RX_BIT,
+ dev->features) &&
!__vlan_get_tag(skb, &vid)) {
eth_hdr = (struct ethhdr *)skb->data;
memmove(skb->data + VLAN_HLEN, eth_hdr, ETH_ALEN * 2);
@@ -1549,14 +1551,15 @@ static int altera_tse_probe(struct platform_device *pdev)
/* Scatter/gather IO is not supported,
* so it is turned off
*/
- ndev->hw_features &= ~NETIF_F_SG;
- ndev->features |= ndev->hw_features | NETIF_F_HIGHDMA;
+ netdev_feature_clear_bit(NETIF_F_SG_BIT, &ndev->hw_features);
+ netdev_feature_or(&ndev->features, ndev->features, ndev->hw_features);
+ netdev_feature_set_bit(NETIF_F_HIGHDMA_BIT, &ndev->features);
/* VLAN offloading of tagging, stripping and filtering is not
* supported by hardware, but driver will accommodate the
* extra 4-byte VLAN tag for processing by upper layers
*/
- ndev->features |= NETIF_F_HW_VLAN_CTAG_RX;
+ netdev_feature_set_bit(NETIF_F_HW_VLAN_CTAG_RX_BIT, &ndev->features);
/* setup NAPI interface */
netif_napi_add(ndev, &priv->napi, tse_poll, NAPI_POLL_WEIGHT);
Use netdev_feature_xxx helpers to replace the logical operation for netdev features. Signed-off-by: Jian Shen <shenjian15@huawei.com> --- drivers/net/ethernet/altera/altera_tse_main.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)