qlcnic: fix unsupported CDRP command error message.
authorJitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Wed, 6 Jun 2012 07:35:07 +0000 (07:35 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 7 Jun 2012 20:18:53 +0000 (13:18 -0700)
Add debug messages for FW CDRP command failure.

Signed-off-by: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qlcnic/qlcnic.h
drivers/net/ethernet/qlogic/qlcnic/qlcnic_ctx.c

index 520ff031cfaaf27c425a6a5aa3da6d3f4142dff7..df4552f15693150369b65995579632c79ff26895 100644 (file)
@@ -612,7 +612,11 @@ struct qlcnic_recv_context {
 #define QLCNIC_CDRP_CMD_GET_MAC_STATS          0x00000037
 
 #define QLCNIC_RCODE_SUCCESS           0
+#define QLCNIC_RCODE_INVALID_ARGS      6
 #define QLCNIC_RCODE_NOT_SUPPORTED     9
+#define QLCNIC_RCODE_NOT_PERMITTED     10
+#define QLCNIC_RCODE_NOT_IMPL          15
+#define QLCNIC_RCODE_INVALID           16
 #define QLCNIC_RCODE_TIMEOUT           17
 #define QLCNIC_DESTROY_CTX_RESET       0
 
index cfa174d3a3b1fa3e73cd05aaa3d9da92b8959153..b8ead696141efbaf452f3a46c23dfba1f199f2fb 100644 (file)
@@ -53,12 +53,39 @@ qlcnic_issue_cmd(struct qlcnic_adapter *adapter, struct qlcnic_cmd_args *cmd)
        rsp = qlcnic_poll_rsp(adapter);
 
        if (rsp == QLCNIC_CDRP_RSP_TIMEOUT) {
-               dev_err(&pdev->dev, "card response timeout.\n");
+               dev_err(&pdev->dev, "CDRP response timeout.\n");
                cmd->rsp.cmd = QLCNIC_RCODE_TIMEOUT;
        } else if (rsp == QLCNIC_CDRP_RSP_FAIL) {
                cmd->rsp.cmd = QLCRD32(adapter, QLCNIC_ARG1_CRB_OFFSET);
-               dev_err(&pdev->dev, "failed card response code:0x%x\n",
+               switch (cmd->rsp.cmd) {
+               case QLCNIC_RCODE_INVALID_ARGS:
+                       dev_err(&pdev->dev, "CDRP invalid args: 0x%x.\n",
                                cmd->rsp.cmd);
+                       break;
+               case QLCNIC_RCODE_NOT_SUPPORTED:
+               case QLCNIC_RCODE_NOT_IMPL:
+                       dev_err(&pdev->dev,
+                               "CDRP command not supported: 0x%x.\n",
+                               cmd->rsp.cmd);
+                       break;
+               case QLCNIC_RCODE_NOT_PERMITTED:
+                       dev_err(&pdev->dev,
+                               "CDRP requested action not permitted: 0x%x.\n",
+                               cmd->rsp.cmd);
+                       break;
+               case QLCNIC_RCODE_INVALID:
+                       dev_err(&pdev->dev,
+                               "CDRP invalid or unknown cmd received: 0x%x.\n",
+                               cmd->rsp.cmd);
+                       break;
+               case QLCNIC_RCODE_TIMEOUT:
+                       dev_err(&pdev->dev, "CDRP command timeout: 0x%x.\n",
+                               cmd->rsp.cmd);
+                       break;
+               default:
+                       dev_err(&pdev->dev, "CDRP command failed: 0x%x.\n",
+                               cmd->rsp.cmd);
+               }
        } else if (rsp == QLCNIC_CDRP_RSP_OK) {
                cmd->rsp.cmd = QLCNIC_RCODE_SUCCESS;
                if (cmd->rsp.arg2)
@@ -957,9 +984,6 @@ int qlcnic_get_mac_stats(struct qlcnic_adapter *adapter,
                mac_stats->mac_rx_jabber = le64_to_cpu(stats->mac_rx_jabber);
                mac_stats->mac_rx_dropped = le64_to_cpu(stats->mac_rx_dropped);
                mac_stats->mac_rx_crc_error = le64_to_cpu(stats->mac_rx_crc_error);
-       } else {
-               dev_info(&adapter->pdev->dev,
-                       "%s: Get mac stats failed =%d.\n", __func__, err);
        }
 
        dma_free_coherent(&adapter->pdev->dev, stats_size, stats_addr,