diff options
Diffstat (limited to 'drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c')
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | 28 |
1 files changed, 7 insertions, 21 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c index 6320d55..58e2554 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c @@ -883,7 +883,7 @@ int qlcnic_check_loopback_buff(unsigned char *data, u8 mac[]) return memcmp(data, buff, QLCNIC_ILB_PKT_SIZE); } -static int qlcnic_do_lb_test(struct qlcnic_adapter *adapter, u8 mode) +int qlcnic_do_lb_test(struct qlcnic_adapter *adapter, u8 mode) { struct qlcnic_recv_context *recv_ctx = adapter->recv_ctx; struct qlcnic_host_sds_ring *sds_ring = &recv_ctx->sds_rings[0]; @@ -925,7 +925,7 @@ static int qlcnic_do_lb_test(struct qlcnic_adapter *adapter, u8 mode) return 0; } -static int qlcnic_loopback_test(struct net_device *netdev, u8 mode) +int qlcnic_loopback_test(struct net_device *netdev, u8 mode) { struct qlcnic_adapter *adapter = netdev_priv(netdev); int max_sds_rings = adapter->max_sds_rings; @@ -935,13 +935,14 @@ static int qlcnic_loopback_test(struct net_device *netdev, u8 mode) int ret; if (qlcnic_83xx_check(adapter)) - goto skip_cap; + return qlcnic_83xx_loopback_test(netdev, mode); + if (!(ahw->capabilities & QLCNIC_FW_CAPABILITY_MULTI_LOOPBACK)) { dev_info(&adapter->pdev->dev, "Firmware do not support loopback test\n"); return -EOPNOTSUPP; } -skip_cap: + dev_warn(&adapter->pdev->dev, "%s loopback test in progress\n", mode == QLCNIC_ILB_MODE ? "internal" : "external"); if (ahw->op_mode == QLCNIC_NON_PRIV_FUNC) { @@ -962,9 +963,6 @@ skip_cap: if (ret) goto free_res; - if (qlcnic_83xx_check(adapter)) - goto skip_fw_msg; - ahw->diag_cnt = 0; do { msleep(500); @@ -979,21 +977,9 @@ skip_cap: goto free_res; } } while (!QLCNIC_IS_LB_CONFIGURED(ahw->loopback_state)); -skip_fw_msg: - if (qlcnic_83xx_check(adapter)) { - /* wait until firmware report link up before running traffic */ - loop = 0; - do { - msleep(500); - if (loop++ > QLCNIC_ILB_MAX_RCV_LOOP) { - dev_info(&adapter->pdev->dev, - "No linkup event after LB req\n"); - ret = -QLCNIC_FW_NOT_RESPOND; - goto free_res; - } - } while ((adapter->ahw->linkup && ahw->has_link_events) != 1); - } + ret = qlcnic_do_lb_test(adapter, mode); + qlcnic_clear_lb_mode(adapter, mode); free_res: |