Commit fbfbc485 authored by Michael Chan's avatar Michael Chan Committed by David S. Miller

bnxt_en: Refactor _hwrm_send_message().

Add a new function bnxt_do_send_msg() to do essentially the same thing
with an additional paramter to silence error response messages.  All
current callers will set silent to false.
Signed-off-by: default avatarMichael Chan <mchan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3ebf6f0a
...@@ -2608,7 +2608,8 @@ void bnxt_hwrm_cmd_hdr_init(struct bnxt *bp, void *request, u16 req_type, ...@@ -2608,7 +2608,8 @@ void bnxt_hwrm_cmd_hdr_init(struct bnxt *bp, void *request, u16 req_type,
req->resp_addr = cpu_to_le64(bp->hwrm_cmd_resp_dma_addr); req->resp_addr = cpu_to_le64(bp->hwrm_cmd_resp_dma_addr);
} }
int _hwrm_send_message(struct bnxt *bp, void *msg, u32 msg_len, int timeout) static int bnxt_hwrm_do_send_msg(struct bnxt *bp, void *msg, u32 msg_len,
int timeout, bool silent)
{ {
int i, intr_process, rc; int i, intr_process, rc;
struct input *req = msg; struct input *req = msg;
...@@ -2686,13 +2687,16 @@ int _hwrm_send_message(struct bnxt *bp, void *msg, u32 msg_len, int timeout) ...@@ -2686,13 +2687,16 @@ int _hwrm_send_message(struct bnxt *bp, void *msg, u32 msg_len, int timeout)
} }
rc = le16_to_cpu(resp->error_code); rc = le16_to_cpu(resp->error_code);
if (rc) { if (rc && !silent)
netdev_err(bp->dev, "hwrm req_type 0x%x seq id 0x%x error 0x%x\n", netdev_err(bp->dev, "hwrm req_type 0x%x seq id 0x%x error 0x%x\n",
le16_to_cpu(resp->req_type), le16_to_cpu(resp->req_type),
le16_to_cpu(resp->seq_id), rc); le16_to_cpu(resp->seq_id), rc);
return rc; return rc;
} }
return 0;
int _hwrm_send_message(struct bnxt *bp, void *msg, u32 msg_len, int timeout)
{
return bnxt_hwrm_do_send_msg(bp, msg, msg_len, timeout, false);
} }
int hwrm_send_message(struct bnxt *bp, void *msg, u32 msg_len, int timeout) int hwrm_send_message(struct bnxt *bp, void *msg, u32 msg_len, int timeout)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment