Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 340464
b: refs/heads/master
c: be71644
h: refs/heads/master
v: v3
  • Loading branch information
Padmanabh Ratnakar authored and David S. Miller committed Oct 23, 2012
1 parent fc454b0 commit 87aeb3a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c80bbeaec98b36eeba9c6c77061226034d5c4622
refs/heads/master: be7164467372a829e5730696b7162b10bc4c8403
7 changes: 4 additions & 3 deletions trunk/drivers/net/ethernet/emulex/benet/be_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -2160,7 +2160,7 @@ int be_cmd_get_flash_crc(struct be_adapter *adapter, u8 *flashed_crc,
int offset)
{
struct be_mcc_wrb *wrb;
struct be_cmd_write_flashrom *req;
struct be_cmd_read_flash_crc *req;
int status;

spin_lock_bh(&adapter->mcc_lock);
Expand All @@ -2173,7 +2173,8 @@ int be_cmd_get_flash_crc(struct be_adapter *adapter, u8 *flashed_crc,
req = embedded_payload(wrb);

be_wrb_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
OPCODE_COMMON_READ_FLASHROM, sizeof(*req)+4, wrb, NULL);
OPCODE_COMMON_READ_FLASHROM, sizeof(*req),
wrb, NULL);

req->params.op_type = cpu_to_le32(OPTYPE_REDBOOT);
req->params.op_code = cpu_to_le32(FLASHROM_OPER_REPORT);
Expand All @@ -2182,7 +2183,7 @@ int be_cmd_get_flash_crc(struct be_adapter *adapter, u8 *flashed_crc,

status = be_mcc_notify_wait(adapter);
if (!status)
memcpy(flashed_crc, req->params.data_buf, 4);
memcpy(flashed_crc, req->crc, 4);

err:
spin_unlock_bh(&adapter->mcc_lock);
Expand Down
12 changes: 10 additions & 2 deletions trunk/drivers/net/ethernet/emulex/benet/be_cmds.h
Original file line number Diff line number Diff line change
Expand Up @@ -1156,14 +1156,22 @@ struct flashrom_params {
u32 op_type;
u32 data_buf_size;
u32 offset;
u8 data_buf[4];
};

struct be_cmd_write_flashrom {
struct be_cmd_req_hdr hdr;
struct flashrom_params params;
};
u8 data_buf[32768];
u8 rsvd[4];
} __packed;

/* cmd to read flash crc */
struct be_cmd_read_flash_crc {
struct be_cmd_req_hdr hdr;
struct flashrom_params params;
u8 crc[4];
u8 rsvd[4];
};
/**************** Lancer Firmware Flash ************/
struct amap_lancer_write_obj_context {
u8 write_length[24];
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/ethernet/emulex/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3114,7 +3114,7 @@ static int be_flash(struct be_adapter *adapter, const u8 *img,
flash_op = FLASHROM_OPER_SAVE;
}

memcpy(req->params.data_buf, img, num_bytes);
memcpy(req->data_buf, img, num_bytes);
img += num_bytes;
status = be_cmd_write_flashrom(adapter, flash_cmd, optype,
flash_op, num_bytes);
Expand Down Expand Up @@ -3471,7 +3471,7 @@ static int be_fw_download(struct be_adapter *adapter, const struct firmware* fw)
const u8 *p;
int status = 0, i = 0, num_imgs = 0, ufi_type = 0;

flash_cmd.size = sizeof(struct be_cmd_write_flashrom) + 32*1024;
flash_cmd.size = sizeof(struct be_cmd_write_flashrom);
flash_cmd.va = dma_alloc_coherent(&adapter->pdev->dev, flash_cmd.size,
&flash_cmd.dma, GFP_KERNEL);
if (!flash_cmd.va) {
Expand Down

0 comments on commit 87aeb3a

Please sign in to comment.