diff options
author | Jitendra Kalsaria <jitendra.kalsaria@qlogic.com> | 2013-02-09 13:29:52 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-02-11 11:04:13 +0400 |
commit | 58ead415a1a7d6800ed4eb3eeed12daedc27ffe6 (patch) | |
tree | 1c5d02b7dc74f9a900371e819dd9adeb178ae409 /drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | |
parent | ba4468dbf3364c35652dda14e2ef90c5cf09ab16 (diff) | |
download | linux-58ead415a1a7d6800ed4eb3eeed12daedc27ffe6.tar.xz |
qlcnic: refactor 83xx diagnostic IRQ test
Cleanly separate 83xx diagnostic IRQ test from 82xx
Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c')
-rw-r--r-- | drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c index 58e255437d5a..5641f8ec49ab 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c @@ -823,38 +823,36 @@ static int qlcnic_get_sset_count(struct net_device *dev, int sset) static int qlcnic_irq_test(struct net_device *netdev) { struct qlcnic_adapter *adapter = netdev_priv(netdev); - int max_sds_rings = adapter->max_sds_rings; - int ret; + struct qlcnic_hardware_context *ahw = adapter->ahw; struct qlcnic_cmd_args cmd; + int ret, max_sds_rings = adapter->max_sds_rings; + + if (qlcnic_83xx_check(adapter)) + return qlcnic_83xx_interrupt_test(netdev); if (test_and_set_bit(__QLCNIC_RESETTING, &adapter->state)) return -EIO; ret = qlcnic_diag_alloc_res(netdev, QLCNIC_INTERRUPT_TEST); if (ret) - goto clear_it; + goto clear_diag_irq; - adapter->ahw->diag_cnt = 0; + ahw->diag_cnt = 0; qlcnic_alloc_mbx_args(&cmd, adapter, QLCNIC_CMD_INTRPT_TEST); - if (qlcnic_83xx_check(adapter)) { - ret = qlcnic_83xx_interrupt_test(adapter, &cmd); - } else { - cmd.req.arg[1] = adapter->ahw->pci_func; - ret = qlcnic_issue_cmd(adapter, &cmd); - } - + cmd.req.arg[1] = ahw->pci_func; + ret = qlcnic_issue_cmd(adapter, &cmd); if (ret) goto done; usleep_range(1000, 12000); - ret = !adapter->ahw->diag_cnt; + ret = !ahw->diag_cnt; done: qlcnic_free_mbx_args(&cmd); qlcnic_diag_free_res(netdev, max_sds_rings); -clear_it: +clear_diag_irq: adapter->max_sds_rings = max_sds_rings; clear_bit(__QLCNIC_RESETTING, &adapter->state); return ret; |