aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/qlcnic/qlcnic_ethtool.c
diff options
context:
space:
mode:
authorAmit Kumar Salecha <amit.salecha@qlogic.com>2010-07-24 14:32:17 -0400
committerDavid S. Miller <davem@davemloft.net>2010-07-25 19:32:40 -0400
commit36a1898ddfde3e36a6813ac72540e011a3de57ae (patch)
tree5fd6aea58575421fb5ff9d0e94e65d47617ca35b /drivers/net/qlcnic/qlcnic_ethtool.c
parentfed66381d65a35198639f564365e61a7f256bf79 (diff)
qlcnic: fix loopback test
o Loopback not supported for virtual function. Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlcnic/qlcnic_ethtool.c')
-rw-r--r--drivers/net/qlcnic/qlcnic_ethtool.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/qlcnic/qlcnic_ethtool.c b/drivers/net/qlcnic/qlcnic_ethtool.c
index 7d6558e33dc..9328d59e21e 100644
--- a/drivers/net/qlcnic/qlcnic_ethtool.c
+++ b/drivers/net/qlcnic/qlcnic_ethtool.c
@@ -678,6 +678,12 @@ static int qlcnic_loopback_test(struct net_device *netdev)
678 int max_sds_rings = adapter->max_sds_rings; 678 int max_sds_rings = adapter->max_sds_rings;
679 int ret; 679 int ret;
680 680
681 if (adapter->op_mode == QLCNIC_NON_PRIV_FUNC) {
682 dev_warn(&adapter->pdev->dev, "Loopback test not supported"
683 "for non privilege function\n");
684 return 0;
685 }
686
681 if (test_and_set_bit(__QLCNIC_RESETTING, &adapter->state)) 687 if (test_and_set_bit(__QLCNIC_RESETTING, &adapter->state))
682 return -EIO; 688 return -EIO;
683 689
@@ -685,13 +691,13 @@ static int qlcnic_loopback_test(struct net_device *netdev)
685 if (ret) 691 if (ret)
686 goto clear_it; 692 goto clear_it;
687 693
688 ret = adapter->nic_ops->set_ilb_mode(adapter); 694 ret = qlcnic_set_ilb_mode(adapter);
689 if (ret) 695 if (ret)
690 goto done; 696 goto done;
691 697
692 ret = qlcnic_do_ilb_test(adapter); 698 ret = qlcnic_do_ilb_test(adapter);
693 699
694 adapter->nic_ops->clear_ilb_mode(adapter); 700 qlcnic_clear_ilb_mode(adapter);
695 701
696done: 702done:
697 qlcnic_diag_free_res(netdev, max_sds_rings); 703 qlcnic_diag_free_res(netdev, max_sds_rings);