compat-drivers: deactivate loopback testing for older kernels
authorHauke Mehrtens <hauke@hauke-m.de>
Thu, 24 Jan 2013 22:55:24 +0000 (23:55 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Fri, 25 Jan 2013 00:07:17 +0000 (01:07 +0100)
ETH_TEST_FL_EXTERNAL_LB and ETH_TEST_FL_EXTERNAL_LB_DONE are not
available in kernel version < 3.1.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
patches/unified-drivers/network/0004-alx-deactivate-loopback-test.patch [new file with mode: 0644]

diff --git a/patches/unified-drivers/network/0004-alx-deactivate-loopback-test.patch b/patches/unified-drivers/network/0004-alx-deactivate-loopback-test.patch
new file mode 100644 (file)
index 0000000..3ed96a4
--- /dev/null
@@ -0,0 +1,25 @@
+--- a/drivers/net/ethernet/atheros/alx/alx_ethtool.c
++++ b/drivers/net/ethernet/atheros/alx/alx_ethtool.c
+@@ -1687,7 +1687,9 @@ static void alx_self_test(struct net_dev
+ {
+       struct alx_adapter *adpt = netdev_priv(netdev);
+       bool if_running = netif_running(netdev);
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
+       bool phy_lpback = etest->flags & ETH_TEST_FL_EXTERNAL_LB;
++#endif
+       ALX_FLAG_SET(adpt, TESTING);
+       memset(data, 0, sizeof(u64) * ALX_TEST_LEN);
+@@ -1707,10 +1709,12 @@ static void alx_self_test(struct net_dev
+               if (alx_diag_interrupt(adpt, &data[2]))
+                       etest->flags |= ETH_TEST_FL_FAILED;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0))
+               if (phy_lpback)
+                       etest->flags |= ETH_TEST_FL_EXTERNAL_LB_DONE;
+               if (alx_diag_loopback(adpt, &data[3], phy_lpback))
+                       etest->flags |= ETH_TEST_FL_FAILED;
++#endif
+       } else {
+               netif_info(adpt, hw, adpt->netdev,  "online test start...\n");