[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1361225178-4363-2-git-send-email-jitendra.kalsaria@qlogic.com>
Date: Mon, 18 Feb 2013 17:06:13 -0500
From: Jitendra Kalsaria <jitendra.kalsaria@...gic.com>
To: davem@...emloft.net
Cc: netdev@...r.kernel.org, sony.chacko@...gic.com,
Dept_NX_Linux_NIC_Driver@...gic.com,
Jitendra Kalsaria <jitendra.kalsaria@...gic.com>
Subject: [PATCH v2 net-next 1/6] qlcnic: fix unsupported CDRP command error message.
From: Jitendra Kalsaria <jitendra.kalsaria@...gic.com>
Added detailed error messages for FW CDRP command failure
Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@...gic.com>
---
drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c | 25 +++++++++++++++++++++-
1 files changed, 23 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
index 4a3bd64..6308d4d 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c
@@ -126,6 +126,7 @@ int qlcnic_82xx_issue_cmd(struct qlcnic_adapter *adapter,
u32 signature;
struct pci_dev *pdev = adapter->pdev;
struct qlcnic_hardware_context *ahw = adapter->ahw;
+ const char *fmt;
signature = qlcnic_get_cmd_signature(ahw);
@@ -147,8 +148,28 @@ int qlcnic_82xx_issue_cmd(struct qlcnic_adapter *adapter,
cmd->rsp.arg[0] = QLCNIC_RCODE_TIMEOUT;
} else if (rsp == QLCNIC_CDRP_RSP_FAIL) {
cmd->rsp.arg[0] = QLCRD32(adapter, QLCNIC_CDRP_ARG(1));
- dev_err(&pdev->dev, "failed card response code:0x%x\n",
- cmd->rsp.arg[0]);
+ switch (cmd->rsp.arg[0]) {
+ case QLCNIC_RCODE_INVALID_ARGS:
+ fmt = "CDRP invalid args: [%d]\n";
+ break;
+ case QLCNIC_RCODE_NOT_SUPPORTED:
+ case QLCNIC_RCODE_NOT_IMPL:
+ fmt = "CDRP command not supported: [%d]\n";
+ break;
+ case QLCNIC_RCODE_NOT_PERMITTED:
+ fmt = "CDRP requested action not permitted: [%d]\n";
+ break;
+ case QLCNIC_RCODE_INVALID:
+ fmt = "CDRP invalid or unknown cmd received: [%d]\n";
+ break;
+ case QLCNIC_RCODE_TIMEOUT:
+ fmt = "CDRP command timeout: [%d]\n";
+ break;
+ default:
+ fmt = "CDRP command failed: [%d]\n";
+ break;
+ }
+ dev_err(&pdev->dev, fmt, cmd->rsp.arg[0]);
} else if (rsp == QLCNIC_CDRP_RSP_OK)
cmd->rsp.arg[0] = QLCNIC_RCODE_SUCCESS;
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists