qlcnic: fix link diag test
authorSony Chacko <sony.chacko@qlogic.com>
Tue, 17 Aug 2010 00:34:24 +0000 (00:34 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 17 Aug 2010 10:59:48 +0000 (03:59 -0700)
o Give sufficient time for all makes of PHY modules
  to establish the link after loopback test.
o Perform online test before offline test.

Signed-off-by: Sony Chacko <sony.chacko@qlogic.com>
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/qlcnic/qlcnic_ethtool.c
drivers/net/qlcnic/qlcnic_hw.c

index 9328d59e21e0c6c2ff8011b19eb30f5f041fed5d..3d4655dce4b516d90070ebbb26cb66287f448295 100644 (file)
@@ -747,6 +747,14 @@ qlcnic_diag_test(struct net_device *dev, struct ethtool_test *eth_test,
 {
        memset(data, 0, sizeof(u64) * QLCNIC_TEST_LEN);
 
+       data[0] = qlcnic_reg_test(dev);
+       if (data[0])
+               eth_test->flags |= ETH_TEST_FL_FAILED;
+
+       data[1] = (u64) qlcnic_test_link(dev);
+       if (data[1])
+               eth_test->flags |= ETH_TEST_FL_FAILED;
+
        if (eth_test->flags == ETH_TEST_FL_OFFLINE) {
                data[2] = qlcnic_irq_test(dev);
                if (data[2])
@@ -757,15 +765,6 @@ qlcnic_diag_test(struct net_device *dev, struct ethtool_test *eth_test,
                        eth_test->flags |= ETH_TEST_FL_FAILED;
 
        }
-
-       data[0] = qlcnic_reg_test(dev);
-       if (data[0])
-               eth_test->flags |= ETH_TEST_FL_FAILED;
-
-       /* link test */
-       data[1] = (u64) qlcnic_test_link(dev);
-       if (data[1])
-               eth_test->flags |= ETH_TEST_FL_FAILED;
 }
 
 static void
index e08c8b0556a47bf2692d272d7d6a1cd029b69608..9d40ce05cb175ffc9e9950d5494eca276e730ef8 100644 (file)
@@ -1245,4 +1245,5 @@ void qlcnic_clear_ilb_mode(struct qlcnic_adapter *adapter)
                mode = VPORT_MISS_MODE_ACCEPT_MULTI;
 
        qlcnic_nic_set_promisc(adapter, mode);
+       msleep(1000);
 }