In kernel 3.7 struct ethtool_cmd received eth_tp_mdix and eth_tp_mdix_ctrl.
Address this by putting ifdef around the code using these struct components.

commit 6f6bbc186dc8e4e0c628db7decbd1a5e02cb5fd8
Author: Jesse Brandeburg <[email protected]>
Date:   Thu Jul 26 02:30:53 2012 +0000

    ethtool.h: MDI setting support

git describe --contains 6f6bbc186dc8e4e0c628db7decbd1a5e02cb5fd8
v3.7-rc1~145^2~300^2~5

Signed-off-by: Stefan Assmann <[email protected]>
---
 .../network/0040-ethtool_cmd_mdix/INFO             | 13 ++++++
 .../igb_ethtool_cmd_mdix.patch                     | 49 ++++++++++++++++++++++
 2 files changed, 62 insertions(+)
 create mode 100644 
patches/collateral-evolutions/network/0040-ethtool_cmd_mdix/INFO
 create mode 100644 
patches/collateral-evolutions/network/0040-ethtool_cmd_mdix/igb_ethtool_cmd_mdix.patch

diff --git a/patches/collateral-evolutions/network/0040-ethtool_cmd_mdix/INFO 
b/patches/collateral-evolutions/network/0040-ethtool_cmd_mdix/INFO
new file mode 100644
index 0000000..21e4add
--- /dev/null
+++ b/patches/collateral-evolutions/network/0040-ethtool_cmd_mdix/INFO
@@ -0,0 +1,13 @@
+In kernel 3.7 struct ethtool_cmd received eth_tp_mdix and eth_tp_mdix_ctrl.
+Address this by putting ifdef around the code using these struct components.
+
+
+commit 6f6bbc186dc8e4e0c628db7decbd1a5e02cb5fd8
+Author: Jesse Brandeburg <[email protected]>
+Date:   Thu Jul 26 02:30:53 2012 +0000
+
+    ethtool.h: MDI setting support
+
+git describe --contains 6f6bbc186dc8e4e0c628db7decbd1a5e02cb5fd8
+v3.7-rc1~145^2~300^2~5
+
diff --git 
a/patches/collateral-evolutions/network/0040-ethtool_cmd_mdix/igb_ethtool_cmd_mdix.patch
 
b/patches/collateral-evolutions/network/0040-ethtool_cmd_mdix/igb_ethtool_cmd_mdix.patch
new file mode 100644
index 0000000..5783b3f
--- /dev/null
+++ 
b/patches/collateral-evolutions/network/0040-ethtool_cmd_mdix/igb_ethtool_cmd_mdix.patch
@@ -0,0 +1,49 @@
+diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c 
b/drivers/net/ethernet/intel/igb/igb_ethtool.c
+index f561b7b..b611f5b 100644
+--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c
++++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c
+@@ -245,10 +245,12 @@ static int igb_get_settings(struct net_device *netdev, 
struct ethtool_cmd *ecmd)
+       else
+               ecmd->eth_tp_mdix = ETH_TP_MDI_INVALID;
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
+       if (hw->phy.mdix == AUTO_ALL_MODES)
+               ecmd->eth_tp_mdix_ctrl = ETH_TP_MDI_AUTO;
+       else
+               ecmd->eth_tp_mdix_ctrl = hw->phy.mdix;
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0) */
+ 
+       return 0;
+ }
+@@ -267,6 +269,7 @@ static int igb_set_settings(struct net_device *netdev, 
struct ethtool_cmd *ecmd)
+               return -EINVAL;
+       }
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
+       /* MDI setting is only allowed when autoneg enabled because
+        * some hardware doesn't allow MDI setting when speed or
+        * duplex is forced.
+@@ -281,6 +284,7 @@ static int igb_set_settings(struct net_device *netdev, 
struct ethtool_cmd *ecmd)
+                       return -EINVAL;
+               }
+       }
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0) */
+ 
+       while (test_and_set_bit(__IGB_RESETTING, &adapter->state))
+               usleep_range(1000, 2000);
+@@ -324,6 +328,7 @@ static int igb_set_settings(struct net_device *netdev, 
struct ethtool_cmd *ecmd)
+               }
+       }
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)
+       /* MDI-X => 2; MDI => 1; Auto => 3 */
+       if (ecmd->eth_tp_mdix_ctrl) {
+               /* fix up the value for auto (3 => 0) as zero is mapped
+@@ -334,6 +339,7 @@ static int igb_set_settings(struct net_device *netdev, 
struct ethtool_cmd *ecmd)
+               else
+                       hw->phy.mdix = ecmd->eth_tp_mdix_ctrl;
+       }
++#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0) */
+ 
+       /* reset the link */
+       if (netif_running(adapter->netdev)) {
-- 
1.9.0

--
To unsubscribe from this list: send the line "unsubscribe backports" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to