diff options
Diffstat (limited to 'drivers/net/benet/be_cmds.c')
-rw-r--r-- | drivers/net/benet/be_cmds.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c index 2547ee296a7d..1db092498309 100644 --- a/drivers/net/benet/be_cmds.c +++ b/drivers/net/benet/be_cmds.c | |||
@@ -155,7 +155,7 @@ static int be_mbox_db_ready_wait(struct be_adapter *adapter, void __iomem *db) | |||
155 | if (ready) | 155 | if (ready) |
156 | break; | 156 | break; |
157 | 157 | ||
158 | if (cnt > 200000) { | 158 | if (cnt > 4000000) { |
159 | dev_err(&adapter->pdev->dev, "mbox poll timed out\n"); | 159 | dev_err(&adapter->pdev->dev, "mbox poll timed out\n"); |
160 | return -1; | 160 | return -1; |
161 | } | 161 | } |
@@ -1040,3 +1040,31 @@ int be_cmd_reset_function(struct be_adapter *adapter) | |||
1040 | spin_unlock(&adapter->mbox_lock); | 1040 | spin_unlock(&adapter->mbox_lock); |
1041 | return status; | 1041 | return status; |
1042 | } | 1042 | } |
1043 | |||
1044 | int be_cmd_write_flashrom(struct be_adapter *adapter, struct be_dma_mem *cmd, | ||
1045 | u32 flash_type, u32 flash_opcode, u32 buf_size) | ||
1046 | { | ||
1047 | struct be_mcc_wrb *wrb = wrb_from_mbox(&adapter->mbox_mem); | ||
1048 | struct be_cmd_write_flashrom *req = cmd->va; | ||
1049 | struct be_sge *sge = nonembedded_sgl(wrb); | ||
1050 | int status; | ||
1051 | |||
1052 | spin_lock(&adapter->mbox_lock); | ||
1053 | memset(wrb, 0, sizeof(*wrb)); | ||
1054 | be_wrb_hdr_prepare(wrb, cmd->size, false, 1); | ||
1055 | |||
1056 | be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON, | ||
1057 | OPCODE_COMMON_WRITE_FLASHROM, cmd->size); | ||
1058 | sge->pa_hi = cpu_to_le32(upper_32_bits(cmd->dma)); | ||
1059 | sge->pa_lo = cpu_to_le32(cmd->dma & 0xFFFFFFFF); | ||
1060 | sge->len = cpu_to_le32(cmd->size); | ||
1061 | |||
1062 | req->params.op_type = cpu_to_le32(flash_type); | ||
1063 | req->params.op_code = cpu_to_le32(flash_opcode); | ||
1064 | req->params.data_buf_size = cpu_to_le32(buf_size); | ||
1065 | |||
1066 | status = be_mbox_notify(adapter); | ||
1067 | |||
1068 | spin_unlock(&adapter->mbox_lock); | ||
1069 | return status; | ||
1070 | } | ||