aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/qlcnic
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
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')
-rw-r--r--drivers/net/qlcnic/qlcnic.h2
-rw-r--r--drivers/net/qlcnic/qlcnic_ethtool.c10
-rw-r--r--drivers/net/qlcnic/qlcnic_main.c18
3 files changed, 8 insertions, 22 deletions
diff --git a/drivers/net/qlcnic/qlcnic.h b/drivers/net/qlcnic/qlcnic.h
index fad8e9a51a54..970389331bbc 100644
--- a/drivers/net/qlcnic/qlcnic.h
+++ b/drivers/net/qlcnic/qlcnic.h
@@ -1301,8 +1301,6 @@ struct qlcnic_nic_template {
1301 int (*get_mac_addr) (struct qlcnic_adapter *, u8*); 1301 int (*get_mac_addr) (struct qlcnic_adapter *, u8*);
1302 int (*config_bridged_mode) (struct qlcnic_adapter *, u32); 1302 int (*config_bridged_mode) (struct qlcnic_adapter *, u32);
1303 int (*config_led) (struct qlcnic_adapter *, u32, u32); 1303 int (*config_led) (struct qlcnic_adapter *, u32, u32);
1304 int (*set_ilb_mode) (struct qlcnic_adapter *);
1305 void (*clear_ilb_mode) (struct qlcnic_adapter *);
1306 int (*start_firmware) (struct qlcnic_adapter *); 1304 int (*start_firmware) (struct qlcnic_adapter *);
1307}; 1305};
1308 1306
diff --git a/drivers/net/qlcnic/qlcnic_ethtool.c b/drivers/net/qlcnic/qlcnic_ethtool.c
index 7d6558e33dca..9328d59e21e0 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);
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index f1f7acfbf412..f147958e05a1 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -107,8 +107,6 @@ static void qlcnic_config_indev_addr(struct net_device *dev, unsigned long);
107static int qlcnic_start_firmware(struct qlcnic_adapter *); 107static int qlcnic_start_firmware(struct qlcnic_adapter *);
108 108
109static void qlcnic_dev_set_npar_ready(struct qlcnic_adapter *); 109static void qlcnic_dev_set_npar_ready(struct qlcnic_adapter *);
110static void qlcnicvf_clear_ilb_mode(struct qlcnic_adapter *);
111static int qlcnicvf_set_ilb_mode(struct qlcnic_adapter *);
112static int qlcnicvf_config_led(struct qlcnic_adapter *, u32, u32); 110static int qlcnicvf_config_led(struct qlcnic_adapter *, u32, u32);
113static int qlcnicvf_config_bridged_mode(struct qlcnic_adapter *, u32); 111static int qlcnicvf_config_bridged_mode(struct qlcnic_adapter *, u32);
114static int qlcnicvf_start_firmware(struct qlcnic_adapter *); 112static int qlcnicvf_start_firmware(struct qlcnic_adapter *);
@@ -381,8 +379,6 @@ static struct qlcnic_nic_template qlcnic_ops = {
381 .get_mac_addr = qlcnic_get_mac_address, 379 .get_mac_addr = qlcnic_get_mac_address,
382 .config_bridged_mode = qlcnic_config_bridged_mode, 380 .config_bridged_mode = qlcnic_config_bridged_mode,
383 .config_led = qlcnic_config_led, 381 .config_led = qlcnic_config_led,
384 .set_ilb_mode = qlcnic_set_ilb_mode,
385 .clear_ilb_mode = qlcnic_clear_ilb_mode,
386 .start_firmware = qlcnic_start_firmware 382 .start_firmware = qlcnic_start_firmware
387}; 383};
388 384
@@ -390,8 +386,6 @@ static struct qlcnic_nic_template qlcnic_vf_ops = {
390 .get_mac_addr = qlcnic_get_mac_address, 386 .get_mac_addr = qlcnic_get_mac_address,
391 .config_bridged_mode = qlcnicvf_config_bridged_mode, 387 .config_bridged_mode = qlcnicvf_config_bridged_mode,
392 .config_led = qlcnicvf_config_led, 388 .config_led = qlcnicvf_config_led,
393 .set_ilb_mode = qlcnicvf_set_ilb_mode,
394 .clear_ilb_mode = qlcnicvf_clear_ilb_mode,
395 .start_firmware = qlcnicvf_start_firmware 389 .start_firmware = qlcnicvf_start_firmware
396}; 390};
397 391
@@ -2841,18 +2835,6 @@ qlcnicvf_config_led(struct qlcnic_adapter *adapter, u32 state, u32 rate)
2841 return -EOPNOTSUPP; 2835 return -EOPNOTSUPP;
2842} 2836}
2843 2837
2844static int
2845qlcnicvf_set_ilb_mode(struct qlcnic_adapter *adapter)
2846{
2847 return -EOPNOTSUPP;
2848}
2849
2850static void
2851qlcnicvf_clear_ilb_mode(struct qlcnic_adapter *adapter)
2852{
2853 return;
2854}
2855
2856static ssize_t 2838static ssize_t
2857qlcnic_store_bridged_mode(struct device *dev, 2839qlcnic_store_bridged_mode(struct device *dev,
2858 struct device_attribute *attr, const char *buf, size_t len) 2840 struct device_attribute *attr, const char *buf, size_t len)