backports: address vlan ethernet driver changes
authorLuis R. Rodriguez <mcgrof@do-not-panic.com>
Sat, 11 May 2013 18:54:28 +0000 (11:54 -0700)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 14 May 2013 20:55:47 +0000 (22:55 +0200)
This addresses the last remaining components to
backport the ethernet vlan changes introduced by
9356b8fc d314774c and f646968f8f on next-20130423.

Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
patches/collateral-evolutions/network/40-netdev-hw-features/drivers_net_ethernet_atheros_atl1c_atl1c_main.patch
patches/collateral-evolutions/network/40-netdev-hw-features/drivers_net_ethernet_atheros_atl1e_atl1e_main.patch
patches/collateral-evolutions/network/40-netdev-hw-features/drivers_net_ethernet_atheros_atlx_atl1.patch
patches/collateral-evolutions/network/40-netdev-hw-features/drivers_net_ethernet_atheros_atlx_atl2.patch

index f0e6f90c7ffd1db173fdbdfc5523552616e19940..f673667983bbf1ef3f544fab0198d633d460cb03 100644 (file)
        .ndo_do_ioctl           = atl1c_ioctl,
        .ndo_tx_timeout         = atl1c_tx_timeout,
        .ndo_get_stats          = atl1c_get_stats,
-@@ -2479,6 +2494,7 @@ static int atl1c_init_netdev(struct net_
+@@ -2478,6 +2493,7 @@ static int atl1c_init_netdev(struct net_
+       netdev->watchdog_timeo = AT_TX_WATCHDOG;
        atl1c_set_ethtool_ops(netdev);
  
-       /* TODO: add when ready */
 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39))
-       netdev->hw_features =   NETIF_F_SG         |
-                               NETIF_F_HW_CSUM    |
-                               NETIF_F_HW_VLAN_RX |
+       /* TODO: add when ready */
+       netdev->hw_features =   NETIF_F_SG              |
+                               NETIF_F_HW_CSUM         |
 @@ -2486,6 +2502,14 @@ static int atl1c_init_netdev(struct net_
                                NETIF_F_TSO6;
-       netdev->features =      netdev->hw_features |
-                               NETIF_F_HW_VLAN_TX;
+       netdev->features =      netdev->hw_features     |
+                               NETIF_F_HW_VLAN_CTAG_TX;
 +#else
 +      netdev->features =      NETIF_F_SG         |
 +                              NETIF_F_HW_CSUM    |
index 04eeb512cb469295ff0072c7b3be678f0e758b64..5a84c3296f316e7b5ec7c0e172081c04a18a9fac 100644 (file)
  
 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39))
        netdev->hw_features = NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_TSO |
-                             NETIF_F_HW_VLAN_RX;
+                             NETIF_F_HW_VLAN_CTAG_RX;
        netdev->features = netdev->hw_features | NETIF_F_LLTX |
-                          NETIF_F_HW_VLAN_TX;
+                          NETIF_F_HW_VLAN_CTAG_TX;
 +#else
 +      netdev->features = NETIF_F_SG | NETIF_F_HW_CSUM | NETIF_F_TSO |
 +                         NETIF_F_HW_VLAN_RX | NETIF_F_LLTX | NETIF_F_HW_VLAN_TX;
-+#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39)) */
++#endif
  
        return 0;
  }
index 2d361370e94e629fa64e17d80064000114299740..47dc6ae26d1e13373ac549c680879f6eb9921e8c 100644 (file)
        .ndo_do_ioctl           = atlx_ioctl,
        .ndo_tx_timeout         = atlx_tx_timeout,
  #ifdef CONFIG_NET_POLL_CONTROLLER
-@@ -3023,11 +3025,13 @@ static int atl1_probe(struct pci_dev *pd
+@@ -3020,11 +3025,13 @@ static int atl1_probe(struct pci_dev *pd
        netdev->features |= NETIF_F_SG;
-       netdev->features |= (NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX);
+       netdev->features |= (NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX);
  
 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39))
        netdev->hw_features = NETIF_F_HW_CSUM | NETIF_F_SG | NETIF_F_TSO |
-                             NETIF_F_HW_VLAN_RX;
+                             NETIF_F_HW_VLAN_CTAG_RX;
  
        /* is this valid? see atl1_setup_mac_ctrl() */
        netdev->features |= NETIF_F_RXCSUM;
