From ae12857d7b097fe779f74f8f488ceecb491e0fd0 Mon Sep 17 00:00:00 2001 From: Victor Gaydov Date: Wed, 7 Sep 2016 16:30:27 +0300 Subject: [PATCH] Update to Linux 4.4 API --- src/alx_ethtool.c | 2 +- src/alx_main.c | 26 +++++++++++++------------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/alx_ethtool.c b/src/alx_ethtool.c index 074c640..07bb61a 100644 --- a/src/alx_ethtool.c +++ b/src/alx_ethtool.c @@ -1797,6 +1797,6 @@ static const struct ethtool_ops alx_ethtool_ops = { void alx_set_ethtool_ops(struct net_device *dev) { - SET_ETHTOOL_OPS(dev, &alx_ethtool_ops); + dev->ethtool_ops = &alx_ethtool_ops; } diff --git a/src/alx_main.c b/src/alx_main.c index 7fe3f4b..5743861 100644 --- a/src/alx_main.c +++ b/src/alx_main.c @@ -691,7 +691,7 @@ static bool alx_dispatch_skb(struct alx_rx_queue *rxq) /* vlan tag */ if (rrd->word3 & (1 << RRD_VLTAGGED_SHIFT)) { u16 tag = ntohs(FIELD_GETX(rrd->word2, RRD_VLTAG)); - __vlan_hwaccel_put_tag(skb, ntohs(tag)); + __vlan_hwaccel_put_tag(skb, ntohs(tag), skb->vlan_tci); } qnum = FIELD_GETX(rrd->word2, RRD_RSSQ) % adpt->nr_rxq; tmp_rxq = ALX_CAP(&adpt->hw, MRQ) ? @@ -1129,7 +1129,7 @@ static int alx_init_sw(struct alx_adapter *adpt) static void alx_set_vlan_mode(struct alx_hw *hw, netdev_features_t features) { - if (features & NETIF_F_HW_VLAN_RX) + if (features & NETIF_F_HW_VLAN_CTAG_RX) hw->rx_ctrl |= ALX_MAC_CTRL_VLANSTRIP; else hw->rx_ctrl &= ~ALX_MAC_CTRL_VLANSTRIP; @@ -1145,10 +1145,10 @@ static netdev_features_t alx_fix_features(struct net_device *netdev, * Since there is no support for separate rx/tx vlan accel * enable/disable make sure tx flag is always in same state as rx. */ - if (features & NETIF_F_HW_VLAN_RX) - features |= NETIF_F_HW_VLAN_TX; + if (features & NETIF_F_HW_VLAN_CTAG_RX) + features |= NETIF_F_HW_VLAN_CTAG_TX; else - features &= ~NETIF_F_HW_VLAN_TX; + features &= ~NETIF_F_HW_VLAN_CTAG_TX; if (netdev->mtu > ALX_MAX_TSO_PKT_SIZE) features &= ~(NETIF_F_TSO | NETIF_F_TSO6); @@ -1163,7 +1163,7 @@ static int alx_set_features(struct net_device *netdev, struct alx_adapter *adpt = netdev_priv(netdev); netdev_features_t changed = netdev->features ^ features; - if (!(changed & NETIF_F_HW_VLAN_RX)) + if (!(changed & NETIF_F_HW_VLAN_CTAG_RX)) return 0; alx_set_vlan_mode(&adpt->hw, features); @@ -2256,9 +2256,9 @@ static netdev_tx_t alx_start_xmit_ring(struct alx_tx_queue *txq, memset(first, 0, sizeof(struct tpd_desc)); /* NOTE, chip only supports single-VLAN insertion (81-00-TAG) */ - if (vlan_tx_tag_present(skb)) { + if (skb_vlan_tag_present(skb)) { first->word1 |= 1 << TPD_INS_VLTAG_SHIFT; - first->word0 |= FIELDX(TPD_VLTAG, htons(vlan_tx_tag_get(skb))); + first->word0 |= FIELDX(TPD_VLTAG, htons(skb_vlan_tag_get(skb))); } if (skb->protocol == htons(ETH_P_8021Q)) first->word1 |= 1 << TPD_VLTAGGED_SHIFT; @@ -2608,12 +2608,12 @@ alx_probe(struct pci_dev *pdev, const struct pci_device_id *ent) } } - netdev->hw_features = NETIF_F_SG | - NETIF_F_HW_CSUM | - NETIF_F_HW_VLAN_RX | - NETIF_F_TSO | + netdev->hw_features = NETIF_F_SG | + NETIF_F_HW_CSUM | + NETIF_F_HW_VLAN_CTAG_RX | + NETIF_F_TSO | NETIF_F_TSO6; - netdev->features = netdev->hw_features | NETIF_F_HW_VLAN_TX; + netdev->features = netdev->hw_features | NETIF_F_HW_VLAN_CTAG_TX; /* read permanent mac addr from register or eFuse */ if (alx_get_perm_macaddr(hw, hw->perm_addr)) {