From: Stefan Assmann Date: Fri, 16 May 2014 11:21:22 +0000 (+0200) Subject: backports: handle struct ethtool_cmd MDI changes X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=bf1bba766cf487273feb65ef06494ed48a397a9f;p=openwrt%2Fstaging%2Fblogic.git backports: handle struct ethtool_cmd MDI changes 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 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 Signed-off-by: Hauke Mehrtens --- 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 000000000000..21e4addeea6f --- /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 +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 000000000000..5783b3f61b26 --- /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)) {