index a9ce7583f9a1b5fd29419ef93cbef3652e57fc9f..95b77e1b1f138d61b1a3f264b9a94c0cc5926611 100644 (file)
@@ -1,14 +1,31 @@
 --- a/drivers/net/ethernet/atheros/atlx/atl2.c
 +++ b/drivers/net/ethernet/atheros/atlx/atl2.c
-@@ -396,6 +396,7 @@ static void atl2_restore_vlan(struct atl
+@@ -365,6 +365,7 @@ static inline void atl2_irq_disable(stru
+     synchronize_irq(adapter->pdev->irq);
+ }
++#if defined(NETIF_F_HW_VLAN_TX) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39))
+ static void __atl2_vlan_mode(netdev_features_t features, u32 *ctrl)
+ {
+       if (features & NETIF_F_HW_VLAN_CTAG_RX) {
+@@ -390,12 +391,16 @@ static void atl2_vlan_mode(struct net_de
+       atl2_irq_enable(adapter);
+ }
++#endif
+ static void atl2_restore_vlan(struct atl2_adapter *adapter)
+ {
++#if defined(NETIF_F_HW_VLAN_TX) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39))
        atl2_vlan_mode(adapter->netdev, adapter->netdev->features);
++#endif
  }
  
 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39))
  static netdev_features_t atl2_fix_features(struct net_device *netdev,
        netdev_features_t features)
  {
-@@ -421,6 +422,7 @@ static int atl2_set_features(struct net_
+@@ -421,6 +426,7 @@ static int atl2_set_features(struct net_
  
        return 0;
  }
  
  static void atl2_intr_rx(struct atl2_adapter *adapter)
  {
-@@ -1319,8 +1321,10 @@ static const struct net_device_ops atl2_
+@@ -1154,7 +1160,9 @@ static void atl2_setup_mac_ctrl(struct a
+               MAC_CTRL_PRMLEN_SHIFT);
+       /* vlan */
++#if defined(NETIF_F_HW_VLAN_TX) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39))
+       __atl2_vlan_mode(netdev->features, &value);
++#endif
+       /* filter mode */
+       value |= MAC_CTRL_BC_EN;
+@@ -1319,8 +1327,10 @@ static const struct net_device_ops atl2_
        .ndo_validate_addr      = eth_validate_addr,
        .ndo_set_mac_address    = atl2_set_mac,
        .ndo_change_mtu         = atl2_change_mtu,
        .ndo_do_ioctl           = atl2_ioctl,
        .ndo_tx_timeout         = atl2_tx_timeout,
  #ifdef CONFIG_NET_POLL_CONTROLLER
-@@ -1417,8 +1421,12 @@ static int atl2_probe(struct pci_dev *pd
+@@ -1417,8 +1427,12 @@ static int atl2_probe(struct pci_dev *pd
  
        err = -EIO;
  
 +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39))
-       netdev->hw_features = NETIF_F_SG | NETIF_F_HW_VLAN_RX;
+       netdev->hw_features = NETIF_F_SG | NETIF_F_HW_VLAN_CTAG_RX;
 +#endif
 +#if defined(NETIF_F_HW_VLAN_TX) || (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39))
-       netdev->features |= (NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX);
+       netdev->features |= (NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX);
 +#endif
  
        /* Init PHY as early as possible due to power saving issue  */
        atl2_phy_init(&adapter->hw);
-@@ -1838,6 +1846,13 @@ static int atl2_set_settings(struct net_
+@@ -2092,6 +2106,13 @@ static int atl2_nway_reset(struct net_de
        return 0;
  }
  
 +}
 +#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,39)) */
 +
- static u32 atl2_get_msglevel(struct net_device *netdev)
- {
-       return 0;
-@@ -2107,6 +2122,14 @@ static const struct ethtool_ops atl2_eth
+ static const struct ethtool_ops atl2_ethtool_ops = {
+       .get_settings           = atl2_get_settings,
+       .set_settings           = atl2_set_settings,
+@@ -2107,6 +2128,14 @@ static const struct ethtool_ops atl2_eth
        .get_eeprom_len         = atl2_get_eeprom_len,
        .get_eeprom             = atl2_get_eeprom,
        .set_eeprom             = atl2_set_eeprom,