Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
[firefly-linux-kernel-4.4.55.git] / drivers / net / ethernet / atheros / atlx / atl2.c
index aab83a2d4e0770a2cb781c5e6062bdb42360e413..265ce1b752ed0b169a927f6dad148e694ca4c5a2 100644 (file)
@@ -363,7 +363,7 @@ static inline void atl2_irq_disable(struct atl2_adapter *adapter)
 
 static void __atl2_vlan_mode(netdev_features_t features, u32 *ctrl)
 {
-       if (features & NETIF_F_HW_VLAN_RX) {
+       if (features & NETIF_F_HW_VLAN_CTAG_RX) {
                /* enable VLAN tag insert/strip */
                *ctrl |= MAC_CTRL_RMV_VLAN;
        } else {
@@ -399,10 +399,10 @@ static netdev_features_t atl2_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;
 
        return features;
 }
@@ -412,7 +412,7 @@ static int atl2_set_features(struct net_device *netdev,
 {
        netdev_features_t changed = netdev->features ^ features;
 
-       if (changed & NETIF_F_HW_VLAN_RX)
+       if (changed & NETIF_F_HW_VLAN_CTAG_RX)
                atl2_vlan_mode(netdev, features);
 
        return 0;
@@ -437,9 +437,6 @@ static void atl2_intr_rx(struct atl2_adapter *adapter)
                        /* alloc new buffer */
                        skb = netdev_alloc_skb_ip_align(netdev, rx_size);
                        if (NULL == skb) {
-                               printk(KERN_WARNING
-                                       "%s: Mem squeeze, deferring packet.\n",
-                                       netdev->name);
                                /*
                                 * Check that some rx space is free. If not,
                                 * free one and mark stats->rx_dropped++.
@@ -455,7 +452,7 @@ static void atl2_intr_rx(struct atl2_adapter *adapter)
                                        ((rxd->status.vtag&7) << 13) |
                                        ((rxd->status.vtag&8) << 9);
 
-                               __vlan_hwaccel_put_tag(skb, vlan_tag);
+                               __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), vlan_tag);
                        }
                        netif_rx(skb);
                        netdev->stats.rx_bytes += rx_size;
@@ -890,7 +887,7 @@ static netdev_tx_t atl2_xmit_frame(struct sk_buff *skb,
                        skb->len-copy_len);
                offset = ((u32)(skb->len-copy_len + 3) & ~3);
        }
-#ifdef NETIF_F_HW_VLAN_TX
+#ifdef NETIF_F_HW_VLAN_CTAG_TX
        if (vlan_tx_tag_present(skb)) {
                u16 vlan_tag = vlan_tx_tag_get(skb);
                vlan_tag = (vlan_tag << 4) |
@@ -1416,8 +1413,8 @@ static int atl2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 
        err = -EIO;
 
-       netdev->hw_features = NETIF_F_SG | NETIF_F_HW_VLAN_RX;
-       netdev->features |= (NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX);
+       netdev->hw_features = NETIF_F_SG | NETIF_F_HW_VLAN_CTAG_RX;
+       netdev->features |= (NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX);
 
        /* Init PHY as early as possible due to power saving issue  */
        atl2_phy_init(&adapter->hw);
@@ -1433,14 +1430,7 @@ static int atl2_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
        /* copy the MAC address out of the EEPROM */
        atl2_read_mac_addr(&adapter->hw);
        memcpy(netdev->dev_addr, adapter->hw.mac_addr, netdev->addr_len);
-/* FIXME: do we still need this? */
-#ifdef ETHTOOL_GPERMADDR
-       memcpy(netdev->perm_addr, adapter->hw.mac_addr, netdev->addr_len);
-
-       if (!is_valid_ether_addr(netdev->perm_addr)) {
-#else
        if (!is_valid_ether_addr(netdev->dev_addr)) {
-#endif
                err = -EIO;
                goto err_eeprom;
        }